-<%
+%if ( $error ) {
+% $cgi->param('error', $error);
+<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
+%} else {
+<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
+%}
+<%init>
+
+my $conf = new FS::Conf;
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $regionnum = $cgi->param('regionnum');
my @npa = split(/\s*,\s*/, $cgi->param('npa'));
$npa[0] = '' unless @npa;
my @rate_prefix = map {
+ #my($npa,$nxx) = split('-', $_);
+ s/\D//g;
new FS::rate_prefix {
'countrycode' => $countrycode,
+ #'npa' => $npa,
+ #'nxx' => $nxx,
'npa' => $_,
}
} @npa;
new FS::rate_detail {
'ratenum' => $ratenum,
map { $_ => $cgi->param("$_$ratenum") }
- qw( min_included min_charge sec_granularity )
+ qw( min_included min_charge sec_granularity classnum )
};
} qsearch('rate', {} );
$regionnum = $new->getfield('regionnum');
}
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string );
-} else {
- #print $cgi->redirect(popurl(3). "browse/rate_region.cgi");
- print $cgi->redirect(popurl(3). "browse/rate.cgi");
-}
-
-%>
+</%init>