X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fsqlradius.cgi;fp=httemplate%2Fsearch%2Fsqlradius.cgi;h=f7873e72fbf37ef5e4121b444a1ed6fe16c50177;hp=c8f7932c530542fc1a7be5c65448a7449826d7b4;hb=1a7f9caff2bc41030408ed8b919a718d5c268548;hpb=c2e6d527477334107535c74b44e238cc656f3449 diff --git a/httemplate/search/sqlradius.cgi b/httemplate/search/sqlradius.cgi index c8f7932c5..f7873e72f 100644 --- a/httemplate/search/sqlradius.cgi +++ b/httemplate/search/sqlradius.cgi @@ -4,11 +4,8 @@ % # and finally, display the thing % ### % -% foreach my $part_export ( -% #grep $_->can('usage_sessions'), qsearch( 'part_export' ) -% qsearch( 'part_export', { 'exporttype' => 'sqlradius' } ), -% qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } ) -% ) { +% foreach my $part_export ( @part_export ) { +% % %user2svc = (); % % my $efields = tie my %efields, 'Tie::IxHash', %fields; @@ -27,10 +24,12 @@ % }, % ); % } -% -% - <% $part_export->exporttype %> to <% $part_export->machine %>
+ + <% $part_export->exportname || $part_export->exporttype |h %> + <% $part_export->machine ? ' to '. $part_export->machine : '' |h %> +
+ <% include( '/elements/table-grid.html' ) %> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; @@ -150,6 +149,23 @@ if ( $cgi->param('svcnum') =~ /^(\d+)$/ ) { $cgi_svc = qsearchs( 'svc_acct', { 'username' => $1 } ); } +my @part_export = (); +if ( $cgi_svc ) { + my $part_svc = $cgi_svc->cust_svc->part_svc; + @part_export = ( + $part_svc->part_export('sqlradius'), + $part_svc->part_export('sqlradius_withdomain'), + $part_svc->part_export('broadband_sqlradius'), + ); +} else { + @part_export = ( + #grep $_->can('usage_sessions'), qsearch( 'part_export' ) + qsearch( 'part_export', { 'exporttype' => 'sqlradius' } ), + qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } ), + qsearch( 'part_export', { 'exporttype' => 'broadband_sqlradius' } ), + ); +} + my $ip = ''; if ( $cgi->param('ip') =~ /^((\d+\.){3}\d+)$/ ) { $ip = $1;