diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php index 5e1b13ba..79992f6f 100644 --- a/www/vicidial/AST_timeonVDADall.php +++ b/www/vicidial/AST_timeonVDADall.php @@ -117,10 +117,11 @@ # 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 -# +# 200428-1337 - Added RS_INcolumnsHIDE, RS_report_default_format & RS_AGENTstatusTALLY options.php settings +# -$version = '2.14-102'; -$build = '200401-1930'; +$version = '2.14-103'; +$build = '200428-1337'; header ("Content-type: text/html; charset=utf-8"); @@ -244,7 +245,7 @@ $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled,allow_chats,cache_carrier_stats_realtime,report_default_format,ofcom_uk_drop_calc,enable_pause_code_limits FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,agent_whisper_enabled,allow_chats,cache_carrier_stats_realtime,report_default_format,ofcom_uk_drop_calc,enable_pause_code_limits,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -263,11 +264,10 @@ if ($qm_conf_ct > 0) $SSreport_default_format = $row[9]; $SSofcom_uk_drop_calc = $row[10]; $SSenable_pause_code_limits = $row[11]; + $SStimeclock_end_of_day = $row[12]; } ##### END SETTINGS LOOKUP ##### ########################################### -if (strlen($report_display_type)<2) {$report_display_type = $SSreport_default_format;} - if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) { mysqli_close($link); @@ -279,12 +279,16 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_ $RS_ListenBarge = 'MONITOR|BARGE|WHISPER'; $RS_agentWAIT = 3; +$RS_INcolumnsHIDE = 0; if (file_exists('options.php')) { require('options.php'); } +if (strlen($RS_report_default_format) > 3) {$SSreport_default_format = $RS_report_default_format;} +if (strlen($report_display_type)<2) {$report_display_type = $SSreport_default_format;} + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} if (!isset($group)) {$group='ALL-ACTIVE';} @@ -2895,7 +2899,18 @@ if ($report_display_type=='TEXT') $HTpause = ''; $HDigcall = "------+------------------"; $HTigcall = " "._QXZ("HOLD",4)." | "._QXZ("IN-GROUP",8)." "; - + if ($RS_INcolumnsHIDE > 0) + { + $HDigcall = ''; + $HTigcall = ''; + } + $HDastcall = ''; + $HTastcall = ''; + if (strlen($RS_AGENTstatusTALLY) > 0) + { + $HDastcall = '--------+'; + $HTastcall = " "._QXZ("$RS_AGENTstatusTALLY",6)." |"; + } if ($agent_pause_codes_active > 0) { $HDstatus = "----------"; @@ -2981,8 +2996,19 @@ if ($report_display_type=='HTML') $HDpause = ''; $HTpause = ''; $HDigcall = ""; - $HTigcall = "  "._QXZ("HOLD")."   "._QXZ("IN-GROUP",8)." "; - + $HTigcall = "  "._QXZ("HOLD")."   "._QXZ("IN-GROUP",8)." "; + if ($RS_INcolumnsHIDE > 0) + { + $HDigcall = ''; + $HTigcall = ''; + } + $HDastcall = ''; + $HTastcall = ''; + if (strlen($RS_AGENTstatusTALLY) > 0) + { + $HDastcall = ''; + $HTastcall = "  "._QXZ("$RS_AGENTstatusTALLY",6)." "; + } if ($agent_pause_codes_active > 0) { $HDstatus = ""; @@ -3045,13 +3071,13 @@ if ($SERVdisplay < 1) if ($realtime_block_user_info > 0) { - $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"; + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDlisten$HDbarge$HDwhisper$HDstatus$HDpause$HDcustphone$HDcustinfo$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcallsHDastcall$HDigcall$\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HDlisten$HTbarge$HTwhisper$HTstatus$HTpause$HTcustphone$HTcustinfo$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTastcall$HTigcall\n"; } else { - $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"; + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDlisten$HDbarge$HDwhisper$HDstatus$HDpause$HDcustphone$HDcustinfo$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDastcall$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTlisten$HTbarge$HTwhisper$HTstatus$HTpause$HTcustphone$HTcustinfo$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTastcall$HTigcall\n"; } $Aecho .= "$Aline"; $Aecho .= "$Bline"; @@ -3641,6 +3667,7 @@ if ($talking_to_print > 0) $vac_stage=''; $vac_campaign=''; $INGRP=''; + $INORcolor=''; if ($CM == 'I') { $stmt="SELECT vac.campaign_id,vac.stage,vig.group_name,vig.group_id from vicidial_auto_calls vac,vicidial_inbound_groups vig where vac.callerid='$Acallerid[$i]' and vac.campaign_id=vig.group_id LIMIT 1;"; @@ -3648,7 +3675,7 @@ if ($talking_to_print > 0) if ($DB) {echo "$stmt\n";} $ING=$G; $INEG=$EG; $ingrp_to_print = mysqli_num_rows($rslt); - if ($ingrp_to_print > 0) + if ($ingrp_to_print > 0) { $row=mysqli_fetch_row($rslt); $vac_campaign_id=$row[0]; @@ -3659,13 +3686,44 @@ if ($talking_to_print > 0) $vac_campaign = sprintf("%-20s", "$row[0] - $row[2]"); $row[1] = preg_replace('/.*\-/i', '',$row[1]); $vac_stage = sprintf("%-4s", $row[1]); + $INORcolor = $row[3]; if ( ($INGROUPcolorOVERRIDE>0) or ($INGROUPcolorOVERRIDE=='YES') ) { - $ING=''; $INEG=''; + $ING=''; $INEG=''; } } $INGRP = " $ING$vac_stage$INEG | $ING$vac_campaign$INEG "; + if ($RS_INcolumnsHIDE > 0) + { + $INGRP = ''; + } + } + + $ASTCT=''; + if (strlen($RS_AGENTstatusTALLY) > 0) + { + $AST_ct=0; + $SStimeclock_end_of_day_HH = substr($SStimeclock_end_of_day,0,2); + $SStimeclock_end_of_day_MM = substr($SStimeclock_end_of_day,2,2); + $TCEODdate = date("Y-m-d H:i:s", mktime($SStimeclock_end_of_day_HH,$SStimeclock_end_of_day_MM,0,date("m"),date("d"),date("Y"))); + + $stmt="SELECT count(*) from vicidial_agent_log where event_time >= \"$TCEODdate\" and user='$Auser[$i]' and status='$RS_AGENTstatusTALLY';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $AST=$G; $ASTG=$EG; + $ast_to_print = mysqli_num_rows($rslt); + if ($ast_to_print > 0) + { + $row=mysqli_fetch_row($rslt); + $AST_ct = sprintf("%-6s", $row[0]); + + if ($INORcolor > 0) + { + $AST=''; $ASTG=''; + } + } + $ASTCT = " $AST$AST_ct$ASTG |"; } $agentcount++; @@ -3674,11 +3732,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$CI$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 |$ASTCT$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$CI$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 |$ASTCT$INGRP\n"; } } @@ -3738,13 +3796,44 @@ if ($talking_to_print > 0) $vac_campaign = sprintf("%-20s", "$row[0] - $row[2]"); $row[1] = preg_replace('/.*\-/i', '',$row[1]); $vac_stage = sprintf("%-4s", $row[1]); + $INORcolor = $row[3]; if ( ($INGROUPcolorOVERRIDE>0) or ($INGROUPcolorOVERRIDE=='YES') ) { - $ING=''; $INEG=''; + $ING=''; $INEG=''; } } $INGRP = " $ING$vac_stage$INEG $ING$vac_campaign$INEG "; + if ($RS_INcolumnsHIDE > 0) + { + $INGRP = ''; + } + } + + $ASTCT=''; + if (strlen($RS_AGENTstatusTALLY) > 0) + { + $AST_ct=0; + $SStimeclock_end_of_day_HH = substr($SStimeclock_end_of_day,0,2); + $SStimeclock_end_of_day_MM = substr($SStimeclock_end_of_day,2,2); + $TCEODdate = date("Y-m-d H:i:s", mktime($SStimeclock_end_of_day_HH,$SStimeclock_end_of_day_MM,0,date("m"),date("d"),date("Y"))); + + $stmt="SELECT count(*) from vicidial_agent_log where event_time >= \"$TCEODdate\" and user='$Auser[$i]' and status='$RS_AGENTstatusTALLY';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($DB) {echo "$stmt\n";} + $AST=$G; $ASTG=$EG; + $ast_to_print = mysqli_num_rows($rslt); + if ($ast_to_print > 0) + { + $row=mysqli_fetch_row($rslt); + $AST_ct = sprintf("%-6s", $row[0]); + + if ($INORcolor > 0) + { + $AST=''; $ASTG=''; + } + } + $ASTCT = " $AST$AST_ct$ASTG "; } $agentcount++; @@ -3753,11 +3842,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$CI$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 $ASTCT$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$CI$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 $ASTCT$INGRP\n"; } } } diff --git a/www/vicidial/functions.php b/www/vicidial/functions.php index be98eca5..366470f2 100644 --- a/www/vicidial/functions.php +++ b/www/vicidial/functions.php @@ -1484,7 +1484,7 @@ function TimeToText($interval) if ($seconds==1) {$return_str.="$seconds "._QXZ("second");} else {$return_str.="$seconds "._QXZ("seconds");} } - $return_str=preg_replace('/, $/', $return_str); + $return_str=preg_replace('/, $/','', $return_str); return $return_str; } function createDateRangeArray($strDateFrom,$strDateTo) diff --git a/www/vicidial/options-example.php b/www/vicidial/options-example.php index 4e4ea661..b63abcbf 100644 --- a/www/vicidial/options-example.php +++ b/www/vicidial/options-example.php @@ -25,7 +25,8 @@ # 190420-1722 - Added RS_ListenBarge # 190503-1544 - Added enable_status_mismatch_leadloader_option # 190525-2145 - Added RS_agentWAIT option -# 100115-1157 - Added call report export ALTERNATE_2 header +# 200115-1157 - Added call report export ALTERNATE_2 header +# 200428-1336 - Added RS_INcolumnsHIDE, RS_report_default_format & RS_AGENTstatusTALLY options # # used by the realtime_report.php script @@ -69,7 +70,10 @@ $RS_droppedOFtotal = 0; # 0=no, 1=yes $RS_logoutLINK = 0; # 0=no, 1=yes $RS_ListenBarge = 'MONITOR|BARGE|WHISPER'; # list of listen-related features separated by pipes: "MONITOR|BARGE|WHISPER" $RS_agentWAIT = 3; # 3 or 4 - +$RS_INcolumnsHIDE = 0; # 0=no, 1=yes # whether to hide the 'HOLD' & 'IN-GROUP' columns in the agent detail section +$RS_report_default_format = ''; # 'TEXT', 'HTML' or '': If set, this will override the System Setting for this report only +$RS_AGENTstatusTALLY = ''; # : If set, will look at the number of calls statused by the agent in this status for today + # WARNING!!! Using the above option may cause system lag issues, USE WITH CAUTION! # used by agent reports $user_case = 0; # 1=upper-case, 2-lower-case, 0-no-case-change diff --git a/www/vicidial/realtime_report.php b/www/vicidial/realtime_report.php index 8c53e591..f81ddb8f 100644 --- a/www/vicidial/realtime_report.php +++ b/www/vicidial/realtime_report.php @@ -48,12 +48,13 @@ # 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 +# 200428-1002 - Added RS_report_default_format options.php setting # $startMS = microtime(); -$version = '2.14-35'; -$build = '200401-1930'; +$version = '2.14-36'; +$build = '200428-1002'; header ("Content-type: text/html; charset=utf-8"); @@ -156,7 +157,6 @@ if ($qm_conf_ct > 0) } ##### END SETTINGS LOOKUP ##### ########################################### -if (strlen($report_display_type)<2) {$report_display_type = $SSreport_default_format;} $webphone_width = '460'; $webphone_height = '500'; @@ -169,11 +169,15 @@ $webphone_clpos = "
  3) {$SSreport_default_format = $RS_report_default_format;} +if (strlen($report_display_type)<2) {$report_display_type = $SSreport_default_format;} + if (!isset($DB)) { if (!isset($RS_DB)) {$DB=0;}