protected function renderMergeTagsContent()
 {
     $title = ZurmoHtml::tag('h3', array(), Zurmo::t('Default', 'Merge Tags'));
     $view = new MergeTagsView('Campaign', Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'textContent')), Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'htmlContent')), false);
     $content = $view->render();
     return $title . $content;
 }
 protected function renderContent()
 {
     $this->resolveContentForFooter();
     $this->resolveContentForMergeTags();
     $content = ZurmoHtml::tag('div', array('id' => 'footer-preview-modal-content', 'class' => 'footer-preview-modal'), $this->placeholderContent);
     return $content;
 }
 /**
  * Render a hidden input, a text input with an auto-complete
  * event, and a select button. These three items together
  * form the Opportunity Editable Element
  * @return The element's content as a string.
  */
 protected function renderControlEditable()
 {
     $content = null;
     $content .= ZurmoHtml::textField('stageToProbabilityMapping_notUsed', null, array('id' => $this->getEditableInputId(), 'style' => "display:none;"));
     $fieldData = CustomFieldData::getByName('SalesStages');
     if ($fieldData->serializedData != null) {
         $values = unserialize($fieldData->serializedData);
         if (!is_array($values)) {
             $values = array();
         }
     } else {
         $values = array();
     }
     $stagesToProbabilities = OpportunitiesModule::getStageToProbabilityMappingData();
     foreach ($values as $value) {
         if (isset($stagesToProbabilities[$value])) {
             $probability = $stagesToProbabilities[$value];
         } else {
             $probability = 0;
         }
         $htmlOptions = array('name' => $this->getNameForInputField($value), 'value' => $probability);
         $element = $this->form->textField($this->model, $this->attribute, $htmlOptions);
         $element .= ZurmoHtml::tag('span', array(), $value);
         $content .= ZurmoHtml::tag('div', array('class' => 'has-lang-label'), $element);
     }
     return $content;
 }
 protected function resolveWrapperTdNonEditableByContent($content, array $properties = array())
 {
     $this->resolveContentWhenColumnIsEmpty($content);
     $content = parent::resolveWrapperTdNonEditableByContent($content, $properties);
     $content .= ZurmoHtml::tag('td', $this->resolveNonEditableExpanderTdHtmlOptions(), '');
     return $content;
 }
 /**
  * Override to ensure label is pointing to the right input id
  * @return A string containing the element's label
  */
 protected function renderLabel()
 {
     if ($this->form === null) {
         throw new NotImplementedException();
     }
     return ZurmoHtml::tag('h3', array(), Zurmo::t('ImportModule', 'Please select the module you would like to import to:'));
 }
 protected function renderTabs()
 {
     $content = ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Library'), '#', array('class' => 'choose-tab active', 'data-view' => 'ImageModalSearchAndListView'));
     $content .= ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Upload'), '#', array('class' => 'upload-tab', 'data-view' => 'ImageFilesUploadView'));
     $content .= ZurmoHtml::link(Zurmo::t('ZurmoModule', 'Import From Url'), '#', array('class' => 'upload-tab', 'data-view' => 'ImageFilesImportFromUrlView'));
     return ZurmoHtml::tag('div', array('class' => 'image-tabs clearfix'), $content);
 }
Ejemplo n.º 7
0
 protected function renderAfterFormLayout($form)
 {
     $title = '<h3>' . $this->getAfterFormLayoutTranslatedTitleContent() . '</h3>';
     $element = new EditableDropDownCollectionElement($this->model, 'customFieldDataData', $form, array('specificValueFromDropDownAttributeName' => 'defaultValueOrder', 'baseLanguage' => Yii::app()->languageHelper->getBaseLanguage(), 'activeLanguagesData' => Yii::app()->languageHelper->getActiveLanguagesData(), 'labelsAttributeName' => 'customFieldDataLabels'));
     $content = ZurmoHtml::tag('div', array('class' => 'left-column full-width'), $title . $element->render());
     return $content;
 }
 /**
  * Override to change the editableTemplate to place the label above the input.
  * @see DetailsView::resolveElementDuringFormLayoutRender()
  */
 protected function resolveElementDuringFormLayoutRender(&$element)
 {
     if ($element->getAttribute() == 'name') {
         $notification = ZurmoHtml::tag('span', array('class' => 'row-description'), Zurmo::t('MarketingListsModule', 'Name will be publicly viewable by Contacts/Leads to manage their subscriptions'));
         $element->editableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}' . $notification . '{error}</td>';
     }
 }
 /**
  * Override to change the editableTemplate to place the label above the input.
  * @see DetailsView::resolveElementDuringFormLayoutRender()
  */
 protected function resolveElementDuringFormLayoutRender(&$element)
 {
     if ($element->getAttribute() == 'imapFolder') {
         $notification = ZurmoHtml::tag('span', array('class' => 'row-description'), Zurmo::t('EmailMessagesModule', 'Emails in the specified folder will be deleted by Zurmo after processing.  We do not recommend using a personal email for archiving'));
         $element->editableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}' . $notification . '{error}</td>';
     }
 }
 protected function renderAfterFormLayout($form)
 {
     $content = ZurmoHtml::tag('h3', array(), Zurmo::t('ContactsModule', 'Contact Statuses'));
     $element = new EditableDropDownCollectionElement($this->model, 'contactStatesData', $form, array('specificValueFromDropDownAttributeName' => 'startingStateOrder', 'baseLanguage' => Yii::app()->languageHelper->getBaseLanguage(), 'activeLanguagesData' => Yii::app()->languageHelper->getActiveLanguagesData(), 'labelsAttributeName' => 'contactStatesLabels'));
     $content .= ZurmoHtml::tag('div', array('class' => 'left-column full-width'), $element->render());
     return $content;
 }
 protected function renderHtmlAndTextContentElement($model, $attribute, $form)
 {
     $this->registerContentTabsHeightScripts();
     $params = array(EmailTemplateHtmlAndTextContentElement::SELECTIVE_TAB_LOAD_KEY => true);
     $element = new EmailTemplateHtmlAndTextContentElement($model, $attribute, $form, $params);
     return ZurmoHtml::tag('div', array('class' => 'email-template-combined-content'), $element->render());
 }
Ejemplo n.º 12
0
 /**
  * @return string
  */
 public static function renderToggleLinkContent()
 {
     static::registerSlidingPanelsScript();
     $content = ZurmoHtml::tag('span', array(), static::getSlideToSecondPanelLabel());
     $content = ZurmoHtml::link($content, '#', array('id' => 'sliding-panel-toggle', 'class' => 'vertical-forward-pager slide-to-second-panel'));
     return $content;
 }
Ejemplo n.º 13
0
 /**
  * Override to handle relation model error summary information.  This information needs to be parsed properly
  * otherwise it will show up as 'Array' for the error text.
  * @see CActiveForm::errorSummary()
  */
 public function errorSummary($models, $header = null, $footer = null, $htmlOptions = array())
 {
     if (!$this->enableAjaxValidation && !$this->enableClientValidation) {
         return ZurmoHtml::errorSummary($models, $header, $footer, $htmlOptions);
     }
     if (!isset($htmlOptions['id'])) {
         $htmlOptions['id'] = $this->id . '_es_';
     }
     $html = ZurmoHtml::errorSummary($models, $header, $footer, $htmlOptions);
     if ($html === '') {
         if ($header === null) {
             $header = '<p>' . Yii::t('yii', 'Please fix the following input errors:') . '</p>';
         }
         if (!isset($htmlOptions['class'])) {
             $htmlOptions['class'] = ZurmoHtml::$errorSummaryCss;
         }
         if (isset($htmlOptions['style'])) {
             $htmlOptions['style'] = rtrim($htmlOptions['style'], ';') . ';display:none';
         } else {
             $htmlOptions['style'] = 'display:none';
         }
         $html = ZurmoHtml::tag('div', $htmlOptions, $header . "\n<ul><li>dummy</li></ul>" . $footer);
     }
     $this->summaryID = $htmlOptions['id'];
     return $html;
 }
Ejemplo n.º 14
0
 protected function renderContent()
 {
     $homeUrl = Yii::app()->createUrl('home/default');
     $content = '<div class="clearfix">';
     $content .= '<a href="#" id="nav-trigger" title="Toggle Navigation">&rsaquo;</a>';
     $content .= '<div id="corp-logo">';
     if ($logoFileModelId = ZurmoConfigurationUtil::getByModuleName('ZurmoModule', 'logoFileModelId')) {
         $logoFileModel = FileModel::getById($logoFileModelId);
         $logoFileSrc = Yii::app()->getAssetManager()->getPublishedUrl(Yii::getPathOfAlias('application.runtime.uploads') . DIRECTORY_SEPARATOR . $logoFileModel->name);
     } else {
         $logoFileSrc = Yii::app()->themeManager->baseUrl . '/default/images/Zurmo_logo.png';
     }
     $logoHeight = ZurmoConfigurationFormAdapter::resolveLogoHeight();
     $logoWidth = ZurmoConfigurationFormAdapter::resolveLogoWidth();
     if (Yii::app()->userInterface->isMobile()) {
         $content .= '<a href="' . $homeUrl . '"><img src="' . $logoFileSrc . '" alt="Zurmo Logo" /></a>';
         //make sure width and height are NEVER defined
     } else {
         $content .= '<a href="' . $homeUrl . '"><img src="' . $logoFileSrc . '" alt="Zurmo Logo" height="' . $logoHeight . '" width="' . $logoWidth . '" /></a>';
     }
     if ($this->applicationName != null) {
         $content .= ZurmoHtml::tag('span', array(), $this->applicationName);
     }
     $content .= '</div>';
     if (!empty($this->userMenuItems) && !empty($this->settingsMenuItems)) {
         $content .= '<div id="user-toolbar" class="clearfix">';
         $content .= static::renderHeaderMenus($this->userMenuItems, $this->settingsMenuItems);
         $content .= '</div>';
     }
     $content .= '</div>';
     return $content;
 }
 /**
  * Renders amount
  * @return string
  */
 protected function renderAmountContent()
 {
     $model = $this->model;
     $amount = Yii::app()->numberFormatter->formatCurrency((double) $model->amount->value, $model->amount->currency->code);
     $content = ZurmoHtml::tag('p', array('class' => static::DESCRIPTION_CLASS), Zurmo::t('OpportunitiesModule', 'Amount') . $this->overlayKeyValueSeparator . $amount);
     return $content;
 }
 public static function getLinkStringForActivityItem($model, $linkRoute, $moduleClassName)
 {
     $modelClassName = get_class($model);
     $linkString = ActionSecurityUtil::resolveLinkToEditModelForCurrentUser(strval($model), $model, $moduleClassName, $linkRoute) . ' (' . $modelClassName . ')';
     $text = ZurmoHtml::tag('div', array(), $linkString);
     return $text;
 }
Ejemplo n.º 17
0
 public function render()
 {
     $htmlOptions = $this->getHtmlOptions();
     $request = Yii::app()->getRequest();
     if ($request->enableCsrfValidation && isset($htmlOptions['csrf']) && $htmlOptions['csrf']) {
         $htmlOptions['params'][$request->csrfTokenName] = $request->getCsrfToken();
     }
     if (isset($htmlOptions['params'])) {
         $params = CJavaScript::encode($htmlOptions['params']);
         unset($htmlOptions['params']);
     } else {
         $params = '{}';
     }
     if (isset($htmlOptions['class'])) {
         $htmlOptions['class'] .= ' z-button';
     } else {
         $htmlOptions['class'] = 'z-button';
     }
     $cs = Yii::app()->getClientScript();
     $cs->registerCoreScript('jquery');
     $cs->registerCoreScript('yii');
     $handler = "jQuery.yii.submitForm(this, '', {$params}); return false;";
     if (isset($htmlOptions['onclick'])) {
         $htmlOptions['onclick'] = $htmlOptions['onclick'] . $handler;
     } else {
         $htmlOptions['onclick'] = $handler;
     }
     $aContent = ZurmoHtml::tag('span', array('class' => 'z-spinner'), null);
     $aContent .= ZurmoHtml::tag('span', array('class' => 'z-icon'), null);
     $aContent .= ZurmoHtml::tag('span', array('class' => 'z-label'), $this->getLabel());
     return ZurmoHtml::link($aContent, '#', $htmlOptions);
 }
 /**
  * @return string|void
  */
 protected function renderBeforeFormLayoutForDetailsContent()
 {
     $embedScript = '<div id="zurmoExternalWebForm">' . '<script type="text/javascript" ' . 'src="' . Yii::app()->createAbsoluteUrl('contacts/external/sourceFiles/', array('id' => $this->model->id)) . '">' . '</script></div>';
     $title = ZurmoHtml::tag('h3', array(), Zurmo::t('ContactWebFormsModule', 'Copy/Paste this code to your web page..'));
     return '<div class="webform-embed-code">' . $title . '<textarea onclick="this.focus();this.select()"
                  readonly="readonly">' . htmlspecialchars($embedScript) . '</textarea></div>';
 }
 /**
  * @return string
  */
 protected function getLabel()
 {
     $content = ZurmoHtml::tag('span', array('class' => 'z-spinner'), null);
     $content .= ZurmoHtml::tag('span', array('class' => 'z-icon'), null);
     $content .= ZurmoHtml::tag('span', array('class' => 'z-label'), $this->getDefaultLabel());
     return $content;
 }
 /**
  * Render a test button. This link calls a modal
  * popup.
  * @return The element's content as a string.
  */
 protected function renderTestButton()
 {
     $content = '<span>';
     $content .= ZurmoHtml::ajaxLink(ZurmoHtml::tag('span', array('class' => 'z-label'), Zurmo::t('ZurmoModule', 'Test Connection')), Yii::app()->createUrl('zurmo/ldap/testConnection/', array()), static::resolveAjaxOptionsForTestLdapConnection($this->form->getId()), array('id' => 'TestLdapConnectionButton', 'class' => 'LdapTestingButton z-button'));
     $content .= '</span>';
     return $content;
 }
 /**
  * @return string
  */
 protected function renderMetricsWrapperContent()
 {
     $cssClass = 'half marketing-graph';
     $content = ZurmoHtml::tag('div', array('class' => $cssClass), $this->renderOverallListPerformanceContent());
     $content .= ZurmoHtml::tag('div', array('class' => $cssClass), $this->renderEmailsInThisListContent());
     return ZurmoHtml::tag('div', array('class' => 'graph-container clearfix'), $content);
 }
Ejemplo n.º 22
0
 protected function getMessageContent()
 {
     $message = Zurmo::t('Core', 'There are no more portlets to add');
     $content = ZurmoHtml::tag('span', array('class' => 'icon-notice'), '');
     $content .= ZurmoHtml::tag('p', array(), $message);
     return $content;
 }
 /**
  * @return string
  */
 protected function renderEditableSecondValueContent()
 {
     $htmlOptions = $this->getHtmlOptionsForSecondValue();
     $inputContent = $this->form->textField($this->model, 'value', $htmlOptions);
     $error = $this->form->error($this->model, 'value', array('inputID' => $this->getSecondValueEditableInputId()), true, true, $this->getSecondValueEditableInputId());
     return $inputContent . $error . ZurmoHtml::tag('span', array(), ' ' . Zurmo::t('WorkflowsModule', 'value(s)'));
 }
 /**
  * Renders the setting as a radio list.
  * @return A string containing the element's content.
  */
 protected function renderThemeContent()
 {
     $gameLevel = GameLevel::resolveByTypeAndPerson(GameLevel::TYPE_GENERAL, Yii::app()->user->userModel);
     $content = ZurmoHtml::tag('h3', array(), Zurmo::t('Core', 'Theme'));
     $content .= ZurmoHtml::radioButtonList($this->getEditableInputName(KanbanBoard::SELECTED_THEME), $this->model->getKanbanBoard()->getSelectedTheme(), $this->resolveThemeColorNamesAndLabelsForLocking($gameLevel), $this->getEditableThemeHtmlOptions(), array(), $this->resolveDataHtmlOptions($gameLevel));
     return $content;
 }
Ejemplo n.º 25
0
 protected function renderContent()
 {
     $failedIndexId = CheckServicesUtil::CHECK_FAILED;
     $passedIndexId = CheckServicesUtil::CHECK_PASSED;
     $warningIndexId = CheckServicesUtil::CHECK_WARNING;
     $requiredIndexId = ServiceHelper::REQUIRED_SERVICE;
     $optionalIndexId = ServiceHelper::OPTIONAL_SERVICE;
     $content = '<div>';
     $content .= ZurmoHtml::tag('h1', array(), Zurmo::t('InstallModule', 'System Diagnostics'));
     $content .= '<div class="left-column full-width">';
     $content .= ZurmoHtml::tag('h3', array(), $this->renderIntroductionContent());
     if (count($this->checkResultsDisplayData[$failedIndexId]) > 0) {
         if (count($this->checkResultsDisplayData[$failedIndexId][$requiredIndexId]) > 0) {
             $content .= $this->renderServiceGroupDisplayByServiceDataAndCheckResult(ZurmoHtml::tag('h4', array(), Zurmo::t('InstallModule', 'Failed Required Services')), $this->checkResultsDisplayData[$failedIndexId][$requiredIndexId], '<span class="fail">' . Zurmo::t('InstallModule', 'FAIL') . '</span>');
         }
         if (count($this->checkResultsDisplayData[$failedIndexId][$optionalIndexId]) > 0) {
             $content .= $this->renderServiceGroupDisplayByServiceDataAndCheckResult(ZurmoHtml::tag('h4', array(), Zurmo::t('InstallModule', 'Failed Optional Services')), $this->checkResultsDisplayData[$failedIndexId][$optionalIndexId], '<span class="warning">' . Zurmo::t('InstallModule', 'FAIL') . '</span>');
         }
     }
     if (count($this->checkResultsDisplayData[$warningIndexId]) > 0) {
         $content .= $this->renderServiceGroupDisplayByServiceDataAndCheckResult(ZurmoHtml::tag('h4', array(), Zurmo::t('InstallModule', 'Service Status Partially Known')), $this->checkResultsDisplayData[$warningIndexId], '<span class="warning">' . Zurmo::t('InstallModule', 'WARNING') . '</span>');
     }
     if (count($this->checkResultsDisplayData[$passedIndexId]) > 0) {
         $content .= $this->renderServiceGroupDisplayByServiceDataAndCheckResult(ZurmoHtml::tag('h4', array(), Zurmo::t('InstallModule', 'Correctly Installed Services')), $this->checkResultsDisplayData[$passedIndexId], '<span class="pass">' . Zurmo::t('InstallModule', 'PASS') . '</span>');
     }
     $content .= $this->renderActionBarContent();
     $content .= '</div>';
     $content .= '</div>';
     return $content;
 }
 protected function renderCustomThemeColorChooser()
 {
     $attribute = 'customThemeColor1';
     $inputId = $this->getEditableInputId($attribute);
     $cClipWidget = new CClipWidget();
     $cClipWidget->beginClip($attribute);
     // Begin Not Coding Standard
     $cClipWidget->widget('application.core.widgets.ZurmoColorPicker', array('inputName' => $this->getEditableInputName($attribute), 'inputId' => $this->getEditableInputId($attribute), 'inputValue' => $this->model->{$attribute}, 'htmlOptions' => array('class' => 'color-picker'), 'change' => "function(event, ui) {\n                                                    \$('#{$inputId}').css('border-color', ui.color.toString());\n                                                    \$('div.custom .theme-color-1').css('background-color', ui.color.toString());\n                                          }"));
     // End Not Coding Standard
     $cClipWidget->endClip();
     $content = ZurmoHtml::tag('div', array(), $cClipWidget->getController()->clips[$attribute]);
     $attribute = 'customThemeColor2';
     $inputId = $this->getEditableInputId($attribute);
     $cClipWidget = new CClipWidget();
     $cClipWidget->beginClip($attribute);
     // Begin Not Coding Standard
     $cClipWidget->widget('application.core.widgets.ZurmoColorPicker', array('inputName' => $this->getEditableInputName($attribute), 'inputId' => $inputId, 'inputValue' => $this->model->{$attribute}, 'htmlOptions' => array('class' => 'color-picker'), 'change' => "function(event, ui) {\n                                                    \$('#{$inputId}').css('border-color', ui.color.toString());\n                                                    \$('div.custom .theme-color-2').css('background-color', ui.color.toString());\n                                          }"));
     // End Not Coding Standard
     $cClipWidget->endClip();
     $content .= ZurmoHtml::tag('div', array(), $cClipWidget->getController()->clips[$attribute]);
     $attribute = 'customThemeColor3';
     $inputId = $this->getEditableInputId($attribute);
     $cClipWidget = new CClipWidget();
     $cClipWidget->beginClip($attribute);
     // Begin Not Coding Standard
     $cClipWidget->widget('application.core.widgets.ZurmoColorPicker', array('inputName' => $this->getEditableInputName($attribute), 'inputId' => $this->getEditableInputId($attribute), 'inputValue' => $this->model->{$attribute}, 'htmlOptions' => array('class' => 'color-picker'), 'change' => "function(event, ui) {\n                                                    \$('#{$inputId}').css('border-color', ui.color.toString());\n                                                    \$('div.custom .theme-color-3').css('background-color', ui.color.toString());\n                                          }"));
     // End Not Coding Standard
     $cClipWidget->endClip();
     $content .= ZurmoHtml::tag('div', array(), $cClipWidget->getController()->clips[$attribute]);
     return ZurmoHtml::tag('div', array('id' => 'customThemeColorPicker', 'class' => 'clearfix'), $content);
 }
 /**
  * @param array $data
  */
 public static function resolveValue($data)
 {
     $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $data['userId']));
     $user = User::getById($data['userId']);
     $avatarImage = $user->getAvatarImage(24);
     $userLabel = ZurmoHtml::tag('span', array(), $data['userLabel']);
     return ZurmoHtml::link($avatarImage . $userLabel, $userUrl, array('class' => 'user-label'));
 }
Ejemplo n.º 28
0
 protected function renderSearchView($searchBoxId, $contentPrefix = null)
 {
     $globalSearchContent = $this->renderGlobalSearchContent();
     $spinner = ZurmoHtml::tag('span', array('class' => 'z-spinner'), '');
     $searchBox = ZurmoHtml::tag('div', array('id' => $searchBoxId, 'class' => 'clearfix'), $globalSearchContent . $spinner);
     $content = $contentPrefix . $searchBox;
     return $content;
 }
Ejemplo n.º 29
0
 protected function renderRightSideFormLayoutForEdit($form)
 {
     assert('$form instanceof ZurmoActiveForm');
     $content = parent::renderRightSideFormLayoutForEdit($form);
     $content .= "<h3>" . Zurmo::t('Core', 'Quick Tip') . '</h3>';
     $content .= ZurmoHtml::tag('p', array(), Zurmo::t('UsersModule', 'Users cannot be deleted. You can however change their status to inactive.'));
     return $content;
 }
 /**
  * Override to change the editableTemplate to place the label above the input.
  * @see DetailsView::resolveElementDuringFormLayoutRender()
  */
 protected function resolveElementDuringFormLayoutRender(&$element)
 {
     if ($element->getAttribute() == 'imapFolder') {
         $message = $this->getMessageForLabelInput();
         $notification = ZurmoHtml::tag('span', array('class' => 'row-description'), $message);
         $element->editableTemplate = '<th>{label}</th><td colspan="{colspan}">{content}' . $notification . '{error}</td>';
     }
 }