public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_ACCESS_ACCOUNT_ACCOUNT_AFFILIATIONS] = Zurmo::t('MarketingModule', 'Access AccountsModuleSingularLabel to AccountsModuleSingularLabel  Affiliations Tab', $params);
     return $labels;
 }
 protected function renderContent()
 {
     $content = '<div>';
     $content .= Zurmo::t('LeadsModule', 'LeadsModulePluralLabel and ContactsModulePluralLabel are the same records, ' . 'just in a different status. To create a LeadsModuleSingularLowerCaseLabel ' . 'field, create a ContactsModuleSingularLowerCaseLabel field, and then it ' . 'will be placeable in the LeadsModulePluralLowerCaseLabel layouts.', LabelUtil::getTranslationParamsForAllModules());
     $content .= '</div>' . "\n";
     return $content;
 }
 /**
  * Runs a query to get all the dates for meetings based on SearchAttributeData.  Then the data is processed
  * and @returns a data array of dates and quantity.  Quantity stands for how many meetings in a given date.
  * (non-PHPdoc)
  * @see CalendarDataProvider::getData()
  */
 public function getData()
 {
     $sql = $this->makeSqlQuery();
     $rows = ZurmoRedBean::getAll($sql);
     $data = array();
     foreach ($rows as $row) {
         $localTimeZoneAdjustedDate = DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($row['startdatetime'], 'medium', null);
         if (isset($data[$localTimeZoneAdjustedDate])) {
             $data[$localTimeZoneAdjustedDate]['quantity'] = $data[$localTimeZoneAdjustedDate]['quantity'] + 1;
         } else {
             $data[$localTimeZoneAdjustedDate] = array('date' => $localTimeZoneAdjustedDate, 'quantity' => 1, 'dbDate' => $row['startdatetime']);
         }
     }
     foreach ($data as $key => $item) {
         if ($item['quantity'] == 1) {
             $label = Zurmo::t('MeetingsModule', '{quantity} MeetingsModuleSingularLabel', array_merge(LabelUtil::getTranslationParamsForAllModules(), array('{quantity}' => $item['quantity'])));
         } else {
             $label = Zurmo::t('MeetingsModule', '{quantity} MeetingsModulePluralLabel', array_merge(LabelUtil::getTranslationParamsForAllModules(), array('{quantity}' => $item['quantity'])));
         }
         $data[$key]['label'] = $label;
         if ($item['quantity'] > 5) {
             $quantityClassSuffix = 6;
         } else {
             $quantityClassSuffix = $item['quantity'];
         }
         $data[$key]['className'] = 'calendar-events-' . $quantityClassSuffix;
     }
     return $data;
 }
 protected function renderContent()
 {
     $nextPageUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/checkSystem/');
     $content = '<div class="MetadataView">';
     $content .= '<table><tr><td>';
     $content .= Zurmo::t('InstallModule', 'Welcome to Zurmo. Before getting started, we need some information ' . 'on the database. You will need to know the following items before proceeding:', LabelUtil::getZurmoLabelParam());
     $content .= '<br/>';
     $content .= '<br/>';
     $content .= '<ul>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database host') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database admin username') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database admin password') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database name') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database username') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Database password') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Memcache host') . '</li>';
     $content .= '<li>' . Zurmo::t('InstallModule', 'Memcache port number') . '</li>';
     $content .= '</ul>';
     $content .= Zurmo::t('InstallModule', 'In all likelihood, these items were supplied to you by your Web Host. ' . 'If you do not have this information, then you will need to contact ' . 'them before you can continue. If you\'re all ready...');
     $content .= '<br/><br/>';
     $content .= ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('InstallModule', 'Click to start')), $nextPageUrl, array('class' => 'default-btn'));
     $content .= '</td></tr></table>';
     $content .= '</div>';
     return $content;
 }
 public static function getSkipCountMessageContentByModelClassName($skipCount, $modelClassName)
 {
     if ($skipCount > 0) {
         return $skipCount . ' ' . LabelUtil::getUncapitalizedModelLabelByCountAndModelClassName($skipCount, $modelClassName) . ' ' . Zurmo::t('ZurmoModule', 'skipped because you do not have sufficient permissions.');
     }
     throw new NotSupportedException();
 }
 /**
  * Given an array of sanitizer util types, a value, as well as several other parameters, run through each
  * sanitizer type on the value and process any sanitization messages or errors into the ImportSanitizeResultsUtil
  * provided.
  * @param array $sanitizerUtilTypes
  * @param string $modelClassName
  * @param string $attributeName
  * @param mixed $value
  * @param array $columnMappingData
  * @param ImportSanitizeResultsUtil $importSanitizeResultsUtil
  * @return mixed value
  */
 public static function sanitizeValueBySanitizerTypes($sanitizerUtilTypes, $modelClassName, $attributeName, $value, $columnName, $columnMappingData, ImportSanitizeResultsUtil $importSanitizeResultsUtil)
 {
     assert('is_array($sanitizerUtilTypes)');
     assert('is_string($modelClassName)');
     assert('is_string($attributeName) || $attributeName == null');
     assert('is_string($columnName)');
     assert('is_array($columnMappingData)');
     foreach ($sanitizerUtilTypes as $sanitizerUtilType) {
         try {
             $sanitizer = ImportSanitizerUtilFactory::make($sanitizerUtilType, $modelClassName, $attributeName, $columnName, $columnMappingData);
             if ($sanitizer->shouldSanitizeValue()) {
                 $value = $sanitizer->sanitizeValue($value);
             }
         } catch (InvalidValueToSanitizeException $e) {
             if ($e->getMessage() != null) {
                 if ($attributeName != null) {
                     $label = LabelUtil::makeModelAndAttributeNameCombinationLabel($modelClassName, $attributeName);
                 } else {
                     $label = $modelClassName::getModelLabelByTypeAndLanguage('Singular') . ' -';
                 }
                 $importSanitizeResultsUtil->addMessage($label . ' ' . $e->getMessage());
             }
             $value = null;
             if ($sanitizer::shouldNotSaveModelOnSanitizingValueFailure()) {
                 $importSanitizeResultsUtil->setModelShouldNotBeSaved();
             }
             break;
         }
     }
     return $value;
 }
 /**
  * @return bool|string
  */
 protected function renderContent()
 {
     $this->registerScripts();
     if ($this->cookieValue == self::HIDDEN_COOKIE_VALUE) {
         $style = "style=display:none;";
         // Not Coding Standard
     } else {
         $style = null;
     }
     $content = '<div id="' . self::PANEL_ID . '" ' . $style . '>';
     $content .= '<h1>' . Zurmo::t('MarketingModule', 'How does Email Marketing work in Zurmo?', LabelUtil::getTranslationParamsForAllModules()) . '</h1>';
     $content .= '<div id="marketing-intro-steps" class="clearfix">';
     $content .= '<div class="third"><h3>' . Zurmo::t('Core', 'Step') . '<strong>1<span>➜</span></strong></h3>';
     $content .= '<p><strong>' . Zurmo::t('MarketingModule', 'Group') . '</strong>';
     $content .= Zurmo::t('MarketingModule', 'Group together the email recipients into a list, use different lists for different purposes');
     $content .= '</p>';
     $content .= '</div>';
     $content .= '<div class="third"><h3>' . Zurmo::t('Core', 'Step') . '<strong>2<span>➜</span></strong></h3>';
     $content .= '<p><strong>' . Zurmo::t('MarketingModule', 'Create') . '</strong>';
     $content .= Zurmo::t('MarketingModule', 'Create the template for the email you are going to send, import and use either full, ' . 'rich HTML templates or plain text');
     $content .= '</p>';
     $content .= '</div>';
     $content .= '<div class="third"><h3>' . Zurmo::t('Core', 'Step') . '<strong>3</strong></h3>';
     $content .= '<p><strong>' . Zurmo::t('MarketingModule', 'Launch') . '</strong>';
     $content .= Zurmo::t('MarketingModule', 'Create a campaign where you can schedule your email to go out, pick the List(s) of recipients, ' . 'add and schedule autoresponders and track your overall campaign performance');
     $content .= '</p>';
     $content .= '</div>';
     $content .= '</div>';
     $content .= $this->renderHideLinkContent();
     $content .= '</div>';
     return $content;
 }
Beispiel #8
0
 protected static function translatedAttributeLabels($language)
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $paramsForAffiliations = $params;
     $paramsForAffiliations['{primaryAccount}'] = AccountAccountAffiliationsModule::resolveAccountRelationLabel('Singular', 'primary');
     $paramsForAffiliations['{secondaryAccount}'] = AccountAccountAffiliationsModule::resolveAccountRelationLabel('Singular', 'secondary');
     return array_merge(parent::translatedAttributeLabels($language), array('account' => Zurmo::t('AccountsModule', 'Parent AccountsModuleSingularLabel', $params, null, $language), 'accounts' => Zurmo::t('AccountsModule', 'AccountsModulePluralLabel', $params, null, $language), 'annualRevenue' => Zurmo::t('AccountsModule', 'Annual Revenue', array(), null, $language), 'billingAddress' => Zurmo::t('AccountsModule', 'Service Address', array(), null, $language), 'contacts' => Zurmo::t('ContactsModule', 'ContactsModulePluralLabel', $params, null, $language), 'description' => Zurmo::t('ZurmoModule', 'Description', array(), null, $language), 'employees' => Zurmo::t('AccountsModule', 'Employees', array(), null, $language), 'industry' => Zurmo::t('ZurmoModule', 'Industry', array(), null, $language), 'latestActivityDateTime' => Zurmo::t('ZurmoModule', 'Latest Activity Date Time', array(), null, $language), 'meetings' => Zurmo::t('MeetingsModule', 'MeetingsModulePluralLabel', $params, null, $language), 'name' => Zurmo::t('Core', 'Name', array(), null, $language), 'notes' => Zurmo::t('NotesModule', 'NotesModulePluralLabel', $params, null, $language), 'officePhone' => Zurmo::t('ZurmoModule', 'Office Phone', array(), null, $language), 'officeFax' => Zurmo::t('ZurmoModule', 'Office Fax', array(), null, $language), 'opportunities' => Zurmo::t('OpportunitiesModule', 'OpportunitiesModulePluralLabel', $params, null, $language), 'contracts' => Zurmo::t('ContractsModule', 'ContractsModulePluralLabel', $params, null, $language), 'primaryAccountAffiliations' => Zurmo::t('AccountAccountAffiliationsModule', '{primaryAccount} Affiliations', $paramsForAffiliations, null, $language), 'primaryEmail' => Zurmo::t('ZurmoModule', 'Primary Email', array(), null, $language), 'secondaryAccountAffiliations' => Zurmo::t('AccountAccountAffiliationsModule', '{secondaryAccount} Affiliations', $paramsForAffiliations, null, $language), 'secondaryEmail' => Zurmo::t('ZurmoModule', 'Secondary Email', array(), null, $language), 'shippingAddress' => Zurmo::t('AccountsModule', 'Shipping Address', array(), null, $language), 'tasks' => Zurmo::t('TasksModule', 'TasksModulePluralLabel', $params, null, $language), 'type' => Zurmo::t('Core', 'Type', array(), null, $language), 'website' => Zurmo::t('ZurmoModule', 'Website', array(), null, $language)));
 }
 protected function getCompleteMessage()
 {
     $successfulCount = MassEditInsufficientPermissionSkipSavingUtil::resolveSuccessfulCountAgainstSkipCount($this->totalRecordCount, $this->skipCount);
     $content = $successfulCount . "&#160;" . LabelUtil::getUncapitalizedRecordLabelByCount($successfulCount) . "&#160;" . Yii::t('Default', 'updated successfully.');
     if ($this->skipCount > 0) {
         $content .= '<br/>' . MassEditInsufficientPermissionSkipSavingUtil::getSkipCountMessageContentByModelClassName($this->skipCount, get_class($this->model));
     }
     return $content;
 }
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_OPPORTUNITIES] = Zurmo::t('OpportunitiesModule', 'Create OpportunitiesModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_OPPORTUNITIES] = Zurmo::t('OpportunitiesModule', 'Delete OpportunitiesModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_OPPORTUNITIES] = Zurmo::t('OpportunitiesModule', 'Access OpportunitiesModulePluralLabel Tab', $params);
     return $labels;
 }
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_DEPARTMENTREFERENCES] = Zurmo::t('DepartmentReferencesModule', 'Create DepartmentReferencesModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_DEPARTMENTREFERENCES] = Zurmo::t('DepartmentReferencesModule', 'Delete DepartmentReferencesModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_DEPARTMENTREFERENCES] = Zurmo::t('DepartmentReferencesModule', 'Access DepartmentReferencesModulePluralLabel Tab', $params);
     return $labels;
 }
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_MEETINGS] = Zurmo::t('MeetingsModule', 'Create MeetingsModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_MEETINGS] = Zurmo::t('MeetingsModule', 'Delete MeetingsModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_MEETINGS] = Zurmo::t('MeetingsModule', 'Access MeetingsModulePluralLabel', $params);
     return $labels;
 }
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_UNITOFMEASURES] = Zurmo::t('UnitofmeasuresModule', 'Create UnitofmeasuresModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_UNITOFMEASURES] = Zurmo::t('UnitofmeasuresModule', 'Delete UnitofmeasuresModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_UNITOFMEASURES] = Zurmo::t('UnitofmeasuresModule', 'Access UnitofmeasuresModulePluralLabel Tab', $params);
     return $labels;
 }
 protected function renderLabel()
 {
     $label = Zurmo::t('LeadsModule', 'ContactsModuleSingularLabel or LeadsModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules());
     if ($this->form === null) {
         return $this->getFormattedAttributeLabel();
     }
     $id = $this->getIdForHiddenField();
     return $this->form->labelEx($this->model, $this->attribute, array('for' => $id, 'label' => $label));
 }
 /**
  * @return array
  */
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_CALENDAR] = Zurmo::t('CalendarsModule', 'Create CalendarsModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_CALENDAR] = Zurmo::t('CalendarsModule', 'Delete CalendarsModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_CALENDAR] = Zurmo::t('CalendarsModule', 'Access CalendarsModulePluralLabel Tab', $params);
     return $labels;
 }
Beispiel #16
0
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_PRODUCTS] = Zurmo::t('ProductsModule', 'Create ProductsModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_PRODUCTS] = Zurmo::t('ProductsModule', 'Delete ProductsModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_PRODUCTS] = Zurmo::t('ProductsModule', 'Access ProductsModulePluralLabel Tab', $params);
     return $labels;
 }
 /**
  * @return array
  */
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_CONTACT_WEB_FORMS] = Zurmo::t('ContactWebFormsModule', 'Create ContactsModuleSingularLabel Web Forms', $params);
     $labels[self::RIGHT_DELETE_CONTACT_WEB_FORMS] = Zurmo::t('ContactWebFormsModule', 'Delete ContactsModuleSingularLabel Web Forms', $params);
     $labels[self::RIGHT_ACCESS_CONTACT_WEB_FORMS] = Zurmo::t('ContactWebFormsModule', 'Access ContactsModuleSingularLabel Web Forms Tab', $params);
     return $labels;
 }
 protected function getCompleteMessage()
 {
     $successfulCount = $this->callInsufficientPermissionSkipSavingUtilFunction('resolveSuccessfulCountAgainstSkipCount', array($this->totalRecordCount, $this->skipCount));
     $content = $successfulCount . '&#160;' . LabelUtil::getUncapitalizedRecordLabelByCount($successfulCount) . '&#160;' . $this->getCompleteMessageSuffix() . '.';
     if ($this->skipCount > 0) {
         $content .= ZurmoHtml::tag('br') . $this->callInsufficientPermissionSkipSavingUtilFunction('getSkipCountMessageContentByModelClassName', array($this->skipCount, get_class($this->model)));
     }
     return $content;
 }
Beispiel #19
0
 public static function getTranslatedRightsLabels()
 {
     $params = LabelUtil::getTranslationParamsForAllModules();
     $labels = array();
     $labels[self::RIGHT_CREATE_LEADS] = Zurmo::t('LeadsModule', 'Create LeadsModulePluralLabel', $params);
     $labels[self::RIGHT_DELETE_LEADS] = Zurmo::t('LeadsModule', 'Delete LeadsModulePluralLabel', $params);
     $labels[self::RIGHT_ACCESS_LEADS] = Zurmo::t('LeadsModule', 'Access LeadsModulePluralLabel Tab', $params);
     $labels[self::RIGHT_CONVERT_LEADS] = Zurmo::t('LeadsModule', 'Convert LeadsModulePluralLabel', $params);
     return $labels;
 }
 /**
  * Based on the current theme, retrieve the email notification template for text content and replace the
  * content tags with the appropriate strings
  */
 public static function resolveNotificationTextTemplate($bodyContent)
 {
     assert('is_string($bodyContent)');
     $url = Yii::app()->createAbsoluteUrl('users/default/configurationEdit', array('id' => Yii::app()->user->userModel->id));
     $htmlTemplate = self::getNotificationTextTemplate();
     $htmlContent = array();
     $htmlContent['{bodyContent}'] = $bodyContent;
     $htmlContent['{sourceContent}'] = Zurmo::t('EmailMessagesModule', 'This message sent from Zurmo', LabelUtil::getTranslationParamsForAllModules());
     $htmlContent['{preferenceContent}'] = Zurmo::t('EmailMessagesModule', 'Manage your email preferences') . ZurmoHtml::link(null, $url);
     return strtr($htmlTemplate, $htmlContent);
 }
 /**
  * There are several scenarios that can occur where a user has access to matching email messages, but is missing other
  * rights in order to properly utilize the matching mechanism.  This method checks for those conditions, and
  * if present, will alert the user that there is a misconfiguration and they should contact their administrator.
  * Scenario #1 - User does not have access to contacts or leads. You need to have at least one to be able to match.
  */
 public static function resolveCanUserProperlyMatchMessage($userCanAccessContacts, $userCanAccessLeads)
 {
     assert('is_bool($userCanAccessContacts)');
     assert('is_bool($userCanAccessLeads)');
     //Scenario #1 - User does not have access to contacts or leads
     if (!$userCanAccessContacts && !$userCanAccessLeads) {
         $scenarioSpecificContent = Zurmo::t('EmailMessagesModule', 'Matching archived emails requires access to either ContactsModulePluralLowerCaseLabel' . ' or LeadsModulePluralLowerCaseLabel both of which you do not have. Please contact your administrator.', LabelUtil::getTranslationParamsForAllModules());
         static::processAccessFailure(false, $scenarioSpecificContent);
         Yii::app()->end(0, false);
     }
 }
 protected function getMenuItems()
 {
     $items = array();
     if (RightsUtil::doesUserHaveAllowByRightName('ProductsModule', ProductsModule::getCreateRight(), Yii::app()->user->userModel)) {
         $items[] = array('label' => Zurmo::t('ProductsModule', 'Create ProductsModuleSingularLabel', LabelUtil::getTranslationParamsForAllModules()), 'url' => Yii::app()->createUrl('products/default/create'));
     }
     if (!empty($items)) {
         return $items;
     }
     return null;
 }
 public function testResolveMetadataForLanguageLocalization()
 {
     //Test AccountsModulePluralLabel
     $metadata = AccountsModule::getMetadata();
     AccountsModule::setMetadata($metadata);
     $metadata = AccountsModule::getMetadata();
     $this->assertEquals("eval:Zurmo::t('AccountsModule', 'AccountsModulePluralLabel', \$translationParams)", $metadata['global']['tabMenuItems'][0]['label']);
     $resolveVariableName = 'translationParams';
     $params = LabelUtil::getTranslationParamsForAllModules();
     MetadataUtil::resolveEvaluateSubString($metadata, $resolveVariableName, $params);
     $this->assertEquals('Accounts', $metadata['global']['tabMenuItems'][0]['label']);
 }
 /**
  * @return string
  */
 protected function getHomeLinkLabel()
 {
     if ($this->moduleId == 'projects') {
         return Zurmo::t('ProjectsModule', 'ProjectsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     } elseif ($this->moduleId == 'accounts') {
         return Zurmo::t('AccountsModule', 'AccountsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     } elseif ($this->moduleId == 'contacts') {
         return Zurmo::t('ContactsModule', 'ContactsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     } elseif ($this->moduleId == 'opportunities') {
         return Zurmo::t('OpportunitiesModule', 'OpportunitiesModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     }
 }
 /**
  * @param User $user
  * @return null|string|void
  * @throws NotSupportedException
  */
 public static function getVariableStateModuleLabel(User $user)
 {
     assert('$user->id > 0');
     $adapterName = ContactsUtil::resolveContactStateAdapterByModulesUserHasAccessTo('LeadsModule', 'ContactsModule', $user);
     if ($adapterName === false) {
         return null;
     } elseif ($adapterName == 'LeadsStateMetadataAdapter') {
         return Zurmo::t('LeadsModule', 'LeadsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     } elseif ($adapterName == 'ContactsStateMetadataAdapter') {
         return Zurmo::t('ContactsModule', 'ContactsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     } elseif ($adapterName === null) {
         return Zurmo::t('ContactsModule', 'ContactsModulePluralLabel and LeadsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     } else {
         throw new NotSupportedException();
     }
 }
 protected function renderInlineEditContent()
 {
     if (null != ($messageContent = RequiredAttributesValidViewUtil::resolveValidView('NotesModule', $this->getInlineEditViewClassName()))) {
         $message = Zurmo::t('NotesModule', 'The NotesModulePluralLabel form cannot be displayed.', LabelUtil::getTranslationParamsForAllModules());
         $message .= '<br/>' . $messageContent . '<br/><br/>';
         return $message;
     }
     $note = new Note();
     $note->activityItems->add($this->params["relationModel"]);
     $inlineViewClassName = $this->getInlineEditViewClassName();
     $urlParameters = array('redirectUrl' => $this->getPortletDetailsUrl());
     //After save, the url to go to.
     $uniquePageId = get_called_class();
     $inlineView = new $inlineViewClassName($note, 'default', 'notes', 'inlineCreateSave', $urlParameters, $uniquePageId);
     return $inlineView->render();
 }
 public function testGetTranslationParamsForAllModules()
 {
     $this->assertEquals('en', Yii::app()->languageHelper->getForCurrentUser());
     $params = LabelUtil::getTranslationParamsForAllModules();
     $this->assertEquals('Account', $params['AccountsModuleSingularLabel']);
     $this->assertEquals('account', $params['AccountsModuleSingularLowerCaseLabel']);
     $this->assertEquals('Accounts', $params['AccountsModulePluralLabel']);
     $this->assertEquals('accounts', $params['AccountsModulePluralLowerCaseLabel']);
     $metadata = AccountsModule::getMetadata();
     $metadata['global']['singularModuleLabels'] = array('en' => 'company');
     $metadata['global']['pluralModuleLabels'] = array('en' => 'companies');
     AccountsModule::setMetadata($metadata);
     Yii::app()->languageHelper->flushModuleLabelTranslationParameters();
     $params = LabelUtil::getTranslationParamsForAllModules();
     $this->assertEquals('Company', $params['AccountsModuleSingularLabel']);
     $this->assertEquals('company', $params['AccountsModuleSingularLowerCaseLabel']);
     $this->assertEquals('Companies', $params['AccountsModulePluralLabel']);
     $this->assertEquals('companies', $params['AccountsModulePluralLowerCaseLabel']);
 }
 /**
  * Make an array of message strings by RedBeanModel errors
  * @param array $errors RedBeanModel errors
  */
 public static function makeMessagesByModel(RedBeanModel $model)
 {
     $messages = array();
     foreach ($model->getErrors() as $attributeName => $errors) {
         foreach ($errors as $relationAttributeName => $errorOrRelatedError) {
             if (is_array($errorOrRelatedError)) {
                 $relationModelClassName = $model->getRelationModelClassName($attributeName);
                 foreach ($errorOrRelatedError as $relatedError) {
                     if ($relatedError != '') {
                         $messages[] = LabelUtil::makeModelAndAttributeNameCombinationLabel(get_class($model), $attributeName) . ' - ' . $relatedError;
                     }
                 }
             } elseif ($errorOrRelatedError != '') {
                 $messages[] = LabelUtil::makeModelAndAttributeNameCombinationLabel(get_class($model), $attributeName) . ' - ' . $errorOrRelatedError;
             }
         }
     }
     return $messages;
 }
 public function actionList()
 {
     $pageSize = Yii::app()->pagination->resolveActiveForCurrentUserByType('listPageSize', get_class($this->getModule()));
     $gameReward = new GameReward(false);
     $searchForm = new GameRewardsSearchForm($gameReward);
     $listAttributesSelector = new ListAttributesSelector('GameRewardsListView', get_class($this->getModule()));
     $searchForm->setListAttributesSelector($listAttributesSelector);
     $dataProvider = $this->resolveSearchDataProvider($searchForm, $pageSize, null, 'GameRewardsSearchView');
     $title = Zurmo::t('GameRewardsModule', 'GameRewardsModulePluralLabel', LabelUtil::getTranslationParamsForAllModules());
     $breadCrumbLinks = array($title);
     if (isset($_GET['ajax']) && $_GET['ajax'] == 'list-view') {
         $mixedView = $this->makeListView($searchForm, $dataProvider);
         $view = new GameRewardsPageView($mixedView);
     } else {
         $mixedView = $this->makeActionBarSearchAndListView($searchForm, $dataProvider);
         $view = new GameRewardsPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $mixedView, $breadCrumbLinks, 'GameRewardBreadCrumbView'));
     }
     echo $view->render();
 }
 protected function renderContent()
 {
     $imagePath = Yii::app()->themeManager->baseUrl . '/default/images/ajax-loader.gif';
     $progressBarImageContent = ZurmoHtml::image($imagePath, 'Progress Bar');
     $cs = Yii::app()->getClientScript();
     $cs->registerScriptFile($cs->getCoreScriptUrl() . '/jquery.min.js', CClientScript::POS_END);
     $demoDataUrl = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/installDemoData/');
     $loginUrl = Yii::app()->createUrl('zurmo/default');
     $content = '<div class="MetadataView">';
     $content .= '<table><tr><td>';
     $content .= '<div id="demo-data-table" style="display:none;">';
     $content .= '<table><tr><td>';
     $content .= Zurmo::t('InstallModule', 'The next step is to install the demo data.');
     $content .= '<br/><br/>';
     $content .= ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('InstallModule', 'Click Here to install the demo data')), $demoDataUrl, array('class' => 'default-btn'));
     $content .= '</td></tr></table>';
     $content .= '</div>';
     $content .= '<div id="complete-table" style="display:none;">';
     $content .= '<table><tr><td>';
     $content .= Zurmo::t('InstallModule', 'Congratulations! The installation of Zurmo is complete.', LabelUtil::getZurmoLabelParam());
     $content .= '<br/>';
     $content .= '<br/>';
     $content .= Zurmo::t('InstallModule', 'Click below to go to the login page. The username is <b>super</b>');
     $content .= '<br/><br/>';
     $content .= ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('ZurmoModule', 'Sign in')), $loginUrl, array('class' => 'z-button'));
     $content .= '</td></tr></table>';
     $content .= '</div>';
     $content .= '<div id="progress-table">';
     $content .= '<table><tr><td class="progress-bar">';
     $content .= Zurmo::t('InstallModule', 'Installation in progress. Please wait.');
     $content .= '<br/>';
     $content .= $progressBarImageContent;
     $content .= '<br/>';
     $content .= '</td></tr></table>';
     $content .= '</div>';
     $content .= Zurmo::t('InstallModule', 'Installation Output:');
     $content .= '<div id="logging-table">';
     $content .= '</div>';
     $content .= '</td></tr></table>';
     $content .= '</div>';
     return $content;
 }