protected function resolveAndRenderView(View $messageView)
 {
     $gridViewId = 'notUsed';
     $pageVar = 'notUsed';
     $listModel = new Campaign();
     $actionBarView = new SecuredActionBarForMarketingListsSearchAndListView('default', 'marketing', $listModel, $gridViewId, $pageVar, false, $this->activeActionElementType);
     $mixedView = new ActionBarAndZeroModelsYetView($actionBarView, $messageView);
     $view = new CampaignsPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this->controller, $mixedView, $this->breadcrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
Esempio n. 2
0
 public function actionEdit($id, $redirectUrl)
 {
     $autoresponder = Autoresponder::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($autoresponder->marketingList);
     $model = $this->attemptToSaveModelFromPost($autoresponder, $redirectUrl);
     $editAndDetailsView = $this->makeEditAndDetailsView($model, 'Edit');
     $breadcrumbLinks = static::getDetailsAndEditBreadcrumbLinks($autoresponder->marketingList);
     $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($autoresponder), 25);
     $view = new AutorespondersPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editAndDetailsView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
Esempio n. 3
0
 public function actionDashboardDetails()
 {
     $params = array('controllerId' => $this->getId(), 'moduleId' => $this->getModule()->getId());
     $gridViewId = 'notUsed';
     $pageVar = 'notUsed';
     $introView = new MarketingDashboardIntroView(get_class($this->getModule()));
     $actionBarView = new SecuredActionBarForMarketingSearchAndListView('default', 'marketing', new EmailTemplate(), $gridViewId, $pageVar, false, 'MarketingDashboardLink', $introView);
     $marketingDashboardView = new MarketingDashboardView($this->getId(), $this->getModule()->getId(), 'MarketingDashboard', $params);
     $marketingDashboardView->setCssClasses(array('clearfix'));
     $gridView = new GridView(2, 1);
     $gridView->setView($actionBarView, 0, 0);
     $gridView->setView($marketingDashboardView, 1, 0);
     $breadcrumbLinks = static::getDashboardBreadcrumbLinks();
     $view = new MarketingPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $gridView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
Esempio n. 4
0
 public function actionDashboardDetails()
 {
     $params = array('controllerId' => $this->getId(), 'moduleId' => $this->getModule()->getId());
     $gridViewId = 'notUsed';
     $pageVar = 'notUsed';
     $introCookieValue = Yii::app()->request->cookies[MarketingDashboardIntroView::resolveCookieId()];
     $actionBarView = new SecuredActionBarForMarketingSearchAndListView('default', 'marketing', new EmailTemplate(), $gridViewId, $pageVar, false, 'MarketingDashboardLink');
     $actionBarView->setIntroCookieValue($introCookieValue);
     $introView = new MarketingDashboardIntroView($introCookieValue);
     $marketingDashboardView = new MarketingDashboardView($this->getId(), $this->getModule()->getId(), 'MarketingDashboard', $params);
     $marketingDashboardView->setCssClasses(array('clearfix'));
     //todo: don't show introView if hidden
     $gridView = new GridView(3, 1);
     $gridView->setView($actionBarView, 0, 0);
     $gridView->setView($introView, 1, 0);
     $gridView->setView($marketingDashboardView, 2, 0);
     $breadcrumbLinks = static::getDashboardBreadcrumbLinks();
     $view = new MarketingPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $gridView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
 public function actionEdit($id)
 {
     $marketingList = MarketingList::getById(intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserWriteModel($marketingList);
     $breadCrumbLinks = static::getDetailsAndEditBreadcrumbLinks();
     $breadCrumbLinks[] = StringUtil::getChoppedStringContent(strval($marketingList), 25);
     $editView = new MarketingListEditView($this->getId(), $this->getModule()->getId(), $this->attemptToSaveModelFromPost($marketingList), strval($marketingList));
     $view = new MarketingListsPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
 protected function processEdit(Campaign $campaign)
 {
     if ($campaign->status != Campaign::STATUS_ACTIVE) {
         Yii::app()->user->setFlash('notification', Zurmo::t('CampaignsModule', 'This campaign has already started, you can only edit its name, rights and permissions.'));
     }
     $breadCrumbLinks = static::getDetailsAndEditBreadcrumbLinks();
     $breadCrumbLinks[] = StringUtil::getChoppedStringContent(strval($campaign), 25);
     //todo: wizard
     $editView = new CampaignEditView($this->getId(), $this->getModule()->getId(), $this->attemptToSaveModelFromPost($campaign), strval($campaign));
     $view = new CampaignsPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'MarketingBreadCrumbView'));
     echo $view->render();
 }
Esempio n. 7
0
 public function actionDetails($id, $renderJson = false, $includeFilesInJson = false)
 {
     $emailTemplate = static::getModelAndCatchNotFoundAndDisplayError('EmailTemplate', intval($id));
     ControllerSecurityUtil::resolveAccessCanCurrentUserReadModel($emailTemplate);
     if ($renderJson) {
         header('Content-type: application/json');
         echo $this->resolveEmailTemplateAsJson($emailTemplate, $includeFilesInJson);
         Yii::app()->end(0, false);
     }
     AuditEvent::logAuditEvent('ZurmoModule', ZurmoModule::AUDIT_EVENT_ITEM_VIEWED, array(strval($emailTemplate), 'EmailTemplatesModule'), $emailTemplate);
     $detailsView = new EmailTemplateEditAndDetailsView('Details', $this->getId(), $this->getModule()->getId(), $emailTemplate);
     if ($emailTemplate->type == EmailTemplate::TYPE_WORKFLOW) {
         $breadcrumbLinks = static::getDetailsAndEditForWorkflowBreadcrumbLinks();
         $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($emailTemplate), 25);
         $view = new EmailTemplatesPageView(WorkflowDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadcrumbLinks, 'WorkflowBreadCrumbView'));
     } elseif ($emailTemplate->type == EmailTemplate::TYPE_CONTACT) {
         $breadcrumbLinks = static::getDetailsAndEditForMarketingBreadcrumbLinks();
         $breadcrumbLinks[] = StringUtil::getChoppedStringContent(strval($emailTemplate), 25);
         $view = new EmailTemplatesPageView(MarketingDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $detailsView, $breadcrumbLinks, 'MarketingBreadCrumbView'));
     } else {
         throw new NotSupportedException();
     }
     echo $view->render();
 }