From 623af0c156c4c0afa1bf64bd65152275320f6dcc Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 13 Apr 2015 17:00:09 +0000 Subject: [PATCH] Call Center: Fix SQL error on Agent Status change, clarify Status as Default Status on Agent Edit. --- app/call_center/app_languages.php | 10 +++++++++- app/call_center/call_center_agent_edit.php | 2 +- app/call_center/call_center_agent_status.php | 12 ++++++------ app/call_center/call_center_agents.php | 2 +- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/call_center/app_languages.php b/app/call_center/app_languages.php index d0eb15812d..3e2507b5d3 100644 --- a/app/call_center/app_languages.php +++ b/app/call_center/app_languages.php @@ -425,6 +425,14 @@ $text['label-status']['pt-br'] = "Estado"; $text['label-status']['pl'] = "Status"; $text['label-status']['sv-se'] = "Status"; +$text['label-default_status']['en-us'] = "Default Status"; +$text['label-default_status']['es-cl'] = "Estado Predeterminado"; +$text['label-default_status']['pt-pt'] = "Estado Predeterminado"; +$text['label-default_status']['fr-fr'] = "Statut Prédéterminée"; +$text['label-default_status']['pt-br'] = "Estado Predeterminado"; +$text['label-default_status']['pl'] = "z góry określony status"; +$text['label-default_status']['sv-se'] = "i förväg fastställda status"; + $text['label-reject_delay_time']['en-us'] = "Reject Delay Time"; $text['label-reject_delay_time']['es-cl'] = "Tiempo de Espera para Rechazar"; $text['label-reject_delay_time']['pt-pt'] = "Tempo de espera para rejeitar"; @@ -762,7 +770,7 @@ $text['description-strategy']['pt-br'] = "Selecione a estraétia da fila"; $text['description-strategy']['pl'] = "Wybierz strategię"; $text['description-strategy']['sv-se'] = "Välj strategi för ringflöde i kö:n."; -$text['description-status']['en-us'] = "Select the agent status."; +$text['description-status']['en-us'] = "Select the default agent status."; $text['description-status']['es-cl'] = "Seleccione el estado del agente."; $text['description-status']['pt-pt'] = "Seleccione o estado do agente."; $text['description-status']['fr-fr'] = "Choisir le statut de l'agent."; diff --git a/app/call_center/call_center_agent_edit.php b/app/call_center/call_center_agent_edit.php index 8babb9c1bf..1d39a86c50 100644 --- a/app/call_center/call_center_agent_edit.php +++ b/app/call_center/call_center_agent_edit.php @@ -148,7 +148,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { //set the user_status $sql = "update v_users set "; $sql .= "user_status = '".$agent_status."' "; - $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "and username = '".$agent_name."' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); diff --git a/app/call_center/call_center_agent_status.php b/app/call_center/call_center_agent_status.php index 2252d0e7c4..8f1cd401fd 100644 --- a/app/call_center/call_center_agent_status.php +++ b/app/call_center/call_center_agent_status.php @@ -58,8 +58,8 @@ else { //set the user_status $sql = "update v_users set "; $sql .= "user_status = '".$row['agent_status']."' "; - $sql .= "where domain_uuid = '$domain_uuid' "; - $sql .= "and call_center_agent_uuid = '".$row['id']."' "; + $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(); @@ -129,7 +129,7 @@ else { } //increment x $x++; - + } //echo "
\n";
 	//print_r($agents);
@@ -190,9 +190,9 @@ else {
 	foreach($agents as $row) {
 		$str = '';
 		$str .= "\n";
-		$str .= "	".$row['agent_name']." \n";
-		$str .= "	".$row['agent_status']." \n";
-		$str .= "	";
+		$str .= "	".$row['agent_name']." \n";
+		$str .= "	".$row['agent_status']." \n";
+		$str .= "	";
 		$str .= "		\n";
 		$str .= "		\n";
 		$str .= "		\n";
diff --git a/app/call_center/call_center_agents.php b/app/call_center/call_center_agents.php
index 602d95b04e..c1db3e0ba5 100644
--- a/app/call_center/call_center_agents.php
+++ b/app/call_center/call_center_agents.php
@@ -113,7 +113,7 @@ else {
 	echo th_order_by('agent_call_timeout', $text['label-call_timeout'], $order_by, $order);
 	echo th_order_by('agent_contact', $text['label-contact'], $order_by, $order);
 	echo th_order_by('agent_max_no_answer', $text['label-max_no_answer'], $order_by, $order);
-	echo th_order_by('agent_status', $text['label-status'], $order_by, $order);
+	echo th_order_by('agent_status', $text['label-default_status'], $order_by, $order);
 	//echo th_order_by('agent_wrap_up_time', $text['label-wrap_up_time'], $order_by, $order);
 	//echo th_order_by('agent_reject_delay_time', $text['label-reject_delay_time'], $order_by, $order);
 	//echo th_order_by('agent_busy_delay_time', $text['label-busy_delay_time'], $order_by, $order);