diff --git a/app/call_centers/call_center_agent_status.php b/app/call_centers/call_center_agent_status.php index df70e9384b..22af1e54b9 100644 --- a/app/call_centers/call_center_agent_status.php +++ b/app/call_centers/call_center_agent_status.php @@ -76,25 +76,25 @@ $sql .= "user_status = '".$row['agent_status']."' "; $sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "and username = '".$row['agent_name']."' "; - //echo $sql."\n"; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); } + //set the call center status if (!isset($row['queue_name'])) { if ($row['agent_status'] == "Do Not Disturb") { //set the default dnd action $dnd_action = "add"; //set the call center status to Logged Out - $cmd = "api callcenter_config agent set status ".$row['agent_name']."@".$_SESSION['domains'][$domain_uuid]['domain_name']." 'Logged Out'"; + $cmd = "api callcenter_config agent set status ".$row['agent_uuid']." 'Logged Out'"; } else { - $cmd = "api callcenter_config agent set status ".$row['agent_name']."@".$_SESSION['domains'][$domain_uuid]['domain_name']." '".$row['agent_status']."'"; + $cmd = "api callcenter_config agent set status ".$row['agent_uuid']." '".$row['agent_status']."'"; } $response = event_socket_request($fp, $cmd); } //echo $cmd."\n"; - + //set the agent status to available and assign the agent to the queue with the tier if (isset($row['queue_name']) && $row['agent_status'] == 'Available') { //set the call center status @@ -102,14 +102,14 @@ //$response = event_socket_request($fp, $cmd); //assign the agent to the queue - $cmd = "api callcenter_config tier add ".$row['queue_name']."@".$_SESSION['domain_name']." ".$row['agent_name']."@".$_SESSION['domain_name']." 1 1"; + $cmd = "api callcenter_config tier add ".$row['queue_name']." ".$row['agent_uuid']." 1 1"; //echo $cmd."
\n"; $response = event_socket_request($fp, $cmd); } //un-assign the agent from the queue if (isset($row['queue_name']) && $row['agent_status'] == 'Logged Out') { - $cmd = "api callcenter_config tier del ".$row['queue_name']."@".$_SESSION['domain_name']." ".$row['agent_name']."@".$_SESSION['domain_name']; + $cmd = "api callcenter_config tier del ".$row['queue_name']." ".$row['agent_uuid']; //echo $cmd."
\n"; $response = event_socket_request($fp, $cmd); } @@ -224,69 +224,69 @@ echo "\n"; $x = 0; foreach($agents as $row) { - $str = "\n"; - $str .= " ".$row['agent_name']." \n"; + $html = "\n"; + $html .= " ".$row['agent_name']." \n"; - //$str .= " ".$row['agent_name']." \n"; - $str .= " ".$row['agent_status']." \n"; - $str .= " "; - $str .= " \n"; - $str .= " \n"; - //$str .= "   \n"; - $str .= "   \n"; - $str .= "   \n"; - $str .= "   \n"; - //$str .= " \n"; - $str .= " \n"; + //$html .= " ".$row['agent_name']." \n"; + $html .= " ".$row['agent_status']." \n"; + $html .= " "; + $html .= " \n"; + $html .= " \n"; + //$html .= "   \n"; + $html .= "   \n"; + $html .= "   \n"; + $html .= "   \n"; + //$html .= " \n"; + $html .= " \n"; - $str .= " "; + $html .= " "; if (is_array($row['queues']) && $per_queue_login) { - $str .= " \n"; - $str .= " \n"; - $str .= " \n"; - $str .= " \n"; - $str .= " \n"; - $str .= " \n"; + $html .= "
".$text['label-agent']."".$text['label-status']."".$text['label-options']."
\n"; + $html .= " \n"; + $html .= " \n"; + $html .= " \n"; + $html .= " \n"; + $html .= " \n"; foreach ($row['queues'] as $queue) { $x++; - $str .= " \n"; - $str .= " \n"; + $html .= " \n"; + $html .= " \n"; - $str .= " \n"; + $html .= " \n"; - $str .= " \n"; - $str .= " \n"; + $html .= " \n"; + $html .= " \n"; } - $str .= "
".$text['label-agent']."".$text['label-status']."".$text['label-options']."
\n"; - $str .= " ".$queue['queue_name']."\n"; - $str .= "
\n"; + $html .= " ".$queue['queue_name']."\n"; + $html .= " \n"; + $html .= " \n"; //.$row[queue_status]."  if ($queue['queue_status'] == "Available") { - $str .= " ".$text['option-available']."\n"; + $html .= " ".$text['option-available']."\n"; } if ($queue['queue_status'] == "Logged Out") { - $str .= " ".$text['option-logged_out']."\n"; + $html .= " ".$text['option-logged_out']."\n"; } - $str .= " "; - $str .= " \n"; - $str .= " \n"; - $str .= " \n"; - $str .= " \n"; - //$str .= "   \n"; - $str .= "   \n"; - $str .= "   \n"; - $str .= "
"; + $html .= " \n"; + $html .= " \n"; + $html .= " \n"; + $html .= " \n"; + //$html .= "   \n"; + $html .= "   \n"; + $html .= "   \n"; + $html .= "
\n"; + $html .= " \n"; } - $str .= " \n"; - $str .= "\n"; + $html .= " \n"; + $html .= "\n"; if (count($_SESSION['domains']) > 1) { if ($row['domain_name'] == $_SESSION['domain_name']) { - echo $str; + echo $html; if ($c==0) { $c=1; } else { $c=0; } } } else { - echo $str; + echo $html; if ($c==0) { $c=1; } else { $c=0; } } $x++;