summaryrefslogtreecommitdiff
path: root/httemplate/edit/rate.cgi
diff options
context:
space:
mode:
authormark <mark>2011-02-11 23:59:29 +0000
committermark <mark>2011-02-11 23:59:29 +0000
commit6a10d16ff4e806357abab206254aa38c80a749d3 (patch)
tree94dfb9705ba9d5aa8b3b0d1d96be6ba460115404 /httemplate/edit/rate.cgi
parentca2b8a8c99585a4619eb657f2c7fca12a7304249 (diff)
rate selection by CDR type, RT#10991
Diffstat (limited to 'httemplate/edit/rate.cgi')
-rw-r--r--httemplate/edit/rate.cgi32
1 files changed, 28 insertions, 4 deletions
diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi
index 13717dc1..1abfb0d 100644
--- a/httemplate/edit/rate.cgi
+++ b/httemplate/edit/rate.cgi
@@ -26,8 +26,24 @@ Rate plan
% if($rate->ratenum) {
<BR><BR><FONT SIZE="+2">Rates in this plan</FONT>
+% if ( my $select_cdr_type = include('/elements/select-cdr_type.html',
+% 'curr_value' => $cdrtypenum,
+% 'onchange' => 'form.submit();',
+% 'name_col' => 'cdrtypename',
+% 'value_col' => 'cdrtypenum',
+% 'empty_label' => '(default)',
+% ) ) {
+<FORM ACTION="<%$cgi->url%>" METHOD="GET">
+<INPUT TYPE="hidden" NAME="ratenum" VALUE="<% $rate->ratenum %>">
+<INPUT TYPE="hidden" NAME="countrycode" VALUE="<% $countrycode %>">
+<FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
+</FORM>
+% }
+
<% include('/edit/elements/rate_detail.html',
- 'ratenum' => $rate->ratenum
+ 'ratenum' => $rate->ratenum,
+ 'countrycode' => $countrycode,
+ 'cdrtypenum' => $cdrtypenum,
) %>
% }
@@ -39,13 +55,21 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $rate;
-if ( $cgi->keywords ) {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
+if ( $cgi->param('ratenum') ) {
+ $cgi->param('ratenum') =~ /^(\d+)$/;
$rate = qsearchs( 'rate', { 'ratenum' => $1 } );
} else { #adding
$rate = new FS::rate {};
}
my $action = $rate->ratenum ? 'Edit' : 'Add';
+my $countrycode = '';
+if ( $cgi->param('countrycode') =~ /^(\d+)$/ ) {
+ $countrycode = $1;
+}
+
+my $cdrtypenum = '';
+if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {
+ $cdrtypenum = $1;
+}
</%init>