public function __construct($controllerId, $moduleId)
 {
     parent::__construct(2, 1);
     $moduleDisplayName = LeadsModule::getModuleLabelByTypeAndLanguage('Plural');
     $this->setView(new ActionBarForDesignerModuleView($controllerId, $moduleId, Yii::app()->getModule('leads'), 'DesignerFieldsLink'), 0, 0);
     $this->setView(new AttributesRedirectToContactsView($controllerId, $moduleId), 1, 0);
 }
예제 #2
0
 protected function renderLabel()
 {
     $label = LeadsModule::getModuleLabelByTypeAndLanguage('Singular');
     if ($this->form === null) {
         return $this->getFormattedAttributeLabel();
     }
     $id = $this->getIdForHiddenField();
     return $this->form->labelEx($this->model, $this->attribute, array('for' => $id, 'label' => $label));
 }
 /**
  * Get the display label used to describe the import rules.
  * @return string
  */
 public static function getDisplayLabel()
 {
     return LeadsModule::getModuleLabelByTypeAndLanguage('Plural');
 }
예제 #4
0
 /**
  * Override since the ContactsModule controls module permissions for both leads and contacts.
  */
 public static function getSecurableModuleDisplayName()
 {
     $label = static::getModuleLabelByTypeAndLanguage('Plural') . ' & ' . LeadsModule::getModuleLabelByTypeAndLanguage('Plural');
     return $label;
 }
 public function testSuperUserLeadDefaultControllerActions()
 {
     $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
     //Default Controller actions requiring some sort of parameter via POST or GET
     //Load Lead Modules Menu.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/modulesMenu');
     //Load AttributesList for Leads module.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/attributesList');
     //Load ModuleLayoutsList for Lead module.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleLayoutsList');
     //Load ModuleEdit view for each applicable module.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/moduleEdit');
     //Now validate save with failed validation.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule'));
     $this->setPostArray(array('ajax' => 'edit-form', 'LeadsModuleForm' => $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' => 'LeadsModule'));
     $this->setPostArray(array('ajax' => 'edit-form', 'LeadsModuleForm' => $this->createModuleEditGoodValidationPostData('lea new name')));
     $content = $this->runControllerWithExitExceptionAndGetContent('designer/default/moduleEdit');
     $this->assertEquals('[]', $content);
     //Now save successfully.
     $this->setGetArray(array('moduleClassName' => 'LeadsModule'));
     $this->setPostArray(array('save' => 'Save', 'LeadsModuleForm' => $this->createModuleEditGoodValidationPostData('lea new name')));
     $this->runControllerWithRedirectExceptionAndGetContent('designer/default/moduleEdit');
     //Now confirm everything did in fact save correctly.
     $this->assertEquals('Lea New Name', LeadsModule::getModuleLabelByTypeAndLanguage('Singular'));
     $this->assertEquals('Lea New Names', LeadsModule::getModuleLabelByTypeAndLanguage('Plural'));
     $this->assertEquals('lea new name', LeadsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase'));
     $this->assertEquals('lea new names', LeadsModule::getModuleLabelByTypeAndLanguage('PluralLowerCase'));
     //Load LayoutEdit for each applicable module and applicable layout
     $this->resetPostArray();
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadEditAndDetailsView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsMassEditView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsModalListView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsModalSearchView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
     $this->setGetArray(array('moduleClassName' => 'LeadsModule', 'viewClassName' => 'LeadsSearchView'));
     $this->runControllerWithNoExceptionsAndGetContent('designer/default/LayoutEdit');
 }
 public function actionMassSubscribeProgress()
 {
     $this->triggerMassAction('Contact', static::getSearchFormClassName(), 'LeadsPageView', LeadsModule::getModuleLabelByTypeAndLanguage('Plural'), 'LeadsSearchView', 'LeadsStateMetadataAdapter', false);
 }
 protected function resolveConfirmAlertInHtmlOptions($htmlOptions)
 {
     $htmlOptions['confirm'] = Zurmo::t('Core', 'Are you sure you want to delete this {modelLabel}?', array('{modelLabel}' => LeadsModule::getModuleLabelByTypeAndLanguage('SingularLowerCase')));
     return $htmlOptions;
 }