From 7e9197ca42e3bb82ee0622beb473d346fb48b4eb Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 4 Dec 2015 11:10:22 +0000 Subject: [PATCH] Added code to look for "CALL_MENU" and "XML_PULL" In-Group permissions for those list options in the IVR report git-svn-id: svn://192.168.202.10@2422 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/AST_IVRstats.php | 63 ++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/www/vicidial/AST_IVRstats.php b/www/vicidial/AST_IVRstats.php index a1bcfe87..1bf15ea8 100644 --- a/www/vicidial/AST_IVRstats.php +++ b/www/vicidial/AST_IVRstats.php @@ -32,6 +32,7 @@ # 141230-1448 - Added code for on-the-fly language translations display # 150516-1301 - Fixed Javascript element problem, Issue #857 # 151125-1643 - Added search archive option +# 151204-0544 - Added code to look for "CALL_MENU" and "XML_PULL" In-Group permissions for those list options # $startMS = microtime(); @@ -302,6 +303,43 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";} + +##### BEGIN Generate select list for which in-groups or campaigns to display ##### + +if ($type == 'inbound') + { + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='CALL_MENU';"; + if ($DB) {$MAIN.="|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $CALL_MENUcount = $row[0]; + + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='XML_PULL';"; + if ($DB) {$MAIN.="|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $XML_PULLcount = $row[0]; + + $CALL_MENUdisplay=1; + $XML_PULLdisplay=1; + if ($CALL_MENUcount > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='CALL_MENU' $LOGadmin_viewable_groupsSQL;"; + if ($DB) {$MAIN.="|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $CALL_MENUdisplay = $row[0]; + } + if ($XML_PULLcount > 0) + { + $stmt="SELECT count(*) from vicidial_inbound_groups where group_id='XML_PULL' $LOGadmin_viewable_groupsSQL;"; + if ($DB) {$MAIN.="|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $XML_PULLdisplay = $row[0]; + } + } + if ($type == 'inbound') {$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;";} else @@ -312,14 +350,20 @@ $groups_to_print = mysqli_num_rows($rslt); $i=0; if ($type == 'inbound') { - $LISTgroups[$i]='CALLMENU'; - $LISTgroups_names[$i]='IVR'; - $i++; - $groups_to_print++; - $LISTgroups[$i]='XMLPULL'; - $LISTgroups_names[$i]='Dynamic Application'; - $i++; - $groups_to_print++; + if ($CALL_MENUdisplay > 0) + { + $LISTgroups[$i]='CALLMENU'; + $LISTgroups_names[$i]='IVR'; + $i++; + $groups_to_print++; + } + if ($XML_PULLdisplay > 0) + { + $LISTgroups[$i]='XMLPULL'; + $LISTgroups_names[$i]='Dynamic Application'; + $i++; + $groups_to_print++; + } } while ($i < $groups_to_print) { @@ -329,6 +373,9 @@ while ($i < $groups_to_print) $i++; } +##### END Generate select list for which in-groups or campaigns to display ##### + + $i=0; $group_string='|'; $group_ct = count($group);