public function testSuperUserProductDefaultControllerActions() { $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super'); //Default Controller actions requiring some sort of parameter via POST or GET //Load Product Modules Menu. $this->setGetArray(array('moduleClassName' => 'ProductsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/modulesMenu'); //Load AttributesList for Product module. $this->setGetArray(array('moduleClassName' => 'ProductsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/attributesList'); //Load ModuleLayoutsList for Product module. $this->setGetArray(array('moduleClassName' => 'ProductsModule')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleLayoutsList'); //Now confirm everything did in fact save correctly. $this->assertEquals('Product', ProductsModule::getModuleLabelByTypeAndLanguage('Singular')); $this->assertEquals('Products', ProductsModule::getModuleLabelByTypeAndLanguage('Plural')); $this->assertEquals('product', ProductsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase')); $this->assertEquals('products', ProductsModule::getModuleLabelByTypeAndLanguage('PluralLowerCase')); //Load LayoutEdit for each applicable module and applicable layout $this->resetPostArray(); $this->setGetArray(array('moduleClassName' => 'ProductsModule', 'viewClassName' => 'ProductsListView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'ProductsModule', 'viewClassName' => 'ProductsModalListView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'ProductsModule', 'viewClassName' => 'ProductsModalSearchView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'ProductsModule', 'viewClassName' => 'ProductsRelatedListView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); $this->setGetArray(array('moduleClassName' => 'ProductsModule', 'viewClassName' => 'ProductEditAndDetailsView')); $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit'); }
/** * 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'); $product = new Product(false); $dataProvider = $this->getDataProviderByResolvingSelectAllFromGet(new ProductsSearchForm($product), $pageSize, Yii::app()->user->userModel->id, null, 'ProductsSearchView'); $this->processMassDeleteProgress('Product', $pageSize, ProductsModule::getModuleLabelByTypeAndLanguage('Plural'), $dataProvider); }
/** * Resolve confirm alert options while deleting product * @param array $htmlOptions * @return array */ protected function resolveConfirmAlertInHtmlOptions($htmlOptions) { $htmlOptions['confirm'] = Zurmo::t('ProductsModule', 'Are you sure you want to delete this {modelLabel}?', array('{modelLabel}' => ProductsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase'))); return $htmlOptions; }