From e73bfa8540eeb9a636f0757a52423814c81bca83 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 7 Mar 2011 16:13:52 +0000 Subject: [PATCH] Added user_case option to options.php for admin Agent report use git-svn-id: svn://192.168.202.10@1616 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../www/vicidial/AST_agent_time_detail.php | 23 +++++++++++++++---- .../trunk/www/vicidial/options-example.php | 6 ++++- 2 files changed, 23 insertions(+), 6 deletions(-) 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 921aab9e..40d8aa19 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 @@ -4,7 +4,7 @@ # Pulls time stats per agent selectable by campaign or user group # should be most accurate agent stats of all of the reports # -# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # CHANGES # 90522-0723 - First build @@ -18,6 +18,7 @@ # 101207-1634 - Changed limits on seconds to 65000 from 30000 in vicidial_agent_log # 101207-1719 - Fixed download file formatting bugs(issue 394) # 101208-0320 - Fixed issue 404 +# 110307-1057 - Added user_case setting in options.php # require("dbconnect.php"); @@ -53,6 +54,18 @@ if (strlen($stage)<2) {$stage='NAME';} $report_name = 'Agent Time Detail'; $db_source = 'M'; +$user_case = ''; +if (file_exists('options.php')) + { + require('options.php'); + } +if ($user_case == '1') + {$userSQL = 'ucase(user)';} +if ($user_case == '2') + {$userSQL = 'lcase(user)';} +if (strlen($userSQL)<2) + {$userSQL = 'user';} + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; @@ -329,7 +342,7 @@ else ############################################################################ ### BEGIN gather user IDs and names for matching up later - $stmt="select full_name,user from vicidial_users order by user limit 100000;"; + $stmt="select full_name,$userSQL from vicidial_users order by user limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); @@ -345,7 +358,7 @@ else ### BEGIN gather timeclock records per agent - $stmt="select user,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; + $stmt="select $userSQL,sum(login_sec) from vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' $TCuser_group_SQL group by user limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $punches_to_print = mysql_num_rows($rslt); @@ -372,7 +385,7 @@ else $PCusersARY=$MT; $PCuser_namesARY=$MT; $user_count=0; - $stmt="select user,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; + $stmt="select $userSQL,sum(pause_sec),sub_status from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec > 0 and pause_sec < 65000 $group_SQL $user_group_SQL group by user,sub_status order by user,sub_status desc limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $subs_to_print = mysql_num_rows($rslt); @@ -407,7 +420,7 @@ else ##### BEGIN Gather all agent time records and parse through them in PHP to save on DB load - $stmt="select user,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; + $stmt="select $userSQL,wait_sec,talk_sec,dispo_sec,pause_sec,lead_id,status,dead_sec from vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' $group_SQL $user_group_SQL limit 10000000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/options-example.php b/agc_2-X/trunk/www/vicidial/options-example.php index 7f1354f1..dfc0a903 100644 --- a/agc_2-X/trunk/www/vicidial/options-example.php +++ b/agc_2-X/trunk/www/vicidial/options-example.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2011 Matt Florell LICENSE: AGPLv2 # # rename this file to options.php for the settings here to go into effect # # CHANGELOG # 101216-1043 - First Build +# 110307-1039 - Added upper-case/lower-case user setting # # used by the realtime_report.php script @@ -44,4 +45,7 @@ $RS_CUSTPHONEdisplay = 0; # 0=no, 1=yes $RS_PAUSEcodes = 'N'; $RS_with_inbound = 'Y'; +# used by agent reports +$user_case = 0; # 1=upper-case, 2-lower-case, 0-no-case-change + ?>