public function actionConfigurationList() { $redirectUrlParams = array('/zurmo/' . $this->getId() . '/ConfigurationList'); $messageBoxContent = Zurmo::t('ZurmoModule', 'Don\'t see a language that you want to load? Help us make Zurmo better by contributing on a translation. Click <a href="{l10nServerDomain}" class="simple-link normal-size" target="_blank">here</a>.', array('{l10nServerDomain}' => ZurmoTranslationServerUtil::getServerDomain())); $view = new LanguageTitleBarConfigurationListView($this->getId(), $this->getModule()->getId(), $messageBoxContent); $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $view)); 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(); } }
public function actionConfigurationList() { $redirectUrlParams = array('/zurmo/' . $this->getId() . '/ConfigurationList'); $currency = new Currency(); $currency = $this->attemptToSaveModelFromPost($currency, $redirectUrlParams); $messageBoxContent = $this->attemptToUpdateActiveCurrenciesFromPostAndGetMessageBoxContent(); $view = new CurrencyTitleBarConfigurationListAndCreateView($this->getId(), $this->getModule()->getId(), $currency, Currency::getAll(), $messageBoxContent); $view = new ZurmoConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $view)); echo $view->render(); }
protected function preFilter($filterChain) { if (!RightsUtil::canUserAccessModule('MarketingListsModule', Yii::app()->user->userModel)) { $messageView = new UserIsMissingMarketingListAccessSplashView(); $pageViewClassName = $this->controller->getModule()->getPluralCamelCasedName() . 'PageView'; $view = new $pageViewClassName(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this->controller, $messageView)); echo $view->render(); return false; } return true; }
public function actionIndex() { if (isset($_GET['clearCache']) && $_GET['clearCache'] == 1) { Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Cache has been successfully cleaned.')); } if (isset($_GET['resolveCustomData']) && $_GET['resolveCustomData'] == 1) { Yii::app()->user->setFlash('notification', Zurmo::t('ZurmoModule', 'Custom data updated successfully.')); } $view = new ConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, new DevelopmentListView())); echo $view->render(); }
public function actionMassDelete() { $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('massDeleteProgressPageSize'); $contactWebFormEntry = new ContactWebFormEntry(false); $activeAttributes = $this->resolveActiveAttributesFromMassDeletePost(); $dataProvider = $this->getDataProviderByResolvingSelectAllFromGet(new ContactWebFormEntrySearchForm($contactWebFormEntry), $pageSize, null, null); $selectedRecordCount = static::getSelectedRecordCountByResolvingSelectAllFromGet($dataProvider); $contactWebFormEntry = $this->processMassDelete($pageSize, $activeAttributes, $selectedRecordCount, 'ContactWebFormsPageView', $contactWebFormEntry, ContactWebFormEntry::getModelLabelByTypeAndLanguage('Plural'), $dataProvider, array($this->getId() . '/list')); $massDeleteView = $this->makeMassDeleteView($contactWebFormEntry, $activeAttributes, $selectedRecordCount, ContactWebFormEntry::getModelLabelByTypeAndLanguage('Plural')); $view = new ContactWebFormsPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $massDeleteView)); echo $view->render(); }
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(); }
/** * 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() { $view = new ConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, new PluginsConfigurationListView())); echo $view->render(); }
/** * Action for displaying a mass edit form and also action when that form is first submitted. * When the form is submitted, in the event that the quantity of models to update is greater * than the pageSize, then once the pageSize quantity has been reached, the user will be * redirected to the makeMassEditProgressView. * In the mass edit progress view, a javascript refresh will take place that will call a refresh * action, usually massEditProgressSave. * If there is no need for a progress view, then a flash message will be added and the user will * be redirected to the list view for the model. A flash message will appear providing information * on the updated records. * @see Controler->makeMassEditProgressView * @see Controller->processMassEdit * @see */ public function actionMassEdit() { $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('massEditProgressPageSize'); $user = new User(false); $activeAttributes = $this->resolveActiveAttributesFromMassEditPost(); $dataProvider = $this->getDataProviderByResolvingSelectAllFromGet(new UsersSearchForm($user), $pageSize, Yii::app()->user->userModel->id, null, 'UsersSearchView'); $selectedRecordCount = static::getSelectedRecordCountByResolvingSelectAllFromGet($dataProvider); $user = $this->processMassEdit($pageSize, $activeAttributes, $selectedRecordCount, 'UsersPageView', $user, UsersModule::getModuleLabelByTypeAndLanguage('Plural'), $dataProvider); $massEditView = $this->makeMassEditView($user, $activeAttributes, $selectedRecordCount, UsersModule::getModuleLabelByTypeAndLanguage('Plural')); $view = new UsersPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $massEditView)); echo $view->render(); }
public function actionJobLogDetails($id) { $jobLog = JobLog::getById(intval($id)); $detailsView = new JobLogDetailsView($this->getId(), $this->getModule()->getId(), $jobLog, strval($jobLog)); $view = new JobsManagerPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $detailsView)); echo $view->render(); }
public function actionIndex() { $view = new ConfigurationPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, new ConfigureModulesView())); echo $view->render(); }
public function actionRebuildSecurityCache($User_page = 1, $continue = false) { if (!Group::isUserASuperAdministrator(Yii::app()->user->userModel)) { $failureMessageContent = Zurmo::t('Core', 'You must be a super administrator to rebuild the security cache.'); $messageView = new AccessFailureView($failureMessageContent); $view = new AccessFailurePageView($messageView); echo $view->render(); Yii::app()->end(0, false); } if ($User_page == 1) { //to more quickly show the view to the user. To give a better indication of what is happening. $pageSize = 1; } else { $pageSize = 25; } $namedSecurableItems = array(); $modules = Module::getModuleObjects(); foreach ($modules as $module) { if ($module instanceof SecurableModule) { $namedSecurableItems[] = NamedSecurableItem::getByName(get_class($module)); } } if ($continue) { $page = static::getMassActionProgressStartFromGet('User_page', $pageSize); } else { $page = 1; } $title = Zurmo::t('ZurmoModule', 'Rebuilding Cache'); $searchAttributeData['clauses'] = array(1 => array('attributeName' => 'isSystemUser', 'operatorType' => 'equals', 'value' => 0), 2 => array('attributeName' => 'isSystemUser', 'operatorType' => 'isNull', 'value' => null)); $searchAttributeData['structure'] = '1 or 2'; $dataProvider = RedBeanModelDataProviderUtil::makeDataProvider($searchAttributeData, 'User', 'RedBeanModelDataProvider', null, false, $pageSize); $selectedRecordCount = $dataProvider->getTotalItemCount(); $users = $dataProvider->getData(); foreach ($users as $user) { if (!$user->isSuperAdministrator()) { foreach ($namedSecurableItems as $namedSecurableItem) { $namedSecurableItem->getActualPermissions($user); } } RightsUtil::cacheAllRightsByPermitable($user); } $rebuildView = new RebuildSecurityCacheProgressView($this->getId(), $this->getModule()->getId(), new User(), $selectedRecordCount, $page, $pageSize, $User_page, 'rebuildSecurityCache', $title); if (!$continue) { $view = new ZurmoPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $rebuildView)); echo $view->render(); Yii::app()->end(0, false); } else { echo $rebuildView->renderRefreshJSONScript(); } }
/** * Step 6. Sanitize and create/update models using a sequential process. * @param integer id - Import model id * @param string $step */ function actionStep6($id, $step = null) { if (isset($_GET['nextParams'])) { $nextParams = $_GET['nextParams']; } else { $nextParams = null; } assert('$step == null || is_string($step)'); assert('$nextParams == null || is_array($nextParams)'); $import = Import::getById((int) $id); $importWizardForm = ImportWizardUtil::makeFormByImport($import); $cs = Yii::app()->getClientScript(); $cs->registerCoreScript('bbq'); if (isset($_GET['ajax']) && $_GET['ajax'] == 'list-view') { $importCompleteView = $this->makeImportCompleteView($import, $importWizardForm); $view = new AjaxPageView($importCompleteView); echo $view->render(); Yii::app()->end(0, false); } $unserializedData = unserialize($import->serializedData); $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('importPageSize'); $config = array('pagination' => array('pageSize' => $pageSize)); $dataProvider = new ImportDataProvider($import->getTempTableName(), (bool) $importWizardForm->firstRowIsHeaderRow, $config); $sequentialProcess = new ImportCreateUpdateModelsSequentialProcess($import, $dataProvider); Yii::app()->gameHelper->muteScoringModelsOnSave(); $sequentialProcess->run($step, $nextParams); Yii::app()->gameHelper->unmuteScoringModelsOnSave(); $nextStep = $sequentialProcess->getNextStep(); $route = $this->getModule()->getId() . '/' . $this->getId() . '/step6'; if ($sequentialProcess->isComplete()) { $importingIntoModelClassName = $unserializedData['importRulesType'] . 'ImportRules'; Yii::app()->gameHelper->triggerImportEvent($importingIntoModelClassName::getModelClassName()); $importCompleteView = $this->makeImportCompleteView($import, $importWizardForm, true); $sequenceView = new ContainedViewCompleteSequentialProcessView($importCompleteView); } else { $sequenceView = SequentialProcessViewFactory::makeBySequentialProcess($sequentialProcess, $route); } if ($step == null) { $title = Zurmo::t('ImportModule', 'Import Wizard: Step 6 of 6'); $wrapperView = new ImportSequentialProcessContainerView($sequenceView, $sequentialProcess->getAllStepsMessage(), $title); $wrapperView->setCssClasses(array('DetailsView')); $view = new ImportPageView(ZurmoDefaultAdminViewUtil::makeStandardViewForCurrentUser($this, $wrapperView)); } else { $view = new AjaxPageView($sequenceView); } 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.'); if ($type == 2) { $adapterClassName = 'BounceConfigurationFormAdapter'; $editViewClassName = 'BounceConfigurationEditAndDetailsView'; $successMessage = Zurmo::t('EmailMessagesModule', 'Bounce configuration saved successfully.'); } $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::makeStandardViewForCurrentUser($this, $editView)); echo $view->render(); }