X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fsqlradius.cgi;h=b84df1a034926a54b832fe820e32dca3c6a13d0d;hb=fadaa67e77ad8d5d966e252aba7f193e9e3840e3;hp=b506ba1cb1c80b42cee142f70208368e2725a112;hpb=b8cfd0780aa40bb07f3215bf9cb58011f5e32a35;p=freeside.git
diff --git a/httemplate/search/sqlradius.cgi b/httemplate/search/sqlradius.cgi
index b506ba1cb..b84df1a03 100644
--- a/httemplate/search/sqlradius.cgi
+++ b/httemplate/search/sqlradius.cgi
@@ -51,6 +51,15 @@
$ip = $1;
}
+ my $prefix = $cgi->param('prefix');
+ $prefix =~ s/\D//g;
+ if ( $prefix =~ /^(\d+)$/ ) {
+ $prefix = $1;
+ $prefix = "011$prefix" unless $prefix =~ /^1/;
+ } else {
+ $prefix = '';
+ }
+
###
# field formatting subroutines
###
@@ -221,30 +230,51 @@
# and finally, display the thing
###
- foreach my $part_export ( map $_->rebless,
+ foreach my $part_export (
+ #grep $_->can('usage_sessions'), qsearch( 'part_export' )
qsearch( 'part_export', { 'exporttype' => 'sqlradius' } ),
qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } )
) {
%user2svc_acct = ();
+
+ my $efields = tie my %efields, 'Tie::IxHash', %fields;
+ delete $efields{'framedipaddress'} if $part_export->option('hide_ip');
+ if ( $part_export->option('hide_data') ) {
+ delete $efields{$_} foreach qw(acctinputoctets acctoutputoctets);
+ }
+ if ( $part_export->option('show_called_station') ) {
+ $efields->Splice(1, 0,
+ 'calledstationid' => {
+ 'name' => 'Destination',
+ 'attrib' => 'Called-Station-ID',
+ 'fmt' =>
+ sub { length($_[0]) ? shift : ' '; },
+ 'align' => 'left',
+ },
+ );
+ }
+
%>
<%= $part_export->exporttype %> to <%= $part_export->machine %>
<%= include( '/elements/table.html' ) %>