Added agent chat screen colors for agent screen chats

git-svn-id: svn://192.168.202.10@2651 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2016-12-22 14:56:11 +00:00
parent b3446519ab
commit c7db5b2261
6 changed files with 117 additions and 47 deletions
@@ -1681,7 +1681,8 @@ rec_prompt_count INT(9) UNSIGNED default '0',
agent_soundboards ENUM('1','0') default '0',
web_loader_phone_length VARCHAR(10) default 'DISABLED',
agent_script VARCHAR(50) default 'vicidial.php',
vdad_debug_logging ENUM('1','0') default '0'
vdad_debug_logging ENUM('1','0') default '0',
agent_chat_screen_colors VARCHAR(20) default 'default'
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -3844,4 +3845,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1482',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1483',db_schema_update_date=NOW(),reload_timestamp=NOW();
+4
View File
@@ -22,3 +22,7 @@ ALTER TABLE vicidial_manager_chat_log ADD column message_id VARCHAR(20) after me
ALTER TABLE vicidial_manager_chat_log_archive ADD column message_id VARCHAR(20) after message;
UPDATE system_settings SET db_schema_version='1482',db_schema_update_date=NOW() where db_schema_version < 1482;
ALTER TABLE system_settings ADD agent_chat_screen_colors VARCHAR(20) default 'default';
UPDATE system_settings SET db_schema_version='1483',db_schema_update_date=NOW() where db_schema_version < 1483;
@@ -13,10 +13,11 @@
# 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency
# 160523-0630 - Fixed vicidial_stylesheet issues
# 161217-0827 - Added code for multi-user internal chat sessions
# 161221-0801 - Added color-coding for users in internal chat sessions
#
$admin_version = '2.14-7';
$build = '161217-0827';
$admin_version = '2.14-8';
$build = '161221-0801';
$sh="managerchats";
@@ -445,6 +446,8 @@ function RefreshActiveChatView() {
var user=document.getElementById("user").value;
var pass='<?php echo $pass ?>';
var ChatReloadIDNumber=document.getElementById("ChatReloadIDNumber").value;
var manager_chat_id=document.getElementById("CurrentActiveChat").value;
var manager_chat_subid=document.getElementById("CurrentActiveChatSubID").value;
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
@@ -466,7 +469,7 @@ function RefreshActiveChatView() {
}
if (xmlhttp)
{
var chat_SQL_query = "action=RefreshActiveChatView&user="+user+"&pass="+pass+"&ChatReloadIDNumber="+ChatReloadIDNumber;
var chat_SQL_query = "action=RefreshActiveChatView&user="+user+"&pass="+pass+"&ChatReloadIDNumber="+ChatReloadIDNumber+"&manager_chat_id="+manager_chat_id+"&manager_chat_subid="+manager_chat_subid;
xmlhttp.open('POST', 'chat_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(chat_SQL_query);
+74 -38
View File
@@ -20,6 +20,7 @@
# 160818-1236 - Added chat colors, usre nickname and scrolling
# 160831-2225 - Agent-to-agent interface now color-coded using system settings, if desired
# 161217-0824 - Added code for multi-user internal chat sessions
# 161221-0800 - Added color-coding for users in internal chat sessions
#
require("dbconnect_mysqli.php");
@@ -244,16 +245,19 @@ if ($action=="DisplayMgrAgentChat" && $manager_chat_id && $manager_chat_subid &&
}
}
$chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background from system_settings s, vicidial_screen_colors v where s.agent_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
$chat_color_stmt="select std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, alt_row1_background, alt_row2_background, alt_row3_background from system_settings s, vicidial_screen_colors v where s.agent_chat_screen_colors=v.colors_id and length(std_row1_background)=6 and length(std_row2_background)=6 and s.agent_chat_screen_colors!='default' limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0) {
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0)
{
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[frame_background]", "#$color_row[menu_background]");
} else {
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array("#FFCCCC", "#CCCCFF", "#CCFFCC", "#FFCCFF", "#CCFFFF", "#CCCC99", "#CCCCCC");
}
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[alt_row1_background]", "#$color_row[alt_row2_background]", "#$color_row[alt_row3_background]");
}
else
{
$color_array=array("#CC0000", "#009900", "#000099", "#999900", "#993300", "#330066", "#009999", "#660033");
$chat_background_array=array("#FFCCCC", "#CCFFCC", "#CCCCFF", "#FFFFCC", "#FFCC99", "#CC99FF", "#CCFFFF", "#FF99CC");
}
while($row=mysqli_fetch_row($rslt)) {
if (!$chat_start_date) {$chat_start_date=$row[6];}
@@ -420,30 +424,59 @@ if ($action=="RefreshActiveChatView" && $user) {
sort($active_chats_array);
asort($chat_managers_array);
# Removed this on 2016-12-09, because a) the active chat display should be refreshing when an agent is added to a chat, and the agent already in the chat isn't seeing the change, and b) the below section isn't querying the database anyway, so it won't affect page performance.
# if ($new_ChatReloadIDNumber!=$ChatReloadIDNumber) {
echo "$new_ChatReloadIDNumber|";
echo "<ul class='chatview'>";
if (empty($chat_managers_array)) {
echo "\t<li class='arial_bold'>"._QXZ("NO OPEN CHATS")."</li>\n";
} else {
while (list($manager_chat_id, $text) = each($chat_managers_array)) {
$manager_chat_subid=$chat_subid_array[$manager_chat_id];
if (!empty($unread_chats_array) && in_array($manager_chat_id, $unread_chats_array)) {$cclass="unreadchat";} else {$cclass="viewedchat";}
echo "\t<li class='".$cclass."'><a onClick=\"document.getElementById('CurrentActiveChat').value='$manager_chat_id'; document.getElementById('CurrentActiveChatSubID').value='$manager_chat_subid'; document.getElementById('AgentManagerOverride').value='".$agents_managers_array[$manager_chat_id]."'; LoadAvailableAgentsForChat('AllLiveNonChatAgents', 'agent_to_add');\">Chat #".$manager_chat_id."</a></li>\n"; # $chat_managers_array[$manager_chat_id]
$additional_agents_stmt="select concat(manager, selected_agents) as participants from vicidial_manager_chats where manager_chat_id='$manager_chat_id'";
$additional_agents_rslt=mysql_to_mysqli($additional_agents_stmt, $link);
$aa_row=mysqli_fetch_row($additional_agents_rslt);
$additional_agents=preg_replace("/^\||\|$/", "", $aa_row[0]);
$additional_agents=preg_replace("/\|/", "','", $additional_agents);
$full_name_stmt="select full_name from vicidial_users where user in ('$additional_agents') and user!='$user' order by full_name asc";
$full_name_rslt=mysql_to_mysqli($full_name_stmt, $link);
while ($fname_row=mysqli_fetch_row($full_name_rslt)) {
echo "\t<li class='additional_agents'><a onClick=\"document.getElementById('CurrentActiveChat').value='$manager_chat_id'; document.getElementById('CurrentActiveChatSubID').value='$manager_chat_subid'; document.getElementById('AgentManagerOverride').value='".$agents_managers_array[$manager_chat_id]."'; LoadAvailableAgentsForChat('AllLiveNonChatAgents', 'agent_to_add');\">".$fname_row[0]."</a></li>\n";
}
# Create color-coding for internal chat
$cc_stmt="select * from vicidial_manager_chat_log where manager_chat_id='$manager_chat_id' and manager_chat_subid='$manager_chat_subid' order by message_date asc";
$cc_rslt=mysql_to_mysqli($cc_stmt, $link);
$chat_members=array();
while ($cc_row=mysqli_fetch_row($cc_rslt)) {
if (!in_array("$cc_row[9]", $chat_members)) {
array_push($chat_members, "$cc_row[9]");
}
}
echo "</ul>\n";
$chat_color_stmt="select std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, alt_row1_background, alt_row2_background, alt_row3_background from system_settings s, vicidial_screen_colors v where s.agent_chat_screen_colors=v.colors_id and length(std_row1_background)=6 and length(std_row2_background)=6 and s.agent_chat_screen_colors!='default' limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0)
{
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[alt_row1_background]", "#$color_row[alt_row2_background]", "#$color_row[alt_row3_background]");
}
else
{
$color_array=array("#CC0000", "#009900", "#000099", "#999900", "#993300", "#330066", "#009999", "#660033");
$chat_background_array=array("#FFCCCC", "#CCFFCC", "#CCCCFF", "#FFFFCC", "#FFCC99", "#CC99FF", "#CCFFFF", "#FF99CC");
}
# Removed this on 2016-12-09, because a) the active chat display should be refreshing when an agent is added to a chat, and the agent already in the chat isn't seeing the change, and b) the below section isn't querying the database anyway, so it won't affect page performance.
# if ($new_ChatReloadIDNumber!=$ChatReloadIDNumber) {
echo "$new_ChatReloadIDNumber|";
echo "<ul class='chatview'>";
if (empty($chat_managers_array)) {
echo "\t<li class='arial_bold'>"._QXZ("NO OPEN CHATS")."</li>\n";
} else {
while (list($manager_chat_id, $text) = each($chat_managers_array)) {
$manager_chat_subid=$chat_subid_array[$manager_chat_id];
if (!empty($unread_chats_array) && in_array($manager_chat_id, $unread_chats_array)) {$cclass="unreadchat";} else {$cclass="viewedchat";}
echo "\t<li class='".$cclass."'><a onClick=\"document.getElementById('CurrentActiveChat').value='$manager_chat_id'; document.getElementById('CurrentActiveChatSubID').value='$manager_chat_subid'; document.getElementById('AgentManagerOverride').value='".$agents_managers_array[$manager_chat_id]."'; LoadAvailableAgentsForChat('AllLiveNonChatAgents', 'agent_to_add');\">Chat #".$manager_chat_id."</a></li>\n"; # $chat_managers_array[$manager_chat_id]
$additional_agents_stmt="select concat(manager, selected_agents) as participants from vicidial_manager_chats where manager_chat_id='$manager_chat_id'";
$additional_agents_rslt=mysql_to_mysqli($additional_agents_stmt, $link);
$aa_row=mysqli_fetch_row($additional_agents_rslt);
$additional_agents=preg_replace("/^\||\|$/", "", $aa_row[0]);
$additional_agents=preg_replace("/\|/", "','", $additional_agents);
$full_name_stmt="select full_name, user from vicidial_users where user in ('$additional_agents') and user!='$user' order by full_name asc";
$full_name_rslt=mysql_to_mysqli($full_name_stmt, $link);
while ($fname_row=mysqli_fetch_row($full_name_rslt)) {
$chat_color_key=array_search("$fname_row[1]", $chat_members);
# $chat_output_text="<tr><td bgcolor='$chat_background_array[$chat_color_key]'><font color='$color_array[$chat_color_key]' FACE=\"ARIAL,HELVETICA\" size='2' class='bold'>$row[1]</font></td></tr>".$chat_output_text;
echo "\t<li class='additional_agents' style='background-color:".$chat_background_array[$chat_color_key].";'><a onClick=\"document.getElementById('CurrentActiveChat').value='$manager_chat_id'; document.getElementById('CurrentActiveChatSubID').value='$manager_chat_subid'; document.getElementById('AgentManagerOverride').value='".$agents_managers_array[$manager_chat_id]."'; LoadAvailableAgentsForChat('AllLiveNonChatAgents', 'agent_to_add');\">".$fname_row[0]."</a></li>\n";
}
}
}
echo "</ul>\n";
# }
}
@@ -888,16 +921,19 @@ if ($action=="update_agent_chat_window" && $chat_id) {
}
}
$chat_color_stmt="select menu_background, frame_background, std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background from system_settings s, vicidial_screen_colors v where s.agent_screen_colors=v.colors_id and length(frame_background)=6 and length(menu_background)=6 limit 1;";
$chat_color_stmt="select std_row1_background, std_row2_background, std_row3_background, std_row4_background, std_row5_background, alt_row1_background, alt_row2_background, alt_row3_background from system_settings s, vicidial_screen_colors v where s.agent_chat_screen_colors=v.colors_id and length(std_row1_background)=6 and length(std_row2_background)=6 and s.agent_chat_screen_colors!='default' limit 1;";
$color_rslt=mysql_to_mysqli($chat_color_stmt, $link);
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0) {
if(mysqli_num_rows($color_rslt)>0 && $use_agent_colors>0)
{
$color_row=mysqli_fetch_array($color_rslt);
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[frame_background]", "#$color_row[menu_background]");
} else {
$color_array=array("#FF0000", "#0000FF", "#009900", "#990099", "#009999", "#666600", "#999999");
$chat_background_array=array("#FFCCCC", "#CCCCFF", "#CCFFCC", "#FFCCFF", "#CCFFFF", "#CCCC99", "#CCCCCC");
}
$color_array=array("#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000", "#000000");
$chat_background_array=array("#$color_row[std_row1_background]", "#$color_row[std_row2_background]", "#$color_row[std_row3_background]", "#$color_row[std_row4_background]", "#$color_row[std_row5_background]", "#$color_row[alt_row1_background]", "#$color_row[alt_row2_background]", "#$color_row[alt_row3_background]");
}
else
{
$color_array=array("#CC0000", "#009900", "#000099", "#999900", "#993300", "#330066", "#009999", "#660033");
$chat_background_array=array("#FFCCCC", "#CCFFCC", "#CCCCFF", "#FFFFCC", "#FFCC99", "#CC99FF", "#CCFFFF", "#FF99CC");
}
## GRAB CHAT MESSAGES AND DISPLAY THEM
if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";}
File diff suppressed because one or more lines are too long
+6
View File
@@ -103,6 +103,7 @@
# 161106-2102 - Added agent_script
# 161126-1815 - Fixed several spelling errors
# 161207-1958 - Added Agent DID Stats report entry
# 161222-0843 - Added agent_chat_screen_colors entry
#
@@ -5276,6 +5277,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
<BR>
<B><?php echo _QXZ("Agent Screen Colors"); ?> -</B><?php echo _QXZ("This feature allows you to set different color schemes and logo for the agent screen. These can be defined in the Screen Colors section. Default is default, for the standard blue screen colors"); ?>
<BR>
<A NAME="settings-agent_chat_screen_colors">
<BR>
<B><?php echo _QXZ("Agent Chat Screen Colors"); ?> -</B><?php echo _QXZ("This feature allows you to set the different colors that are used for the users chatting within the internal chat window in the agent screen. These can be defined in the Screen Colors section, and only the five standard and three alternate colors are used. Default is default, for a standard set of eight colors"); ?>
<BR>
<A NAME="settings-label_hide_field_logs">
<BR>