protected function resolveAndRenderView(View $messageView)
 {
     $gridViewId = 'notUsed';
     $pageVar = 'notUsed';
     $listModel = new SavedWorkflow();
     $actionBarView = new SecuredActionBarForWorkflowsSearchAndListView('default', 'workflows', $listModel, $gridViewId, $pageVar, false, $this->activeActionElementType);
     $mixedView = new ActionBarAndZeroModelsYetView($actionBarView, $messageView);
     $view = new WorkflowsPageView(WorkflowDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this->controller, $mixedView, $this->breadCrumbLinks, 'WorkflowBreadCrumbView'));
     echo $view->render();
 }
示例#2
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();
 }