summaryrefslogtreecommitdiff
path: root/httemplate/edit/rate_region.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_region.cgi
parentca2b8a8c99585a4619eb657f2c7fca12a7304249 (diff)
rate selection by CDR type, RT#10991
Diffstat (limited to 'httemplate/edit/rate_region.cgi')
-rw-r--r--httemplate/edit/rate_region.cgi31
1 files changed, 22 insertions, 9 deletions
diff --git a/httemplate/edit/rate_region.cgi b/httemplate/edit/rate_region.cgi
index cae30030a..367bbafb6 100644
--- a/httemplate/edit/rate_region.cgi
+++ b/httemplate/edit/rate_region.cgi
@@ -35,17 +35,28 @@
</TABLE>
-<BR><BR>
+<BR>
<INPUT TYPE="submit" VALUE="<% $rate_region->regionnum ? "Apply changes" : "Add region" %>">
</FORM>
%# rate plan info, if the region has been created yet
% if($rate_region->regionnum) {
-<BR>
-<BR>
-<FONT SIZE="+2">Rates in this region</FONT>
+<BR><BR><FONT SIZE="+2">Rates in this region</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="regionnum" VALUE="<% $rate_region->regionnum %>">
+<FONT SIZE="+1">Usage type: <% $select_cdr_type %></FONT>
+</FORM>
+% }
<% include('/edit/elements/rate_detail.html',
- 'regionnum' => $rate_region->regionnum,
+ 'regionnum' => $rate_region->regionnum,
+ 'cdrtypenum' => $cdrtypenum,
) %>
% }
@@ -68,9 +79,8 @@ if ( $cgi->param('error') ) {
$rate_region = new FS::rate_region ( {
map { $_, scalar($cgi->param($_)) } fields('rate_region')
} );
-} elsif ( $cgi->keywords ) {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/ or die "unparsable regionnum";
+} elsif ( $cgi->param('regionnum') ) {
+ $cgi->param('regionnum') =~ /^(\d+)$/ or die "unparseable regionnum";
$rate_region = qsearchs( 'rate_region', { 'regionnum' => $1 } )
or die "unknown regionnum $1\n";
} else { #adding
@@ -91,5 +101,8 @@ if ( @rate_prefix ) {
unless $rate_prefix->countrycode eq $countrycode;
}
}
-
+my $cdrtypenum = '';
+if ( $cgi->param('cdrtypenum') =~ /^(\d+)$/ ) {
+ $cdrtypenum = $1;
+}
</%init>