/**
  * 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');
     $contract = new Contract(false);
     $dataProvider = $this->getDataProviderByResolvingSelectAllFromGet(new ContractsSearchForm($contract), $pageSize, Yii::app()->user->userModel->id, null, 'ContractsSearchView');
     $this->processMassDeleteProgress('Contract', $pageSize, ContractsModule::getModuleLabelByTypeAndLanguage('Plural'), $dataProvider);
 }
 protected function resolveConfirmAlertInHtmlOptions($htmlOptions)
 {
     $htmlOptions['confirm'] = Zurmo::t('Core', 'Are you sure you want to delete this {modelLabel}?', array('{modelLabel}' => ContractsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase')));
     return $htmlOptions;
 }
 public function testSuperUserContractDefaultControllerActions()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Default Controller actions requiring some sort of parameter via POST or GET
     //Load Contract Modules Menu.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/modulesMenu');
     //Load AttributesList for Contract module.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/attributesList');
     //Load ModuleLayoutsList for Contract module.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleLayoutsList');
     //Load ModuleEdit view for each applicable module.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleEdit');
     //Now validate save with failed validation.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->setPostArray(array('ajax' => 'edit-form', 'ContractsModuleForm' => $this->createModuleEditBadValidationPostData()));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/moduleEdit');
     $this->assertTrue(strlen($content) > 50);
     //approximate, but should definetely be larger than 50.
     //Now validate save with successful validation.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->setPostArray(array('ajax' => 'edit-form', 'ContractsModuleForm' => $this->createModuleEditGoodValidationPostData('opp new name')));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/moduleEdit');
     $this->assertEquals('[]', $content);
     //Now save successfully.
     $this->setGetArray(array('moduleClassName' => 'ContractsModule'));
     $this->setPostArray(array('save' => 'Save', 'ContractsModuleForm' => $this->createModuleEditGoodValidationPostData('opp new name')));
     $this->runControllerWithRedirectExceptionAndGetContent('designer/default/moduleEdit');
     //Now confirm everything did in fact save correctly.
     $this->assertEquals('Opp New Name', ContractsModule::getModuleLabelByTypeAndLanguage('Singular'));
     $this->assertEquals('Opp New Names', ContractsModule::getModuleLabelByTypeAndLanguage('Plural'));
     $this->assertEquals('opp new name', ContractsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase'));
     $this->assertEquals('opp new names', ContractsModule::getModuleLabelByTypeAndLanguage('PluralLowerCase'));
     //Load LayoutEdit for each applicable module and applicable layout
     $this->resetPostArray();
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractsListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractsModalListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractsModalSearchView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractsMassEditView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractsRelatedListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractsSearchView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'ContractsModule', 'viewClassName' => 'ContractEditAndDetailsView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
 }