本文整理汇总了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;
}