/** * Execute the action */ public function execute() { parent::execute(); // action to execute $id = \SpoonFilter::getGetValue('id', null, 0); // no id's provided if (!BackendMailmotorModel::existsCampaign($id)) { $this->redirect(BackendModel::createURLForAction('Campaigns') . '&error=campaign-does-not-exist'); } else { // at least one id BackendMailmotorModel::exportStatisticsByCampaignID($id); } // redirect $this->redirect(BackendModel::createURLForAction('Groups') . '&report=export-failed'); }
/** * Execute the action */ public function execute() { // get parameters $this->id = $this->getParameter('id', 'int'); // does the item exist if (BackendMailmotorModel::existsCampaign($this->id)) { parent::execute(); $this->getData(); $this->loadForm(); $this->validateForm(); $this->parse(); $this->display(); } else { $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing'); } }
/** * Gets all data needed for this page */ private function getData() { // get parameters $this->id = $this->getParameter('id', 'int'); // does the item exist if (!BackendMailmotorModel::existsCampaign($this->id)) { $this->redirect(BackendModel::createURLForAction('Campaigns') . '&error=campaign-does-not-exist'); } // store mailing $this->campaign = BackendMailmotorModel::getCampaign($this->id); // fetch the statistics $this->statistics = BackendMailmotorCMHelper::getStatisticsByCampaignID($this->id, true); // no stats found if ($this->statistics === false || empty($this->statistics)) { $this->redirect(BackendModel::createURLForAction('Campaigns') . '&error=no-statistics-loaded'); } }