diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index 8fd1e40e..5e1b13ba 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -116,16 +116,48 @@ # 190531-1454 - Upgraded ingroup filter # 190927-1759 - Fixed PHP7 array issue # 191113-2027 - Fixed cached carrier stats bug +# 200401-1930 - Added option to show more customer info for level 9 users and customize the color chart times # -$version = '2.14-101'; -$build = '190927-1759'; +$version = '2.14-102'; +$build = '200401-1930'; header ("Content-type: text/html; charset=utf-8"); require("dbconnect_mysqli.php"); require("functions.php"); + +### CUSTOMIZE TIMES FOR REALTIME DISPLAY ### +$rt_report_times["waiting_short_time"]=30; +$rt_report_times["waiting_medium_time"]=60; +$rt_report_times["waiting_long_time"]=300; +$rt_report_times["incall_short_time"]=10; +$rt_report_times["incall_medium_time"]=60; +$rt_report_times["incall_long_time"]=300; +$rt_report_times["paused_short_time"]=10; +$rt_report_times["paused_medium_time"]=60; +$rt_report_times["paused_long_time"]=300; +$rt_report_times["threeway_short_time"]=10; +$rt_report_times["dead_short_time"]=10; +$rt_report_times["pause_limit"]=20; + +$container_stmt="select container_entry from vicidial_settings_containers where container_id='REALTIME_REPORT_TIMES'"; +$container_rslt=mysql_to_mysqli($container_stmt, $link); +while ($crow=mysqli_fetch_row($container_rslt)) + { + $realtime_times=$crow[0]; + $rt_times=explode("\n", $realtime_times); + for ($q=0; $q", $rt_times[$q]); + $var_name=trim($rt_array[0]); + $var_value=preg_replace('/[^0-9]/', '', trim($rt_array[1])); + $rt_report_times["$var_name"]=$var_value; + } + } +###### END CUSTOM REALTIMES SECTION ######## + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -167,6 +199,8 @@ if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} +if (isset($_GET["CUSTINFOdisplay"])) {$CUSTINFOdisplay=$_GET["CUSTINFOdisplay"];} + elseif (isset($_POST["CUSTINFOdisplay"])) {$CUSTINFOdisplay=$_POST["CUSTINFOdisplay"];} if (isset($_GET["NOLEADSalert"])) {$NOLEADSalert=$_GET["NOLEADSalert"];} elseif (isset($_POST["NOLEADSalert"])) {$NOLEADSalert=$_POST["NOLEADSalert"];} if (isset($_GET["DROPINGROUPstats"])) {$DROPINGROUPstats=$_GET["DROPINGROUPstats"];} @@ -265,6 +299,9 @@ if (!isset($SERVdisplay)) {$SERVdisplay=0;} # 0=no, 1=yes if (!isset($CALLSdisplay)) {$CALLSdisplay=1;} # 0=no, 1=yes if (!isset($PHONEdisplay)) {$PHONEdisplay=0;} # 0=no, 1=yes if (!isset($CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} # 0=no, 1=yes +if (!isset($CUSTINFOdisplay)) {$CUSTINFOdisplay=0;} # 0=no, 1=yes +if ($CUSTINFOdisplay==1) {$CUSTPHONEdisplay=0;} # only one of these should be on at one time +if ($CUSTPHONEdisplay==1) {$CUSTINFOdisplay=0;} # only one of these should be on at one time if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { @@ -1000,10 +1037,6 @@ else document.getElementById(divvar).innerHTML = open_list; document.getElementById(divvar).style.left = 160; } - function closeAlert(divvar) - { - document.getElementById(divvar).innerHTML = ''; - } // function to launch monitoring calls function send_monitor(session_id,server_ip,stage) @@ -1252,7 +1285,7 @@ else \n"; - echo"\n"; + echo"\n"; echo "$report_name: $group\n"; $short_header=1; @@ -1288,6 +1321,7 @@ if ($RTajax < 1) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -1305,9 +1339,9 @@ if ($RTajax < 1) echo "\n"; echo "   "; echo "\n"; - echo ""._QXZ("STOP")." | "; - echo ""._QXZ("SLOW")." | "; - echo ""._QXZ("GO").""; + echo ""._QXZ("STOP")." | "; + echo ""._QXZ("SLOW")." | "; + echo ""._QXZ("GO").""; if (preg_match('/ALL\-ACTIVE/i',$group_string)) { echo "       "._QXZ("MODIFY")." | \n"; @@ -2170,61 +2204,72 @@ if ( ($report_display_type!='WALL_1') and ($report_display_type!='WALL_2') and ( { if ($adastats<2) { - echo "+ "._QXZ("VIEW MORE").""; + echo "+ "._QXZ("VIEW MORE").""; } else { - echo "- "._QXZ("VIEW LESS").""; + echo "- "._QXZ("VIEW LESS").""; } } if ($UGdisplay>0) { - echo "       "._QXZ("HIDE USER GROUP").""; + echo "       "._QXZ("HIDE USER GROUP").""; } else { - echo "       "._QXZ("VIEW USER GROUP").""; + echo "       "._QXZ("VIEW USER GROUP").""; } if ($SERVdisplay>0) { - echo "       "._QXZ("HIDE SERVER INFO").""; + echo "       "._QXZ("HIDE SERVER INFO").""; } else { - echo "       "._QXZ("SHOW SERVER INFO").""; + echo "       "._QXZ("SHOW SERVER INFO").""; } if ($CALLSdisplay>0) { - echo "       "._QXZ("HIDE WAITING CALLS").""; + echo "       "._QXZ("HIDE WAITING CALLS").""; } else { - echo "       "._QXZ("SHOW WAITING CALLS").""; + echo "       "._QXZ("SHOW WAITING CALLS").""; } if ($ALLINGROUPstats>0) { - echo "       "._QXZ("HIDE IN-GROUP STATS").""; + echo "       "._QXZ("HIDE IN-GROUP STATS").""; } else { - echo "       "._QXZ("SHOW IN-GROUP STATS").""; + echo "       "._QXZ("SHOW IN-GROUP STATS").""; } if ($PHONEdisplay>0) { - echo "       "._QXZ("HIDE PHONES").""; + echo "       "._QXZ("HIDE PHONES").""; } else { - echo "       "._QXZ("SHOW PHONES").""; + echo "       "._QXZ("SHOW PHONES").""; } if ($CUSTPHONEdisplay>0) { - echo "       "._QXZ("HIDE CUSTPHONES").""; + echo "       "._QXZ("HIDE CUSTPHONES").""; } else { - echo "       "._QXZ("SHOW CUSTPHONES").""; + echo "       "._QXZ("SHOW CUSTPHONES").""; + } + if ($LOGuser_level>=9) + { + if ($CUSTINFOdisplay>0) + { + echo "       "._QXZ("HIDE FULL CUST INFO").""; + } + else + { + echo "       "._QXZ("SHOW FULL CUST INFO").""; + } } } @@ -2786,12 +2831,12 @@ if ($report_display_type=='TEXT') $HDstation = "----------------+"; $HTstation = " "._QXZ("STATION", 14)." |"; $HDphone = "-------------------+"; - $HTphone = " "._QXZ("PHONE",11)." |"; + $HTphone = " "._QXZ("PHONE",11)." |"; if ($RTajax > 0) {$HTphone = " "._QXZ("PHONE",11)." |";} $HDuser = "------------------------+"; - $HTuser = " "._QXZ("USER",5)." "; + $HTuser = " "._QXZ("USER",5)." "; if ($RTajax > 0) {$HTuser = " "._QXZ("USER",5)." ";} if ($UidORname>0) @@ -2800,7 +2845,7 @@ if ($report_display_type=='TEXT') {$HTuser .= ""._QXZ("SHOW ID",8)." ";} else { - $HTuser .= ""._QXZ("SHOW ID",8)." "; + $HTuser .= ""._QXZ("SHOW ID",8)." "; } } else @@ -2809,13 +2854,13 @@ if ($report_display_type=='TEXT') {$HTuser .= ""._QXZ("SHOW NAME",9)."";} else { - $HTuser .= ""._QXZ("SHOW NAME",9).""; + $HTuser .= ""._QXZ("SHOW NAME",9).""; } } $HTuser .= " "._QXZ("INFO",6)." |"; $HDusergroup = "--------------+"; - $HTusergroup = " "._QXZ("USER GROUP",12)." |"; + $HTusergroup = " "._QXZ("USER GROUP",12)." |"; if ($RTajax > 0) {$HTusergroup = " "._QXZ("USER GROUP",12)." |";} $HDsessionid = "-----------+"; @@ -2830,16 +2875,18 @@ if ($report_display_type=='TEXT') $HTstatus = " "._QXZ("STATUS",8)." |"; $HDcustphone = "-------------+"; $HTcustphone = " "._QXZ("CUST PHONE",11)." |"; + $HDcustinfo = "-------------+----------------------+---------------------+-------+"; + $HTcustinfo = " "._QXZ("CUST PHONE",11)." | "._QXZ("SOURCE ID",20)." | "._QXZ("ENTRY DATE",19)." | "._QXZ("STATE",5)." |"; $HDserver_ip = "-----------------+"; $HTserver_ip = " "._QXZ("SERVER IP",15)." |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " "._QXZ("CALL SERVER IP",15)." |"; $HDtime = "---------+"; - $HTtime = " MM:SS |"; + $HTtime = " MM:SS |"; if ($RTajax > 0) {$HTtime = " MM:SS |";} $HDcampaign = "------------+"; - $HTcampaign = " "._QXZ("CAMPAIGN",10)." |"; + $HTcampaign = " "._QXZ("CAMPAIGN",10)." |"; if ($RTajax > 0) {$HTcampaign = " "._QXZ("CAMPAIGN",10)." |";} $HDcalls = "-------+"; @@ -2871,12 +2918,12 @@ if ($report_display_type=='HTML') $HDstation = ""; $HTstation = "  "._QXZ("STATION")." "; $HDphone = ""; - $HTphone = " "._QXZ("PHONE")." "; + $HTphone = " "._QXZ("PHONE")." "; if ($RTajax > 0) {$HTphone = " "._QXZ("PHONE")." ";} $HDuser = ""; - $HTuser = " "._QXZ("USER")." "; + $HTuser = " "._QXZ("USER")." "; if ($RTajax > 0) {$HTuser = "   "._QXZ("USER")." ";} if ($UidORname>0) @@ -2885,7 +2932,7 @@ if ($report_display_type=='HTML') {$HTuser .= " "._QXZ("SHOW ID")." ";} else { - $HTuser .= " "._QXZ("SHOW ID")." "; + $HTuser .= " "._QXZ("SHOW ID")." "; } } else @@ -2894,13 +2941,13 @@ if ($report_display_type=='HTML') {$HTuser .= " "._QXZ("SHOW NAME")." ";} else { - $HTuser .= "  "._QXZ("SHOW NAME")." "; + $HTuser .= "  "._QXZ("SHOW NAME")." "; } } $HTuser .= " "._QXZ("INFO",6)." "; $HDusergroup = ""; - $HTusergroup = " "._QXZ("USER GROUP")." "; + $HTusergroup = " "._QXZ("USER GROUP")." "; if ($RTajax > 0) {$HTusergroup = " "._QXZ("USER GROUP")." ";} $HDsessionid = ""; @@ -2915,16 +2962,18 @@ if ($report_display_type=='HTML') $HTstatus = "  "._QXZ("STATUS")."  "; $HDcustphone = ""; $HTcustphone = "  "._QXZ("CUST PHONE")." "; + $HDcustinfo = ""; + $HTcustinfo = "  "._QXZ("CUST PHONE")."   "._QXZ("SOURCE ID")."   "._QXZ("ENTRY DATE")."   "._QXZ("STATE")." "; $HDserver_ip = ""; $HTserver_ip = "  "._QXZ("SERVER IP")." "; $HDcall_server_ip = ""; $HTcall_server_ip = "  "._QXZ("CALL SERVER IP")." "; $HDtime = ""; - $HTtime = " MM:SS "; + $HTtime = " MM:SS "; if ($RTajax > 0) {$HTtime = " MM:SS ";} $HDcampaign = ""; - $HTcampaign = " "._QXZ("CAMPAIGN")." "; + $HTcampaign = " "._QXZ("CAMPAIGN")." "; if ($RTajax > 0) {$HTcampaign = " "._QXZ("CAMPAIGN",10)." ";} $HDcalls = ""; @@ -2960,6 +3009,11 @@ if ($CUSTPHONEdisplay < 1) $HDcustphone = ''; $HTcustphone = ''; } +if ($CUSTINFOdisplay < 1) + { + $HDcustinfo = ''; + $HTcustinfo = ''; + } if ($UGdisplay < 1) { $HDusergroup = ''; @@ -2991,13 +3045,13 @@ if ($SERVdisplay < 1) if ($realtime_block_user_info > 0) { - $Aline = "$HDbegin$HDusergroup$HDsessionid$HDlisten$HDbarge$HDwhisper$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; - $Bline = "$HTbegin$HTusergroup$HTsessionid$HDlisten$HTbarge$HTwhisper$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDlisten$HDbarge$HDwhisper$HDstatus$HDpause$HDcustphone$HDcustinfo$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HDlisten$HTbarge$HTwhisper$HTstatus$HTpause$HTcustphone$HTcustinfo$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; } else { - $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDlisten$HDbarge$HDwhisper$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; - $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTlisten$HTbarge$HTwhisper$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDlisten$HDbarge$HDwhisper$HDstatus$HDpause$HDcustphone$HDcustinfo$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTlisten$HTbarge$HTwhisper$HTstatus$HTpause$HTcustphone$HTcustinfo$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; } $Aecho .= "$Aline"; $Aecho .= "$Bline"; @@ -3265,9 +3319,22 @@ if ($talking_to_print > 0) while(mb_strlen($extension, 'utf-8')>14) {$extension = mb_substr("$extension", 0, -1,'UTF8');} } } + + if ($CUSTINFOdisplay>0 && $Alead_id[$j]>0) + { + $custinfo_stmt="select * from vicidial_list where lead_id='".$Alead_id[$j]."' and phone_number='".$custphone."'"; + $custinfo_rslt=mysql_to_mysqli($custinfo_stmt, $link); + $CIrow=mysqli_fetch_array($custinfo_rslt); + $cust_state=$CIrow["state"]; + $cust_entrydate=$CIrow["entry_date"]; + $cust_source=substr($CIrow["source_id"], 0, 20); + } $phone = sprintf("%-18s", $phone_split[0]); $custphone = sprintf("%-11s", $custphone); + $cust_state = sprintf("%-5s", $cust_state); + $cust_entrydate = sprintf("%-19s", $cust_entrydate); + $cust_source = sprintf("%-20s", $cust_source); $Luser = $Auser[$i]; $user = sprintf("%-20s", $Auser[$i]); $Lsessionid = $Asessionid[$i]; @@ -3430,15 +3497,15 @@ if ($talking_to_print > 0) else if ($comments == 'EMAIL') {$G=''; $EG=''; $status='EMAIL'; $tr_class='TRorange';} else { - if ($call_time_S >= 10) {$G=''; $EG=''; $tr_class='TRthistle';} - if ($call_time_S >= 60) {$G=''; $EG=''; $tr_class='TRviolet';} - if ($call_time_S >= 300) {$G=''; $EG=''; $tr_class='TRpurple';} + if ($call_time_S >= $rt_report_times["incall_short_time"]) {$G=''; $EG=''; $tr_class='TRthistle';} + if ($call_time_S >= $rt_report_times["incall_medium_time"]) {$G=''; $EG=''; $tr_class='TRviolet';} + if ($call_time_S >= $rt_report_times["incall_long_time"]) {$G=''; $EG=''; $tr_class='TRpurple';} # if ($call_time_S >= 600) {$G=''; $EG=''; $tr_class='TRpurple';} } } if ($Lstatus=='3-WAY') { - if ($call_time_S >= 10) {$G=''; $EG=''; $tr_class='TRlime';} + if ($call_time_S >= $rt_report_times["threeway_short_time"]) {$G=''; $EG=''; $tr_class='TRlime';} } if ($Lstatus=='DEAD') { @@ -3448,7 +3515,7 @@ if ($talking_to_print > 0) { $agent_dead++; $agent_total++; $G = ''; $EG = ''; $tr_class='TRblank'; - if ($call_time_S >= 10) {$G=''; $EG=''; $tr_class='TRblack';} + if ($call_time_S >= $rt_report_times["dead_short_time"]) {$G=''; $EG=''; $tr_class='TRblack';} } } if ($Lstatus=='DISPO') @@ -3459,9 +3526,10 @@ if ($talking_to_print > 0) { $agent_dispo++; $agent_total++; $G = ''; $EG = ''; $tr_class='TRblank'; - if ($call_time_S >= 10) {$G=''; $EG=''; $tr_class='TRkhaki';} - if ($call_time_S >= 60) {$G=''; $EG=''; $tr_class='TRyellow';} - if ($call_time_S >= 300) {$G=''; $EG=''; $tr_class='TRolive';} + if ($call_time_S >= $rt_report_times["paused_short_time"]) {$G=''; $EG=''; $tr_class='TRkhaki';} + if ($call_time_S >= $rt_report_times["paused_medium_time"]) {$G=''; $EG=''; $tr_class='TRyellow';} + if ($call_time_S >= $rt_report_times["paused_long_time"]) {$G=''; $EG=''; $tr_class='TRolive';} + if ($call_time_S >= $rt_report_times["pause_limit"]) {$G=''; $EG=''; $tr_class='TRdarkred';} } } if ($Lstatus=='PAUSED') @@ -3485,7 +3553,7 @@ if ($talking_to_print > 0) } else { - $pause_limit="999999"; + $pause_limit=$rt_report_times["pause_limit"]; } } else @@ -3500,9 +3568,9 @@ if ($talking_to_print > 0) { $agent_paused++; $agent_total++; $G = ''; $EG = ''; $tr_class='TRblank'; - if ($call_time_S >= 10) {$G=''; $EG=''; $tr_class='TRkhaki';} - if ($call_time_S >= 60) {$G=''; $EG=''; $tr_class='TRyellow';} - if ($call_time_S >= 300) {$G=''; $EG=''; $tr_class='TRolive';} + if ($call_time_S >= $rt_report_times["paused_short_time"]) {$G=''; $EG=''; $tr_class='TRkhaki';} + if ($call_time_S >= $rt_report_times["paused_medium_time"]) {$G=''; $EG=''; $tr_class='TRyellow';} + if ($call_time_S >= $rt_report_times["paused_long_time"]) {$G=''; $EG=''; $tr_class='TRolive';} if ($call_time_S >= $pause_limit) {$G=''; $EG=''; $tr_class='TRdarkred';} } } @@ -3517,15 +3585,15 @@ if ($talking_to_print > 0) if ($RS_agentWAIT == 4) { $G=''; $EG=''; $tr_class='TRlightblue'; - if ($call_time_S >= 30) {$G=''; $EG=''; $tr_class='TRrust';} - if ($call_time_S >= 60) {$G=''; $EG=''; $tr_class='TRblue';} - if ($call_time_S >= 300) {$G=''; $EG=''; $tr_class='TRmidnightblue';} + if ($call_time_S >= $rt_report_times["waiting_short_time"]) {$G=''; $EG=''; $tr_class='TRrust';} + if ($call_time_S >= $rt_report_times["waiting_medium_time"]) {$G=''; $EG=''; $tr_class='TRblue';} + if ($call_time_S >= $rt_report_times["waiting_long_time"]) {$G=''; $EG=''; $tr_class='TRmidnightblue';} } else { $G=''; $EG=''; $tr_class='TRlightblue'; - if ($call_time_S >= 60) {$G=''; $EG=''; $tr_class='TRblue';} - if ($call_time_S >= 300) {$G=''; $EG=''; $tr_class='TRmidnightblue';} + if ($call_time_S >= $rt_report_times["waiting_medium_time"]) {$G=''; $EG=''; $tr_class='TRblue';} + if ($call_time_S >= $rt_report_times["waiting_long_time"]) {$G=''; $EG=''; $tr_class='TRmidnightblue';} } } @@ -3558,6 +3626,9 @@ if ($talking_to_print > 0) if ($CUSTPHONEdisplay > 0) {$CP = " $G$custphone$EG |";} else {$CP = "";} + if ($CUSTINFOdisplay > 0) {$CI = " $G$custphone$EG | $G$cust_source$EG | $G$cust_entrydate$EG | $G$cust_state$EG |";} + else {$CI = "";} + if ($UGdisplay > 0) {$UGD = " $G$user_group$EG |";} else {$UGD = "";} @@ -3603,11 +3674,11 @@ if ($talking_to_print > 0) { if ($realtime_block_user_info > 0) { - $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G"._QXZ("$status",6)."$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "|$UGD $G$sessionid$EG$L$R$Aring_note[$i]| $G"._QXZ("$status",6)."$EG $CM $pausecode|$CP$CI$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; } if ($realtime_block_user_info < 1) { - $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G"._QXZ("$status",6)."$EG $CM $pausecode|$CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + $Aecho .= "| $G$extension$EG$Aring_note[$i]|$phoneD$G$user$EG + |$UGD $G$sessionid$EG$L$R | $G"._QXZ("$status",6)."$EG $CM $pausecode|$CP$CI$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; } } @@ -3631,6 +3702,9 @@ if ($talking_to_print > 0) if ($CUSTPHONEdisplay > 0) {$CP = " $G$custphone$EG ";} else {$CP = "";} + if ($CUSTINFOdisplay > 0) {$CI = " $G$custphone$EG $G$cust_source$EG $G$cust_entrydate$EG $G$cust_state$EG ";} + else {$CI = "";} + if ($UGdisplay > 0) {$UGD = " $G$user_group$EG ";} else {$UGD = "";} @@ -3679,11 +3753,11 @@ if ($talking_to_print > 0) { if ($realtime_block_user_info > 0) { - $Aecho .= "$UGD $G$sessionid$EG$L$R$Aring_note[$i] $G"._QXZ("$status",6)."$EG$CM$pausecodeHTML$CP$SVD$G$call_time_MS$EG $G$campaign_id$EG $G$calls_today$EG $INGRP\n"; + $Aecho .= "$UGD $G$sessionid$EG$L$R$Aring_note[$i] $G"._QXZ("$status",6)."$EG$CM$pausecodeHTML$CP$CI$SVD$G$call_time_MS$EG $G$campaign_id$EG $G$calls_today$EG $INGRP\n"; } if ($realtime_block_user_info < 1) { - $Aecho .= " $G$extension$EG$Aring_note[$i]$phoneD$G$user$EG $G+$EG $UGD $G$sessionid$EG$L$R $G"._QXZ("$status",6)."$EG$CM$pausecodeHTML$CP$SVD$G$call_time_MS$EG $G$campaign_id$EG $G$calls_today$EG $INGRP\n"; + $Aecho .= " $G$extension$EG$Aring_note[$i]$phoneD$G$user$EG $G+$EG $UGD $G$sessionid$EG$L$R $G"._QXZ("$status",6)."$EG$CM$pausecodeHTML$CP$CI$SVD$G$call_time_MS$EG $G$campaign_id$EG $G$calls_today$EG $INGRP\n"; } } } @@ -3702,23 +3776,23 @@ if ($talking_to_print > 0) if ($RS_agentWAIT == 4) { $Aecho .= " - "._QXZ("Agent waiting for call")."\n"; - $Aecho .= " - "._QXZ("Agent waiting for call > 30 seconds")."\n"; - $Aecho .= " - "._QXZ("Agent waiting for call > 1 minute")."\n"; - $Aecho .= " - "._QXZ("Agent waiting for call > 5 minutes")."\n"; + $Aecho .= " - "._QXZ("Agent waiting for call")."> ".TimeToText($rt_report_times["waiting_short_time"])."\n"; + $Aecho .= " - "._QXZ("Agent waiting for call")." > ".TimeToText($rt_report_times["waiting_medium_time"])."\n"; + $Aecho .= " - "._QXZ("Agent waiting for call")." > ".TimeToText($rt_report_times["waiting_long_time"])."\n"; } else { $Aecho .= " - "._QXZ("Agent waiting for call")."\n"; - $Aecho .= " - "._QXZ("Agent waiting for call > 1 minute")."\n"; - $Aecho .= " - "._QXZ("Agent waiting for call > 5 minutes")."\n"; + $Aecho .= " - "._QXZ("Agent waiting for call")." > ".TimeToText($rt_report_times["waiting_medium_time"])."\n"; + $Aecho .= " - "._QXZ("Agent waiting for call")." > ".TimeToText($rt_report_times["waiting_long_time"])."\n"; } - $Aecho .= " - "._QXZ("Agent on call > 10 seconds")."\n"; - $Aecho .= " - "._QXZ("Agent on call > 1 minute")."\n"; - $Aecho .= " - "._QXZ("Agent on call > 5 minutes")."\n"; - $Aecho .= " - "._QXZ("Agent Paused > 10 seconds")."\n"; - $Aecho .= " - "._QXZ("Agent Paused > 1 minute")."\n"; - $Aecho .= " - "._QXZ("Agent Paused > 5 minutes")."\n"; - $Aecho .= " - "._QXZ("Agent in 3-WAY > 10 seconds")."\n"; + $Aecho .= " - "._QXZ("Agent on call")." > ".TimeToText($rt_report_times["incall_short_time"])."\n"; + $Aecho .= " - "._QXZ("Agent on call")." > ".TimeToText($rt_report_times["incall_medium_time"])."\n"; + $Aecho .= " - "._QXZ("Agent on call")." > ".TimeToText($rt_report_times["incall_long_time"])."\n"; + $Aecho .= " - "._QXZ("Agent Paused")." > ".TimeToText($rt_report_times["paused_short_time"])."\n"; + $Aecho .= " - "._QXZ("Agent Paused")." > ".TimeToText($rt_report_times["paused_medium_time"])."\n"; + $Aecho .= " - "._QXZ("Agent Paused")." > ".TimeToText($rt_report_times["paused_long_time"])."\n"; + $Aecho .= " - "._QXZ("Agent in 3-WAY")." > ".TimeToText($rt_report_times["threeway_short_time"])."\n"; $Aecho .= " - "._QXZ("Agent on a dead call")."\n"; if ($SSenable_pause_code_limits > 0) { @@ -3772,8 +3846,6 @@ if ( ($report_display_type!='HTML') and ($report_display_type!='WALL_2') and ($r echo ""; } - - ##### BEGIN HTML output for agents summary ##### if ( ($report_display_type=='HTML') or ($report_display_type=='WALL_2') ) { diff --git a/www/vicidial/AST_timeonVDADall_mobile.php b/www/vicidial/AST_timeonVDADall_mobile.php index 8597340f..76753669 100644 --- a/www/vicidial/AST_timeonVDADall_mobile.php +++ b/www/vicidial/AST_timeonVDADall_mobile.php @@ -898,10 +898,6 @@ else document.getElementById(divvar).innerHTML = open_list; document.getElementById(divvar).style.left = 160; } - function closeAlert(divvar) - { - document.getElementById(divvar).innerHTML = ''; - } // function to launch monitoring calls function send_monitor(session_id,server_ip,stage) diff --git a/www/vicidial/functions.php b/www/vicidial/functions.php index e28db831..be98eca5 100644 --- a/www/vicidial/functions.php +++ b/www/vicidial/functions.php @@ -4,7 +4,7 @@ # # functions for administrative scripts and reports # -# Copyright (C) 2019 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # # CHANGES: @@ -34,6 +34,7 @@ # 170930-0852 - Added code for custom reports variable display # 180508-2215 - Added new help display # 191013-0901 - Fixes for PHP7 +# 200401-1920 - Added TimeToText function to convert integers to strings # ##### BEGIN validate user login credentials, check for failed lock out ##### @@ -1461,6 +1462,31 @@ function ConvertPresets($URL_string) return $URL_string; } +function TimeToText($interval) + { + $interval=preg_replace('/[^0-9]/', '', $interval); + $interval+=0; + if ($interval==0) + { + return "0 "._QXZ("seconds"); + } + $return_str=""; + + $minutes=floor($interval/60); + $seconds=floor($interval%60); + if ($minutes>0) + { + if ($minutes==1) {$return_str.="$minutes "._QXZ("minute").", ";} + else {$return_str.="$minutes "._QXZ("minutes").", ";} + } + if ($seconds>0) + { + if ($seconds==1) {$return_str.="$seconds "._QXZ("second");} + else {$return_str.="$seconds "._QXZ("seconds");} + } + $return_str=preg_replace('/, $/', $return_str); + return $return_str; + } function createDateRangeArray($strDateFrom,$strDateTo) { $aryRange=array(); diff --git a/www/vicidial/realtime_report.php b/www/vicidial/realtime_report.php index cd3bc7c4..8c53e591 100644 --- a/www/vicidial/realtime_report.php +++ b/www/vicidial/realtime_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -47,12 +47,13 @@ # 190513-1711 - Added ingroup filter # 190525-2205 - Added rust color definition # 190927-1758 - Fixed PHP7 array issue +# 200401-1930 - Added option to show more customer info to level 9 users # $startMS = microtime(); -$version = '2.14-34'; -$build = '190927-1758'; +$version = '2.14-35'; +$build = '200401-1930'; header ("Content-type: text/html; charset=utf-8"); @@ -104,6 +105,8 @@ if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} +if (isset($_GET["CUSTINFOdisplay"])) {$CUSTINFOdisplay=$_GET["CUSTINFOdisplay"];} + elseif (isset($_POST["CUSTINFOdisplay"])) {$CUSTINFOdisplay=$_POST["CUSTINFOdisplay"];} if (isset($_GET["NOLEADSalert"])) {$NOLEADSalert=$_GET["NOLEADSalert"];} elseif (isset($_POST["NOLEADSalert"])) {$NOLEADSalert=$_POST["NOLEADSalert"];} if (isset($_GET["DROPINGROUPstats"])) {$DROPINGROUPstats=$_GET["DROPINGROUPstats"];} @@ -226,6 +229,11 @@ if (!isset($CUSTPHONEdisplay)) if (!isset($RS_CUSTPHONEdisplay)) {$CUSTPHONEdisplay=0;} else {$CUSTPHONEdisplay = $RS_CUSTPHONEdisplay;} } +if (!isset($CUSTINFOdisplay)) + { + if (!isset($RS_CUSTINFOdisplay)) {$CUSTINFOdisplay=0;} + else {$CUSTINFOdisplay = $RS_CUSTINFOdisplay;} + } if (!isset($PAUSEcodes)) { if (!isset($RS_PAUSEcodes)) {$PAUSEcodes='N';} @@ -314,6 +322,9 @@ $SERVdisplay = preg_replace('/[^-_0-9a-zA-Z]/', '', $SERVdisplay); $CALLSdisplay = preg_replace('/[^-_0-9a-zA-Z]/', '', $CALLSdisplay); $PHONEdisplay = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHONEdisplay); $CUSTPHONEdisplay = preg_replace('/[^-_0-9a-zA-Z]/', '', $CUSTPHONEdisplay); +$CUSTINFOdisplay = preg_replace('/[^-_0-9a-zA-Z]/', '', $CUSTINFOdisplay); +if ($CUSTINFOdisplay==1) {$CUSTPHONEdisplay=0;} # only one of these should be on at one time +if ($CUSTPHONEdisplay==1) {$CUSTINFOdisplay=0;} # only one of these should be on at one time $NOLEADSalert = preg_replace('/[^-_0-9a-zA-Z]/', '', $NOLEADSalert); $DROPINGROUPstats = preg_replace('/[^-_0-9a-zA-Z]/', '', $DROPINGROUPstats); $ALLINGROUPstats = preg_replace('/[^-_0-9a-zA-Z]/', '', $ALLINGROUPstats); @@ -1199,6 +1210,7 @@ var SERVdisplay = ''; var CALLSdisplay = ''; var PHONEdisplay = ''; var CUSTPHONEdisplay = ''; +var CUSTINFOdisplay = ''; var with_inbound = ''; var monitor_active = ''; var monitor_phone = ''; @@ -1239,6 +1251,10 @@ function hideDiv(divvar) } } } +function closeAlert(divvar) + { + document.getElementById(divvar).innerHTML = ''; + } function ShowWebphone(divvis) { @@ -1496,7 +1512,7 @@ function gather_realtime_content() } if (xmlhttp) { - RTupdate_query = "RTajax=1&DB=" + DB + "" + groupQS + usergroupQS + ingroupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "&UGdisplay=" + UGdisplay + "&UidORname=" + UidORname + "&orderby=" + orderby + "&SERVdisplay=" + SERVdisplay + "&CALLSdisplay=" + CALLSdisplay + "&PHONEdisplay=" + PHONEdisplay + "&CUSTPHONEdisplay=" + CUSTPHONEdisplay + "&with_inbound=" + with_inbound + "&monitor_active=" + monitor_active + "&monitor_phone=" + monitor_phone + "&ALLINGROUPstats=" + ALLINGROUPstats + "&DROPINGROUPstats=" + DROPINGROUPstats + "&NOLEADSalert=" + NOLEADSalert + "&CARRIERstats=" + CARRIERstats + "&PRESETstats=" + PRESETstats + "&AGENTtimeSTATS=" + AGENTtimeSTATS + "&INGROUPcolorOVERRIDE=" + INGROUPcolorOVERRIDE + "&droppedOFtotal=" + droppedOFtotal + "&report_display_type=" + report_display_type + ""; + RTupdate_query = "RTajax=1&DB=" + DB + "" + groupQS + usergroupQS + ingroupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "&UGdisplay=" + UGdisplay + "&UidORname=" + UidORname + "&orderby=" + orderby + "&SERVdisplay=" + SERVdisplay + "&CALLSdisplay=" + CALLSdisplay + "&PHONEdisplay=" + PHONEdisplay + "&CUSTPHONEdisplay=" + CUSTPHONEdisplay + "&CUSTINFOdisplay=" + CUSTINFOdisplay + "&with_inbound=" + with_inbound + "&monitor_active=" + monitor_active + "&monitor_phone=" + monitor_phone + "&ALLINGROUPstats=" + ALLINGROUPstats + "&DROPINGROUPstats=" + DROPINGROUPstats + "&NOLEADSalert=" + NOLEADSalert + "&CARRIERstats=" + CARRIERstats + "&PRESETstats=" + PRESETstats + "&AGENTtimeSTATS=" + AGENTtimeSTATS + "&INGROUPcolorOVERRIDE=" + INGROUPcolorOVERRIDE + "&droppedOFtotal=" + droppedOFtotal + "&report_display_type=" + report_display_type + ""; xmlhttp.open('POST', 'AST_timeonVDADall.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); @@ -1588,8 +1604,33 @@ function update_variables(task_option,task_choice,force_reload) } if (task_option == 'CUSTPHONEdisplay') { - if (CUSTPHONEdisplay == '1') {CUSTPHONEdisplay='0'; document.getElementById("CUSTPHONEdisplayTXT").innerHTML = "";} - else {CUSTPHONEdisplay='1'; document.getElementById("CUSTPHONEdisplayTXT").innerHTML = "";} + if (CUSTPHONEdisplay == '1') + { + CUSTPHONEdisplay='0'; + document.getElementById("CUSTPHONEdisplayTXT").innerHTML = ""; + } + else + { + CUSTPHONEdisplay='1'; + document.getElementById("CUSTPHONEdisplayTXT").innerHTML = ""; + CUSTINFOdisplay='0'; + document.getElementById("CUSTINFOdisplayTXT").innerHTML = ""; + } + } + if (task_option == 'CUSTINFOdisplay') + { + if (CUSTINFOdisplay == '1') + { + CUSTINFOdisplay='0'; + document.getElementById("CUSTINFOdisplayTXT").innerHTML = ""; + } + else + { + CUSTINFOdisplay='1'; + document.getElementById("CUSTINFOdisplayTXT").innerHTML = ""; + CUSTPHONEdisplay='0'; + document.getElementById("CUSTPHONEdisplayTXT").innerHTML = ""; + } } if (task_option == 'ALLINGROUPstats') { @@ -1928,6 +1969,14 @@ if (!preg_match("/WALL/",$report_display_type)) {echo "       "._QXZ("HIDE CUSTPHONES")."";} else {echo "       "._QXZ("SHOW CUSTPHONES")."";} + + if ($LOGuser_level >= 9) + { + if ($CUSTINFOdisplay>0) + {echo "       "._QXZ("HIDE CUST INFO")."";} + else + {echo "       "._QXZ("SHOW CUST INFO")."";} + } } #echo ""; diff --git a/www/vicidial/realtime_report_mobile.php b/www/vicidial/realtime_report_mobile.php index d5207231..5eb1e9a0 100644 --- a/www/vicidial/realtime_report_mobile.php +++ b/www/vicidial/realtime_report_mobile.php @@ -907,6 +907,9 @@ if (strlen($monitor_phone)>1) $outbound_cid = $row[11]; $webphone_auto_answer = $row[12]; + ## Important - don't want this on mobile + $is_webphone='N'; + if ($is_webphone == 'Y') { ### build Iframe variable content for webphone here @@ -1090,6 +1093,10 @@ function hideDiv(divvar) } } } +function closeAlert(divvar) + { + document.getElementById(divvar).innerHTML = ''; + } function ShowWebphone(divvis) { @@ -1720,6 +1727,7 @@ echo ""; echo "$webphone_content\n$webphone_clpos\n"; echo "\n"; echo "\n"; + echo "\n"; echo "   "; echo "\n";