1 <% include("/elements/header.html","$action Rate plan", menubar(
2 'View all rate plans' => "${p}browse/rate.cgi",
6 <% include('/elements/progress-init.html',
8 [ 'rate', 'preserve_rate_detail' ], # 'rate', 'min_', 'sec_' ],
13 <FORM NAME="OneTrueForm">
14 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
17 <INPUT TYPE="text" NAME="ratename" SIZE=32 VALUE="<% $rate->ratename %>">
20 <INPUT TYPE="hidden" NAME="preserve_rate_detail" VALUE="1">
22 <INPUT NAME="submit" TYPE="button" VALUE="<%
23 $rate->ratenum ? "Apply changes" : "Add rate plan"
24 %>" onClick="document.OneTrueForm.submit.disabled=true; process();">
27 % if($rate->ratenum) {
28 <BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
29 % if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
30 % 'curr_value' => $cdrtypenum,
31 % 'onchange' => 'form.submit();',
32 % 'name_col' => 'cdrtypename',
33 % 'value_col' => 'cdrtypenum',
34 % 'empty_label' => '(default)',
36 <FORM ACTION="<%$cgi->url%>" METHOD="GET">
37 <INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
38 <INPUT TYPE="hidden" NAME="countrycode" VALUE="<% $countrycode %>">
39 <FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
43 <% include('/edit/elements/rate_detail.html',
44 'ratenum' => $rate->ratenum,
45 'countrycode' => $countrycode,
46 'cdrtypenum' => $cdrtypenum,
50 <% include('/elements/footer.html') %>
55 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
58 if ( $cgi->param('ratenum') ) {
59 $cgi->param('ratenum') =~ /^(\d+)$/;
60 $rate = qsearchs( 'rate', { 'ratenum' => $1 } );
62 $rate = new FS::rate {};
64 my $action = $rate->ratenum ? 'Edit' : 'Add';
67 if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
72 if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {