From: Ivan Kohler Date: Fri, 21 Oct 2016 19:11:18 +0000 (-0700) Subject: multi-select for agent on RADIUS usage report, RT#73050 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=ae2ce7f3fc2a0fe00f05145ce64e8b6b8c034631 multi-select for agent on RADIUS usage report, RT#73050 --- diff --git a/httemplate/search/sqlradius_usage.html b/httemplate/search/sqlradius_usage.html index 6b1806ee3..494a27591 100644 --- a/httemplate/search/sqlradius_usage.html +++ b/httemplate/search/sqlradius_usage.html @@ -74,12 +74,16 @@ if ( $opt{'agentnum'} =~ /^(\d+)$/ ) { my @agentnums = grep /^(\d+)$/, $cgi->param('agentnum'); if ( ! @agentnums ) { - @include_agents = qsearch('agent', {}); + @include_agents = qsearch({ 'table' => 'agent', + 'hashref' => { 'disabled'=>'' }, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, + }); } elsif ( scalar(@agentnums) == 1 ) { $agentnum = $agentnums[0]; } else { @include_agents = qsearch({ 'table' => 'agent', - 'extra_sql' => 'WHERE agentnum IN ('. + 'hashref' => { 'disabled' => '', }, + 'extra_sql' => 'AND agentnum IN ('. join(',',@agentnums). ') '. ' AND '. $curuser->agentnums_sql, });