From d0fb2a4bfce4c9bc9649e2a83f0cf6ee9bfcfbd3 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 18 Jan 2007 22:12:07 +0000 Subject: [PATCH] the field user_group was added to the vicidial_log, vicidial_user_log, vicidial_closer_log, vicidial_agent_log and vicidial_callbacks tables and several reports were altered to display this information. git-svn-id: svn://192.168.202.10@472 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 4 ++ bin/AST_VDauto_dial.pl | 16 ++++- extras/MySQL_AST_CREATE_tables.sql | 7 +- extras/upgrade_2.0.3.sql | 5 ++ .../TO_BE_TRANSLATED_2.0.3.txt | 2 + www/agc/vdc_db_query.php | 58 +++++++++++++--- www/agc/vicidial.php | 11 +-- www/vicidial/AST_agent_performance_detail.php | 52 ++++++++++++-- www/vicidial/admin.php | 67 +++++++++++++++++-- www/vicidial/user_stats.php | 16 +++-- www/vicidial/user_status.php | 8 ++- 11 files changed, 211 insertions(+), 35 deletions(-) diff --git a/UPGRADE b/UPGRADE index 1f81ff3d..7d33b428 100644 --- a/UPGRADE +++ b/UPGRADE @@ -49,6 +49,10 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 11. New optimized code for AST_manager_send.pl and AST_send_action_child.pl. Thanks to Lott Caskey for the code contribution +12. The field user_group has been added to several log tables to allow for + better tracking of stats by user groups. Several reports now offer + user group display options. + diff --git a/bin/AST_VDauto_dial.pl b/bin/AST_VDauto_dial.pl index 58c0761b..6e16662a 100644 --- a/bin/AST_VDauto_dial.pl +++ b/bin/AST_VDauto_dial.pl @@ -56,6 +56,7 @@ # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70115-1635 - Added initial auto-alt-dial functionality # 70116-1619 - Added VDAD Ring-No-Answer Auto Alt Dial code +# 70118-1539 - Added user_group logging to vicidial_user_log # @@ -1039,7 +1040,20 @@ while($one_day_interval > 0) $logrun=0; foreach(@VALOuser) { - $stmtA = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch) values('$VALOuser[$logrun]','LOGOUT','$VALOcampaign[$logrun]','$SQLdate','$now_date_epoch');"; + $VALOuser_group=''; + $stmtA = "SELECT user_group FROM vicidial_users where user='$VALOuser[$logrun]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $UGrec_count=0; + while ($sthArows > $UGrec_count) + { + @aryA = $sthA->fetchrow_array; + $VALOuser_group = "$aryA[0]"; + $UGrec_count++; + } + $sthA->finish(); + $stmtA = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VALOuser[$logrun]','LOGOUT','$VALOcampaign[$logrun]','$SQLdate','$now_date_epoch','$VALOuser_group');"; $affected_rows = $dbhA->do($stmtA); $event_string = "| lagged agent LOGOUT entry inserted $VALOuser[$logrun]|$VALOcampaign[$logrun]|$VALOextension[$logcount]|"; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 1bc2d962..47c4831c 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -350,6 +350,7 @@ phone_number VARCHAR(12), user VARCHAR(20), comments VARCHAR(255), processed ENUM('Y','N'), +user_group VARCHAR(20), index (lead_id), index (call_date) ); @@ -370,6 +371,7 @@ user VARCHAR(20), comments VARCHAR(255), processed ENUM('Y','N'), queue_seconds DECIMAL(7,2) default '0', +user_group VARCHAR(20), index (lead_id), index (call_date) ); @@ -433,6 +435,7 @@ event VARCHAR(50), campaign_id VARCHAR(8), event_date DATETIME, event_epoch INT(10) UNSIGNED, +user_group VARCHAR(20), index (user) ); @@ -653,7 +656,8 @@ talk_epoch INT(10) UNSIGNED, talk_sec SMALLINT(5) UNSIGNED default '0', dispo_epoch INT(10) UNSIGNED, dispo_sec SMALLINT(5) UNSIGNED default '0', -status VARCHAR(6) +status VARCHAR(6), +user_group VARCHAR(20) ); CREATE TABLE vicidial_scripts ( @@ -682,6 +686,7 @@ modify_date TIMESTAMP, user VARCHAR(20), recipient ENUM('USERONLY','ANYONE'), comments VARCHAR(255), +user_group VARCHAR(20), index (lead_id), index (status), index (callback_time) diff --git a/extras/upgrade_2.0.3.sql b/extras/upgrade_2.0.3.sql index 3b23b7f2..5fc27d8b 100644 --- a/extras/upgrade_2.0.3.sql +++ b/extras/upgrade_2.0.3.sql @@ -7,3 +7,8 @@ ALTER TABLE vicidial_auto_calls ADD alt_dial ENUM('NONE','MAIN','ALT','ADDR3') d ALTER TABLE vicidial_hopper ADD alt_dial ENUM('NONE','ALT','ADDR3') default 'NONE'; ALTER TABLE vicidial_hopper MODIFY status ENUM('READY','QUEUE','INCALL','DONE','HOLD') default 'READY'; +ALTER TABLE vicidial_log ADD user_group VARCHAR(20); +ALTER TABLE vicidial_closer_log ADD user_group VARCHAR(20); +ALTER TABLE vicidial_user_log ADD user_group VARCHAR(20); +ALTER TABLE vicidial_agent_log ADD user_group VARCHAR(20); +ALTER TABLE vicidial_callbacks ADD user_group VARCHAR(20); diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt index ba737a3c..d7bac9ed 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.3.txt @@ -67,6 +67,8 @@ Delete Auto Alt Dial Status|| Add New VICIDIAL Conference || List Servers || Add New Server || +CallBacks Within User Group|| +USERS WITHIN THIS USER GROUP|| ############################################################ CLIENT diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php index 5c88b470..6b93c116 100644 --- a/www/agc/vdc_db_query.php +++ b/www/agc/vdc_db_query.php @@ -112,10 +112,11 @@ # 61128-2229 - Added vicidial_live_agents and vicidial_auto_calls manual dial entries # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70115-1733 - Added alt_dial functionality in auto-dial modes +# 70118-1501 - Added user_group to vicidial_log,_agent_log,_closer_log,_callbacks # -$version = '2.0.39'; -$build = '70115-1733'; +$version = '2.0.40'; +$build = '70118-1501'; require("dbconnect.php"); @@ -797,8 +798,18 @@ if ($stage == "start") } else { + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_group = trim("$row[0]"); + } ##### insert log into vicidial_log for manual VICIDiaL call - $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N');"; + $stmt="INSERT INTO vicidial_log (uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,comments,processed,user_group) values('$uniqueid','$lead_id','$list_id','$campaign','$NOW_TIME','$StarTtime','INCALL','$phone_code','$phone_number','$user','MANUAL','N','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1238,14 +1249,24 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); ### update the log status to INCALL - $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' and uniqueid='$uniqueid';"; + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_group = trim("$row[0]"); + } + $stmt = "UPDATE vicidial_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$campaign)) { ### update the vicidial_closer_log user to INCALL - $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL' where lead_id='$lead_id' order by closecallid desc limit 1;"; + $stmt = "UPDATE vicidial_closer_log set user='$user', comments='AUTO', list_id='$list_id', status='INCALL', user_group='$user_group' where lead_id='$lead_id' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -1429,8 +1450,18 @@ if ( (strlen($campaign)<1) || (strlen($conf_exten)<1) ) } else { + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_group = trim("$row[0]"); + } ##### Insert a LOGOUT record into the user log - $stmt="INSERT INTO vicidial_user_log values('','$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime');"; + $stmt="INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$user','LOGOUT','$campaign','$NOW_TIME','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $vul_insert = mysql_affected_rows($link); @@ -1525,7 +1556,18 @@ if ($ACTION == 'updateDISPO') if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime');"; + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_group = trim("$row[0]"); + } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1534,7 +1576,7 @@ if ($ACTION == 'updateDISPO') ### CALLBACK ENTRY if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) ) { - $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments');"; + $stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); } diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 288f8a05..c5cbd642 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -135,7 +135,8 @@ # 70109-1128 - Fixed wrapup timer bug # 70109-1635 - Added option for HotKeys automatically dialing next number in manual mode # - Added option for alternate number dialing with hotkeys -# 70111-1600 - added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns +# 70118-1517 - Added vicidial_agent_log and vicidial_user_log logging of user_group # require("dbconnect.php"); @@ -181,8 +182,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} $forever_stop=0; -$version = '2.0.107'; -$build = '70109-1635'; +$version = '2.0.108'; +$build = '70118-1517'; if ($force_logout) { @@ -888,7 +889,7 @@ else if ( (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $VD_campaign)) || ($campaign_leads_to_call > 0) ) { ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log values('','$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE')"; + $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -1031,7 +1032,7 @@ else $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE');"; + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); diff --git a/www/vicidial/AST_agent_performance_detail.php b/www/vicidial/AST_agent_performance_detail.php index 3048e685..ad2e3aed 100644 --- a/www/vicidial/AST_agent_performance_detail.php +++ b/www/vicidial/AST_agent_performance_detail.php @@ -7,6 +7,7 @@ # # 60619-1712 - Added variable filtering to eliminate SQL injection attack threat # - Added required user/pass to gain access to this page +# 70118-1705 - Added user_group filtering option # require("dbconnect.php"); @@ -15,15 +16,19 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];} - elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} + elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} + elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} if (isset($_GET["shift"])) {$shift=$_GET["shift"];} elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} - elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} + elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} - elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} + +if (strlen($shift)<2) {$shift='ALL';} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -59,6 +64,17 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } +$stmt="select user_group from vicidial_user_groups;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$user_groups_to_print = mysql_num_rows($rslt); +$i=0; +while ($i < $user_groups_to_print) + { + $row=mysql_fetch_row($rslt); + $user_groups[$i] =$row[0]; + $i++; + } ?> @@ -86,9 +102,22 @@ echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "           MODIFY | REPORTS \n"; @@ -120,6 +149,16 @@ if ($shift == 'PM') $time_BEGIN = "15:15:00"; $time_END = "23:15:00"; } +if ($shift == 'ALL') + { + $query_date_BEGIN = "$query_date 00:00:00"; + $query_date_END = "$query_date 23:59:59"; + $time_BEGIN = "00:00:00"; + $time_END = "23:59:59"; + } + +if (strlen($user_group)>0) {$ugSQL="and vicidial_agent_log.user_group='$user_group'";} +else {$ugSQL='';} echo "VICIDIAL: Agent Performance Detail $NOW_TIME\n"; @@ -130,7 +169,7 @@ echo "+-----------------+--------+--------+--------+--------+--------+--------+- echo "| USER NAME | ID | CALLS | TIME | PAUSE | PAUSAVG| WAIT | WAITAVG| TALK | TALKAVG| DISPO | DISPAVG| A | B | DC | DNC | N | NI | CB | SALE |\n"; echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 group by full_name order by calls desc limit 1000;"; +$stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and campaign_id='" . mysql_real_escape_string($group) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 $ugSQL group by full_name order by calls desc limit 1000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $rows_to_print = mysql_num_rows($rslt); @@ -390,9 +429,10 @@ while($k < $i) $TOT_NI = sprintf("%-5s", $TOT_NI); $TOT_CB = sprintf("%-5s", $TOT_CB); $TOT_SALE = sprintf("%-5s", $TOT_SALE); + $TOT_AGENTS = sprintf("%-4s", $k); echo "+-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; -echo "| TOTALS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; +echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS| $TOTtotPAUSE_MS| $TOTavgPAUSE_MS | $TOTtotWAIT_MS| $TOTavgWAIT_MS | $TOTtotTALK_MS| $TOTavgTALK_MS | $TOTtotDISPO_MS| $TOTavgDISPO_MS | $TOT_A| $TOT_B| $TOT_DC| $TOT_DNC| $TOT_N| $TOT_NI| $TOT_CB| $TOT_SALE|\n"; echo "+--------------------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+------+------+------+------+------+------+------+------+\n"; echo "\n"; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index ec048a98..f3008ee5 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -856,12 +856,13 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql); # 70116-1200 - Added auto_alt_dial_status functionality to campaign screen # 70117-1235 - Added header formatting variables at top of script # - Moved Call Times and Phones/Server functions to Admin section +# 70118-1706 - Added new user group displays and links # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$version = '2.0.79'; -$build = '70117-1235'; +$version = '2.0.80'; +$build = '70118-1706'; $STARTtime = date("U"); @@ -1066,7 +1067,8 @@ if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} if ($ADD==0) {$hh='users'; echo "Users List";} if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} -if ($ADD==811) {$hh='campaigns'; echo "CallBacks Within List";} +if ($ADD==811) {$hh='lists'; echo "CallBacks Within List";} +if ($ADD==8111) {$hh='usergroups'; echo "CallBacks Within User Group";} if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} if ($ADD==100) {$hh='lists'; echo "Lists";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} @@ -6161,7 +6163,7 @@ else $h++; } echo "$NWB#vicidial_users-user_level$NWE\n"; - echo "User Group: \n"; $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); @@ -7360,6 +7362,8 @@ echo "
\n"; echo "
\n"; +echo "

Click here to see all CallBack Holds in this list

\n"; + if ($LOGdelete_lists > 0) { echo "

DELETE THIS LIST\n"; @@ -7532,6 +7536,43 @@ echo "$NWB#vicidial_user_groups-allowed_campaigns$NWE\n"; echo "\n"; echo "
\n"; + +### list of users in this user group + + $active_confs = 0; + $stmt="SELECT user,full_name,user_level from vicidial_users where user_group='$user_group'"; + $rsltx=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + echo "
\n"; + echo "
USERS WITHIN THIS USER GROUP: $users_to_print
\n"; + echo "\n"; + echo "\n"; + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + +echo "
USERFULL NAMELEVEL
$rowx[0]$rowx[1]$rowx[2]

\n"; + + + +echo "

Click here to see all CallBack Holds in this user group

\n"; + if ($LOGdelete_user_groups > 0) { echo "

DELETE THIS USER GROUP\n"; @@ -8404,6 +8445,21 @@ echo "
LIST CALLBACK HOLD LISTINGS: $list_id\n"; $ADD='82'; } +###################### +# ADD=8111 find all callbacks on hold within a user group +###################### +if ($ADD==8111) +{ + echo ""; + + $stmt="SELECT * from vicidial_callbacks where status IN('ACTIVE','LIVE') and user_group='$user_group' order by recipient,status desc,callback_time"; + $rslt=mysql_query($stmt, $link); + $cb_to_print = mysql_num_rows($rslt); + +echo "
USER GROUP CALLBACK HOLD LISTINGS: $list_id\n"; +$ADD='82'; +} + ###################### # ADD=82 display all callbacks on hold ###################### @@ -8411,7 +8467,7 @@ if ($ADD==82) { echo "
\n"; echo "
\n"; -echo "\n"; +echo "\n"; $o=0; while ($cb_to_print > $o) { @@ -8429,6 +8485,7 @@ echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } diff --git a/www/vicidial/user_stats.php b/www/vicidial/user_stats.php index dd9077cc..d23db235 100644 --- a/www/vicidial/user_stats.php +++ b/www/vicidial/user_stats.php @@ -7,6 +7,7 @@ # # 60619-1743 - Added variable filtering to eliminate SQL injection attack threat # 61201-1136 - Added recordings display and changed calls to time range with 10000 limit +# 70118-1605 - Added user group column to login/out and calls lists # header ("Content-type: text/html; charset=utf-8"); @@ -178,10 +179,10 @@ echo "

\n"; echo "
\n"; echo "LOGIN/LOGOUT TIME:\n"; -echo "
LEADLIST CAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUS
LEADLIST CAMPAIGNENTRY DATECALLBACK DATEUSERRECIPIENTSTATUSGROUP
LEAD$row[8]$row[9]$row[4]$row[11]
\n"; -echo "\n"; +echo "
EVENT DATE CAMPAIGNHOURS:MINUTES
\n"; +echo "\n"; - $stmt="SELECT event,event_epoch,event_date,campaign_id from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; $rslt=mysql_query($stmt, $link); $events_to_print = mysql_num_rows($rslt); @@ -202,6 +203,7 @@ echo ""; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; } if (ereg("LOGOUT", $row[0])) @@ -221,6 +223,7 @@ echo ""; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; $event_start_seconds=''; $event_stop_seconds=''; @@ -261,8 +264,8 @@ echo "

\n"; echo "
\n"; echo "CALLS FOR THIS TIME PERIOD: (10000 record limit)\n"; -echo "
EVENT DATE CAMPAIGN GROUPHOURS:MINUTES
EVENT DATE$row[0] $row[2] $row[3] $row[4]
EVENT DATE$row[0] $row[2] $row[3] $row[4] $event_hours_int:$event_minutes_int
\n"; -echo "\n"; +echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN LIST LEAD
\n"; +echo "\n"; $stmt="select * from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); @@ -284,13 +287,14 @@ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; } -echo "
# DATE/TIME LENGTH STATUS PHONE CAMPAIGN GROUP LIST LEAD
# DATE/TIME $row[8] $row[10] $row[3] $row[14] $row[2] $row[1]
\n"; +echo "


\n"; diff --git a/www/vicidial/user_status.php b/www/vicidial/user_status.php index 956b70ab..0cb7548f 100644 --- a/www/vicidial/user_status.php +++ b/www/vicidial/user_status.php @@ -75,10 +75,11 @@ $browser = getenv("HTTP_USER_AGENT"); fclose($fp); } - $stmt="SELECT full_name from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; + $stmt="SELECT full_name,user_group from vicidial_users where user='" . mysql_real_escape_string($user) . "';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $full_name = $row[0]; + $user_group = $row[1]; $stmt="SELECT * from vicidial_live_agents where user='" . mysql_real_escape_string($user) . "';"; $rslt=mysql_query($stmt, $link); @@ -198,9 +199,10 @@ else } -echo "           $user - $full_name\n"; +echo "           $user - $full_name \n"; +echo "       GROUP: $user_group

\n"; -echo " - VICIDIAL Time Sheet\n"; +echo "VICIDIAL Time Sheet\n"; echo " - User Stats\n"; echo " - Modify User\n";