diff --git a/www/vicidial/AST_timeonVDADall.php b/www/vicidial/AST_timeonVDADall.php
index 794cc2b4..1cf227cb 100644
--- a/www/vicidial/AST_timeonVDADall.php
+++ b/www/vicidial/AST_timeonVDADall.php
@@ -111,10 +111,11 @@
# 190206-1616 - Added mobile device display variable
# 190313-0607 - Fix for columns display issue #1141
# 190420-1728 - Added RS_ListenBarge options.php setting
+# 190513-1711 - Added ingroup filter
#
-$version = '2.14-98';
-$build = '190420-1728';
+$version = '2.14-99';
+$build = '190513-1711';
header ("Content-type: text/html; charset=utf-8");
@@ -190,6 +191,8 @@ if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];}
elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];}
if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];}
elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];}
+if (isset($_GET["ingroup_filter"])) {$ingroup_filter=$_GET["ingroup_filter"];}
+ elseif (isset($_POST["ingroup_filter"])) {$ingroup_filter=$_POST["ingroup_filter"];}
if (isset($_GET["droppedOFtotal"])) {$droppedOFtotal=$_GET["droppedOFtotal"];}
elseif (isset($_POST["droppedOFtotal"])) {$droppedOFtotal=$_POST["droppedOFtotal"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
@@ -582,6 +585,20 @@ while($i < $user_group_ct)
}
$user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
+$i=0;
+$ingroup_string='|';
+$ingroup_ct = count($ingroup_filter);
+while($i < $ingroup_ct)
+ {
+ $ingroup_filter[$i] = preg_replace('/[^-_0-9a-zA-Z]/', '', $ingroup_filter[$i]);
+ $ingroup_string .= "$ingroup_filter[$i]|";
+ $ingroup_SQL .= "'$ingroup_filter[$i]',";
+ $ingroupQS .= "&ingroup_filter[]=$ingroup_filter[$i]";
+
+ $i++;
+ }
+$ingroup_SQL = preg_replace('/,$/i', '',$ingroup_SQL);
+
### if no campaigns selected, display all
if ( ($group_ct < 1) or (strlen($group_string) < 2) )
{
@@ -597,6 +614,15 @@ if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) )
$user_group_string = '|ALL-GROUPS|';
$usergroupQS .= "&user_group_filter[]=ALL-GROUPS";
}
+### if no ingroups selected, display all
+$ingroup_none=0;
+if ( ($ingroup_ct < 1) or (strlen($ingroup_string) < 2) )
+ {
+ $ingroup_filter[0] = 'ALL-INGROUPS';
+ $ingroup_string = '|ALL-INGROUPS|';
+ $ingroupQS .= "&ingroup_filter[]=ALL-INGROUPS";
+ $ingroup_none=1;
+ }
if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{
@@ -641,6 +667,22 @@ else
# $user_group_SQLwhere = "where user_group IN($user_group_SQL)";
}
+if ( (preg_match('/\s\-\-NONE\-\-\s/',$ingroup_string) ) or ($ingroup_ct < 1) )
+ {
+ $all_active_ingroups = 0;
+ $ingroup_SQL = "''";
+ }
+elseif ( preg_match('/ALL\-INGROUPS/i',$ingroup_string) )
+ {
+ $all_active_ingroups = 1;
+ $ingroup_SQL = "'$rawLOGadmin_viewable_groupsSQL'";
+ $ingroup_SQLand = "and campaign_id IN($rawLOGadmin_viewable_groupsSQL)";
+ $ingroup_SQLwhere = "where campaign_id IN($rawLOGadmin_viewable_groupsSQL)";
+ }
+else
+ {
+ $all_active_ingroups = 0;
+ }
$stmt="SELECT user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -659,6 +701,24 @@ while ($i < $usergroups_to_print)
$i++;
}
+$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;";
+$rslt=mysql_to_mysqli($stmt, $link);
+if ($DB) {$MAIN.="$stmt\n";}
+$ingroups_to_print = mysqli_num_rows($rslt);
+$i=0;
+$LISTingroups[$i]='ALL-INGROUPS';
+$i++;
+$ingroups_to_print++;
+$ingroups_string='|';
+while ($i < $ingroups_to_print)
+ {
+ $row=mysqli_fetch_row($rslt);
+ $LISTingroups[$i] = $row[0];
+ $LISTingroup_names[$i] = $row[1];
+ $ingroups_string .= "$LISTingroups[$i]|";
+ $i++;
+ }
+
if (!isset($RR)) {$RR=4;}
$NFB = '';
@@ -692,6 +752,24 @@ while ($o < $usergroups_to_print)
}
$select_list .= "";
+$select_list .= "
"._QXZ("Select In-Groups").":
";
+$select_list .= "";
+
$select_list .= "
| "._QXZ("STATION")." | "; $HDphone = ""; - $HTphone = ""._QXZ("PHONE")." | "; + $HTphone = ""._QXZ("PHONE")." | "; if ($RTajax > 0) {$HTphone = ""._QXZ("PHONE")." | ";} $HDuser = ""; - $HTuser = ""._QXZ("USER")." "; + $HTuser = " | "._QXZ("USER")." "; if ($RTajax > 0) {$HTuser = " | "._QXZ("USER")." ";} if ($UidORname>0) @@ -2747,7 +2853,7 @@ if ($report_display_type=='HTML') {$HTuser .= " "._QXZ("SHOW ID")." ";} else { - $HTuser .= " "._QXZ("SHOW ID")." "; + $HTuser .= " "._QXZ("SHOW ID")." "; } } else @@ -2756,13 +2862,13 @@ if ($report_display_type=='HTML') {$HTuser .= " "._QXZ("SHOW NAME")." ";} else { - $HTuser .= " "._QXZ("SHOW NAME")." "; + $HTuser .= " "._QXZ("SHOW NAME")." "; } } $HTuser .= " "._QXZ("INFO",6)." | "; $HDusergroup = ""; - $HTusergroup = ""._QXZ("USER GROUP")." | "; + $HTusergroup = ""._QXZ("USER GROUP")." | "; if ($RTajax > 0) {$HTusergroup = ""._QXZ("USER GROUP")." | ";} $HDsessionid = ""; @@ -2782,11 +2888,11 @@ if ($report_display_type=='HTML') $HDcall_server_ip = ""; $HTcall_server_ip = ""._QXZ("CALL SERVER IP")." | "; $HDtime = ""; - $HTtime = "MM:SS | "; + $HTtime = "MM:SS | "; if ($RTajax > 0) {$HTtime = "MM:SS | ";} $HDcampaign = ""; - $HTcampaign = ""._QXZ("CAMPAIGN")." | "; + $HTcampaign = ""._QXZ("CAMPAIGN")." | "; if ($RTajax > 0) {$HTcampaign = ""._QXZ("CAMPAIGN",10)." | ";} $HDcalls = ""; diff --git a/www/vicidial/realtime_report.php b/www/vicidial/realtime_report.php index 9e657782..c3547c64 100644 --- a/www/vicidial/realtime_report.php +++ b/www/vicidial/realtime_report.php @@ -44,12 +44,13 @@ # 190302-1927 - Added variable-length header icon tables # 190414-1106 - Made admin and summary report links conditional, RS_logoutLINK options.php option # 190420-1729 - Added RS_ListenBarge options.php setting +# 190513-1711 - Added ingroup filter # $startMS = microtime(); -$version = '2.14-31'; -$build = '190420-1729'; +$version = '2.14-32'; +$build = '190513-1711'; header ("Content-type: text/html; charset=utf-8"); @@ -73,6 +74,8 @@ if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];} elseif (isset($_POST["usergroup"])) {$usergroup=$_POST["usergroup"];} if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];} elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];} +if (isset($_GET["ingroup_filter"])) {$ingroup_filter=$_GET["ingroup_filter"];} + elseif (isset($_POST["ingroup_filter"])) {$ingroup_filter=$_POST["ingroup_filter"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} @@ -622,6 +625,20 @@ while($i < $user_group_ct) } $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL); +$i=0; +$ingroup_string='|'; +$ingroup_ct = count($ingroup_filter); +while($i < $ingroup_ct) + { + $ingroup_filter[$i] = preg_replace('/[^-_0-9a-zA-Z]/', '', $ingroup_filter[$i]); + $ingroup_string .= "$ingroup_filter[$i]|"; + $ingroup_SQL .= "'$ingroup_filter[$i]',"; + $usergroupQS .= "&ingroup_filter[]=$ingroup_filter[$i]"; + + $i++; + } +$ingroup_SQL = preg_replace('/,$/i', '',$ingroup_SQL); + ### if no campaigns selected, display all if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { @@ -639,6 +656,15 @@ if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) ) $usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; $user_group_none=1; } +### if no ingroups selected, display all +$ingroup_none=0; +if ( ($ingroup_ct < 1) or (strlen($ingroup_string) < 2) ) + { + $ingroup_filter[0] = 'ALL-INGROUPS'; + $ingroup_string = '|ALL-INGROUPS|'; + $ingroupQS .= "&ingroup_filter[]=ALL-INGROUPS"; + $ingroup_none=1; + } if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) ) { @@ -683,6 +709,23 @@ else # $user_group_SQLwhere = "where user_group IN($user_group_SQL)"; } + +if ( (preg_match('/\s\-\-NONE\-\-\s/',$ingroup_string) ) or ($ingroup_ct < 1) ) + { + $all_active_ingroups = 0; + $ingroup_SQL = "''"; + } +elseif ( preg_match('/ALL\-INGROUPS/i',$ingroup_string) ) + { + $all_active_ingroups = 1; + $ingroup_SQL = "'$rawLOGadmin_viewable_groupsSQL'"; + } +else + { + $all_active_ingroups = 0; + } + + $stmt="select user_group, group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $rslt=mysql_to_mysqli($stmt, $link); if (!isset($DB)) {$DB=0;} @@ -701,6 +744,25 @@ while ($i < $usergroups_to_print) $i++; } +$stmt="select group_id,group_name from vicidial_inbound_groups $whereLOGadmin_viewable_groupsSQL order by group_id;"; +$rslt=mysql_to_mysqli($stmt, $link); +if ($DB) {$MAIN.="$stmt\n";} +$ingroups_to_print = mysqli_num_rows($rslt); +$i=0; +$LISTingroups[$i]='ALL-INGROUPS'; +$i++; +$ingroups_to_print++; +$ingroups_string='|'; +while ($i < $ingroups_to_print) + { + $row=mysqli_fetch_row($rslt); + $LISTingroups[$i] = $row[0]; + $LISTingroup_names[$i] = $row[1]; + $ingroups_string .= "$LISTingroups[$i]|"; + $i++; + } + + if (!isset($RR)) {$RR=4;} $NFB = ''; @@ -739,6 +801,24 @@ while ($o < $usergroups_to_print) } $select_list .= ""; +$select_list .= "";
$select_list .= ""._QXZ("Close Panel")." "; $select_list .= " |