From 1c044c24b12148cbc176590bdbc146d2b1f1390b Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 28 Jun 2019 01:32:07 +0000 Subject: [PATCH] Added new options for campaign agent_screen_time_display setting added CONNECTED column to Agent Time Detail report git-svn-id: svn://192.168.202.10@3115 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../branches/agc_2.0.4/extras/GMT_USA_zip.txt | 49 +++ .../agc_2.0.4/extras/phone_codes_GMT.txt | 2 + agc_2-X/trunk/bin/FastAGI_log.pl | 8 +- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 7 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 8 +- agc_2-X/trunk/www/agc/vdc_db_query.php | 357 +++++++++++++----- agc_2-X/trunk/www/agc/vicidial.php | 54 ++- .../www/vicidial/AST_agent_time_detail.php | 69 ++-- agc_2-X/trunk/www/vicidial/admin.php | 7 +- .../trunk/www/vicidial/help_documentation.txt | 4 +- 10 files changed, 432 insertions(+), 133 deletions(-) diff --git a/agc_2-X/branches/agc_2.0.4/extras/GMT_USA_zip.txt b/agc_2-X/branches/agc_2.0.4/extras/GMT_USA_zip.txt index f97b5e93..c97696ed 100644 --- a/agc_2-X/branches/agc_2.0.4/extras/GMT_USA_zip.txt +++ b/agc_2-X/branches/agc_2.0.4/extras/GMT_USA_zip.txt @@ -3294,6 +3294,7 @@ 09096 AE 1.0 Y 09099 AE 1.0 Y 09100 AE 1.0 Y +09101 AE 1.0 Y 09102 AE 1.0 Y 09103 AE 1.0 Y 09104 AE 1.0 Y @@ -3315,8 +3316,13 @@ 09154 AE 1.0 Y 09160 AE 1.0 Y 09161 AE 1.0 Y +09170 AE 1.0 Y +09171 AE 1.0 Y 09172 AE 1.0 Y 09173 AE 1.0 Y +09174 AE 1.0 Y +09175 AE 1.0 Y +09176 AE 1.0 Y 09177 AE 1.0 Y 09180 AE 1.0 Y 09186 AE 1.0 Y @@ -3326,17 +3332,25 @@ 09211 AE 1.0 Y 09213 AE 1.0 Y 09214 AE 1.0 Y +09216 AE 1.0 Y 09226 AE 1.0 Y 09227 AE 1.0 Y 09229 AE 1.0 Y 09237 AE 1.0 Y +09241 AE 1.0 Y 09245 AE 1.0 Y 09250 AE 1.0 Y 09261 AE 1.0 Y 09263 AE 1.0 Y 09264 AE 1.0 Y 09265 AE 1.0 Y +09266 AE 1.0 Y 09267 AE 1.0 Y +09276 AE 1.0 Y +09277 AE 1.0 Y +09278 AE 1.0 Y +09289 AE 1.0 Y +09290 AE 1.0 Y 09301 AE 1.0 Y 09302 AE 1.0 Y 09304 AE 1.0 Y @@ -3353,9 +3367,12 @@ 09315 AE 1.0 Y 09316 AE 1.0 Y 09317 AE 1.0 Y +09318 AE 1.0 Y 09319 AE 1.0 Y 09320 AE 1.0 Y 09321 AE 1.0 Y +09322 AE 1.0 Y +09323 AE 1.0 Y 09327 AE 1.0 Y 09328 AE 1.0 Y 09330 AE 1.0 Y @@ -3422,9 +3439,13 @@ 09461 AE 1.0 Y 09463 AE 1.0 Y 09464 AE 1.0 Y +09467 AE 1.0 Y 09468 AE 1.0 Y 09469 AE 1.0 Y 09470 AE 1.0 Y +09487 AE 1.0 Y +09488 AE 1.0 Y +09489 AE 1.0 Y 09494 AE 1.0 Y 09496 AE 1.0 Y 09497 AE 1.0 Y @@ -3440,6 +3461,7 @@ 09509 AE 1.0 Y 09510 AE 1.0 Y 09511 AE 1.0 Y +09512 AE 1.0 Y 09513 AE 1.0 Y 09517 AE 1.0 Y 09520 AE 1.0 Y @@ -3515,6 +3537,8 @@ 09630 AE 1.0 Y 09631 AE 1.0 Y 09633 AE 1.0 Y +09634 AE 1.0 Y +09635 AE 1.0 Y 09636 AE 1.0 Y 09642 AE 1.0 Y 09643 AE 1.0 Y @@ -3660,11 +3684,23 @@ 09873 AE 1.0 Y 09874 AE 1.0 Y 09875 AE 1.0 Y +09876 AE 1.0 Y 09880 AE 1.0 Y 09890 AE 1.0 Y 09892 AE 1.0 Y 09895 AE 1.0 Y 09898 AE 1.0 Y +09901 AE 1.0 Y +09902 AE 1.0 Y +09903 AE 1.0 Y +09904 AE 1.0 Y +09908 AE 1.0 Y +09909 AE 1.0 Y +09910 AE 1.0 Y +09974 AE 1.0 Y +09975 AE 1.0 Y +09976 AE 1.0 Y +09977 AE 1.0 Y 10001 NY -5.0 Y 10002 NY -5.0 Y 10003 NY -5.0 Y @@ -4175,6 +4211,7 @@ 11434 NY -5.0 Y 11435 NY -5.0 Y 11436 NY -5.0 Y +11437 NY -5.0 Y 11439 NY -5.0 Y 11451 NY -5.0 Y 11499 NY -5.0 Y @@ -15017,6 +15054,10 @@ 34055 AA -4.0 Y 34058 AA -4.0 Y 34060 AA -4.0 Y +34066 AA -4.0 Y +34067 AA -4.0 Y +34068 AA -4.0 Y +34069 AA -4.0 Y 34078 AA -4.0 Y 34080 AA -4.0 Y 34081 AA -4.0 Y @@ -24150,6 +24191,7 @@ 55128 MN -6.0 Y 55129 MN -6.0 Y 55130 MN -6.0 Y +55131 MN -6.0 Y 55133 MN -6.0 Y 55144 MN -6.0 Y 55145 MN -6.0 Y @@ -25093,6 +25135,7 @@ 56967 DC -5.0 Y 56968 DC -5.0 Y 56969 DC -5.0 Y +56970 DC -5.0 Y 56972 DC -5.0 Y 56998 DC -5.0 Y 56999 DC -5.0 Y @@ -31576,6 +31619,7 @@ 72402 AR -6.0 Y 72403 AR -6.0 Y 72404 AR -6.0 Y +72405 AR -6.0 Y 72410 AR -6.0 Y 72411 AR -6.0 Y 72412 AR -6.0 Y @@ -32712,6 +32756,7 @@ 75056 TX -6.0 Y 75057 TX -6.0 Y 75058 TX -6.0 Y +75059 TX -6.0 Y 75060 TX -6.0 Y 75061 TX -6.0 Y 75062 TX -6.0 Y @@ -38027,6 +38072,7 @@ 89434 NV -8.0 Y 89435 NV -8.0 Y 89436 NV -8.0 Y +89437 NV -8.0 Y 89438 NV -8.0 Y 89439 NV -8.0 Y 89440 NV -8.0 Y @@ -38195,6 +38241,7 @@ 90101 CA -8.0 Y 90102 CA -8.0 Y 90103 CA -8.0 Y +90134 CA -8.0 Y 90189 CA -8.0 Y 90201 CA -8.0 Y 90202 CA -8.0 Y @@ -40825,6 +40872,7 @@ 96367 AP 9.0 N 96368 AP 9.0 N 96370 AP 9.0 N +96371 AP 9.0 N 96372 AP 9.0 N 96373 AP 9.0 N 96374 AP 9.0 N @@ -40868,6 +40916,7 @@ 96535 AP 9.0 N 96537 AP 9.0 N 96538 AP 9.0 N +96539 AP 9.0 N 96540 AP 9.0 N 96541 AP 9.0 N 96542 AP 9.0 N diff --git a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt index a82215e6..cda18da9 100644 --- a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt +++ b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt @@ -105,6 +105,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE PHP 1 USA 364 KY -6 Y SSM-FSN Kentucky CST America/Chicago 1 CAN 365 ON -5 Y SSM-FSN Ontario EST America/Toronto 1 CAN 367 QC -5 Y SSM-FSN Quebec EST America/Toronto +1 CAN 368 AB -7 Y SSM-FSN Alberta MST America/Edmonton 1 USA 369 CA -8 Y SSM-FSN California PST America/Los_Angeles 1 USA 380 OH -5 Y SSM-FSN Ohio EST America/New_York 1 USA 385 UT -7 Y SSM-FSN Utah MST America/Denver @@ -151,6 +152,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE PHP 1 USA 469 TX -6 Y SSM-FSN Texas CST America/Chicago 1 USA 470 GA -5 Y SSM-FSN Georgia EST America/New_York 1 GRD 473 -4 N Grenada AST America/Grenada +1 CAN 474 SK -6 N Saskatchewan CST America/Regina 1 USA 475 CT -5 Y SSM-FSN Connecticut EST America/New_York 1 USA 478 GA -5 Y SSM-FSN Georgia EST America/New_York 1 USA 479 AR -6 Y SSM-FSN Arkansas CST America/Chicago diff --git a/agc_2-X/trunk/bin/FastAGI_log.pl b/agc_2-X/trunk/bin/FastAGI_log.pl index e8434a51..5b871d5c 100644 --- a/agc_2-X/trunk/bin/FastAGI_log.pl +++ b/agc_2-X/trunk/bin/FastAGI_log.pl @@ -82,6 +82,7 @@ # 170915-1753 - Asterisk 13 compatibility # 180521-1153 - Changed closer log logging to use agent if call was AGENTDIRECT # 180919-1729 - Fix for rare non-NA-set-as-NA call logging issue +# 190626-1100 - Added more logging for Auto-Alt-Dial debug # # defaults for PreFork @@ -1213,7 +1214,7 @@ sub process_request { $stmtA = "DELETE FROM vicidial_auto_calls where ( ( (status!='IVR') and (uniqueid='$uniqueid' or callerid = '$callerid') ) or ( (status='IVR') and (uniqueid='$uniqueid') ) ) order by call_time desc limit 1;"; $VACaffected_rows = $dbhA->do($stmtA); - if ($AGILOG) {$agi_string = "-- VDAC record deleted: |$VACaffected_rows| |$VD_lead_id|$uniqueid|$VD_uniqueid|$VD_callerid|$callerid|$VD_status|$channel($VARserver_ip)|$PC_channel($VD_server_ip)|($PC_count_rows|$PCR_count)|"; &agi_output;} + if ($AGILOG) {$agi_string = "-- VDAC record deleted: |$VACaffected_rows| |$VD_lead_id|$uniqueid|$VD_uniqueid|$VD_callerid|$callerid|$VD_status|$channel($VARserver_ip)|$PC_channel($VD_server_ip)|($PC_count_rows|$PCR_count)|$VD_alt_dial|"; &agi_output;} $stmtA = "UPDATE vicidial_live_agents SET ring_callerid='' where ring_callerid='$callerid';"; $VLACaffected_rows = $dbhA->do($stmtA); @@ -1415,7 +1416,7 @@ sub process_request if ($calleridname !~ /^Y\d\d\d\d/) { ########## FIND AND UPDATE vicidial_log ########## - $stmtA = "SELECT start_epoch,status,user,term_reason,comments FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;"; + $stmtA = "SELECT start_epoch,status,user,term_reason,comments,alt_dial FROM vicidial_log FORCE INDEX(lead_id) where lead_id = '$VD_lead_id' and uniqueid LIKE \"$Euniqueid%\" limit 1;"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; @@ -1428,6 +1429,7 @@ sub process_request $VD_user = $aryA[2]; $VD_term_reason = $aryA[3]; $VD_comments = $aryA[4]; + $VD_alt_dial_log = $aryA[5]; $epc_countCUSTDATA++; } $sthA->finish(); @@ -1659,7 +1661,7 @@ sub process_request # if ($AGILOG) {$agi_string = "AUTO-ALT TEST: |$VD_status|$VDL_status|$VD_auto_alt_dial_statuses|$VD_auto_alt_dial|"; &agi_output;} if ($VD_auto_alt_dial_statuses =~ / $VD_status | $VDL_status /) { - if ($AGILOG) {$agi_string = "AUTO-ALT MATCH: |$VD_status|$VDL_status|$VD_auto_alt_dial_statuses|$VD_auto_alt_dial|"; &agi_output;} + if ($AGILOG) {$agi_string = "AUTO-ALT MATCH: |$VD_status|$VDL_status|$VD_auto_alt_dial_statuses|$VD_auto_alt_dial|$VD_alt_dial|$VD_alt_dial_log|"; &agi_output;} if ( ($VD_auto_alt_dial =~ /(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)/) && ($VD_alt_dial =~ /NONE|MAIN/) ) { $alt_dial_skip=0; diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 88ae5914..0d3bde16 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -1001,7 +1001,7 @@ hangup_xfer_record_start ENUM('Y','N') default 'N', scheduled_callbacks_email_alert ENUM('Y', 'N') default 'N', max_inbound_calls_outcome ENUM('DEFAULT','ALLOW_AGENTDIRECT','ALLOW_MI_PAUSE','ALLOW_AGENTDIRECT_AND_MI_PAUSE') default 'DEFAULT', manual_auto_next_options ENUM('DEFAULT','PAUSE_NO_COUNT') default 'DEFAULT', -agent_screen_time_display ENUM('DISABLED','ENABLED_BASIC','ENABLED_FULL','ENABLED_BILL_BREAK_LUNCH_COACH') default 'DISABLED', +agent_screen_time_display VARCHAR(40) default 'DISABLED', next_dial_my_callbacks ENUM('DISABLED','ENABLED') default 'DISABLED', inbound_no_agents_no_dial_container VARCHAR(40) default '---DISABLED---', inbound_no_agents_no_dial_threshold SMALLINT(5) default '0', @@ -3155,7 +3155,8 @@ PRIMARY KEY (email_row_id), KEY email_list_account_key (email_account_id), KEY email_list_user_key (user), KEY vicidial_email_lead_id_key (lead_id), -KEY vicidial_email_group_key (group_id) +KEY vicidial_email_group_key (group_id), +KEY vicidial_email_xfer_key (xfercallid) ) ENGINE=MyISAM; CREATE TABLE vicidial_email_accounts ( @@ -4420,4 +4421,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_ UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1571',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1572',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index d8e0e4ed..4a72e387 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -442,7 +442,7 @@ ALTER TABLE vicidial_campaigns ADD manual_auto_next_options ENUM('DEFAULT','PAUS UPDATE system_settings SET db_schema_version='1526',db_schema_update_date=NOW() where db_schema_version < 1526; -ALTER TABLE vicidial_campaigns ADD agent_screen_time_display ENUM('DISABLED','ENABLED_BASIC','ENABLED_FULL','ENABLED_BILL_BREAK_LUNCH_COACH') default 'DISABLED'; +ALTER TABLE vicidial_campaigns ADD agent_screen_time_display VARCHAR(40) default 'DISABLED'; UPDATE system_settings SET db_schema_version='1527',db_schema_update_date=NOW() where db_schema_version < 1527; @@ -926,3 +926,9 @@ CREATE TABLE vicidial_log_extended_sip_archive LIKE vicidial_log_extended_sip; CREATE UNIQUE INDEX vlesa on vicidial_log_extended_sip_archive (caller_code,call_date); UPDATE system_settings SET db_schema_version='1571',db_schema_update_date=NOW() where db_schema_version < 1571; + +CREATE INDEX vicidial_email_xfer_key on vicidial_email_list (xfercallid); + +ALTER TABLE vicidial_campaigns MODIFY agent_screen_time_display VARCHAR(40) default 'DISABLED'; + +UPDATE system_settings SET db_schema_version='1572',db_schema_update_date=NOW() where db_schema_version < 1572; diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 04eddb0b..65247382 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -474,10 +474,11 @@ # 190515-1556 - Fixed scheduled callback email alert bug # 190524-1142 - Added gmt_offset population to new manual dialed leads # 190531-1045 - Added sip_event_logging +# 190627-1535 - Added new options for campaign agent_screen_time_display feature # -$version = '2.14-368'; -$build = '190531-1045'; +$version = '2.14-369'; +$build = '190627-1535'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=797; @@ -776,6 +777,10 @@ if (isset($_GET["callback_timezone"])) {$callback_timezone=$_GET["callback_tim elseif (isset($_POST["callback_timezone"])) {$callback_timezone=$_POST["callback_timezone"];} if (isset($_GET["manual_dial_validation"])) {$manual_dial_validation=$_GET["manual_dial_validation"];} elseif (isset($_POST["manual_dial_validation"])) {$manual_dial_validation=$_POST["manual_dial_validation"];} +if (isset($_GET["start_date"])) {$start_date=$_GET["start_date"];} + elseif (isset($_POST["start_date"])){$start_date=$_POST["start_date"];} +if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} + elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} header ("Content-type: text/html; charset=utf-8"); @@ -1110,6 +1115,8 @@ $dead_time = preg_replace('/[^0-9]/','',$dead_time); $callback_gmt_offset = preg_replace('/[^- \._0-9a-zA-Z]/','',$callback_gmt_offset); $callback_timezone = preg_replace('/[^-, _0-9a-zA-Z]/','',$callback_timezone); $manual_dial_validation = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_validation); +$start_date = preg_replace('/[^-_0-9]/','',$start_date); +$end_date = preg_replace('/[^-_0-9]/','',$end_date); # default optional vars if not set @@ -17753,6 +17760,13 @@ if ($ACTION == 'AGENTtimeREPORT') { if (strlen($stage) < 5) {$stage = 'DISABLED';} + if (strlen($start_date) < 8) + { + $start_date = $NOW_DATE; + $temp_date = $NOW_DATE; + } + if (strlen($end_date) < 8) + {$end_date = $NOW_DATE;} $stmt="SELECT agent_screen_time_display from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); @@ -17774,101 +17788,264 @@ if ($ACTION == 'AGENTtimeREPORT') } else { - $stmt="SELECT pause_epoch,wait_epoch,talk_epoch,dispo_epoch,dead_epoch,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,sub_status,agent_log_id from vicidial_agent_log where user='$user' and event_time >= '$NOW_DATE 00:00:00' and event_time <= '$NOW_DATE 23:59:59' order by agent_log_id desc limit 10000;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00707',$user,$server_ip,$session_name,$one_mysql_log);} - $time_logs_to_print = mysqli_num_rows($rslt); - if ($format=='debug') {echo "|$stage|$time_logs_to_print|$stmt|";} - - $g=0; - $pauseTOTAL=0; - $waitTOTAL=0; - $talkTOTAL=0; - $dispoTOTAL=0; - $billTOTAL=0; - $breakTOTAL=0; - $lunchTOTAL=0; - $coachTOTAL=0; - $loginTOTAL=0; - while ($time_logs_to_print > $g) + if (preg_match("/RANGE/",$stage)) { - $row=mysqli_fetch_row($rslt); - $Tpause_epoch[$g] = $row[0]; - $Twait_epoch[$g] = $row[1]; - $talk_epoch[$g] = $row[2]; - $Tdispo_epoch[$g] = $row[3]; - $Tdead_epoch[$g] = $row[4]; - $Tpause_sec[$g] = $row[5]; - $Twait_sec[$g] = $row[6]; - $Ttalk_sec[$g] = $row[7]; - $Tdispo_sec[$g] = $row[8]; - $Tdead_sec[$g] = $row[9]; - $Tsub_status[$g] = $row[10]; - $Tagent_log_id[$g] = $row[11]; - - if ($Tpause_sec[$g] < 65000) + $archive_cutoff=0; + $stmt="SELECT event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log order by agent_log_id limit 1;"; + $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);} + $archive_check_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {echo "|$archive_check_to_print|$stmt|";} + if ($archive_check_to_print > 0) { - $pauseTOTAL = ($pauseTOTAL + $Tpause_sec[$g]); - if (preg_match("/break/i",$Tsub_status[$g])) {$breakTOTAL = ($breakTOTAL + $Tpause_sec[$g]);} - if (preg_match("/lunch/i",$Tsub_status[$g])) {$lunchTOTAL = ($lunchTOTAL + $Tpause_sec[$g]);} - if (preg_match("/coach/i",$Tsub_status[$g])) {$coachTOTAL = ($coachTOTAL + $Tpause_sec[$g]);} + $row=mysqli_fetch_row($rslt); + $archive_cutoff = $row[1]; } - if ($Twait_sec[$g] < 65000) {$waitTOTAL = ($waitTOTAL + $Twait_sec[$g]);} - if ($Ttalk_sec[$g] < 65000) {$talkTOTAL = ($talkTOTAL + $Ttalk_sec[$g]);} - if ($Tdispo_sec[$g] < 65000) {$dispoTOTAL = ($dispoTOTAL + $Tdispo_sec[$g]);} - if ($format=='debug') {echo "|$g|$Tagent_log_id[$g]|$Tpause_epoch[$g]|$Tpause_sec[$g]|
\n";} - $g++; - } - $billTOTAL = ($waitTOTAL + $talkTOTAL + $dispoTOTAL); - $loginTOTAL = ($pauseTOTAL + $waitTOTAL + $talkTOTAL + $dispoTOTAL); + $days=-1; + if ($start_date == "$end_date") + { + $days=0; + $temp_date_epoch = $secX; + } + else + { + $start_date_epoch = strtotime("$start_date 12:00:00"); + $end_date_epoch = strtotime("$end_date 12:00:00"); + $datediff = $end_date_epoch - $start_date_epoch; + $days = round($datediff / (60 * 60 * 24)); + $temp_date_epoch = $start_date_epoch; + } + if ($days < 0) + { + echo "

\n"; + echo "" . _QXZ("ERROR: you must select a date range to use this feature")."\n"; + echo "

\n"; + echo ""._QXZ("Close Agent Time Report").""; + } + else + { + echo "
            \n"; + echo ""._QXZ("AGENT TIME REPORT FOR").": $start_date - $end_date             \n"; + echo "

\n"; + if (preg_match("/ENABLED_BASIC/",$stage)) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + if (preg_match("/ENABLED_FULL/",$stage)) + { + echo "
  "._QXZ("DATE")."     "._QXZ("TOTAL LOGGED IN TIME")."  
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + if (preg_match("/ENABLED_BILL_BREAK_LUNCH_COACH/",$stage)) + { + echo "
  "._QXZ("DATE")."     "._QXZ("TOTAL LOGGED IN")."     "._QXZ("WAIT")."     "._QXZ("TALK")."     "._QXZ("DISPO")."     "._QXZ("PAUSE")."  
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + $day_ct=0; + while ($days >= $day_ct) + { + $vicidial_agent_log = 'vicidial_agent_log'; + $archive_flag=''; + if ($temp_date_epoch < $archive_cutoff) + {$vicidial_agent_log = 'vicidial_agent_log_archive'; $archive_flag='';} + $temp_date = date("Y-m-d",$temp_date_epoch); + $stmt="SELECT pause_epoch,wait_epoch,talk_epoch,dispo_epoch,dead_epoch,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,sub_status,agent_log_id from $vicidial_agent_log where user='$user' and event_time >= '$temp_date 00:00:00' and event_time <= '$temp_date 23:59:59' order by agent_log_id desc limit 10000;"; + $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);} + $time_logs_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {echo "|$stage|$time_logs_to_print|$stmt|";} - echo "
\n"; - #echo ""._QXZ("Agent Time Report for Today").":\n"; - echo "

\n"; - if ($stage == 'ENABLED_BASIC') - { - echo "
  "._QXZ("DATE")."     "._QXZ("BILLABLE")."     "._QXZ("BREAK")."     "._QXZ("LUNCH")."     "._QXZ("COACH")."  
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
  "._QXZ("TOTAL LOGGED IN TIME")."  
  " . gmdate("H:i:s", $loginTOTAL) . "  
"; + $g=0; + $pauseTOTAL=0; + $waitTOTAL=0; + $talkTOTAL=0; + $dispoTOTAL=0; + $billTOTAL=0; + $breakTOTAL=0; + $lunchTOTAL=0; + $coachTOTAL=0; + $loginTOTAL=0; + while ($time_logs_to_print > $g) + { + $row=mysqli_fetch_row($rslt); + $Tpause_epoch[$g] = $row[0]; + $Twait_epoch[$g] = $row[1]; + $talk_epoch[$g] = $row[2]; + $Tdispo_epoch[$g] = $row[3]; + $Tdead_epoch[$g] = $row[4]; + $Tpause_sec[$g] = $row[5]; + $Twait_sec[$g] = $row[6]; + $Ttalk_sec[$g] = $row[7]; + $Tdispo_sec[$g] = $row[8]; + $Tdead_sec[$g] = $row[9]; + $Tsub_status[$g] = $row[10]; + $Tagent_log_id[$g] = $row[11]; + + if ($Tpause_sec[$g] < 65000) + { + $pauseTOTAL = ($pauseTOTAL + $Tpause_sec[$g]); + if (preg_match("/break/i",$Tsub_status[$g])) {$breakTOTAL = ($breakTOTAL + $Tpause_sec[$g]);} + if (preg_match("/lunch/i",$Tsub_status[$g])) {$lunchTOTAL = ($lunchTOTAL + $Tpause_sec[$g]);} + if (preg_match("/coach/i",$Tsub_status[$g])) {$coachTOTAL = ($coachTOTAL + $Tpause_sec[$g]);} + } + if ($Twait_sec[$g] < 65000) {$waitTOTAL = ($waitTOTAL + $Twait_sec[$g]);} + if ($Ttalk_sec[$g] < 65000) {$talkTOTAL = ($talkTOTAL + $Ttalk_sec[$g]);} + if ($Tdispo_sec[$g] < 65000) {$dispoTOTAL = ($dispoTOTAL + $Tdispo_sec[$g]);} + + if ($format=='debug') {echo "|$g|$Tagent_log_id[$g]|$Tpause_epoch[$g]|$Tpause_sec[$g]|
\n";} + $g++; + } + $billTOTAL = ($waitTOTAL + $talkTOTAL + $dispoTOTAL); + $loginTOTAL = ($pauseTOTAL + $waitTOTAL + $talkTOTAL + $dispoTOTAL); + + if (preg_match("/ENABLED_BASIC/",$stage)) + { + echo ""; + echo "   $temp_date   $archive_flag"; + echo "   " . gmdate("H:i:s", $loginTOTAL) . "   "; + } + if (preg_match("/ENABLED_FULL/",$stage)) + { + echo ""; + echo "   $temp_date   $archive_flag"; + echo "   " . gmdate("H:i:s", $loginTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $waitTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $talkTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $dispoTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $pauseTOTAL) . "   "; + } + if (preg_match("/ENABLED_BILL_BREAK_LUNCH_COACH/",$stage)) + { + echo ""; + echo "   $temp_date   $archive_flag"; + echo "   " . gmdate("H:i:s", $billTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $breakTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $lunchTOTAL) . "   "; + echo "   " . gmdate("H:i:s", $coachTOTAL) . "   "; + } + $day_ct++; + $temp_date_epoch = ($temp_date_epoch + 86400); + } + echo ""; + } } - if ($stage == 'ENABLED_FULL') + else { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
  "._QXZ("TOTAL LOGGED IN")."     "._QXZ("WAIT")."     "._QXZ("TALK")."     "._QXZ("DISPO")."     "._QXZ("PAUSE")."  
  " . gmdate("H:i:s", $loginTOTAL) . "     " . gmdate("H:i:s", $waitTOTAL) . "     " . gmdate("H:i:s", $talkTOTAL) . "     " . gmdate("H:i:s", $dispoTOTAL) . "     " . gmdate("H:i:s", $pauseTOTAL) . "  
"; - } - if ($stage == 'ENABLED_BILL_BREAK_LUNCH_COACH') - { - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "
  "._QXZ("BILLABLE")."     "._QXZ("BREAK")."     "._QXZ("LUNCH")."     "._QXZ("COACH")."  
  " . gmdate("H:i:s", $billTOTAL) . "     " . gmdate("H:i:s", $breakTOTAL) . "     " . gmdate("H:i:s", $lunchTOTAL) . "     " . gmdate("H:i:s", $coachTOTAL) . "  
"; + $stmt="SELECT pause_epoch,wait_epoch,talk_epoch,dispo_epoch,dead_epoch,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,sub_status,agent_log_id from vicidial_agent_log where user='$user' and event_time >= '$NOW_DATE 00:00:00' and event_time <= '$NOW_DATE 23:59:59' order by agent_log_id desc limit 10000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00707',$user,$server_ip,$session_name,$one_mysql_log);} + $time_logs_to_print = mysqli_num_rows($rslt); + if ($format=='debug') {echo "|$stage|$time_logs_to_print|$stmt|";} + + $g=0; + $pauseTOTAL=0; + $waitTOTAL=0; + $talkTOTAL=0; + $dispoTOTAL=0; + $billTOTAL=0; + $breakTOTAL=0; + $lunchTOTAL=0; + $coachTOTAL=0; + $loginTOTAL=0; + while ($time_logs_to_print > $g) + { + $row=mysqli_fetch_row($rslt); + $Tpause_epoch[$g] = $row[0]; + $Twait_epoch[$g] = $row[1]; + $talk_epoch[$g] = $row[2]; + $Tdispo_epoch[$g] = $row[3]; + $Tdead_epoch[$g] = $row[4]; + $Tpause_sec[$g] = $row[5]; + $Twait_sec[$g] = $row[6]; + $Ttalk_sec[$g] = $row[7]; + $Tdispo_sec[$g] = $row[8]; + $Tdead_sec[$g] = $row[9]; + $Tsub_status[$g] = $row[10]; + $Tagent_log_id[$g] = $row[11]; + + if ($Tpause_sec[$g] < 65000) + { + $pauseTOTAL = ($pauseTOTAL + $Tpause_sec[$g]); + if (preg_match("/break/i",$Tsub_status[$g])) {$breakTOTAL = ($breakTOTAL + $Tpause_sec[$g]);} + if (preg_match("/lunch/i",$Tsub_status[$g])) {$lunchTOTAL = ($lunchTOTAL + $Tpause_sec[$g]);} + if (preg_match("/coach/i",$Tsub_status[$g])) {$coachTOTAL = ($coachTOTAL + $Tpause_sec[$g]);} + } + if ($Twait_sec[$g] < 65000) {$waitTOTAL = ($waitTOTAL + $Twait_sec[$g]);} + if ($Ttalk_sec[$g] < 65000) {$talkTOTAL = ($talkTOTAL + $Ttalk_sec[$g]);} + if ($Tdispo_sec[$g] < 65000) {$dispoTOTAL = ($dispoTOTAL + $Tdispo_sec[$g]);} + + if ($format=='debug') {echo "|$g|$Tagent_log_id[$g]|$Tpause_epoch[$g]|$Tpause_sec[$g]|
\n";} + $g++; + } + $billTOTAL = ($waitTOTAL + $talkTOTAL + $dispoTOTAL); + $loginTOTAL = ($pauseTOTAL + $waitTOTAL + $talkTOTAL + $dispoTOTAL); + + echo "
            \n"; + echo ""._QXZ("AGENT TIME REPORT FOR TODAY").":             \n"; + echo ""._QXZ("close")." [X]
\n"; + echo "

\n"; + if ($stage == 'ENABLED_BASIC') + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
  "._QXZ("TOTAL LOGGED IN TIME")."  
  " . gmdate("H:i:s", $loginTOTAL) . "  
"; + } + if ($stage == 'ENABLED_FULL') + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
  "._QXZ("TOTAL LOGGED IN")."     "._QXZ("WAIT")."     "._QXZ("TALK")."     "._QXZ("DISPO")."     "._QXZ("PAUSE")."  
  " . gmdate("H:i:s", $loginTOTAL) . "     " . gmdate("H:i:s", $waitTOTAL) . "     " . gmdate("H:i:s", $talkTOTAL) . "     " . gmdate("H:i:s", $dispoTOTAL) . "     " . gmdate("H:i:s", $pauseTOTAL) . "  
"; + } + if ($stage == 'ENABLED_BILL_BREAK_LUNCH_COACH') + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
  "._QXZ("BILLABLE")."     "._QXZ("BREAK")."     "._QXZ("LUNCH")."     "._QXZ("COACH")."  
  " . gmdate("H:i:s", $billTOTAL) . "     " . gmdate("H:i:s", $breakTOTAL) . "     " . gmdate("H:i:s", $lunchTOTAL) . "     " . gmdate("H:i:s", $coachTOTAL) . "  
"; + } } echo "
"; echo ""._QXZ("Close Agent Time Report").""; diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 95ef881e..e985968c 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -613,10 +613,11 @@ # 190406-1615 - Added agent next_dial_my_callbacks override # 190529-2144 - Fix for shift enforcement dispo-call-url issue # 190617-1116 - Fix for script variable issue +# 190627-2134 - Added new options for campaign agent_screen_time_display feature # -$version = '2.14-582c'; -$build = '190617-1116'; +$version = '2.14-583c'; +$build = '190627-2134'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -700,6 +701,7 @@ $forever_stop=0; $isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); +$NOW_DATE = date("Y-m-d"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $loginDATE = date("Ymd"); @@ -969,6 +971,8 @@ echo ' + + '; echo "\n"; echo "\n"; @@ -17129,9 +17133,19 @@ function phone_number_format(formatphone) { } +// ################################################################################ +// Launch the Agent Time Report function + function LaunchAgentTimeReport(temp_none) + { + var temp_ATstart_date = document.vicidial_form.ATstart_date.value; + var temp_ATend_date = document.vicidial_form.ATend_date.value; + AgentTimeReport('open',temp_ATstart_date,temp_ATend_date); + } + + // ################################################################################ // Agent Time Report loading function - function AgentTimeReport(temp_open_close) + function AgentTimeReport(temp_open_close,temp_start_date,temp_end_date) { if (temp_open_close == 'open') { @@ -17156,12 +17170,12 @@ function phone_number_format(formatphone) { } if (xmlhttp) { - var ATR_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&stage=" + agent_screen_time_display + "&lead_id=" + document.vicidial_form.lead_id.value + "&ACTION=AGENTtimeREPORT&format=text&user=" + user + "&campaign=" + campaign + "&pass=" + pass; + var ATR_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&stage=" + agent_screen_time_display + "&lead_id=" + document.vicidial_form.lead_id.value + "&ACTION=AGENTtimeREPORT&format=text&user=" + user + "&campaign=" + campaign + "&start_date=" + temp_start_date + "&end_date=" + temp_end_date + "&pass=" + pass; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(ATR_query); xmlhttp.onreadystatechange = function() - { + { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { // alert(xmlhttp.responseText); @@ -20686,7 +20700,35 @@ if ($agent_display_dialable_leads > 0) - \n"; - echo "\n"; + echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index ccae9290..66b52e68 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,4 +1,4 @@ -# version: 20190530194101 +# version: 20190627153101 users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N. @@ -294,7 +294,7 @@ campaigns-allow_required_fields Allow Required Fields Must be enabled for r campaigns-status_display_fields Status Display Fields You can select which variables for calls will be displayed in the status line of the agent screen. CALLID will display the 20 character unique call ID, LEADID will display the system lead ID, LISTID will display the list ID, NAME will display the customer name. Default is CALLID. campaigns-status_display_ingroup Status Display In-Group This option if set to ENABLED will display the In-Group name in the agent screen when an inbound call is sent to the agent. Default is ENABLED. campaigns-agent_display_fields Agent Display Fields This option allows you to display hidden fields as read-only in the agent screen. Available fields are entry_date, source_id, date_of_birth, rank, owner, last_local_call_time. Default is blank. -campaigns-agent_screen_time_display Agent Screen Time Display This option allows you to display a link on the agent screen that when clicked will open a frame showing the agent their time statistics for the day. There are several options that will determine what information is displayed. Default is DISABLED. +campaigns-agent_screen_time_display Agent Screen Time Display This option allows you to display a link on the agent screen that when clicked will open a frame showing the agent their time statistics for the day. There are several options that will determine what information is displayed. If RANGE is in the option, it will allow the agent to select a date range to see stats from. Default is DISABLED. campaigns-use_internal_dnc Use Internal DNC List This defines whether this campaign is to filter leads against the Internal DNC list. If it is set to Y, the hopper will look for each phone number in the DNC list before placing it in the hopper. If it is in the DNC list then it will change that lead status to DNCL so it cannot be dialed. Default is N. The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled. campaigns-use_campaign_dnc Use Campaign DNC List This defines whether this campaign is to filter leads against a DNC list that is specific to that campaign only. If it is set to Y, the hopper will look for each phone number in the campaign-specific DNC list before placing it in the hopper. If it is in the campaign-specific DNC list then it will change that lead status to DNCC so it cannot be dialed. Default is N. The AREACODE option is just like the Y option, except it is used to also filter out an entire area code in North America from being dialed, in this case using the 201XXXXXXX entry in the DNC list would block all calls to the 201 areacode if enabled. campaigns-use_other_campaign_dnc Other Campaign DNC If the option Use Campaign DNC List is enabled, this option can allow you to use a different campaign DNC list, just put the Campaign ID of the other campaign in this field. If you use this option, the original campaign DNC list will no longer be checked, only the OTHER campaign DNC list will be used. This does not affect use of the Internal System DNC list. Default is EMPTY.
                  [X]
+
+ "._QXZ("AGENT TIME REPORT")." :  
"; + echo " "; + echo "\n"; + echo "   "._QXZ("to"); + echo "   "; + echo "\n"; + echo "   "._QXZ("GO")."           "; + echo ""._QXZ("close")." [X]
"; + } + else + { + echo "\n"; + echo "\n"; + } + ?>


 
diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php index 0fbb03c8..7a4c0629 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php @@ -53,6 +53,7 @@ # 170409-1542 - Added IP List validation code # 170829-0040 - Added screen color settings # 171012-2015 - Fixed javascript/apache errors with graphs +# 180502-2215 - Added new help display, added CONNECTED column # $startMS = microtime(); @@ -468,9 +469,11 @@ while ($i < $statha_to_print) $LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&show_parks=$show_parks&time_in_sec=$time_in_sec&search_archived_data=$search_archived_data&report_display_type=$report_display_type&DB=$DB"; -$NWB = "   \"HELP\""; +# $NWB = "   \"HELP\""; +$NWB = "\"HELP\""; if ($file_download < 1) { @@ -496,6 +499,10 @@ if ($file_download < 1) echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; echo ""._QXZ("$report_name")."\n"; echo ""; @@ -723,6 +730,7 @@ else if ($pause > 65000) {$pause=0;} if ($dead > 65000) {$dead=0;} $customer = ($talk - $dead); + $connected = ($talk + $wait); if ($customer < 1) {$customer=0;} $TOTwait = ($TOTwait + $wait); @@ -731,6 +739,7 @@ else $TOTpause = ($TOTpause + $pause); $TOTdead = ($TOTdead + $dead); $TOTcustomer = ($TOTcustomer + $customer); + $TOTconnected = ($TOTconnected + $connected); $TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait); if ( ($lead > 0) and ((!preg_match("/NULL/i",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;} @@ -753,6 +762,7 @@ else $Spause[$m] = ($Spause[$m] + $pause); $Sdead[$m] = ($Sdead[$m] + $dead); $Scustomer[$m] = ($Scustomer[$m] + $customer); + $Sconnected[$m] = ($Sconnected[$m] + $connected); if ( ($lead > 0) and ((!preg_match("/NULL/i",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;} } $m++; @@ -767,6 +777,7 @@ else $Spause[$uc] = $pause; $Sdead[$uc] = $dead; $Scustomer[$uc] = $customer; + $Sconnected[$uc] = $connected; if ($lead > 0) {$Scalls[$uc]++;} $uc++; } @@ -787,13 +798,13 @@ else if ($file_download < 1) { $ASCII_text.=_QXZ("AGENT TIME BREAKDOWN").":\n"; - $ASCII_text.="+---------------------------+----------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - $ASCII_text.="| "._QXZ("USER NAME",25)." | "._QXZ("ID",8)." | "._QXZ("CALLS",8)." | "._QXZ("TIME CLOCK",10)." | "._QXZ("LOGIN TIME",10)." |$park_HEADER "._QXZ("WAIT",10)." | "._QXZ("WAIT",8)." % | "._QXZ("TALK",10)." | "._QXZ("TALK TIME",9)." %| "._QXZ("DISPO",10)." | "._QXZ("DISPOTIME",9)." %| "._QXZ("PAUSE",10)." | "._QXZ("PAUSETIME",9)." %| "._QXZ("DEAD",10)." | "._QXZ("DEAD TIME",9)." %| "._QXZ("CUSTOMER",10)." | |$sub_statusesHTML\n"; - $ASCII_text.="+---------------------------+----------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+---------------------------+----------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| "._QXZ("USER NAME",25)." | "._QXZ("ID",8)." | "._QXZ("CALLS",8)." | "._QXZ("TIME CLOCK",10)." | "._QXZ("LOGIN TIME",10)." |$park_HEADER "._QXZ("WAIT",10)." | "._QXZ("WAIT",8)." % | "._QXZ("TALK",10)." | "._QXZ("TALK TIME",9)." %| "._QXZ("DISPO",10)." | "._QXZ("DISPOTIME",9)." %| "._QXZ("PAUSE",10)." | "._QXZ("PAUSETIME",9)." %| "._QXZ("DEAD",10)." | "._QXZ("DEAD TIME",9)." %| "._QXZ("CUSTOMER",10)." | "._QXZ("CONNECTED",10)." | |$sub_statusesHTML\n"; + $ASCII_text.="+---------------------------+----------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= _QXZ("USER").","._QXZ("ID").","._QXZ("CALLS").","._QXZ("TIME CLOCK").","._QXZ("LOGIN TIME")."$park_HEADER_CSV,"._QXZ("WAIT").","._QXZ("WAIT %").","._QXZ("TALK").","._QXZ("TALK TIME %").","._QXZ("DISPO").","._QXZ("DISPOTIME %").","._QXZ("PAUSE").","._QXZ("PAUSETIME %").","._QXZ("DEAD").","._QXZ("DEAD TIME %").","._QXZ("CUSTOMER")."$sub_statusesFILE\n"; + $file_output .= _QXZ("USER").","._QXZ("ID").","._QXZ("CALLS").","._QXZ("TIME CLOCK").","._QXZ("LOGIN TIME")."$park_HEADER_CSV,"._QXZ("WAIT").","._QXZ("WAIT %").","._QXZ("TALK").","._QXZ("TALK TIME %").","._QXZ("DISPO").","._QXZ("DISPOTIME %").","._QXZ("PAUSE").","._QXZ("PAUSETIME %").","._QXZ("DEAD").","._QXZ("DEAD TIME %").","._QXZ("CUSTOMER").","._QXZ("CONNECTED")."$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -830,6 +841,7 @@ else if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);} if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);} if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);} + if (trim($Sconnected[$m])>$max_connected) {$max_connected=trim($Sconnected[$m]);} if (trim($Swaitpct[$m])>$max_waitpct) {$max_waitpct=trim($Swaitpct[$m]);} if (trim($Stalkpct[$m])>$max_talkpct) {$max_talkpct=trim($Stalkpct[$m]);} if (trim($Sdispopct[$m])>$max_dispopct) {$max_dispopct=trim($Sdispopct[$m]);} @@ -843,11 +855,12 @@ else $graph_stats[$m][7]=trim($Spause[$m]); $graph_stats[$m][8]=trim($Sdead[$m]); $graph_stats[$m][9]=trim($Scustomer[$m]); - $graph_stats[$m][10]=trim(sprintf("%01.2f", $Stalkpct[$m])); - $graph_stats[$m][11]=trim(sprintf("%01.2f", $Sdispopct[$m])); - $graph_stats[$m][12]=trim(sprintf("%01.2f", $Spausepct[$m])); - $graph_stats[$m][13]=trim(sprintf("%01.2f", $Sdeadpct[$m])); - $graph_stats[$m][14]=trim(sprintf("%01.2f", $Swaitpct[$m])); + $graph_stats[$m][10]=trim($Sconnected[$m]); + $graph_stats[$m][11]=trim(sprintf("%01.2f", $Stalkpct[$m])); + $graph_stats[$m][12]=trim(sprintf("%01.2f", $Sdispopct[$m])); + $graph_stats[$m][13]=trim(sprintf("%01.2f", $Spausepct[$m])); + $graph_stats[$m][14]=trim(sprintf("%01.2f", $Sdeadpct[$m])); + $graph_stats[$m][15]=trim(sprintf("%01.2f", $Swaitpct[$m])); $Swaitpct[$m]= sprintf("%01.2f", $Swaitpct[$m]); $Stalkpct[$m]= sprintf("%01.2f", $Stalkpct[$m]); @@ -860,6 +873,7 @@ else $Spause[$m]= sec_convert($Spause[$m],$TIME_agenttimedetail); $Sdead[$m]= sec_convert($Sdead[$m],$TIME_agenttimedetail); $Scustomer[$m]= sec_convert($Scustomer[$m],$TIME_agenttimedetail); + $Sconnected[$m]= sec_convert($Sconnected[$m],$TIME_agenttimedetail); $Stime[$m]= sec_convert($Stime[$m],$TIME_agenttimedetail); $RAWtime = $Stime[$m]; @@ -869,6 +883,7 @@ else $RAWpause = $Spause[$m]; $RAWdead = $Sdead[$m]; $RAWcustomer = $Scustomer[$m]; + $RAWconnected = $Sconnected[$m]; $RAWwaitpct = $Swaitpct[$m]; $RAWtalkpct = $Stalkpct[$m]; $RAWdispopct = $Sdispopct[$m]; @@ -1015,6 +1030,7 @@ else $Spause[$m]= sprintf("%10s", $Spause[$m]); $Sdead[$m]= sprintf("%10s", $Sdead[$m]); $Scustomer[$m]= sprintf("%10s", $Scustomer[$m]); + $Sconnected[$m]= sprintf("%10s", $Sconnected[$m]); $Scalls[$m]= sprintf("%8s", $Scalls[$m]); $Stime[$m]= sprintf("%10s", $Stime[$m]); @@ -1044,10 +1060,10 @@ else if (trim($park_array[$Suser[$m]][1]+0)>$max_total_hold_time) {$max_total_hold_time=trim($park_array[$Suser[$m]][1]+0);} if (trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds)))>$max_avg_hold_time) {$max_avg_hold_time=trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds)));} if (trim($user_hpc)>$max_user_hpc) {$max_user_hpc=trim($user_hpc);} - $graph_stats[$m][15]=trim($user_holds); - $graph_stats[$m][16]=trim($park_array[$Suser[$m]][1]+0); - $graph_stats[$m][17]=trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds))); - $graph_stats[$m][18]=trim($user_hpc); + $graph_stats[$m][16]=trim($user_holds); + $graph_stats[$m][17]=trim($park_array[$Suser[$m]][1]+0); + $graph_stats[$m][18]=trim(round(MathZDC(($park_array[$Suser[$m]][1]+0), $user_holds))); + $graph_stats[$m][19]=trim($user_hpc); if ($file_download<1) { @@ -1071,11 +1087,11 @@ else { if ($atdr_login_logout_user_link > 0) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] |$park_AGENT_INFO $Swait[$m] | $Swaitpct[$m] | $Stalk[$m] | $Stalkpct[$m] | $Sdispo[$m] | $Sdispopct[$m] | $Spause[$m] | $Spausepct[$m] | $Sdead[$m] | $Sdeadpct[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] |$park_AGENT_INFO $Swait[$m] | $Swaitpct[$m] | $Stalk[$m] | $Stalkpct[$m] | $Sdispo[$m] | $Sdispopct[$m] | $Spause[$m] | $Spausepct[$m] | $Sdead[$m] | $Sdeadpct[$m] | $Scustomer[$m] | $Sconnected[$m] | |$SstatusesHTML\n"; } else { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] |$park_AGENT_INFO $Swait[$m] | $Swaitpct[$m] | $Stalk[$m] | $Stalkpct[$m] | $Sdispo[$m] | $Sdispopct[$m] | $Spause[$m] | $Spausepct[$m] | $Sdead[$m] | $Sdeadpct[$m] | $Scustomer[$m] | |$SstatusesHTML\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] |$park_AGENT_INFO $Swait[$m] | $Swaitpct[$m] | $Stalk[$m] | $Stalkpct[$m] | $Sdispo[$m] | $Sdispopct[$m] | $Spause[$m] | $Spausepct[$m] | $Sdead[$m] | $Sdeadpct[$m] | $Scustomer[$m] | $Sconnected[$m] | |$SstatusesHTML\n"; } $graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]"); @@ -1095,12 +1111,13 @@ else if (strlen($RAWdead)<1) {$RAWdead='0';} if (strlen($RAWdeadpct)<0) {$RAWdeadpct='0.0%';} if (strlen($RAWcustomer)<1) {$RAWcustomer='0';} + if (strlen($RAWconnected)<1) {$RAWconnected='0';} $user_holds=trim($user_holds); $total_hold_time=trim($total_hold_time); $avg_hold_time=trim($avg_hold_time); $user_hpc=trim($user_hpc); - $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$park_AGENT_INFO_CSV$RAWwait,$RAWwaitpct %,$RAWtalk,$RAWtalkpct %,$RAWdispo,$RAWdispopct %,$RAWpause,$RAWpausepct %,$RAWdead,$RAWdeadpct %,$RAWcustomer$SstatusesFILE\n"; + $fileToutput = "$RAWname,$RAWuser,$RAWcalls,$RAWtimeTC,$RAWtime,$park_AGENT_INFO_CSV$RAWwait,$RAWwaitpct %,$RAWtalk,$RAWtalkpct %,$RAWdispo,$RAWdispopct %,$RAWpause,$RAWpausepct %,$RAWdead,$RAWdeadpct %,$RAWcustomer,$RAWconnected$SstatusesFILE\n"; } $TOPsorted_output[$m] = $Toutput; @@ -1149,7 +1166,7 @@ else $hTOT_AGENTS = sprintf("%5s", $TOT_AGENTS); $k=$m; - if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTALtime|$TOTcalls|$uc|
\n";} + if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTdead|$TOTcustomer|$TOTconnected|$TOTALtime|$TOTcalls|$uc|
\n";} ### BEGIN sort through output to display properly ### @@ -1243,6 +1260,7 @@ else $TOTpause = sec_convert($TOTpause,$TIME_agenttimedetail); $TOTdead = sec_convert($TOTdead,$TIME_agenttimedetail); $TOTcustomer = sec_convert($TOTcustomer,$TIME_agenttimedetail); + $TOTconnected = sec_convert($TOTconnected,$TIME_agenttimedetail); $TOTALtime = sec_convert($TOTALtime,$TIME_agenttimedetail); $TOTtimeTC = sec_convert($TOTtimeTC,$TIME_agenttimedetail); @@ -1272,6 +1290,7 @@ else $hTOTpause = sprintf("%11s", $TOTpause); $hTOTdead = sprintf("%11s", $TOTdead); $hTOTcustomer = sprintf("%11s", $TOTcustomer); + $hTOTconnected = sprintf("%11s", $TOTconnected); $hTOTALtime = sprintf("%11s", $TOTALtime); $hTOTtimeTC = sprintf("%11s", $TOTtimeTC); ###### END LAST LINE TOTALS FORMATTING ########## @@ -1280,9 +1299,9 @@ else if ($file_download < 1) { - $ASCII_text.="+---------------------------+----------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - $ASCII_text.="| "._QXZ("TOTALS",10)." "._QXZ("AGENTS",9,"r").":$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$park_TOTALS$hTOTwait |$hTOTwaitpct |$hTOTtalk |$hTOTtalkpct |$hTOTdispo |$hTOTdispopct |$hTOTpause |$hTOTpausepct |$hTOTdead |$hTOTdeadpct |$hTOTcustomer | |$SUMstatusesHTML\n"; - $ASCII_text.="+--------------------------------------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="+---------------------------+----------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; + $ASCII_text.="| "._QXZ("TOTALS",10)." "._QXZ("AGENTS",9,"r").":$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$park_TOTALS$hTOTwait |$hTOTwaitpct |$hTOTtalk |$hTOTtalkpct |$hTOTdispo |$hTOTdispopct |$hTOTpause |$hTOTpausepct |$hTOTdead |$hTOTdeadpct |$hTOTcustomer |$hTOTconnected | |$SUMstatusesHTML\n"; + $ASCII_text.="+--------------------------------------+----------+------------+------------$park_HEADER_DIV+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; if ($AUTOLOGOUTflag > 0) { $ASCII_text.= " * "._QXZ("denotes AUTOLOGOUT from timeclock")."\n"; @@ -1303,9 +1322,9 @@ else $graph_id++; $graph_array=array("ATD_CALLSdata|1|CALLS|integer|", "ATD_TIMECLOCKdata|2|TIME CLOCK|time|", "ATD_LOGINTIMEdata|3|LOGIN TIME|time|"); if ($show_parks) { - array_push($graph_array, "ATD_PARKSdata|15|PARKS|integer|", "ATD_PARKTIMEdata|16|PARKTIME|time|", "ATD_AVGPARKdata|17|AVGPARK|time|", "ATD_PARKSCALLdata|18|PARKS/CALL|decimal|"); + array_push($graph_array, "ATD_PARKSdata|16|PARKS|integer|", "ATD_PARKTIMEdata|17|PARKTIME|time|", "ATD_AVGPARKdata|18|AVGPARK|time|", "ATD_PARKSCALLdata|19|PARKS/CALL|decimal|"); } - array_push($graph_array, "ATD_WAITdata|4|WAIT|time|", "ATD_WAITPCTdata|14|WAIT %|percent|", "ATD_TALKdata|5|TALK|time|", "ATD_TALKTIMEPCTdata|10|TALKTIME%|percent|", "ATD_DISPOdata|6|DISPO|time|", "ATD_DISPOTIMEPCTdata|11|DISPOTIME%|percent|", "ATD_PAUSEdata|7|PAUSE|time|", "ATD_PAUSETIMEPCTdata|12|PAUSETIME%|percent|", "ATD_DEADdata|8|DEAD|time|", "ATD_DEADTIMEPCTdata|13|DEADTIME%|percent|", "ATD_CUSTOMERdata|9|CUSTOMER|time|"); + array_push($graph_array, "ATD_WAITdata|4|WAIT|time|", "ATD_WAITPCTdata|15|WAIT %|percent|", "ATD_TALKdata|5|TALK|time|", "ATD_TALKTIMEPCTdata|11|TALKTIME%|percent|", "ATD_DISPOdata|6|DISPO|time|", "ATD_DISPOTIMEPCTdata|12|DISPOTIME%|percent|", "ATD_PAUSEdata|7|PAUSE|time|", "ATD_PAUSETIMEPCTdata|13|PAUSETIME%|percent|", "ATD_DEADdata|8|DEAD|time|", "ATD_DEADTIMEPCTdata|14|DEADTIME%|percent|", "ATD_CUSTOMERdata|9|CUSTOMER|time|", "ATD_CONNECTEDdata|10|CONNECTED|time|"); for ($e=0; $e
"._QXZ("Agent Display Fields").": $NWB#campaigns-agent_display_fields$NWE
"._QXZ("Agent Screen Time Display").": $NWB#campaigns-agent_screen_time_display$NWE
"._QXZ("Agent Screen Time Display").": $NWB#campaigns-agent_screen_time_display$NWE
"._QXZ("Agent Display Queue Count").": $NWB#campaigns-display_queue_count$NWE