28 if ( $soxId !=
"-1" && isset( $soxId ) ) {
30 $oNewsletter =
oxNew(
"oxnewsletter" );
31 if ( $oNewsletter->load( $soxId ) ) {
32 $this->_aViewData[
"edit"] = $oNewsletter;
35 $oNewsletterSelectionAjax =
oxNew(
'newsletter_selection_ajax' );
36 $this->_aViewData[
'oxajax'] = $oNewsletterSelectionAjax->getColumns();
37 return "popups/newsletter_selection.tpl";
42 return "newsletter_selection.tpl";
52 if ( $this->_iUserCount === null ) {
53 $this->_iUserCount = 0;
56 $oNewsletter =
oxNew(
"oxnewsletter" );
57 if ( $oNewsletter->load( $this->getEditObjectId() ) ) {
62 $sSelectGroups =
" ( oxobject2group.oxgroupsid in ( ";
65 foreach ( $oNewsletter->getGroups() as $oInGroup ) {
67 $sSelectGroups .=
",";
69 $sSelectGroups .= $oDB->quote( $oInGroup->oxgroups__oxid->value );
73 $sSelectGroups .=
" ) ) ";
77 $sSelectGroups =
" oxobject2group.oxobjectid is null ";
79 $sShopId = $this->
getConfig()->getShopID();
80 $sQ =
"select count(*) from ( select oxnewssubscribed.oxemail as _icnt from oxnewssubscribed left join
81 oxobject2group on oxobject2group.oxobjectid = oxnewssubscribed.oxuserid
82 where ( oxobject2group.oxshopid = '{$sShopId}'
83 or oxobject2group.oxshopid is null ) and {$sSelectGroups} and
84 oxnewssubscribed.oxdboptin = 1 and ( not ( oxnewssubscribed.oxemailfailed = '1') )
85 and (not(oxnewssubscribed.oxemailfailed = '1')) and oxnewssubscribed.oxshopid = '{$sShopId}'
86 group by oxnewssubscribed.oxemail ) as _tmp";
88 $this->_iUserCount = $oDB->getOne( $sQ,
false,
false );
103 $aParams[
'oxnewsletter__oxshopid'] = $this->
getConfig()->getShopId();
105 $oNewsletter =
oxNew(
"oxNewsLetter" );
106 if ( $soxId !=
"-1" ) {
107 $oNewsletter->load( $soxId );
109 $aParams[
'oxnewsletter__oxid'] = null;
112 $oNewsletter->assign( $aParams );
113 $oNewsletter->save();