/**
  * @return string
  */
 protected function renderFormContent()
 {
     $leftSideContent = null;
     $element = new TextElement($this->model, 'name', $this->form);
     $element->editableTemplate = '<th>{label}<span class="required">*</span></th><td colspan="{colspan}">{content}{error}</td>';
     $leftSideContent = '<table class="form-fields"><colgroup><col class="col-0"><col class="col-1">' . '</colgroup><tr>' . $element->render() . '</tr>';
     $element = new TextAreaElement($this->model, 'description', $this->form, array('rows' => 5));
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new TriggerOnStaticDropDownElement($this->model, 'triggerOn', $this->form);
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new CheckBoxElement($this->model, 'isActive', $this->form);
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $leftSideContent .= '</table>';
     $leftSideContent = ZurmoHtml::tag('div', array('class' => 'panel'), $leftSideContent);
     $content = '<div class="attributesContainer">';
     $content .= $leftSideContent;
     $content .= '</div>';
     return $content;
 }
 /**
  * @return string
  */
 protected function renderFormContent()
 {
     $leftSideContent = null;
     $element = new TextElement($this->model, 'name', $this->form);
     $element->editableTemplate = '<th>{label}<span class="required">*</span></th><td colspan="{colspan}">{content}{error}</td>';
     $leftSideContent = '<table><colgroup><col class="col-0"><col class="col-1">' . '</colgroup><tr>' . $element->render() . '</tr>';
     $element = new TextAreaElement($this->model, 'description', $this->form, array('rows' => 5));
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new CurrencyConversionTypeStaticDropDownElement($this->model, 'currencyConversionType', $this->form);
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new CurrencyCodeStaticDropDownFormElement($this->model, 'spotConversionCurrencyCode', $this->form, array('addBlank' => true));
     $leftSideContent .= '<tr>' . $element->render() . '</tr></table>';
     $leftSideContent = ZurmoHtml::tag('div', array('class' => 'panel'), $leftSideContent);
     $leftSideContent = ZurmoHtml::tag('div', array('class' => 'left-column'), $leftSideContent);
     $rightSideContent = ZurmoHtml::tag('div', array('class' => 'right-side-edit-view-panel'), $this->renderRightSideFormLayout());
     $rightSideContent = ZurmoHtml::tag('div', array('class' => 'right-column'), $rightSideContent);
     $content = '<div class="attributesContainer">';
     $content .= $leftSideContent . $rightSideContent;
     $content .= '</div>';
     return $content;
 }
 /**
  * Render A text area with X rows and Y columns.
  */
 protected function renderControlEditable()
 {
     $content = parent::renderControlEditable();
     $selector = '$("#' . $this->getEditableInputId() . '").parent().find("div.shadow").html()';
     $previewElementParams = array('isHtmlContent' => 0, 'inputId' => $this->getEditableInputId(), 'selector' => $selector);
     $previewElementParams = CMap::mergeArray($this->params, $previewElementParams);
     $controllerId = Yii::app()->controller->id;
     $moduleId = Yii::app()->controller->module->id;
     $previewElement = new GlobalMarketingFooterConfigurationPreviewElement($controllerId, $moduleId, $this->model->Id, $previewElementParams);
     $content .= $previewElement->render();
     return $content;
 }
示例#4
0
 protected function renderMissionContent()
 {
     $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $this->model->createdByUser->id));
     $content = '<div class="comment model-details-summary">';
     $content .= ZurmoHtml::link($this->model->createdByUser->getAvatarImage(100), $userUrl);
     $content .= '<span class="user-details">';
     $content .= ZurmoHtml::link(strval($this->model->createdByUser), $userUrl, array('class' => 'user-link'));
     $content .= '</span>';
     $element = new TextAreaElement($this->model, 'description');
     $element->nonEditableTemplate = '<div class="comment-content">{content}</div>';
     $content .= $element->render();
     if ($this->model->reward != null) {
         $element = new TextElement($this->model, 'reward');
         $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Reward') . ': {content}</div>';
         $content .= $element->render();
     }
     if ($this->model->takenByUser->id > 0) {
         $element = new UserElement($this->model, 'takenByUser');
         $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Taken By') . ': {content}</div>';
         $content .= $element->render();
     }
     if (!DateTimeUtil::isDateTimeValueNull($this->model, 'dueDateTime')) {
         $element = new DateTimeElement($this->model, 'dueDateTime');
         $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Due') . ': {content}</div>';
         $content .= $element->render();
     }
     $date = '<span class="comment-details"><strong>' . DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($this->model->createdDateTime, 'long', null) . '</strong></span>';
     $content .= $date;
     if ($this->model->files->count() > 0) {
         $element = new FilesElement($this->model, 'null');
         $element->nonEditableTemplate = '<div>{content}</div>';
         $content .= '<div><strong>' . Zurmo::t('MissionsModule', 'Attachments') . '</strong></div>';
         $content .= $element->render();
     }
     $element = new MissionStatusElement($this->model, 'status');
     $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Status') . ': {content}</div>';
     $content .= $element->render();
     $content .= '</div>';
     return ZurmoHtml::tag('div', array('id' => 'ModelDetailsSummaryView'), $content);
 }
 protected function renderTextContentArea()
 {
     $textContentElement = new TextAreaElement($this->model, static::TEXT_CONTENT_INPUT_NAME, $this->form);
     $textContentElement->editableTemplate = str_replace('{error}', '', $this->editableTemplate);
     return $textContentElement->render();
 }
 protected function renderCommentsContent()
 {
     $content = null;
     $rows = 0;
     foreach (array_reverse($this->commentsData) as $comment) {
         //Skip the first if the page size is smaller than what is returned.
         if (count($this->commentsData) > $this->pageSize && $this->pageSize != null && $rows == 0) {
             $rows++;
             continue;
         }
         $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $comment->createdByUser->id));
         $stringContent = ZurmoHtml::link($comment->createdByUser->getAvatarImage(36), $userUrl);
         $userName = ZurmoHtml::link(strval($comment->createdByUser), $userUrl, array('class' => 'user-link'));
         $element = new TextAreaElement($comment, 'description');
         $element->nonEditableTemplate = '<div class="comment-content"><p>' . $userName . ': {content}</p>';
         $stringContent .= $element->render();
         //attachments
         if ($comment->files->count() > 0) {
             $stringContent .= FileModelDisplayUtil::renderFileDataDetailsWithDownloadLinksContent($comment, 'files', true);
         }
         if ($comment->createdByUser == Yii::app()->user->userModel || $this->relatedModel->createdByUser == Yii::app()->user->userModel || $this->relatedModel instanceof OwnedSecurableItem && $this->relatedModel->owner == Yii::app()->user->userModel) {
             $deleteCommentLink = ' · <span class="delete-comment">' . $this->renderDeleteLinkContent($comment) . '</span>';
             $editCommentLink = ' · <span class="edit-comment">' . $this->renderEditLinkContent($comment) . '</span>';
         } else {
             $deleteCommentLink = null;
             $editCommentLink = null;
         }
         $editCommentLink = null;
         //temporary until edit link is added
         $stringContent .= '<span class="comment-details"><strong>' . DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($comment->createdDateTime, 'long', null) . '</strong></span>' . $editCommentLink . $deleteCommentLink;
         $stringContent .= '</div>';
         $content .= '<div class="comment">' . $stringContent . '</div>';
         $rows++;
     }
     return $content;
 }
 protected function renderConversationContent()
 {
     $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $this->model->createdByUser->id));
     $content = '<div class="comment model-details-summary clearfix">';
     $content .= ZurmoHtml::link($this->model->createdByUser->getAvatarImage(100), $userUrl);
     $content .= '<span class="user-details">';
     $content .= ZurmoHtml::link(strval($this->model->createdByUser), $userUrl, array('class' => 'user-link'));
     $content .= '</span>';
     if ($this->model->description == null) {
         $element = new TextElement($this->model, 'subject');
     } else {
         $element = new TextAreaElement($this->model, 'description');
     }
     $element->nonEditableTemplate = '<div class="comment-content">{content}</div>';
     $content .= $element->render();
     $date = '<span class="comment-details"><strong>' . DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($this->model->createdDateTime, 'long', null) . '</strong></span>';
     $content .= $date;
     $content .= '</div>';
     return ZurmoHtml::tag('div', array('id' => 'ModelDetailsSummaryView'), $content);
 }
 protected function renderLeftSideTopContent()
 {
     $content = null;
     $content .= '<div class="wide form">';
     $clipWidget = new ClipWidget();
     list($form, $formStart) = $clipWidget->renderBeginWidget('ZurmoActiveForm', array_merge(array('id' => static::getLeftSideFormId(), 'action' => '#'), $this->resolveActiveFormAjaxValidationOptions()));
     $content .= $formStart;
     $nameElement = new TextElement($this->getModel(), 'name', $form);
     $nameElement->editableTemplate = '{content}{error}';
     $content .= $nameElement->render();
     $descriptionElement = new TextAreaElement($this->getModel(), 'description', $form, array('rows' => 2));
     $content .= $descriptionElement->render();
     $formEnd = $clipWidget->renderEndWidget();
     $content .= $formEnd;
     $content .= $this->renderModalContainer();
     $content .= $this->renderAuditTrailModalContainer();
     $content .= '</div>';
     return ZurmoHtml::tag('div', array('class' => 'left-side-edit-view-panel'), $content);
 }
 /**
  * Render additional help information besides the text input box.
  * @return The element's content as a string.
  */
 protected function renderControlEditable()
 {
     $content = parent::renderControlEditable();
     $content .= '<div class="field-instructions">' . $this->renderAvailableAttributesContent() . '</div>';
     return $content;
 }