public function testSuperUserProjectDefaultControllerActions()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Default Controller actions requiring some sort of parameter via POST or GET
     //Load Project Modules Menu.
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/modulesMenu');
     //Load AttributesList for Project module.
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/attributesList');
     //Load ModuleLayoutsList for Project module.
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleLayoutsList');
     //Now confirm everything did in fact save correctly.
     $this->assertEquals('Project', ProjectsModule::getModuleLabelByTypeAndLanguage('Singular'));
     $this->assertEquals('Projects', ProjectsModule::getModuleLabelByTypeAndLanguage('Plural'));
     $this->assertEquals('project', ProjectsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase'));
     $this->assertEquals('projects', ProjectsModule::getModuleLabelByTypeAndLanguage('PluralLowerCase'));
     //Load LayoutEdit for each applicable module and applicable layout
     $this->resetPostArray();
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule', 'viewClassName' => 'ProjectsListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule', 'viewClassName' => 'ProjectsModalListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule', 'viewClassName' => 'ProjectsModalSearchView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule', 'viewClassName' => 'ProjectsRelatedListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ProjectsModule', 'viewClassName' => 'ProjectEditAndDetailsView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
 }
コード例 #2
0
 /**
  * @return array
  */
 protected function getMenuItems()
 {
     $items = array();
     if (RightsUtil::doesUserHaveAllowByRightName('ProjectsModule', ProjectsModule::getCreateRight(), Yii::app()->user->userModel)) {
         $items[] = array('label' => Zurmo::t('ProjectsModule', 'Create Project'), 'url' => Yii::app()->createUrl('projects/default/create'));
         return $items;
     }
     return null;
 }
コード例 #3
0
 /**
  * Resolve confirm alert options while deleting project
  * @param array $htmlOptions
  * @return array
  */
 protected function resolveConfirmAlertInHtmlOptions($htmlOptions)
 {
     $htmlOptions['confirm'] = Zurmo::t('Core', 'Are you sure you want to delete this {modelLabel}?', array('{modelLabel}' => ProjectsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase')));
     return $htmlOptions;
 }
コード例 #4
0
 /**
  * Action called in the event that the mass delete quantity is larger than the pageSize.
  * This action is called after the pageSize quantity has been delted and continues to be
  * called until the mass delete action is complete.  For example, if there are 20 records to delete
  * and the pageSize is 5, then this action will be called 3 times.  The first 5 are updated when
  * the actionMassDelete is called upon the initial form submission.
  */
 public function actionMassDeleteProgress()
 {
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('massDeleteProgressPageSize');
     $project = new Project(false);
     $dataProvider = $this->getDataProviderByResolvingSelectAllFromGet(new ProjectsSearchForm($project), $pageSize, Yii::app()->user->userModel->id, null, 'ProjectsSearchView');
     $this->processMassDeleteProgress('Project', $pageSize, ProjectsModule::getModuleLabelByTypeAndLanguage('Plural'), $dataProvider);
 }