/**
  * Resolve ajax options for modal view
  * @param string $linkId
  * @return string
  */
 protected function resolveAjaxOptionsForModalView($linkId)
 {
     assert('is_string($linkId)');
     $title = $this->getCreateAccountLabel();
     return ModalView::getAjaxOptionsForModalLink($title, $this->getModalContainerId(), 'auto', 600, 'center top+25', $class = "'task-dialog'");
     // Not Coding Standard
 }
 protected static function resolveAjaxOptionsForTestLdapConnection($formId)
 {
     assert('is_string($formId)');
     $title = Zurmo::t('ZurmoModule', 'Test Connection Results');
     $ajaxOptions = ModalView::getAjaxOptionsForModalLink($title);
     $ajaxOptions['type'] = 'POST';
     $ajaxOptions['data'] = 'js:$("#' . $formId . '").serialize()';
     return $ajaxOptions;
 }
 protected static function resolveAjaxOptionsForTestEmailSettings($formId)
 {
     assert('is_string($formId)');
     $title = Zurmo::t('EmailMessagesModule', 'Test Message Results');
     $ajaxOptions = ModalView::getAjaxOptionsForModalLink($title);
     $ajaxOptions['type'] = 'POST';
     $ajaxOptions['data'] = 'js:$("#' . $formId . '").serialize()';
     return $ajaxOptions;
 }
 protected function getAjaxOptions()
 {
     $parentAjaxOptions = parent::getAjaxOptions();
     $modalViewAjaxOptions = ModalView::getAjaxOptionsForModalLink($this->getDefaultLabel());
     if (!isset($this->params['ajaxOptions'])) {
         $this->params['ajaxOptions'] = array();
     }
     return CMap::mergeArray($parentAjaxOptions, $modalViewAjaxOptions, $this->params['ajaxOptions']);
 }
 protected function getAjaxOptions()
 {
     $parentAjaxOptions = parent::getAjaxOptions();
     $modalViewAjaxOptions = ModalView::getAjaxOptionsForModalLink($this->getDefaultLabel());
     if (!isset($this->params['ajaxOptions'])) {
         $selector = $this->params['selector'];
         $isHtmlContent = $this->params['isHtmlContent'];
         $this->params['ajaxOptions'] = array('data' => array('isHtmlContent' => $isHtmlContent, 'content' => new CJavaScriptExpression('
                                                                 function()
                                                                  {
                                                                     return ' . $selector . ';
                                                                  }')));
     }
     return CMap::mergeArray($parentAjaxOptions, $modalViewAjaxOptions, $this->params['ajaxOptions']);
 }
 protected function renderControlNonEditable()
 {
     $avatarImage = $this->model->getAvatarImage(110);
     $content = '<div class="gravatar-container">';
     if (Yii::app()->user->userModel->id == $this->model->id || RightsUtil::canUserAccessModule('UsersModule', Yii::app()->user->userModel)) {
         $span = ZurmoHtml::tag('span', array('id' => 'profile-picture-tooltip'), Zurmo::t('UsersModule', 'Change Profile Picture'), true);
         $url = Yii::app()->createUrl('/users/default/changeAvatar', array('id' => $this->model->id));
         $modalTitle = ModalView::getAjaxOptionsForModalLink(Zurmo::t('UsersModule', 'Change Profile Picture') . ": " . strval($this->model));
         $content .= ZurmoHtml::ajaxLink($span . $avatarImage, $url, $modalTitle);
     } else {
         $content .= $avatarImage;
     }
     $content .= '</div>';
     return $content;
 }
 protected static function resolveAjaxOptionsForSelectList()
 {
     $singularTitle = ProductTemplate::getModelLabelByTypeAndLanguage('Singular');
     $title = Zurmo::t('ProductTemplatesModule', $singularTitle . ' Search', LabelUtil::getTranslationParamsForAllModules());
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 protected static function resolveAjaxOptionsForSelectList()
 {
     $title = Zurmo::t('MarketingListsModule', 'Marketing List Search', LabelUtil::getTranslationParamsForAllModules());
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 /**
  * Utilized when auditEventsModalLink is used during mobile select option render
  * @return array
  */
 protected function getAjaxOptions()
 {
     $title = Zurmo::t('ZurmoModule', 'Audit Trail');
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 /**
  * Utilized when auditEventsModalLink is used during mobile select option render
  * @return array
  */
 protected function getAjaxOptions()
 {
     $title = Zurmo::t('GamificationModule', 'Game Dashboard');
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 /**
  * @return array
  */
 protected static function resolveAjaxOptionsForAddPortlet()
 {
     $title = Zurmo::t('HomeModule', 'Add Portlet');
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 protected function getAjaxLinkOptions()
 {
     $title = Zurmo::t('EmailMessagesModule', 'Email');
     return ModalView::getAjaxOptionsForModalLink(Zurmo::t('EmailMessagesModule', 'Compose Email'), 'modalContainer', 'auto', 800, array('my' => 'top', 'at' => 'bottom', 'of' => '#HeaderView'));
 }
 protected function resolveAjaxOptionsForSelectingModel($formId)
 {
     assert('is_string($formId)');
     $title = $this->getModalTitleForSelectingModel();
     return ModalView::getAjaxOptionsForModalLink($title, $this->getModalContainerId());
 }
 /**
  * @return array
  */
 public static function resolveAjaxOptionsForModalView()
 {
     $title = Zurmo::t('Calendarsmodule', 'Shared Calendars');
     return ModalView::getAjaxOptionsForModalLink($title, self::getModalContainerId(), 'auto', 600, 'center top+25', $class = "''");
 }
 protected static function resolveAjaxOptionsForSelectList()
 {
     $title = Zurmo::t('ProductTemplatesModule', 'ProductTemplatesModuleSingularLabel Search', LabelUtil::getTranslationParamsForAllModules());
     return ModalView::getAjaxOptionsForModalLink($title);
 }
Exemple #16
0
 protected static function resolveAjaxOptionsForEditLink()
 {
     $title = Yii::t('Default', 'Edit Portlet');
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 protected static function resolveOptionsForSelectList()
 {
     $title = 'AgreementProduct';
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 protected static function resolveAjaxOptionsForJobLogLink($type)
 {
     assert('is_string($type) && $type != ""');
     $jobClassName = $type . 'Job';
     $title = Zurmo::t('JobsManagerModule', 'Job Log for {jobDisplayName}', array('{jobDisplayName}' => $jobClassName::getDisplayName()));
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 protected function resolveAjaxOptionsForSelectingModel()
 {
     $title = $this->getModalTitleForSelectingModel();
     return ModalView::getAjaxOptionsForModalLink($title, $this->getModalContainerId());
 }
 protected static function resolveAjaxOptionsForEditLink()
 {
     $title = Zurmo::t('Core', 'Edit Portlet');
     return ModalView::getAjaxOptionsForModalLink($title);
 }
 /**
  * Based on security, render an email address as a clickable link to a modal window or just a mailto: link
  * that will open the user's configured email client.
  * @param EmailMessage $emailAddress
  * @param RedBeanModel $model
  * @return string $content
  */
 public static function renderEmailAddressAsMailToOrModalLinkStringContent($emailAddress, RedBeanModel $model)
 {
     assert('is_string($emailAddress) || $emailAddress == null');
     if ($emailAddress == null) {
         return;
     }
     $userCanAccess = RightsUtil::canUserAccessModule('EmailMessagesModule', Yii::app()->user->userModel);
     $userCanCreate = RightsUtil::doesUserHaveAllowByRightName('EmailMessagesModule', EmailMessagesModule::RIGHT_CREATE_EMAIL_MESSAGES, Yii::app()->user->userModel);
     if (!$userCanAccess || !$userCanCreate) {
         $showLink = false;
     } else {
         $showLink = true;
     }
     if ($showLink && !$model instanceof Account) {
         $url = Yii::app()->createUrl('/emailMessages/default/createEmailMessage', array('toAddress' => $emailAddress, 'relatedId' => $model->id, 'relatedModelClassName' => get_class($model), 'redirectUrl' => Yii::app()->request->getRequestUri()));
         $modalAjaxOptions = ModalView::getAjaxOptionsForModalLink(Zurmo::t('EmailMessagesModule', 'Compose Email'), 'modalContainer', 'auto', 800, array('my' => 'top', 'at' => 'bottom', 'of' => '#HeaderView'));
         $content = ZurmoHtml::ajaxLink($emailAddress, $url, $modalAjaxOptions);
     } else {
         $content = Yii::app()->format->email($emailAddress);
     }
     return $content;
 }
Exemple #22
0
 protected function resolveAjaxOptionsForMapLink()
 {
     return ModalView::getAjaxOptionsForModalLink(strval($this->model));
 }
 protected function getAjaxLinkOptions()
 {
     return ModalView::getAjaxOptionsForModalLink($this->getAjaxLinkTitle(), $this->getModalContainerId());
 }
 /**
  * @param $renderType
  * @param string|null $sourceKanbanBoardId
  * @return array
  */
 public static function resolveAjaxOptionsForModalView($renderType, $sourceKanbanBoardId = null)
 {
     assert('is_string($renderType)');
     $title = self::getModalTitleForCreateTask($renderType);
     return ModalView::getAjaxOptionsForModalLink($title, self::getModalContainerId(), 'auto', 600, 'center top+25', $class = "'task-dialog'", static::resolveExtraCloseScriptForModalAjaxOptions($sourceKanbanBoardId));
 }
 protected function resolveAjaxOptionsForEditingModel()
 {
     $title = $this->getModalTitleForEditingModel();
     return ModalView::getAjaxOptionsForModalLink($title, $this->getModalContainerId(), 'auto', 600, 'center top+25', "'image-edit-modal'");
     // Not Coding Standard
 }