Example #1
0
 public function actionConfigurationEditLdap()
 {
     $configurationForm = LdapConfigurationFormAdapter::makeFormFromGlobalConfiguration();
     $postVariableName = get_class($configurationForm);
     if (isset($_POST[$postVariableName])) {
         $configurationForm->setAttributes($_POST[$postVariableName]);
         if ($configurationForm->validate()) {
             LdapConfigurationFormAdapter::setConfigurationFromForm($configurationForm);
             Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'LDAP Configuration saved successfully.'));
             $this->redirect(Yii::app()->createUrl('configuration/default/index'));
         }
     }
     $editView = new LdapConfigurationEditAndDetailsView('Edit', $this->getId(), $this->getModule()->getId(), $configurationForm);
     $editView->setCssClasses(array('AdministrativeArea'));
     $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $editView));
     echo $view->render();
 }
Example #2
0
 /**
  * Admin configuration action for entering the google map api key.
  */
 public function actionConfigurationView()
 {
     $configurationForm = new MapsConfigurationForm();
     $configurationForm->apiKey = Yii::app()->mappingHelper->getGeoCodeApiKey();
     $postVariableName = get_class($configurationForm);
     if (isset($_POST[$postVariableName])) {
         $configurationForm->setAttributes($_POST[$postVariableName]);
         if ($configurationForm->validate()) {
             ZurmoConfigurationUtil::setByModuleName('MapsModule', 'googleMapApiKey', $configurationForm->apiKey);
             Yii::app()->user->setFlash('notification', Zurmo::t('MapsModule', 'Maps configuration saved successfully.'));
             $this->redirect(Yii::app()->createUrl('maps/default/configurationView'));
         }
     }
     $editView = new MapConfigurationView('Edit', $this->getId(), $this->getModule()->getId(), $configurationForm);
     $editView->setCssClasses(array('AdministrativeArea'));
     $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $editView));
     echo $view->render();
 }
 public function actionConfigurationEdit()
 {
     $breadCrumbLinks = array(Zurmo::t('MarketingModule', 'Marketing Configuration'));
     $form = MarketingConfigurationFormAdapter::makeFormFromMarketingConfiguration();
     $postData = PostUtil::getData();
     $postVariableName = get_class($form);
     if (isset($postData[$postVariableName])) {
         $form->setAttributes($postData[$postVariableName]);
         if ($form->validate()) {
             MarketingConfigurationFormAdapter::setConfigurationFromForm($form);
             Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Marketing configuration saved successfully.'));
             $this->redirect(Yii::app()->createUrl('configuration/default/index'));
         }
     }
     $editView = new MarketingConfigurationEditAndDetailsView('Edit', $this->getId(), $this->getModule()->getId(), $form);
     $editView->setCssClasses(array('AdministrativeArea'));
     $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'SettingsBreadCrumbView'));
     echo $view->render();
 }
 public function actionConfigurationEditImap($type = 1)
 {
     $type = intval($type);
     if ($type < 1 || $type > 2) {
         throw new CHttpException(400);
     }
     $adapterClassName = 'EmailArchivingConfigurationFormAdapter';
     $editViewClassName = 'EmailArchivingConfigurationEditAndDetailsView';
     $successMessage = Zurmo::t('EmailMessagesModule', 'Email archiving configuration saved successfully.');
     $breadCrumbLinks = array(Zurmo::t('EmailMessagesModule', 'Email Configuration') => array('/emailMessages/default/configurationEdit'));
     if ($type == 2) {
         $adapterClassName = 'BounceConfigurationFormAdapter';
         $editViewClassName = 'BounceConfigurationEditAndDetailsView';
         $successMessage = Zurmo::t('EmailMessagesModule', 'Bounce configuration saved successfully.');
         $breadCrumbLinks[] = Zurmo::t('EmailMessagesModule', 'Bounce Configuration (IMAP)');
     } else {
         $breadCrumbLinks[] = Zurmo::t('EmailMessagesModule', 'Email Archiving Configuration (IMAP)');
     }
     $configurationForm = $adapterClassName::makeFormFromGlobalConfiguration();
     $postVariableName = get_class($configurationForm);
     if (isset($_POST[$postVariableName])) {
         $configurationForm->setAttributes($_POST[$postVariableName]);
         if ($configurationForm->validate()) {
             $adapterClassName::setConfigurationFromForm($configurationForm);
             Yii::app()->user->setFlash('notification', $successMessage);
             $this->redirect(Yii::app()->createUrl('configuration/default/index'));
         }
     }
     $editView = new $editViewClassName('Edit', $this->getId(), $this->getModule()->getId(), $configurationForm);
     $editView->setCssClasses(array('AdministrativeArea'));
     $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'SettingsBreadCrumbView'));
     echo $view->render();
 }
 /**
  * Action to configure sendgrid outbound settings.
  */
 public function actionConfigurationEditOutbound()
 {
     $breadCrumbLinks = array(Zurmo::t('SendGridModule', 'SendGrid Global Configuration'));
     $configurationForm = SendGridWebApiConfigurationFormAdapter::makeFormFromGlobalConfiguration();
     $postVariableName = get_class($configurationForm);
     if (isset($_POST[$postVariableName])) {
         $configurationForm->setAttributes($_POST[$postVariableName]);
         if ($configurationForm->validate()) {
             SendGridWebApiConfigurationFormAdapter::setConfigurationFromForm($configurationForm);
             if (!Yii::app()->user->hasFlash('notification')) {
                 Yii::app()->user->setFlash('notification', Zurmo::t('SendGridModule', 'Sendgrid configuration saved successfully.'));
             }
             $this->redirect(Yii::app()->createUrl('sendGrid/default/configurationEditOutbound'));
         }
     }
     $editView = new SendGridConfigurationEditAndDetailsView('Edit', $this->getId(), $this->getModule()->getId(), $configurationForm);
     $editView->setCssClasses(array('AdministrativeArea'));
     $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $editView, $breadCrumbLinks, 'SettingsBreadCrumbView'));
     echo $view->render();
 }
 public function actionUserInterface($type = null)
 {
     if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) {
         throw new NotSupportedException();
     }
     if ($type == null) {
         $demoView = new MenuUserInterfaceDemoView();
         $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $demoView));
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::STANDARD_VIEW) {
         $demoView = new StandardUserInterfaceDemoView();
         $demoView->message = 'Standard View';
         $view = new ZurmoConfigurationPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $demoView));
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::STANDARD_BREADCRUMBS_VIEW) {
         $breadCrumbLinks = array('Breadcrumb 1' => array('/zurmo/demo/userInterface'), 'Breadcrumb 2');
         $demoView = new StandardUserInterfaceDemoView();
         $demoView->message = 'Standard View with BreadCrumbs';
         $view = new ZurmoConfigurationPageView(ZurmoDefaultViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $demoView, $breadCrumbLinks, 'SettingsBreadCrumbView'));
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::GRACEFUL_ERROR_VIEW) {
         $demoView = new StandardUserInterfaceDemoView();
         $demoView->message = 'Graceful Error View';
         $view = new ZurmoConfigurationPageView(ZurmoDefaultViewUtil::makeErrorViewForCurrentUser($this, $demoView));
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::UNEXPECTED_ERROR_VIEW) {
         $view = new ErrorPageView('Unexpected error view');
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::AUTHORIZATION_VIEW) {
         $demoView = new StandardUserInterfaceDemoView();
         $demoView->message = 'Authorization View';
         $view = new ZurmoConfigurationPageView(ZurmoDefaultViewUtil::makeAuthorizationViewForCurrentUser($this, $demoView));
         $view->setCssClasses(array_merge($view->getCssClasses(), array('ZurmoAuthorizationPageView')));
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::CONTACT_FORM_EXTERNAL_VIEW) {
         $containedView = new ContactExternalEditAndDetailsView('Edit', $this->getId(), $this->getModule()->getId(), new ContactWebFormsModelForm(new Contact()), ContactExternalEditAndDetailsView::getMetadata());
         $view = new ContactWebFormsExternalPageView(ZurmoExternalViewUtil::makeExternalViewForCurrentUser($containedView));
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::MARKETING_LISTS_EXTERNAL_PREVIEW_VIEW) {
         $splashView = new MarketingListsExternalActionsPreviewView();
         $view = new MarketingListsExternalActionsPageView($this, $splashView);
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::MARKETING_LISTS_MANAGE_SUBSCRIPTIONS_VIEW) {
         $marketingListMember = MarketingListMember::getSubset(null, 0, 1);
         $marketingLists = MarketingList::getByUnsubscribedAndAnyoneCanSubscribe($marketingListMember[0]->contact->id);
         $listView = new MarketingListsManageSubscriptionsListView($this->getId(), $this->getModule()->getId(), $marketingLists, -100, -100, -100, 'notUsed');
         $view = new MarketingListsManageSubscriptionsPageView($this, $listView);
         echo $view->render();
     } elseif ($type == MenuUserInterfaceDemoView::MOBILE_HEADER_VIEW) {
         Yii::app()->userInterface->setSelectedUserInterfaceType(UserInterface::MOBILE);
         $demoView = new StandardUserInterfaceDemoView();
         $demoView->message = 'Standard View';
         $view = new ZurmoConfigurationPageView(ZurmoDefaultViewUtil::makeStandardViewForCurrentUser($this, $demoView));
         echo $view->render();
     } else {
         throw new NotSupportedException();
     }
 }