protected function resolveConfirmAlertInHtmlOptions($htmlOptions) { $htmlOptions['confirm'] = Zurmo::t('AccountsModule', 'Are you sure you want to delete this {modelLabel}?', array('{modelLabel}' => AccountsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase'))); return $htmlOptions; }
/** * 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'); $account = new Account(false); $dataProvider = $this->getDataProviderByResolvingSelectAllFromGet(new AccountsSearchForm($account), $pageSize, Yii::app()->user->userModel->id, null, 'AccountsSearchView'); $this->processMassDeleteProgress('Account', $pageSize, AccountsModule::getModuleLabelByTypeAndLanguage('Plural'), $dataProvider); }
public function testSuperUserAccountDefaultControllerActions() { $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super'); //Default Controller actions requiring some sort of parameter via POST or GET //Load Account Modules Menu. $this->resetPostArray(); $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/modulesMenu'); //Load AttributesList for Account module. $this->resetPostArray(); $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/attributesList'); //Load ModuleLayoutsList for Account module. $this->resetPostArray(); $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleLayoutsList'); //Load ModuleEdit view for each applicable module. $this->resetPostArray(); $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleEdit'); //Now validate save with failed validation. $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->setPostArray(array('ajax' => 'edit-form', 'AccountsModuleForm' => $this->createModuleEditBadValidationPostData())); $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/moduleEdit'); //Now validate save with successful validation. $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->setPostArray(array('ajax' => 'edit-form', 'AccountsModuleForm' => $this->createModuleEditGoodValidationPostData('acc new name'))); $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/moduleEdit'); $this->assertEquals('[]', $content); //Now save successfully. $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted(); $this->assertTrue($value); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated(); $this->assertTrue($value); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived(); $this->assertTrue($value); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast(); $this->assertTrue($value); $postDataForForm = $this->createModuleEditGoodValidationPostData('acc new name'); $postDataForForm['updateLatestActivityDateTimeWhenATaskIsCompleted'] = ''; $postDataForForm['updateLatestActivityDateTimeWhenANoteIsCreated'] = ''; $postDataForForm['updateLatestActivityDateTimeWhenAnEmailIsSentOrArchived'] = ''; $postDataForForm['updateLatestActivityDateTimeWhenAMeetingIsInThePast'] = ''; $this->setGetArray(array('moduleClassName' => 'AccountsModule')); $this->setPostArray(array('save' => 'Save', 'AccountsModuleForm' => $postDataForForm)); $this->runControllerWithRedirectExceptionAndGetContent('designer/default/moduleEdit'); //Now confirm everything did in fact save correctly. $this->assertEquals('Acc New Name', AccountsModule::getModuleLabelByTypeAndLanguage('Singular')); $this->assertEquals('Acc New Names', AccountsModule::getModuleLabelByTypeAndLanguage('Plural')); $this->assertEquals('acc new name', AccountsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase')); $this->assertEquals('acc new names', AccountsModule::getModuleLabelByTypeAndLanguage('PluralLowerCase')); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenATaskIsCompleted(); $this->assertFalse($value); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenANoteIsCreated(); $this->assertFalse($value); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenAnEmailIsSentOrArchived(); $this->assertFalse($value); $value = AccountsModule::shouldUpdateLatestActivityDateTimeWhenAMeetingIsInThePast(); $this->assertFalse($value); //Load LayoutEdit for each applicable module and applicable layout $this->resetPostArray(); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountEditAndDetailsView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountsListView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountsMassEditView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountsModalListView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountsModalSearchView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountsRelatedListView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountsSearchView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'AccountsModule', 'viewClassName' => 'AccountConvertToView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); }