summaryrefslogtreecommitdiff
path: root/httemplate/browse/rate.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/browse/rate.cgi')
-rw-r--r--httemplate/browse/rate.cgi20
1 files changed, 17 insertions, 3 deletions
diff --git a/httemplate/browse/rate.cgi b/httemplate/browse/rate.cgi
index ea59a0c5b..79bebadee 100644
--- a/httemplate/browse/rate.cgi
+++ b/httemplate/browse/rate.cgi
@@ -8,9 +8,9 @@
'order_by' => 'ORDER BY ratenum',
},
'count_query' => $count_query,
- 'header' => [ '#', 'Rate plan', 'Rates' ],
- 'fields' => [ 'ratenum', 'ratename', $rates_sub ],
- 'links' => [ $link, $link, '' ],
+ 'header' => \@header,
+ 'fields' => \@fields,
+ 'links' => \@links,
'agent_virt' => 1,
'agent_pos' => 1,
'agent_null_right' => 'Configuration', #'Edit global CDR rates',
@@ -76,4 +76,18 @@ if ( $curuser->access_right('Configuration') ) { #, 'Edit global CDR rates') ) {
;
}
+my @header = ();
+my @fields = ();
+my @links = ();
+
+if ( FS::Record->scalar_sql('SELECT 1 FROM rate WHERE agent_rateid IS NOT NULL LIMIT 1') ) {
+ push @header, 'Legacy #';
+ push @fields, 'agent_rateid';
+ push @links, $link;
+}
+
+push @header, 'Rate plan', 'Rates';
+push @fields, 'ratename', $rates_sub;
+push @links, $link, '';
+
</%init>