584891aea02125da4d83eb24fc521710c1eabefd
[freeside.git] / httemplate / browse / rate.cgi
1 <% include( 'elements/browse.html',
2                  'title'       => 'Rate plans',
3                  'menubar'     => [ 'Main menu' => $p, ],
4                  'html_init'   => $html_init,
5                  'name'        => 'rate plans',
6                  'query'       => { 'table'     => 'rate',
7                                     'hashref'   => {},
8                                     'extra_sql' => 'ORDER BY ratenum',
9                                   },
10                  'count_query' => $count_query,
11                  'header'      => [ '#', 'Rate plan', ],
12                  'fields'      => [ 'ratenum', 'ratename' ],
13                  'links'       => [ $link, $link ],
14              )
15 %>
16 <%init>
17
18 die "access denied"
19   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
20
21 my $html_init = 
22 'Rate plans, regions and prefixes for VoIP and call billing.<BR><BR>'.
23 qq!<A HREF="${p}edit/rate.cgi"><I>Add a rate plan</I></A>!.
24 qq! | <A HREF="${p}edit/rate_region.cgi"><I>Add a region</I></A>!.
25 '<BR><BR>
26  <SCRIPT>
27  function rate_areyousure(href) {
28   if (confirm("Are you sure you want to delete this rate plan?") == true)
29     window.location.href = href;
30  }
31  </SCRIPT>';
32
33 my $count_query = 'SELECT COUNT(*) FROM rate';
34
35 my $link = [ $p.'edit/rate.cgi?', 'ratenum' ];
36
37 </%init>