Chat fixes, added called_count as dispo-call-url variable

git-svn-id: svn://192.168.202.10@2562 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2016-07-19 14:44:46 +00:00
parent 6199235405
commit 458397ee40
2 changed files with 18 additions and 7 deletions
+13 -5
View File
@@ -16,6 +16,7 @@
# 160107-2318 - Bug fix for agent ending chat with manager
# 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency
# 160303-0051 - Added code for chat transfers
# 160719-1043 - Bug fixes for non-owner chats, and other issues
#
require("dbconnect_mysqli.php");
@@ -657,7 +658,8 @@ if ($action=="agent_leave_chat" && $user && $chat_id) {
$ins_stmt="insert ignore into vicidial_chat_archive select * From vicidial_live_chats where chat_id='$chat_id'";
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
$del_stmt="delete from vicidial_live_chats where chat_id='$chat_id' and status='WAITING' and chat_creator='NONE'";
# DELETE ONLY IF NO ONE'S LEFT IN THE CHAT AFTER THIS POINT
$del_stmt="delete from vicidial_live_chats where chat_id='$chat_id' and status='WAITING' and chat_creator='NONE' and (select count(*) from vicidial_chat_participants where chat_id='$chat_id')=0;";
$del_rslt=mysql_to_mysqli($del_stmt, $link);
}
}
@@ -1019,7 +1021,7 @@ if ($action=="show_live_chats" && $user) {
$chat_member_name=$row[2];
$chat_creator=$row[3];
$vd_agent=$row[4];
$active_chats[$chat_id][]=array("$chat_member", "$chat_member_name", "in chat");
$active_chats[$chat_id][]=array("$chat_member", "$chat_member_name", "in chat", "$chat_creator");
if ($vd_agent=="Y") {
array_push($agents_in_chat, "$chat_member");
}
@@ -1032,16 +1034,22 @@ if ($action=="show_live_chats" && $user) {
$chat_id=$row[0];
$chat_member=$row[1];
$chat_member_name=$row[2];
$empty_chat_creator=$row[3];
if (!$active_chats[$chat_id]) {
$active_chats[$chat_id][]=array("$chat_member", "$chat_member_name", "absent");
$active_chats[$chat_id][]=array("$chat_member", "$chat_member_name", "absent", "$empty_chat_creator");
}
}
}
if ($active_chats) {
echo "<font class='chat_title bold'>"._QXZ("Available Chats").":</font><BR><BR>";
echo "<font class='chat_title bold'>"._QXZ("Live Chats").":</font><BR><BR>";
while (list($key, $val)=each($active_chats)) {
echo "<li class='submenu' onClick=\"JoinChat('$key', '$chat_creator');\"><font class='chat_message bold'>"._QXZ("Chat ID")." #$key</font>\n";
# PREVENT CLICKING ON UNAVAILABLE CHAT ROOMS
if ($val[0][3]!="NONE") {
echo "<li class='submenu' onClick=\"JoinChat('$key', '$chat_creator');\"><font class='chat_message bold'>"._QXZ("Chat ID")." #$key</font>\n";
} else {
echo "<li class='submenu' onClick=\"chat_alert_box('Chat room is not available - no agent has been assigned it.')\"><font class='chat_message bold'>"._QXZ("Chat ID")." #$key</font>\n";
}
echo "\t<ul id=\"chat_members_$key\">\n";
while (list($subkey, $subval)=each($val)) {
if ($subval[2]=="absent") {
+5 -2
View File
@@ -407,10 +407,11 @@
# 160414-0944 - Added default_phone_code value instead of hard-coded '1'
# 160510-0840 - Added callback_lead_status as dispo_call_url variable
# 160706-1437 - Added font styles to text in many places
# 160714-1503 - Added called_count as a dispo_call_url variable
#
$version = '2.12-301';
$build = '160706-1437';
$version = '2.12-302';
$build = '160714-1503';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=654;
@@ -11443,6 +11444,8 @@ if ($ACTION == 'updateDISPO')
$dispo_call_urlARY[$j] = preg_replace('/--A--did_custom_five--B--/i',urlencode(trim($DID_custom_five)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--agent_email--B--/i',urlencode(trim($agent_email)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--callback_lead_status--B--/i',urlencode(trim($CallBackLeadStatus)),$dispo_call_urlARY[$j]);
$dispo_call_urlARY[$j] = preg_replace('/--A--called_count--B--/i',"$called_count",$dispo_call_urlARY[$j]);
if (strlen($FORMcustom_field_names)>2)
{