From f7b14563788adb48b4f8b64a42031c1c3d298aeb Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 13 Nov 2015 18:59:00 +0000 Subject: [PATCH] Added ability to search archive logs and show defunct users in Agent Performance Detail and Agent Status Detail reports Added ability to search archive logs in Agent Time Detail report git-svn-id: svn://192.168.202.10@2412 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../vicidial/AST_agent_performance_detail.php | 152 +++++++++++++++--- .../www/vicidial/AST_agent_status_detail.php | 96 +++++++++-- .../www/vicidial/AST_agent_time_detail.php | 40 ++++- 3 files changed, 247 insertions(+), 41 deletions(-) diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php index 21bfb9b4..cc7364c7 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php @@ -51,6 +51,7 @@ # 150603-1533 - Statuses are now sorted in alphabetical order # 150728-1230 - Fix for non-latin display issue #858 # 150909-0728 - Fix for time display issue for downloads, issue #886 +# 151112-1338 - Added ability to search archive logs and show defunct users # $startMS = microtime(); @@ -89,8 +90,13 @@ if (isset($_GET["show_percentages"])) {$show_percentages=$_GET["show_percentag elseif (isset($_POST["show_percentages"])) {$show_percentages=$_POST["show_percentages"];} if (isset($_GET["time_in_sec"])) {$time_in_sec=$_GET["time_in_sec"];} elseif (isset($_POST["time_in_sec"])) {$time_in_sec=$_POST["time_in_sec"];} +if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];} + elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];} +if (isset($_GET["show_defunct_users"])) {$show_defunct_users=$_GET["show_defunct_users"];} + elseif (isset($_POST["show_defunct_users"])) {$show_defunct_users=$_POST["show_defunct_users"];} if (strlen($shift)<2) {$shift='ALL';} +if ($search_archived_data=="checked") {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} $TIME_HF_agentperfdetail = 'HF'; $TIME_H_agentperfdetail = 'H'; @@ -338,7 +344,7 @@ while($i < $users_ct) $i++; } -$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$stmt="SELECT campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$HTML_text.="$stmt\n";} $campaigns_to_print = mysqli_num_rows($rslt); @@ -356,7 +362,7 @@ for ($i=0; $i\"HELP\""; @@ -562,7 +568,9 @@ $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.="

\n"; $HTML_text.=""._QXZ("Show %s")."
\n"; -$HTML_text.=""._QXZ("Time in seconds")."\n"; +$HTML_text.=""._QXZ("Time in seconds")."
\n"; +$HTML_text.=""._QXZ("Search archived data")."
\n"; +$HTML_text.=""._QXZ("Show defunct users")."\n"; $HTML_text.=""; $HTML_text.=_QXZ("Display as").":
"; $HTML_text.=""; if ($report_display_type) {echo "";} echo "\n

"; echo "$NWB#agent_status_detail$NWE\n"; +echo "
"; +echo ""._QXZ("Search archived data")."

\n"; +echo ""._QXZ("Show defunct users")."
\n"; echo "         "; 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 3cbcd586..409859d3 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 @@ -44,6 +44,7 @@ # 150516-1311 - Fixed Javascript element problem, Issue #857 # 150529-1921 - Sub statuses are now sorted in alphabetical order # 151110-1612 - Changed download function to always export time with hours +# 151112-1335 - Added option to search archived tables # $startMS = microtime(); @@ -86,10 +87,32 @@ if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_d elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (isset($_GET["time_in_sec"])) {$time_in_sec=$_GET["time_in_sec"];} elseif (isset($_POST["time_in_sec"])) {$time_in_sec=$_POST["time_in_sec"];} +if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];} + elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='NAME';} +if ($search_archived_data=="checked") + { + $agent_log_table="vicidial_agent_log_archive"; + $table_check_stmt="show tables like 'vicidial_timeclock_log_archive'"; + $table_check_rslt=mysql_to_mysqli($table_check_stmt, $link); + if (mysqli_num_rows($table_check_rslt)>0) + { + $timeclock_log_table="vicidial_timeclock_log_archive"; + } + else + { + $timeclock_log_table="vicidial_timeclock_log"; + } + } +else + { + $agent_log_table="vicidial_agent_log"; + $timeclock_log_table="vicidial_timeclock_log"; + } + $report_name = 'Agent Time Detail'; $db_source = 'M'; $JS_text="