diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php
index 3f14aa6174..5e3575b75e 100644
--- a/app/call_centers/call_center_agent_edit.php
+++ b/app/call_centers/call_center_agent_edit.php
@@ -83,6 +83,7 @@
//get http post variables and set them to php variables
if (is_array($_POST)) {
$call_center_agent_uuid = check_str($_POST["call_center_agent_uuid"]);
+ $user_uuid = check_str($_POST["user_uuid"]);
$agent_name = check_str($_POST["agent_name"]);
$agent_type = check_str($_POST["agent_type"]);
$agent_call_timeout = check_str($_POST["agent_call_timeout"]);
@@ -110,6 +111,7 @@
$msg = '';
//if (strlen($call_center_agent_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-call_center_agent_uuid']."
\n"; }
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-domain_uuid']."
\n"; }
+ if (strlen($user_uuid) == 0) { $msg .= $text['message-required']." ".$text['label-user_uuid']."
\n"; }
if (strlen($agent_name) == 0) { $msg .= $text['message-required']." ".$text['label-agent_name']."
\n"; }
if (strlen($agent_type) == 0) { $msg .= $text['message-required']." ".$text['label-agent_type']."
\n"; }
if (strlen($agent_call_timeout) == 0) { $msg .= $text['message-required']." ".$text['label-agent_call_timeout']."
\n"; }
@@ -211,22 +213,20 @@
$_POST["call_center_agent_uuid"] = $call_center_agent_uuid;
}
- //get the user_uuid
- $sql = "select user_uuid from v_users ";
+ //get the users array
+ $sql = "SELECT * FROM v_users ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
- $sql .= "and username = '".$agent_name."' ";
+ $sql .= "order by username asc ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
- $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
- foreach ($result as &$row) {
- $user_uuid = $row["user_uuid"];
- }
+ $users = $prep_statement->fetchAll(PDO::FETCH_NAMED);
+ unset($prep_statement, $sql);
//prepare the array
$array['call_center_agents'][] = $_POST;
- //$array['users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
- //$array['users'][0]['user_uuid'] = $user_uuid;
- //$array['users'][0]['user_status'] = $agent_status;
+ $array['users'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
+ $array['users'][0]['user_uuid'] = $user_uuid;
+ $array['users'][0]['user_status'] = $agent_status;
//save to the data
$database = new database;
@@ -271,6 +271,7 @@
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$call_center_agent_uuid = $row["call_center_agent_uuid"];
+ $user_uuid = $row["user_uuid"];
$agent_name = $row["agent_name"];
$agent_type = $row["agent_type"];
$agent_call_timeout = $row["agent_call_timeout"];
@@ -410,6 +411,26 @@
echo "\n";
echo "\n";
+ echo "