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


PHP SugarFolder::getSubscriptions方法代码示例

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


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

示例1: getFromAccountsArray

 function getFromAccountsArray($ie)
 {
     global $current_user;
     global $app_strings;
     $ieAccountsFull = $ie->retrieveAllByGroupIdWithGroupAccounts($current_user->id);
     $ieAccountsFrom = array();
     $oe = new OutboundEmail();
     $system = $oe->getSystemMailerSettings();
     $ret = $current_user->getUsersNameAndEmail();
     $ret['name'] = from_html($ret['name']);
     $useMyAccountString = true;
     if (empty($ret['email'])) {
         $systemReturn = $current_user->getSystemDefaultNameAndEmail();
         $ret['email'] = $systemReturn['email'];
         $ret['name'] = from_html($systemReturn['name']);
         $useMyAccountString = false;
     }
     // if
     $myAccountString = '';
     if ($useMyAccountString) {
         $myAccountString = " - {$app_strings['LBL_MY_ACCOUNT']}";
     }
     // if
     //Check to make sure that the user has set the associated inbound email account -> outbound account is active.
     $showFolders = unserialize(base64_decode($current_user->getPreference('showFolders', 'Emails')));
     $sf = new SugarFolder();
     $groupSubs = $sf->getSubscriptions($current_user);
     foreach ($ieAccountsFull as $k => $v) {
         $personalSelected = !empty($showFolders) && in_array($v->id, $showFolders);
         $allowOutboundGroupUsage = $v->get_stored_options('allow_outbound_group_usage', FALSE);
         $groupSelected = in_array($v->groupfolder_id, $groupSubs) && $allowOutboundGroupUsage;
         $selected = $personalSelected || $groupSelected;
         if (!$selected) {
             $GLOBALS['log']->debug("Inbound Email {$v->name}, not selected and will not be available for selection within compose UI.");
             continue;
         }
         $name = $v->get_stored_options('from_name');
         $addr = $v->get_stored_options('from_addr');
         if ($name != null && $addr != null) {
             $name = from_html($name);
             if (!$v->is_personal) {
                 $ieAccountsFrom[] = array("value" => $v->id, "text" => "{$name} ({$addr}) - {$app_strings['LBL_EMAIL_UPPER_CASE_GROUP']}");
             } else {
                 $ieAccountsFrom[] = array("value" => $v->id, "text" => "{$name} ({$addr})");
             }
             // else
         }
         // if
     }
     // foreach
     $userSystemOverride = $oe->getUsersMailerForSystemOverride($current_user->id);
     //Substitute in the users system override if its available.
     if ($userSystemOverride != null) {
         $system = $userSystemOverride;
     }
     if (!empty($system->mail_smtpserver)) {
         $admin = new Administration();
         $admin->retrieveSettings();
         //retrieve all admin settings.
         $ieAccountsFrom[] = array("value" => $system->id, "text" => "{$ret['name']} ({$ret['email']}){$myAccountString}");
     }
     return $ieAccountsFrom;
 }
开发者ID:NALSS,项目名称:SuiteCRM,代码行数:63,代码来源:EmailUI.php


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