protected function renderContent()
 {
     $titleView = new TitleBarView(Zurmo::t('ZurmoModule', 'Global Search'), null, 1);
     $content = $titleView->render();
     $model = new MixedModelsSearchForm();
     $model->setGlobalSearchAttributeNamesAndLabelsAndAll($this->moduleNamesAndLabelsAndAll);
     $content .= "<div class='wide form'>";
     $clipWidget = new ClipWidget();
     list($form, $formStart) = $clipWidget->renderBeginWidget('NoRequiredsActiveForm', array('id' => $this->getSearchFormId(), 'action' => $this->sourceUrl, 'enableAjaxValidation' => false, 'clientOptions' => array(), 'focus' => array($model, 'term'), 'method' => 'get'));
     $content .= $formStart;
     //Scope search
     $content .= "<div class='search-view-0'>";
     $scope = new MixedModelsSearchElement($model, 'term', $form, array('htmlOptions' => array('id' => 'term')));
     $scope->setValue($this->term);
     if (isset($this->scopeData)) {
         $scope->setSelectedValue($this->scopeData);
     }
     $content .= $scope->render();
     //Search button
     $params = array();
     $params['label'] = Zurmo::t('Core', 'Search');
     $params['htmlOptions'] = array('id' => $this->getSearchFormId() . '-search', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $element = new SaveButtonActionElement(null, null, null, $params);
     $content .= $element->render();
     $content .= "</div>";
     $clipWidget->renderEndWidget();
     $content .= "</div>";
     $this->renderScripts();
     return $content;
 }
 /**
  * Override if the view should show a next link.
  */
 protected function renderNextPageLinkContent()
 {
     $params = array();
     $params['label'] = $this->renderNextPageLinkLabel();
     $params['htmlOptions'] = $this->resolveNextPageLinkHtmlOptions();
     $element = new SaveButtonActionElement(null, null, null, $params);
     return $element->render();
 }
 /**
  * Override if the view should show a next link.
  */
 protected function renderNextPageLinkContent()
 {
     $params = array();
     $params['label'] = Zurmo::t('Core', 'Next');
     $params['htmlOptions'] = array('id' => static::getNextPageLinkId(), 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $element = new SaveButtonActionElement(null, null, null, $params);
     return $element->render();
 }
 public function renderFormLayout($form = null)
 {
     $nameElement = new TextElement($this->getModel(), 'name', $form);
     $nameElement->editableTemplate = '{content}{error}';
     $taskInput = ZurmoHtml::tag('div', array('class' => 'task-input'), $nameElement->render());
     $params = array('label' => Zurmo::t('TasksModule', 'Add'));
     $element = new SaveButtonActionElement($this->controllerId, $this->moduleId, $this->modelId, $params);
     $addButton = ZurmoHtml::tag('div', array('class' => 'task-add-button'), $element->render());
     return $taskInput . $addButton;
 }
 protected function renderFormLayout($form = null)
 {
     $content = '<table class="form-fields">';
     $content .= '<colgroup>';
     $content .= '<col style="width:100%" />';
     $content .= '</colgroup>';
     $content .= '<tbody>';
     $content .= '<tr>';
     $content .= '<th>' . Zurmo::t('LeadsModule', 'Complete LeadsModuleSingularLowerCaseLabel conversion without ' . 'selecting or creating an AccountsModuleSingularLowerCaseLabel.', LabelUtil::getTranslationParamsForAllModules()) . '</th>';
     $content .= '</tr>';
     $content .= '</tbody>';
     $content .= '</table>';
     $cancelLink = new CancelConvertLinkActionElement($this->controllerId, $this->moduleId, $this->modelId);
     $content .= '<div class="view-toolbar-container clearfix"><div class="form-toolbar">';
     $element = new SaveButtonActionElement($this->controllerId, $this->moduleId, null, array('htmlOptions' => array('name' => 'AccountSkip', 'id' => 'AccountSkip', 'params' => array('AccountSkip' => true)), 'label' => Zurmo::t('ZurmoModule', 'Next')));
     $content .= $element->render();
     $content .= $cancelLink->render();
     $content .= '</div></div>';
     return $content;
 }
Exemple #6
0
 protected function renderContent()
 {
     list($form, $formStart) = $this->controller->renderBeginWidget('ZurmoActiveForm', array('id' => 'login-form', 'enableAjaxValidation' => true, 'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false, 'beforeValidate' => 'js:$(this).beforeValidateAction', 'afterValidate' => 'js:$(this).afterValidateAction')));
     $usernameLabel = $form->label($this->formModel, 'username');
     $usernameTextField = $form->textField($this->formModel, 'username');
     $usernameError = $form->error($this->formModel, 'username');
     $passwordLabel = $form->label($this->formModel, 'password');
     $passwordField = $form->passwordField($this->formModel, 'password');
     $passwordError = $form->error($this->formModel, 'password');
     $rememberMeCheckBox = $form->checkBox($this->formModel, 'rememberMe');
     $rememberMeLabel = $form->label($this->formModel, 'rememberMe');
     $rememberMeError = $form->error($this->formModel, 'rememberMe');
     $element = new SaveButtonActionElement($this->controller->getId(), $this->controller->getModule()->getId(), null, array('htmlOptions' => array('name' => 'Login', 'id' => 'Login'), 'label' => Zurmo::t('ZurmoModule', 'Sign in')));
     $submitButton = $element->render();
     $fieldsRequiredLabel = Zurmo::t('ZurmoModule', 'Fields with') . ' <span class="required">*</span> ' . Zurmo::t('ZurmoModule', 'are required.');
     $formEnd = $this->controller->renderEndWidget();
     $content = $this->extraHeaderContent;
     $content .= "<div class=\"form\">{$formStart}" . "<div>{$usernameLabel}{$usernameTextField}{$usernameError}</div>" . "<div>{$passwordLabel}{$passwordField}{$passwordError}</div>" . "<div class=\"remember-me\">{$rememberMeCheckBox}{$rememberMeLabel}{$rememberMeError}</div>" . "<div>{$submitButton}</div>" . "{$formEnd}</div>";
     Yii::app()->clientScript->registerScript('submitLoginFormOnKeyPressEnterOnPassword', "\n                \$('#LoginForm_password').keypress(function(e)\n                {\n                    c = e.which ? e.which : e.keyCode;\n                    if (c == 13)\n                    {\n                        \$(this).closest('form').submit();\n                    }\n                });\n            ", CClientScript::POS_END);
     return $content;
 }
 protected function renderApplyResetContent()
 {
     $params = array();
     $params['label'] = Zurmo::t('Core', 'Reset');
     $params['htmlOptions'] = array('id' => 'kanban-board-options-reset', 'class' => 'default-btn', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");' . $this->renderResetScript());
     $element = new SaveButtonActionElement(null, null, null, $params);
     return $element->render();
 }
 /**
  * @param $form
  * @return string
  */
 protected function renderViewToolBarLinks($form)
 {
     $params = array();
     $params['label'] = Zurmo::t('ReportsModule', 'Apply');
     $params['htmlOptions'] = array('id' => 'apply-runtime-filters', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $resetElement = new RefreshRuntimeFiltersAjaxLinkActionElement(null, null, $this->params['relationModel']->getId(), array());
     $applyElement = new SaveButtonActionElement(null, null, null, $params);
     return $resetElement->render() . $applyElement->render();
 }
 /**
  * Render an install settings view.
  * @return A string containing the element's content.
  */
 protected function renderFormLayout($form = null)
 {
     $metadata = self::getMetadata();
     $content = '<table>';
     $content .= '<colgroup><col/><col/><col/></colgroup>';
     assert('count($metadata["global"]["panels"]) == 1');
     foreach ($metadata['global']['panels'] as $key => $panel) {
         $content .= '<tbody>';
         foreach ($panel['rows'] as $row) {
             $content .= '<tr>';
             foreach ($row['cells'] as $cell) {
                 if (!empty($cell['elements'])) {
                     foreach ($cell['elements'] as $elementInformation) {
                         $elementclassname = $elementInformation['type'] . 'Element';
                         $element = new $elementclassname($this->model, $elementInformation['attributeName'], $form, array_slice($elementInformation, 2));
                         $element->editableTemplate = '<th  nowrap="nowrap">{label}</th><td
                                                           colspan="{colspan}">{content}{error}</td>';
                         $content .= $element->render();
                         $content .= '<td>' . Yii::app()->format->text($elementInformation['description']) . '</td>';
                     }
                 }
             }
             $content .= '</tr>';
         }
         $content .= '</tbody>';
     }
     $content .= '</table>';
     $element = new SaveButtonActionElement($this->controllerId, $this->moduleId, null, array('label' => Zurmo::t('InstallModule', 'Install')));
     $content .= '<div class="view-toolbar-container clearfix"><div class="form-toolbar">' . $element->render() . '</div></div>';
     return $content;
 }
 protected function renderFormLayout($form = null)
 {
     $content = '<table class="form-fields">';
     $content .= TableUtil::getColGroupContent(1);
     $content .= '<tbody>';
     $content .= '<tr>';
     $element = new AccountNameIdElement($this->model, 'null', $form);
     $content .= $element->render();
     $content .= '</tr>';
     $content .= '</tbody>';
     $content .= '</table>';
     $cancelLink = new CancelConvertLinkActionElement($this->controllerId, $this->moduleId, $this->modelId);
     $content .= '<div class="view-toolbar-container clearfix"><div class="form-toolbar">';
     $element = new SaveButtonActionElement($this->controllerId, $this->moduleId, null, array('htmlOptions' => array('name' => 'AccountSelect', 'id' => 'AccountSelect'), 'label' => Zurmo::t('ZurmoModule', 'Complete Conversion')));
     $content .= $element->render();
     $content .= $cancelLink->render();
     $content .= $this->renderModalContainer();
     $content .= '</div></div>';
     return $content;
 }
 protected function renderViewToolBarLinksForAdvancedSearch($form)
 {
     $params = array();
     $params['label'] = Zurmo::t('Core', 'Search');
     $params['htmlOptions'] = array('id' => 'search-advanced-search', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $searchElement = new SaveButtonActionElement(null, null, null, $params);
     $content = $searchElement->render();
     $closeButton = ZurmoHtml::link(ZurmoHtml::wrapLabel(Zurmo::t('Core', 'Close')), '#', array('id' => 'cancel-advanced-search', 'class' => 'cancel-button'));
     return $content . $closeButton;
 }
 /**
  * @param string $rowId
  * @return string
  */
 protected function renderSaveActionElementsContent($rowId)
 {
     assert('is_string($rowId)');
     $params = array();
     $params['label'] = Zurmo::t('Core', 'Save');
     $params['htmlOptions'] = array('id' => 'saveAction' . $this->rowNumber, 'data-purpose' => 'validate-action', 'data-row' => $rowId, 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $element = new SaveButtonActionElement(null, null, null, $params);
     return $element->render();
 }
 protected function renderSaveInputAndSaveButtonContentForAdvancedSearch($form)
 {
     $content = $form->textField($this->model, 'savedSearchName');
     $content .= $form->hiddenField($this->model, 'savedSearchId');
     $content .= $form->hiddenField($this->model, 'sortAttribute');
     $content .= $form->hiddenField($this->model, 'sortDescending');
     $params['label'] = Zurmo::t('Core', 'Save');
     $params['htmlOptions'] = array('id' => 'save-advanced-search', 'value' => 'saveSearch', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $element = new SaveButtonActionElement(null, null, null, $params);
     $content .= $element->render();
     $content .= $this->renderDeleteLinkContent();
     $content .= $form->error($this->model, 'savedSearchName');
     return $content;
 }
 protected function renderFormLayout($form = null)
 {
     $content = '<table>';
     $content .= TableUtil::getColGroupContent(1);
     $content .= '<tbody>';
     $content .= '<tr>';
     if ($this->model instanceof AnyContactSelectForm) {
         $elementClassName = 'AnyContactNameIdElement';
     } elseif ($this->model instanceof ContactSelectForm) {
         $elementClassName = 'ContactNameIdElement';
     } else {
         $elementClassName = 'LeadNameIdElement';
     }
     $params = array();
     $params['inputPrefix'] = array(get_class($this->model), $this->uniqueId);
     $element = new $elementClassName($this->model, 'null', $form, $params);
     $content .= $element->render();
     $content .= '</tr>';
     $content .= '</tbody>';
     $content .= '</table>';
     $content .= '<div class="view-toolbar-container clearfix"><div class="form-toolbar">';
     $cancelElement = new CancelLinkForEmailsMatchingListActionElement($this->controllerId, $this->moduleId, null, array('htmlOptions' => array('name' => 'anyContactCancel-' . $this->uniqueId, 'id' => 'anyContactCancel-' . $this->uniqueId, 'class' => 'anyContactCancel')));
     $content .= $cancelElement->render();
     $element = new SaveButtonActionElement($this->controllerId, $this->moduleId, null, array('htmlOptions' => array('name' => 'ContactSelect-' . $this->uniqueId, 'id' => 'ContactSelect-' . $this->uniqueId)));
     $content .= $element->render();
     $content .= '</div></div>';
     return $content;
 }
 protected function renderApplyResetContent()
 {
     $params = array();
     $params['label'] = Yii::t('Default', 'Reset');
     $params['htmlOptions'] = array('id' => 'list-attributes-reset', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");');
     $searchElement = new SaveButtonActionElement(null, null, null, $params);
     return $searchElement->render();
 }