本文整理汇总了PHP中astercrm::updateAgentOnlineTime方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::updateAgentOnlineTime方法的具体用法?PHP astercrm::updateAgentOnlineTime怎么用?PHP astercrm::updateAgentOnlineTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::updateAgentOnlineTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listenCalls
/**
* check if there's new event happen
*
*/
function listenCalls($aFormValues)
{
global $config, $locate;
//print_r($_SESSION['ticketNoticeTime']);exit;
//print_r($aFormValues);exit;
$objResponse = new xajaxResponse();
// if($agentData = Customer::getAgentData()){
// if(strstr($agentData['agent'],'agent')){
// $objResponse->addAssign("spanDialList", "style.display", "none");
// $objResponse->addAssign("misson", "style.display", "none");
// }else{
// $objResponse->addAssign("spanDialList", "style.display", "");
// $objResponse->addAssign("misson", "style.display", "");
// }
//// print_r($agentData);exit;
// if($aFormValues['breakStatus'] == -1){
// $span = '<input type="button" value="" name="btnPause" id="btnPause" onclick="queuePaused();" >';
// $objResponse->addAssign("spnPause","innerHTML", $span );
// }
// if($agentData['cretime'] > $aFormValues['clkPauseTime']){
// $objResponse->addAssign("agentData","innerHTML", $agentData['data'] );
// if($agentData['agent_status'] != 'paused'){
// $objResponse->addAssign("btnPause","value", $locate->Translate("Break") );
// $objResponse->addAssign("breakStatus","value", 0);
// }else{
// $objResponse->addAssign("btnPause","value", $locate->Translate("Continue") );
// $objResponse->addAssign("breakStatus","value", 1);
// }
// }
// }else{
// if($_SESSION['curuser']['agent'] == '' ){
// $objResponse->addAssign("agentData","innerHTML", '');
// $objResponse->addAssign("spnPause","innerHTML", '' );
// $objResponse->addAssign("breakStatus","value", -1);
// }
// }
//根据后台 astercrm_accountgroup里设置的参数 notice_interval 来判断多少分钟的间隔执行 ticket 的提示
if ($_SESSION['curuser']['usertype'] == 'agent') {
$noticeInterval = $_SESSION['noticeInterval'];
//print_r($_SESSION['ticketNoticeTime'].' - '.date("Y-m-d H:i:s",strtotime($_SESSION['ticketNoticeTime']." + $noticeInterval minutes")));exit;
//print_r($noticeInterval > 0 && (strtotime($_SESSION['ticketNoticeTime']." + $noticeInterval minutes") <= strtotime(date("Y-m-d"))));exit;
$noticeArray = array();
if ($noticeInterval > 0 && strtotime($_SESSION['ticketNoticeTime'] . " + {$noticeInterval} minutes") <= strtotime(date("Y-m-d H:i:s"))) {
$noticeArray = Customer::ticketNoticeValid();
//更新右上角的mytickets处的数值
$curTicketmsg = Customer::getTicketInWork();
$objResponse->addAssign("curticketMsg", "innerHTML", $curTicketmsg);
}
if (!empty($noticeArray)) {
$objResponse->addAssign("noticeTicketMsgDiv", "innerHTML", str_replace('%d', count($noticeArray), $locate->Translate('you have new tickets')));
$objResponse->addScript('getTicketNoticeMsg();');
$_SESSION['ticketNoticeTime'] = date("Y-m-d H:i:s");
//更新session里的提醒时间
}
/* else {
$objResponse->addAssign("noticeTicketMsgDiv","innerHTML",'');
$objResponse->addScript('closeTicketNotice();');
}*/
}
//根据后台设置的update_online_interval 判断多长时间进行更新astecrm_account表里的last_update_time字段值
if (isset($_SESSION['curuser']['update_online_interval']) && $_SESSION['curuser']['update_online_interval'] != '') {
if (strtotime(date("Y-m-d H:i:s")) - strtotime($_SESSION['curuser']['update_online_interval']) >= $config['system']['update_online_interval'] * 60) {
astercrm::updateAgentOnlineTime('update', date("Y-m-d H:i:s"), $_SESSION['curuser']['accountid']);
}
}
if ($aFormValues['dpnShow'] > 0) {
//for refresh diallist pannel
$lastDiallistId = Customer::getLastOwnDiallistId();
if ($lastDiallistId == '') {
$lastDiallistId = 1;
}
if ($aFormValues['dpnShow'] != $lastDiallistId) {
$objResponse->addAssign("dpnShow", "value", $lastDiallistId);
$objResponse->addScript("showDiallist('" . $_SESSION['curuser']['extension'] . "',0,0,5,'','','','formDiallistPannel','','');");
}
}
if ($aFormValues['uniqueid'] == '') {
$objResponse->addAssign("btnDial", "disabled", false);
$objResponse->loadXML(waitingCalls($aFormValues));
} else {
$objResponse->addAssign("btnDial", "disabled", true);
$objResponse->loadXML(incomingCalls($aFormValues));
}
//set time intervals of update events
//$check_interval = 2000;
//if ( is_numeric($config['system']['status_check_interval']) ) $check_interval = $config['system']['status_check_interval'] * 1000;
//$objResponse->addScript('setTimeout("updateEvents()", '.$check_interval.');');
return $objResponse;
}
示例2: processAccountData
/**
* function to verify user data
*
* @param $aFormValues (array) login form data
$aFormValues['username']
$aFormValues['password']
$aFormValues['locate']
* @return $objResponse
* @session
$_SESSION['curuser']['username']
$_SESSION['curuser']['extension']
$_SESSION['curuser']['extensions']
$_SESSION['curuser']['country']
$_SESSION['curuser']['language']
$_SESSION['curuser']['channel']
$_SESSION['curuser']['accountcode']
*/
function processAccountData($aFormValues)
{
global $db, $locate, $config;
$objResponse = new xajaxResponse();
$bError = false;
$loginError = false;
list($_SESSION['curuser']['country'], $_SESSION['curuser']['language']) = split("_", $aFormValues['locate']);
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'login');
/* check whether the pear had been installed */
$pear_exists_result = class_exists('PEAR');
if (empty($pear_exists_result)) {
$objResponse->addAlert($locate->Translate("Please install php pear"));
return $objResponse;
}
if (!$bError) {
//$query = "SELECT * FROM account WHERE username='" . $aFormValues['username'] . "'";
//$res = $db->query($query);
$row = astercrm::getRecordByField("username", $aFormValues['username'], "astercrm_account");
if ($row['id'] != '') {
if ($row['password'] == $aFormValues['password']) {
$identity = astercrm::calculateAgentOntime('login', trim($aFormValues['username']));
if ($identity) {
$update = astercrm::updateAgentOnlineTime('login', date('Y-m-d H:i:s'), $row['id']);
}
if ($aFormValues['rememberme'] == "forever") {
// set cookies for three years
setcookie("username", $aFormValues['username'], time() + 94608000);
setcookie("password", $aFormValues['password'], time() + 94608000);
setcookie("language", $aFormValues['locate'], time() + 94608000);
} else {
// destroy cookies
setcookie("username", "", time() - 3600);
setcookie("password", "", time() - 3600);
setcookie("language", "", time() - 3600);
$username = '';
$password = '';
$language = 'en_US';
$checked = false;
}
$_SESSION = array();
$_SESSION['curuser']['username'] = trim($aFormValues['username']);
$_SESSION['curuser']['extension'] = $row['extension'];
$_SESSION['curuser']['usertype'] = $row['usertype'];
$_SESSION['curuser']['usertype_id'] = $row['usertype_id'];
$_SESSION['curuser']['accountid'] = $row['id'];
$_SESSION['curuser']['accountcode'] = $row['accountcode'];
$_SESSION['curuser']['agent'] = $row['agent'];
$_SESSION['curuser']['callerid'] = trim($row['callerid']);
$_SESSION['curuser']['update_online_interval'] = date("Y-m-d H:i:s");
// added by solo 2007-10-90
$_SESSION['curuser']['channel'] = $row['channel'];
$_SESSION['curuser']['extensions'] = array();
$_SESSION['curuser']['groupid'] = $row['groupid'];
$privilege = array();
if ($row['usertype_id'] > 0) {
$privileges = $db->getAll("SELECT * FROM user_privileges WHERE user_type_id='" . $row['usertype_id'] . "'");
foreach ($privileges as $p) {
$privilege[$p['page']][$p['action']] = 1;
}
}
$_SESSION['curuser']['privileges'] = $privilege;
if ($row['extensions'] != '') {
$_SESSION['curuser']['extensions'] = split(',', $row['extensions']);
}
//check extensions if exists in account table
foreach ($_SESSION['curuser']['extensions'] as $key => $value) {
$exten_row = astercrm::getRecordByField("username", $value, "astercrm_account");
if ($exten_row['id'] == '') {
unset($_SESSION['curuser']['extensions'][$key]);
}
}
// if it's a group admin, then add all group extension to it
if ($row['usertype'] == 'groupadmin' || is_array($_SESSION['curuser']['privileges']['systemstatus']) || is_array($_SESSION['curuser']['privileges']['import'])) {
$_SESSION['curuser']['memberExtens'] = array();
$_SESSION['curuser']['memberNames'] = array();
$_SESSION['curuser']['memberAgents'] = array();
$groupList = astercrm::getGroupMemberListByID($row['groupid']);
while ($groupList->fetchInto($groupRow)) {
$_SESSION['curuser']['memberExtens'][] = $groupRow['extension'];
$_SESSION['curuser']['memberNames'][] = $groupRow['username'];
if ($groupRow['agent'] != '') {
$_SESSION['curuser']['memberAgents'][] = $groupRow['agent'];
}
//.........这里部分代码省略.........