当前位置: 首页>>代码示例>>PHP>>正文


PHP EmailUI::generateComposePackageForQuickCreateFromComposeUrl方法代码示例

本文整理汇总了PHP中EmailUI::generateComposePackageForQuickCreateFromComposeUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailUI::generateComposePackageForQuickCreateFromComposeUrl方法的具体用法?PHP EmailUI::generateComposePackageForQuickCreateFromComposeUrl怎么用?PHP EmailUI::generateComposePackageForQuickCreateFromComposeUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmailUI的用法示例。


在下文中一共展示了EmailUI::generateComposePackageForQuickCreateFromComposeUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: display

 function display($defines)
 {
     global $app_strings, $current_user, $sugar_config, $beanList, $beanFiles;
     $title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE'];
     $accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY'];
     $value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL'];
     $parent_type = $defines['focus']->module_dir;
     $parent_id = $defines['focus']->id;
     //martin Bug 19660
     $userPref = $current_user->getPreference('email_link_type');
     $defaultPref = $sugar_config['email_default_client'];
     if ($userPref != '') {
         $client = $userPref;
     } else {
         $client = $defaultPref;
     }
     if ($client != 'sugar') {
         $class = $beanList[$parent_type];
         require_once $beanFiles[$class];
         $bean = new $class();
         $bean->retrieve($parent_id);
         // awu: Not all beans have emailAddress property, we must account for this
         if (isset($bean->emailAddress)) {
             $to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
             $button = "<input class='button' type='button'  value='{$value}'  name='{$title}'  accesskey='{$accesskey}' title='{$title}' onclick=\"location.href='mailto:{$to_addrs}';return false;\" />";
         } else {
             $button = "<input class='button' type='button'  value='{$value}'  name='{$title}'  accesskey='{$accesskey}' title='{$title}' onclick=\"location.href='mailto:';return false;\" />";
         }
     } else {
         //Generate the compose package for the quick create options.
         $composeData = "parent_id={$parent_id}&parent_type={$parent_type}";
         require_once 'modules/Emails/EmailUI.php';
         $eUi = new EmailUI();
         $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreateFromComposeUrl($composeData);
         $button = "<input title='{$title}' accesskey='{$accesskey}' onclick='SUGAR.quickCompose.init({$j_quickComposeOptions});' class='button' type='submit' name='button' value='{$value}'";
     }
     return $button;
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:38,代码来源:SugarWidgetSubPanelTopComposeEmailButton.php

示例2: getEmailLink

 /**
  * returns opening <a href=xxxx for a contact, account, etc
  * cascades from User set preference to System-wide default
  * @return string	link
  * @param attribute the email addy
  * @param focus the parent bean
  * @param contact_id
  * @param return_module
  * @param return_action
  * @param return_id
  * @param class
  */
 function getEmailLink($attribute, &$focus, $contact_id = '', $ret_module = '', $ret_action = 'DetailView', $ret_id = '', $class = '')
 {
     $emailLink = '';
     global $sugar_config;
     if (!isset($sugar_config['email_default_client'])) {
         $this->setDefaultsInConfig();
     }
     $userPref = $this->getPreference('email_link_type');
     $defaultPref = $sugar_config['email_default_client'];
     if ($userPref != '') {
         $client = $userPref;
     } else {
         $client = $defaultPref;
     }
     if ($client == 'sugar') {
         $email = '';
         $to_addrs_ids = '';
         $to_addrs_names = '';
         $to_addrs_emails = '';
         $fullName = !empty($focus->name) ? $focus->name : '';
         if (!empty($focus->{$attribute})) {
             $email = $focus->{$attribute};
         }
         if (empty($ret_module)) {
             $ret_module = $focus->module_dir;
         }
         if (empty($ret_id)) {
             $ret_id = $focus->id;
         }
         if ($focus->object_name == 'Contact') {
             // Bug #48555 Not User Name Format of User's locale.
             $focus->_create_proper_name_field();
             $fullName = $focus->name;
             $contact_id = $focus->id;
             $to_addrs_ids = $focus->id;
             $to_addrs_names = $fullName;
             $to_addrs_emails = $focus->email1;
         }
         $emailLinkUrl = 'contact_id=' . $contact_id . '&parent_type=' . $focus->module_dir . '&parent_id=' . $focus->id . '&parent_name=' . urlencode($fullName) . '&to_addrs_ids=' . $to_addrs_ids . '&to_addrs_names=' . urlencode($to_addrs_names) . '&to_addrs_emails=' . urlencode($to_addrs_emails) . '&to_email_addrs=' . urlencode($fullName . '&nbsp;&lt;' . $email . '&gt;') . '&return_module=' . $ret_module . '&return_action=' . $ret_action . '&return_id=' . $ret_id;
         //Generate the compose package for the quick create options.
         require_once 'modules/Emails/EmailUI.php';
         $eUi = new EmailUI();
         $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreateFromComposeUrl($emailLinkUrl, true);
         $emailLink = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init({$j_quickComposeOptions});' class='{$class}'>";
     } else {
         // straight mailto:
         $emailLink = '<a href="mailto:' . $focus->{$attribute} . '" class="' . $class . '">';
     }
     return $emailLink;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:62,代码来源:User.php

示例3: displayList

 function displayList(&$layout_def)
 {
     global $current_user;
     global $beanList;
     global $focus;
     global $sugar_config;
     global $locale;
     if (isset($layout_def['varname'])) {
         $key = strtoupper($layout_def['varname']);
     } else {
         $key = $this->_get_column_alias($layout_def);
         $key = strtoupper($key);
     }
     $value = $layout_def['fields'][$key];
     if (isset($_REQUEST['action'])) {
         $action = $_REQUEST['action'];
     } else {
         $action = '';
     }
     if (isset($_REQUEST['module'])) {
         $module = $_REQUEST['module'];
     } else {
         $module = '';
     }
     if (isset($_REQUEST['record'])) {
         $record = $_REQUEST['record'];
     } else {
         $record = '';
     }
     if (!empty($focus->name)) {
         $name = $focus->name;
     } else {
         if (!empty($focus->first_name) && !empty($focus->last_name)) {
             $name = $locale->getLocaleFormattedName($focus->first_name, $focus->last_name);
         }
         if (empty($name)) {
             $name = '*';
         }
     }
     $userPref = $current_user->getPreference('email_link_type');
     $defaultPref = $sugar_config['email_default_client'];
     if ($userPref != '') {
         $client = $userPref;
     } else {
         $client = $defaultPref;
     }
     if ($client == 'sugar') {
         $fullComposeUrl = 'load_id=' . $layout_def['fields']['ID'] . '&load_module=' . $this->layout_manager->defs['module_name'] . '&parent_type=' . $this->layout_manager->defs['module_name'] . '&parent_id=' . $layout_def['fields']['ID'];
         if (isset($layout_def['fields']['FULL_NAME'])) {
             $fullComposeUrl .= '&parent_name=' . urlencode($layout_def['fields']['FULL_NAME']);
         }
         $fullComposeUrl .= '&return_module=' . $module . '&return_action=' . $action . '&return_id=' . $record;
         require_once 'modules/Emails/EmailUI.php';
         $eUi = new EmailUI();
         $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreateFromComposeUrl($fullComposeUrl);
         $link = "<a href='javascript:void(0);' onclick='SUGAR.quickCompose.init({$j_quickComposeOptions});'>";
     } else {
         $link = '<a href="mailto:' . $value . '" >';
     }
     return $link . $value . '</a>';
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:61,代码来源:SugarWidgetSubPanelEmailLink.php


注:本文中的EmailUI::generateComposePackageForQuickCreateFromComposeUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。