30         if ($soxId != 
"-1" && isset($soxId)) {
 
   32             $oNewsletter = 
oxNew(
"oxnewsletter");
 
   33             if ($oNewsletter->load($soxId)) {
 
   34                 $this->_aViewData[
"edit"] = $oNewsletter;
 
   37                     $oNewsletterSelectionAjax = 
oxNew(
'newsletter_selection_ajax');
 
   38                     $this->_aViewData[
'oxajax'] = $oNewsletterSelectionAjax->getColumns();
 
   40                     return "popups/newsletter_selection.tpl";
 
   45         return "newsletter_selection.tpl";
 
   55         if ($this->_iUserCount === null) {
 
   56             $this->_iUserCount = 0;
 
   59             $oNewsletter = 
oxNew(
"oxnewsletter");
 
   60             if ($oNewsletter->load($this->getEditObjectId())) {
 
   65                 $sSelectGroups = 
" ( oxobject2group.oxgroupsid in ( ";
 
   68                 foreach ($oNewsletter->getGroups() as $oInGroup) {
 
   70                         $sSelectGroups .= 
",";
 
   72                     $sSelectGroups .= $oDB->quote($oInGroup->oxgroups__oxid->value);
 
   76                 $sSelectGroups .= 
" ) ) ";
 
   80                     $sSelectGroups = 
" oxobject2group.oxobjectid is null ";
 
   82                 $sShopId = $this->
getConfig()->getShopID();
 
   83                 $sQ = 
"select count(*) from ( select oxnewssubscribed.oxemail as _icnt from oxnewssubscribed left join 
   84                    oxobject2group on oxobject2group.oxobjectid = oxnewssubscribed.oxuserid 
   85                    where ( oxobject2group.oxshopid = '{$sShopId}' 
   86                    or oxobject2group.oxshopid is null ) and {$sSelectGroups} and 
   87                    oxnewssubscribed.oxdboptin = 1 and ( not ( oxnewssubscribed.oxemailfailed = '1') ) 
   88                    and (not(oxnewssubscribed.oxemailfailed = '1')) and oxnewssubscribed.oxshopid = '{$sShopId}' 
   89                    group by oxnewssubscribed.oxemail ) as _tmp";
 
   91                 $this->_iUserCount = $oDB->getOne($sQ, 
false, 
false);
 
  105         $aParams[
'oxnewsletter__oxshopid'] = $this->
getConfig()->getShopId();
 
  107         $oNewsletter = 
oxNew(
"oxNewsLetter");
 
  108         if ($soxId != 
"-1") {
 
  109             $oNewsletter->load($soxId);
 
  111             $aParams[
'oxnewsletter__oxid'] = null;
 
  114         $oNewsletter->assign($aParams);
 
  115         $oNewsletter->save();