diff --git a/www/chat_customer/customer_chat_functions.php b/www/chat_customer/customer_chat_functions.php index 35b1c2b9..7882b730 100644 --- a/www/chat_customer/customer_chat_functions.php +++ b/www/chat_customer/customer_chat_functions.php @@ -8,6 +8,7 @@ # 151219-0850 - Added translation code # 160108-1710 - Added available_agents variable # 160120-1943 - Added show_email variable +# 160203-1051 - Added display of chat message after ending it # require("dbconnect_mysqli.php"); @@ -182,7 +183,30 @@ if ($action=="update_chat_window" && $chat_id) { $status_stmt="SELECT status, chat_creator from vicidial_live_chats where chat_id='$chat_id'"; $status_rslt=mysql_to_mysqli($status_stmt, $link); if (mysqli_num_rows($status_rslt)==0) { - echo ""._QXZ("Chat does not exist or has been closed").": $chat_id

"._QXZ("GO BACK TO CHAT FORM")."\n"; + # JCJ - comment out to display in Javascript function that calls this in parent page. + # echo ""._QXZ("Chat does not exist or has been closed").": $chat_id

"._QXZ("GO BACK TO CHAT FORM")."\n"; + echo "Error|"; + + # Create color-coding for archived chat + $stmt="SELECT * from vicidial_chat_log_archive where chat_id='$chat_id' order by message_time asc"; + $rslt=mysql_to_mysqli($stmt, $link); + $chat_members=array(); + while ($row=mysqli_fetch_row($rslt)) { + if (!in_array("$row[4]", $chat_members)) { + array_push($chat_members, "$row[4]"); + } + } + + ## GRAB ARCHIVED CHAT MESSAGES AND DISPLAY THEM + if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";} + $stmt="SELECT * from vicidial_chat_log_archive where chat_id='$chat_id' $user_level_clause order by message_time asc"; + $rslt=mysql_to_mysqli($stmt, $link); + while ($row=mysqli_fetch_row($rslt)) { + $chat_color_key=array_search("$row[4]", $chat_members); + $row[2]=preg_replace('/\n/', '
', $row[2]); + echo "
  • $row[5] ($row[3]) - $row[2]
  • \n"; + } + } else { $status_row=mysqli_fetch_row($status_rslt); diff --git a/www/chat_customer/vicidial_chat_customer_side.php b/www/chat_customer/vicidial_chat_customer_side.php index c48550a6..e40ec2df 100644 --- a/www/chat_customer/vicidial_chat_customer_side.php +++ b/www/chat_customer/vicidial_chat_customer_side.php @@ -16,6 +16,7 @@ # 151220-0959 - Only search for phone number if greater than 4 digits # 160108-1700 - Added available_agents, status_link button options and validation of active in-group # 160120-1925 - Fixed missing list_id on vicidial_list inserts, Issue #915. Added show_email option +# 160203-1052 - Added display of chat message after ending it # require("dbconnect_mysqli.php"); @@ -84,7 +85,7 @@ else ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $VUselected_language=''; -$stmt = "SELECT use_non_latin,enable_languages,language_method,default_language,allow_chats FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_languages,language_method,default_language,allow_chats,chat_url FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -97,6 +98,7 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSdefault_language = $row[3]; $SSallow_chats = $row[4]; + $SSchat_url = $row[5]; } $VUselected_language = $SSdefault_language; ##### END SETTINGS LOOKUP ##### @@ -392,6 +394,7 @@ echo '