summaryrefslogtreecommitdiff
path: root/httemplate/edit/rate_region.cgi
diff options
context:
space:
mode:
authorivan <ivan>2006-08-23 22:25:39 +0000
committerivan <ivan>2006-08-23 22:25:39 +0000
commit3ce7691203a7737406bf2d4442f7fd84b81f847e (patch)
tree90658b097da96772224f04771888ac6ca1a940aa /httemplate/edit/rate_region.cgi
parent15e561850b61b10a92a46d8f3e316d53d4970087 (diff)
Will things ever be the same again?
It's the final masonize
Diffstat (limited to 'httemplate/edit/rate_region.cgi')
-rw-r--r--httemplate/edit/rate_region.cgi135
1 files changed, 70 insertions, 65 deletions
diff --git a/httemplate/edit/rate_region.cgi b/httemplate/edit/rate_region.cgi
index 934fe8035..12cb180de 100644
--- a/httemplate/edit/rate_region.cgi
+++ b/httemplate/edit/rate_region.cgi
@@ -1,109 +1,114 @@
<!-- mason kludge -->
-<%
-
-my $rate_region;
-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+)$/;
- $rate_region = qsearchs( 'rate_region', { 'regionnum' => $1 } );
-} else { #adding
- $rate_region = new FS::rate_region {};
-}
-my $action = $rate_region->regionnum ? 'Edit' : 'Add';
-
-my $p1 = popurl(1);
-
-my %granularity = (
- '6' => '6 second',
- '60' => 'minute',
-);
-
-my @rate_prefix = $rate_region->rate_prefix;
-my $countrycode = '';
-if ( @rate_prefix ) {
- $countrycode = $rate_prefix[0]->countrycode;
- foreach my $rate_prefix ( @rate_prefix ) {
- eidiot 'multiple country codes per region not yet supported by web UI'
- unless $rate_prefix->countrycode eq $countrycode;
- }
-}
-
-%>
-
-<%= include("/elements/header.html","$action Region", menubar(
+%
+%
+%my $rate_region;
+%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+)$/;
+% $rate_region = qsearchs( 'rate_region', { 'regionnum' => $1 } );
+%} else { #adding
+% $rate_region = new FS::rate_region {};
+%}
+%my $action = $rate_region->regionnum ? 'Edit' : 'Add';
+%
+%my $p1 = popurl(1);
+%
+%my %granularity = (
+% '6' => '6 second',
+% '60' => 'minute',
+%);
+%
+%my @rate_prefix = $rate_region->rate_prefix;
+%my $countrycode = '';
+%if ( @rate_prefix ) {
+% $countrycode = $rate_prefix[0]->countrycode;
+% foreach my $rate_prefix ( @rate_prefix ) {
+% eidiot 'multiple country codes per region not yet supported by web UI'
+% unless $rate_prefix->countrycode eq $countrycode;
+% }
+%}
+%
+%
+
+
+<% include("/elements/header.html","$action Region", menubar(
'Main Menu' => $p,
#'View all regions' => "${p}browse/rate_region.cgi",
))
%>
+% if ( $cgi->param('error') ) {
-<% if ( $cgi->param('error') ) { %>
-<FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT><BR>
-<% } %>
+<FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT><BR>
+% }
-<FORM ACTION="<%=$p1%>process/rate_region.cgi" METHOD=POST>
-<INPUT TYPE="hidden" NAME="regionnum" VALUE="<%= $rate_region->regionnum %>">
+<FORM ACTION="<%$p1%>process/rate_region.cgi" METHOD=POST>
-<%= ntable('#cccccc') %>
+<INPUT TYPE="hidden" NAME="regionnum" VALUE="<% $rate_region->regionnum %>">
+
+<% ntable('#cccccc') %>
<TR>
<TH ALIGN="right">Region name</TH>
- <TD><INPUT TYPE="text" NAME="regionname" SIZE=32 VALUE="<%= $rate_region->regionname %>"></TR>
+ <TD><INPUT TYPE="text" NAME="regionname" SIZE=32 VALUE="<% $rate_region->regionname %>"></TR>
</TR>
<TR>
<TH ALIGN="right">Country code</TH>
- <TD><INPUT TYPE="text" NAME="countrycode" SIZE=4 MAXLENGTH=3 VALUE="<%= $countrycode %>"></TR>
+ <TD><INPUT TYPE="text" NAME="countrycode" SIZE=4 MAXLENGTH=3 VALUE="<% $countrycode %>"></TR>
</TR>
<TR>
<TH ALIGN="right">Prefixes</TH>
<TD>
- <TEXTAREA NAME="npa" WRAP=SOFT><%= join(', ', map $_->npa, @rate_prefix ) %></TEXTAREA>
+ <TEXTAREA NAME="npa" WRAP=SOFT><% join(', ', map $_->npa, @rate_prefix ) %></TEXTAREA>
</TD>
</TR>
</TABLE>
<BR>
-<%= table() %>
+<% table() %>
<TR>
<TH>Rate plan</TH>
<TH><FONT SIZE=-1>Included<BR>minutes</FONT></TH>
<TH><FONT SIZE=-1>Charge per<BR>minute</FONT></TH>
<TH><FONT SIZE=-1>Granularity</FONT></TH>
</TR>
+% foreach my $rate ( qsearch('rate', {}) ) {
+%
+% my $n = $rate->ratenum;
+% my $rate_detail = $rate->dest_detail($rate_region)
+% || new FS::rate_region { 'min_included' => 0,
+% 'min_charge' => 0,
+% 'sec_granularity' => '60'
+% };
+%
+%
-<% foreach my $rate ( qsearch('rate', {}) ) {
-
- my $n = $rate->ratenum;
- my $rate_detail = $rate->dest_detail($rate_region)
- || new FS::rate_region { 'min_included' => 0,
- 'min_charge' => 0,
- 'sec_granularity' => '60'
- };
-
-%>
<TR>
- <TD><A HREF="<%=$p%>edit/rate.cgi?<%= $rate->ratenum %>"><%= $rate->ratename %></TD>
- <TD><INPUT TYPE="text" SIZE=5 NAME="min_included<%=$n%>" VALUE="<%= $cgi->param("min_included$n") || $rate_detail->min_included %>"></TD>
- <TD>$<INPUT TYPE="text" SIZE=4 NAME="min_charge<%=$n%>" VALUE="<%= sprintf('%.2f', $cgi->param("min_charge$n") || $rate_detail->min_charge ) %>"></TD>
+ <TD><A HREF="<%$p%>edit/rate.cgi?<% $rate->ratenum %>"><% $rate->ratename %></TD>
+ <TD><INPUT TYPE="text" SIZE=5 NAME="min_included<%$n%>" VALUE="<% $cgi->param("min_included$n") || $rate_detail->min_included %>"></TD>
+ <TD>$<INPUT TYPE="text" SIZE=4 NAME="min_charge<%$n%>" VALUE="<% sprintf('%.2f', $cgi->param("min_charge$n") || $rate_detail->min_charge ) %>"></TD>
<TD>
- <SELECT NAME="sec_granularity<%=$n%>">
- <% foreach my $granularity ( keys %granularity ) { %>
- <OPTION VALUE="<%=$granularity%>"<%= $granularity == ( $cgi->param("sec_granularity$n") || $rate_detail->sec_granularity ) ? ' SELECTED' : '' %>><%=$granularity{$granularity}%>
- <% } %>
+ <SELECT NAME="sec_granularity<%$n%>">
+% foreach my $granularity ( keys %granularity ) {
+
+ <OPTION VALUE="<%$granularity%>"<% $granularity == ( $cgi->param("sec_granularity$n") || $rate_detail->sec_granularity ) ? ' SELECTED' : '' %>><%$granularity{$granularity}%>
+% }
+
</SELECT>
</TR>
-<% } %>
+% }
+
</TABLE>
-<BR><BR><INPUT TYPE="submit" VALUE="<%=
+<BR><BR><INPUT TYPE="submit" VALUE="<%
$rate_region->regionnum ? "Apply changes" : "Add region"
%>">