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


PHP SugarBean::getPreference方法代码示例

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


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

示例1: setupEmailSettings

 protected function setupEmailSettings()
 {
     global $current_user, $app_list_strings;
     $this->ss->assign("MAIL_SENDTYPE", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $this->bean->getPreference('mail_sendtype')));
     ///////////////////////////////////////////////////////////////////////////////
     ////	EMAIL OPTIONS
     // We need to turn off the requiredness of emails if it is a group or portal user
     if ($this->usertype == 'GROUP' || $this->usertype == 'PORTAL_ONLY') {
         global $dictionary;
         $dictionary['User']['fields']['email1']['required'] = false;
     }
     // hack to disable email field being required if it shouldn't be required
     if ($this->ss->get_template_vars("REQUIRED_EMAIL_ADDRESS") == '0') {
         $GLOBALS['dictionary']['User']['fields']['email1']['required'] = false;
     }
     $this->ss->assign("NEW_EMAIL", '<span id="email_span">' . getEmailAddressWidget($this->bean, "email1", $this->bean->email1, $this->viewType) . '</span>');
     // hack to undo that previous hack
     if ($this->ss->get_template_vars("REQUIRED_EMAIL_ADDRESS") == '0') {
         $GLOBALS['dictionary']['User']['fields']['email1']['required'] = true;
     }
     $raw_email_link_type = $this->bean->getPreference('email_link_type');
     $mailerPreferenceStatus = OutboundEmailConfigurationPeer::getMailConfigurationStatusForUser($current_user);
     $options = $app_list_strings['dom_email_link_type'];
     if ($this->viewType == 'EditView') {
         if ($mailerPreferenceStatus === OutboundEmailConfigurationPeer::STATUS_INVALID_SYSTEM_CONFIG) {
             $raw_email_link_type = 'mailto';
         }
         $this->ss->assign('EMAIL_LINK_TYPE', get_select_options_with_id($options, $raw_email_link_type));
     } else {
         $this->ss->assign('EMAIL_LINK_TYPE', $options[$raw_email_link_type]);
     }
     /////	END EMAIL OPTIONS
     ///////////////////////////////////////////////////////////////////////////////
     /////////////////////////////////////////////
     /// Handle email account selections for users
     /////////////////////////////////////////////
     $hide_if_can_use_default = true;
     $disableSugarClient = false;
     if (!($this->usertype == 'GROUP' || $this->usertype == 'PORTAL_ONLY')) {
         // email smtp
         $systemOutboundEmail = new OutboundEmail();
         $systemOutboundEmail = $systemOutboundEmail->getSystemMailerSettings();
         $mail_smtpserver = $systemOutboundEmail->mail_smtpserver;
         $mail_smtptype = $systemOutboundEmail->mail_smtptype;
         $mail_smtpport = $systemOutboundEmail->mail_smtpport;
         $mail_smtpssl = $systemOutboundEmail->mail_smtpssl;
         $mail_smtpuser = "";
         $mail_smtppass = "";
         $mail_smtpdisplay = $systemOutboundEmail->mail_smtpdisplay;
         $mail_smtpauth_req = true;
         $mail_haspass = empty($systemOutboundEmail->mail_smtppass) ? 0 : 1;
         if (!$systemOutboundEmail->isAllowUserAccessToSystemDefaultOutbound()) {
             $mail_smtpauth_req = $systemOutboundEmail->mail_smtpauth_req;
             $userOverrideOE = $systemOutboundEmail->getUsersMailerForSystemOverride($this->bean->id);
             if ($userOverrideOE != null) {
                 $mail_smtpuser = $userOverrideOE->mail_smtpuser;
                 $mail_smtppass = $userOverrideOE->mail_smtppass;
                 $mail_haspass = empty($userOverrideOE->mail_smtppass) ? 0 : 1;
             }
             if (!$mail_smtpauth_req && (empty($systemOutboundEmail->mail_smtpserver) || empty($systemOutboundEmail->mail_smtpuser) || empty($systemOutboundEmail->mail_smtppass))) {
                 $hide_if_can_use_default = true;
             } else {
                 $hide_if_can_use_default = false;
             }
         }
         $this->ss->assign("mail_smtpdisplay", $mail_smtpdisplay);
         $this->ss->assign("mail_smtpserver", $mail_smtpserver);
         $this->ss->assign("mail_smtpuser", $mail_smtpuser);
         $this->ss->assign("mail_smtppass", "");
         $this->ss->assign("mail_haspass", $mail_haspass);
         $this->ss->assign("mail_smtpauth_req", $mail_smtpauth_req);
         $this->ss->assign('MAIL_SMTPPORT', $mail_smtpport);
         $this->ss->assign('MAIL_SMTPSSL', $mail_smtpssl);
     }
     if ($mailerPreferenceStatus === OutboundEmailConfigurationPeer::STATUS_INVALID_SYSTEM_CONFIG) {
         $disableSugarClient = true;
         $hide_if_can_use_default = true;
         //to hide the username/password fields
     }
     $this->ss->assign('DISABLE_SUGAR_CLIENT', $disableSugarClient);
     $this->ss->assign('HIDE_IF_CAN_USE_DEFAULT_OUTBOUND', $hide_if_can_use_default);
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:82,代码来源:UserViewHelper.php


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