本文整理汇总了PHP中EmailUI::setLastRobin方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailUI::setLastRobin方法的具体用法?PHP EmailUI::setLastRobin怎么用?PHP EmailUI::setLastRobin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailUI
的用法示例。
在下文中一共展示了EmailUI::setLastRobin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pollMonitoredInboxes
//.........这里部分代码省略.........
if ($distributionMethod == 'roundRobin') {
if (sizeof($users) == 1) {
$userId = $users[0];
$lastRobin = $users[0];
} else {
$userIdsKeys = array_flip($users);
// now keys are values
$thisRobinKey = $userIdsKeys[$lastRobin] + 1;
if (!empty($users[$thisRobinKey])) {
$userId = $users[$thisRobinKey];
$lastRobin = $users[$thisRobinKey];
} else {
$userId = $users[0];
$lastRobin = $users[0];
}
}
// else
} else {
if (sizeof($users) == 1) {
foreach ($users as $k => $value) {
$userId = $value;
}
// foreach
} else {
asort($counts);
// lowest to highest
$countsKeys = array_flip($counts);
// keys now the 'count of items'
$leastBusy = array_shift($countsKeys);
// user id of lowest item count
$userId = $leastBusy;
$counts[$leastBusy] = $counts[$leastBusy] + 1;
}
}
// else
Log::debug('userId [ ' . $userId . ' ]');
$ieX->handleCreateCase($ieX->email, $userId);
}
// if
}
// if
} else {
if ($ieX->isAutoImport()) {
$ieX->importOneEmail($msgNo, $uid);
} else {
/*If the group folder doesn't exist then download only those messages
which has caseid in message*/
$ieX->getMessagesInEmailCache($msgNo, $uid);
$email = new Email();
$header = imap_headerinfo($ieX->conn, $msgNo);
$email->name = $ieX->handleMimeHeaderDecode($header->subject);
$email->from_addr = $ieX->convertImapToSugarEmailAddress($header->from);
$email->reply_to_email = $ieX->convertImapToSugarEmailAddress($header->reply_to);
if (!empty($email->reply_to_email)) {
$contactAddr = $email->reply_to_email;
} else {
$contactAddr = $email->from_addr;
}
$mailBoxType = $ieX->mailbox_type;
$ieX->handleAutoresponse($email, $contactAddr);
}
// else
}
// else
Log::debug('***** On message [ ' . $current . ' of ' . $total . ' ] *****');
$current++;
}
// foreach
// update Inbound Account with last robin
if ($ieX->isMailBoxTypeCreateCase() && $distributionMethod == 'roundRobin') {
$emailUI->setLastRobin($ieX, $lastRobin);
}
// if
}
// if
if ($isGroupFolderExists) {
$leaveMessagesOnMailServer = $ieX->get_stored_options("leaveMessagesOnMailServer", 0);
if (!$leaveMessagesOnMailServer) {
if ($ieX->isPop3Protocol()) {
$ieX->deleteMessageOnMailServerForPop3(implode(",", $messagesToDelete));
} else {
$ieX->deleteMessageOnMailServer(implode($app_strings['LBL_EMAIL_DELIMITER'], $messagesToDelete));
}
}
}
} else {
Log::fatal("SCHEDULERS: could not get an IMAP connection resource for ID [ {$a['id']} ]. Skipping mailbox [ {$a['name']} ].");
// cn: bug 9171 - continue while
}
// else
}
// foreach
imap_expunge($ieX->conn);
imap_close($ieX->conn, CL_EXPUNGE);
}
// while
$GLOBALS['current_user']->team_id = $_bck_up['team_id'];
$GLOBALS['current_user']->team_set_id = $_bck_up['team_set_id'];
return true;
}