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;
 }
 /**
  * Render a form layout.
  *  Gets appropriate meta data and loops through it. Builds form content
  *  as it loops through. For each element in the form it calls the appropriate
  *  Element class.
  * @return A string containing the element's content.
  */
 public function render()
 {
     $content = '';
     if ($this->shouldRenderTabbedPanels()) {
         $content .= $this->errorSummaryContent;
     }
     $tabsContent = '';
     foreach ($this->metadata['global']['panels'] as $panelNumber => $panel) {
         $content .= $this->renderDivTagByPanelNumber($panelNumber);
         $content .= $this->renderPanelHeaderByPanelNumberAndPanel($panelNumber, $panel);
         $content .= '<table>';
         $content .= TableUtil::getColGroupContent(static::getMaximumColumnCountForAllPanels($this->metadata), $this->labelsHaveOwnCells);
         $content .= '<tbody>';
         foreach ($panel['rows'] as $row) {
             $cellsContent = null;
             foreach ($row['cells'] as $cell) {
                 if (is_array($cell['elements'])) {
                     foreach ($cell['elements'] as $renderedElement) {
                         $cellsContent .= $renderedElement;
                     }
                 }
             }
             if (!empty($cellsContent)) {
                 $content .= '<tr>';
                 $content .= $cellsContent;
                 $content .= '</tr>';
             }
         }
         $content .= $this->renderLastPanelRowsByPanelNumber($panelNumber);
         $content .= '</tbody>';
         $content .= '</table>';
         if ($this->shouldRenderTabbedPanels()) {
             $content .= '</div>';
         }
         $content .= '</div>';
     }
     $this->renderScripts();
     return $this->resolveFormLayoutContent($content);
 }
 protected function getPanelSettingsDisplay($title, $detailViewOnly, $locked, $panelIdName)
 {
     assert('is_bool($locked) || $locked == null');
     $content = '<div class="panel-settings modal-settings" title="' . Zurmo::t('Core', 'Panel Settings') . '">';
     $content .= '<div class="wide form">';
     $content .= '<table>';
     $content .= TableUtil::getColGroupContent(1);
     $content .= '<tr>';
     $content .= '<th><label>' . Zurmo::t('Core', 'Panel Title') . '</label></th>';
     $content .= '<td>' . ZurmoHtml::textField('title_' . $panelIdName, $title, array('class' => 'panel-title settings-form-field')) . ZurmoHtml::hiddenField('locked_' . $panelIdName, $locked, array('class' => 'panel-title settings-form-field')) . '</td>';
     $content .= '</tr>';
     $content .= '<tr>';
     $content .= '<th><label>' . Zurmo::t('Core', 'Detail View Only') . '</label></th>';
     $content .= '<td>' . ZurmoHtml::checkBox('detailViewOnly_' . $panelIdName, $detailViewOnly, array('class' => 'panel-title settings-form-field')) . '</td>';
     $content .= '</tr>';
     $content .= '</table>';
     $content .= '<div class="view-toolbar-container clearfix"><div class="form-toolbar">';
     $content .= $this->renderSaveModalSettingsButton();
     $content .= '</div></div>';
     $content .= '</div>';
     $content .= '</div>';
     return $content;
 }
Example #4
0
 /**
  * Render a search form that has two panels. The
  * second panel is hidden by default in the user interface.
  * @return A string containing the element's content.
  */
 protected function renderFormLayout(ZurmoActiveForm $form)
 {
     $metadata = self::getMetadata();
     $maxCellsPerRow = $this->getMaxCellsPerRow();
     $content = $this->renderSummaryCloneContent();
     $content .= TableUtil::getColGroupContent($this->getColumnCount($metadata['global']));
     assert('count($metadata["global"]["panels"]) == 2');
     foreach ($metadata['global']['panels'] as $key => $panel) {
         $startingDivStyle = "";
         if ($key == 1 || $this->hideAllSearchPanelsToStart) {
             $startingDivStyle = "style='display:none;'";
         }
         $content .= '<div class="search-view-' . $key . '" ' . $startingDivStyle . '>';
         if ($key == 1) {
             $content .= $this->renderAdvancedSearchForFormLayout($panel, $maxCellsPerRow, $form);
         } else {
             $content .= $this->renderStaticSearchRows($panel, $maxCellsPerRow, $form);
         }
         if ($key == 1) {
             $content .= $this->renderViewToolBarContainerForAdvancedSearch($form);
         }
         $content .= '</div>';
     }
     $content .= $this->renderListAttributesSelectionContent($form);
     $content .= $this->renderFormBottomPanel();
     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;
 }