本文整理匯總了PHP中InboundEmail::retrieveByGroupId方法的典型用法代碼示例。如果您正苦於以下問題:PHP InboundEmail::retrieveByGroupId方法的具體用法?PHP InboundEmail::retrieveByGroupId怎麽用?PHP InboundEmail::retrieveByGroupId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類InboundEmail
的用法示例。
在下文中一共展示了InboundEmail::retrieveByGroupId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: InboundEmail
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $current_user;
if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'personal') {
if ($current_user->hasPersonalEmail()) {
$ie = new InboundEmail();
$beans = $ie->retrieveByGroupId($current_user->id);
if (!empty($beans)) {
foreach ($beans as $bean) {
$bean->connectMailserver();
$newMsgs = array();
if ($bean->isPop3Protocol()) {
$newMsgs = $bean->getPop3NewMessagesToDownload();
} else {
$newMsgs = $bean->getNewMessageIds();
}
//$newMsgs = $bean->getNewMessageIds();
if (is_array($newMsgs)) {
foreach ($newMsgs as $k => $msgNo) {
$uid = $msgNo;
if ($bean->isPop3Protocol()) {
$uid = $bean->getUIDLForMessage($msgNo);
示例2: getMailboxNodes
/**
* returns an array of nodes that correspond to IMAP mailboxes.
* @param bool $forceRefresh
* @return object TreeView object
*/
function getMailboxNodes()
{
global $sugar_config;
global $current_user;
global $app_strings;
$tree = new Tree("frameFolders");
$tree->tree_style = 'include/ytree/TreeView/css/check/tree.css';
$nodes = array();
$ie = new InboundEmail();
$refreshOffset = $this->cacheTimeouts['folders'];
// 5 mins. this will be set via user prefs
$rootNode = new ExtNode($app_strings['LBL_EMAIL_HOME_FOLDER'], $app_strings['LBL_EMAIL_HOME_FOLDER']);
$rootNode->dynamicloadfunction = '';
$rootNode->expanded = true;
$rootNode->dynamic_load = true;
$showFolders = unserialize(base64_decode($current_user->getPreference('showFolders', 'Emails')));
if (empty($showFolders)) {
$showFolders = array();
}
// INBOX NODES
if ($current_user->hasPersonalEmail()) {
$personals = $ie->retrieveByGroupId($current_user->id);
foreach ($personals as $k => $personalAccount) {
if (in_array($personalAccount->id, $showFolders)) {
// check for cache value
$cacheRoot = sugar_cached("modules/Emails/{$personalAccount->id}");
$this->preflightEmailCache($cacheRoot);
if ($this->validCacheFileExists($personalAccount->id, 'folders', "folders.php")) {
$mailboxes = $this->getMailBoxesFromCacheValue($personalAccount);
} else {
$mailboxes = $personalAccount->getMailboxes();
}
$acctNode = new ExtNode('Home::' . $personalAccount->name, $personalAccount->name);
$acctNode->dynamicloadfunction = '';
$acctNode->expanded = false;
$acctNode->set_property('cls', 'ieFolder');
$acctNode->set_property('ieId', $personalAccount->id);
$acctNode->set_property('protocol', $personalAccount->protocol);
if (array_key_exists('Home::' . $personalAccount->name, $this->folderStates)) {
if ($this->folderStates['Home::' . $personalAccount->name] == 'open') {
$acctNode->expanded = true;
}
}
$acctNode->dynamic_load = true;
$nodePath = $acctNode->_properties['id'];
foreach ($mailboxes as $k => $mbox) {
$acctNode->add_node($this->buildTreeNode($k, $k, $mbox, $personalAccount->id, $nodePath, false, $personalAccount));
}
$rootNode->add_node($acctNode);
}
}
}
// GROUP INBOX NODES
$beans = $ie->retrieveAllByGroupId($current_user->id, false);
foreach ($beans as $k => $groupAccount) {
if (in_array($groupAccount->id, $showFolders)) {
// check for cache value
$cacheRoot = sugar_cached("modules/Emails/{$groupAccount->id}");
$this->preflightEmailCache($cacheRoot);
//$groupAccount->connectMailserver();
if ($this->validCacheFileExists($groupAccount->id, 'folders', "folders.php")) {
$mailboxes = $this->getMailBoxesFromCacheValue($groupAccount);
} else {
$mailboxes = $groupAccount->getMailBoxesForGroupAccount();
}
$acctNode = new ExtNode($groupAccount->name, "group.{$groupAccount->name}");
$acctNode->dynamicloadfunction = '';
$acctNode->expanded = false;
$acctNode->set_property('isGroup', 'true');
$acctNode->set_property('ieId', $groupAccount->id);
$acctNode->set_property('protocol', $groupAccount->protocol);
if (array_key_exists('Home::' . $groupAccount->name, $this->folderStates)) {
if ($this->folderStates['Home::' . $groupAccount->name] == 'open') {
$acctNode->expanded = true;
}
}
$acctNode->dynamic_load = true;
$nodePath = $rootNode->_properties['id'] . "::" . $acctNode->_properties['id'];
foreach ($mailboxes as $k => $mbox) {
$acctNode->add_node($this->buildTreeNode($k, $k, $mbox, $groupAccount->id, $nodePath, true, $groupAccount));
}
$rootNode->add_node($acctNode);
}
}
// SugarFolder nodes
/* SugarFolders are built at onload when the UI renders */
$tree->add_node($rootNode);
return $tree;
}
示例3: InboundEmail
///////////////////////////////////////////////////////////////////////////////
//// INBOUND EMAIL SETUP
if (function_exists('imap_open')) {
require_once 'modules/Emails/Email.php';
require_once 'modules/InboundEmail/InboundEmail.php';
$ie = new InboundEmail();
$email = new Email();
$xtpl->assign('ROLLOVER', $email->rolloverStyle);
$xtpl->assign('IE_HIDE', '');
$xtpl->assign('IE_NAME', $focus->user_name);
$xtpl->assign('GROUP_ID', $focus->id);
$xtpl->assign('THEME', $theme);
$status = get_select_options_with_id($app_list_strings['user_status_dom'], '');
$mailbox_type = get_select_options_with_id($app_list_strings['dom_email_server_type'], '');
$mailbox = 'INBOX';
$beans = $ie->retrieveByGroupId($focus->id);
if (!empty($beans)) {
foreach ($beans as $bean) {
// default MAILBOX value
if (!empty($bean->mailbox)) {
$mailbox = $bean->mailbox;
}
if (!empty($bean->stored_options)) {
$storedOptions = unserialize(base64_decode($bean->stored_options));
$from_name = $storedOptions['from_name'];
$from_addr = $storedOptions['from_addr'];
if ($storedOptions['only_since']) {
$only_since = 'CHECKED';
} else {
$only_since = '';
}
示例4: retrieveByGroupId
public function retrieveByGroupId($group_id)
{
$inboundEmail = new InboundEmail();
$result = $inboundEmail->retrieveByGroupId($group_id);
$this->assertTrue(is_array($result));
foreach ($result as $ie) {
$this->assertInstanceOf('InboundEmail', $ie);
}
}