protected function renderRightSideFormLayoutForEdit($form) { assert('$form instanceof ZurmoActiveForm'); $content = parent::renderRightSideFormLayoutForEdit($form); $content .= "<h3>" . Zurmo::t('ZurmoModule', 'Rights and Permissions') . '</h3><div id="owner-box">'; $element = new UserElement($this->getModel(), 'owner', $form); $element->editableTemplate = '{label}{content}{error}'; $content .= $element->render() . '</div>'; $element = new DerivedExplicitReadWriteModelPermissionsElement($this->getModel(), 'null', $form); $element->editableTemplate = '{label}{content}{error}'; $content .= $element->render(); return $content; }
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 renderRightSideFormLayoutForEdit($form) { assert('$form instanceof ZurmoActiveForm'); $content = "<h3>" . Zurmo::t('ZurmoModule', 'Rights and Permissions') . '</h3><div id="owner-box">'; if ($this->model->isAttributeEditable('owner')) { $element = new UserElement($this->getModel(), 'owner', $form); } else { $element = new UserElement($this->getModel(), 'owner', $form, array('disabled' => true)); } $element->editableTemplate = '{label}{content}{error}'; $content .= $element->render() . '</div>'; $element = new CampaignDerivedExplicitReadWriteModelPermissionsElement($this->getModel(), 'null', $form); $element->editableTemplate = '{label}{content}{error}'; $content .= $element->render(); return $content; }