$bounces[] = $bounce; } } $tpl->setVariable('delete_result', $bounces); $Result = array(); $Result['newsletter_menu'] = 'design:parts/content/bounce_menu.tpl'; $Result['left_menu'] = 'design:parts/content/eznewsletter_menu.tpl'; $Result['content'] = $tpl->fetch("design:{$extension}/confirmremove_bounce.tpl"); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('eznewsletter/list_newsletterbounce', 'Newsletter types'))); return; } else { if ($http->hasPostVariable('RemoveAndUnSubscribeButton')) { if ($http->hasPostVariable('MailArray')) { foreach ($http->postVariable('MailArray') as $mail) { foreach (eZBounce::fetchListByAddress($mail) as $bounce) { $bounces[] = eZBounce::fetch($bounce->ID); } } } $http->setSessionVariable('BounceIDArray', $bounces); $tpl->setVariable('delete_result', $bounces); $Result = array(); $Result['newsletter_menu'] = 'design:parts/content/bounce_menu.tpl'; $Result['left_menu'] = 'design:parts/content/eznewsletter_menu.tpl'; $Result['content'] = $tpl->fetch("design:{$extension}/confirmremoveandunsubscribe_bounce.tpl"); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('eznewsletter/list_newsletterbounce', 'Remove and unsubscribe'))); return; } else { if ($http->hasPostVariable('ConfirmRemoveAndUnsubscribeButton')) { $bounceArray = $http->sessionVariable('BounceIDArray'); $db->begin();
static function removeAllBounceInformation($bounceID) { $bounceItem = eZBounce::fetch($bounceID); if (!$bounceItem) { return; } $sendItem = eZSendNewsletterItem::fetch($bounceItem->attribute('newslettersenditem_id'), true); if ($sendItem) { $subscription = eZSubscription::fetch($sendItem->attribute('subscription_id')); if ($subscription) { $subscription->setAttribute('bounce_count', 0); $subscription->store(); } $sendItem->setAttribute('bounce_id', 0); $sendItem->store(); $bounceItem->remove(); } else { $bounceItem->remove(); } }
// /*! \file bounce_search.php */ $Module = $Params['Module']; $extension = 'eznewsletter'; $http = eZHTTPTool::instance(); $tpl = eZNewsletterTemplateWrapper::templateInit(); $tpl->setVariable('module', $Module); if ($http->hasPostVariable('RemoveBounceButton')) { if (is_array($http->postVariable('BounceIDArray'))) { $bounceIDArray = $http->postVariable('BounceIDArray'); $http->setSessionVariable('BounceIDArray', $bounceIDArray); $bounces = array(); if (count($bounceIDArray) > 0) { foreach ($bounceIDArray as $bounceID) { $bounce = eZBounce::fetch($bounceID); $bounces[] = $bounce; } } $tpl->setVariable('delete_result', $bounces); $Result = array(); $Result['newsletter_menu'] = 'design:parts/content/bounce_menu.tpl'; $Result['left_menu'] = 'design:parts/content/eznewsletter_menu.tpl'; $Result['content'] = $tpl->fetch("design:{$extension}/confirmremove_bounce_search.tpl"); $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('eznewsletter/bounce_search', 'Bounce Search'))); return; } } if ($http->hasPostVariable('searchString') && trim($http->postVariable('searchString')) != "") { $search = trim(strtolower($http->postVariable('searchString'))); $db = eZDB::instance();