X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Frate_region.cgi;h=12cb180de217d39f9301d2b32226a4c1d343aa67;hp=934fe8035af4728e2c1387eae8786b17bc272675;hb=3ce7691203a7737406bf2d4442f7fd84b81f847e;hpb=15e561850b61b10a92a46d8f3e316d53d4970087 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 @@ -<% - -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') ) { %> -Error: <%= $cgi->param('error') %>
-<% } %> +Error: <% $cgi->param('error') %>
+% } -
- + -<%= ntable('#cccccc') %> + + +<% ntable('#cccccc') %> Region name - + Country code - + Prefixes - +
-<%= table() %> +<% table() %> Rate plan Included
minutes
Charge per
minute
Granularity +% 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' - }; - -%> - <%= $rate->ratename %> - min_included %>"> - $min_charge ) %>"> + <% $rate->ratename %> + min_included %>"> + $min_charge ) %>"> - +% foreach my $granularity ( keys %granularity ) { + +