projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tower tracking, RT#15538
[freeside.git]
/
httemplate
/
edit
/
process
/
rate_region.cgi
diff --git
a/httemplate/edit/process/rate_region.cgi
b/httemplate/edit/process/rate_region.cgi
index
861a6dc
..
d342e60
100755
(executable)
--- a/
httemplate/edit/process/rate_region.cgi
+++ b/
httemplate/edit/process/rate_region.cgi
@@
-1,6
+1,8
@@
%if ( $error ) {
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
%if ( $error ) {
% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). "rate_region.cgi?". $cgi->query_string ) %>
+%} elsif ( $action eq 'Add' ) {
+<% $cgi->redirect(popurl(2). "rate_region.cgi?$regionnum") %>
%} else {
<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
%}
%} else {
<% $cgi->redirect(popurl(3). "browse/rate_region.html") %>
%}
@@
-11,6
+13,7
@@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $regionnum = $cgi->param('regionnum');
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $regionnum = $cgi->param('regionnum');
+my $action = $regionnum ? 'Edit' : 'Add';
my $old = qsearchs('rate_region', { 'regionnum' => $regionnum } ) if $regionnum;
my $old = qsearchs('rate_region', { 'regionnum' => $regionnum } ) if $regionnum;
@@
-24,31
+27,21
@@
my $countrycode = $cgi->param('countrycode');
my @npa = split(/\s*,\s*/, $cgi->param('npa'));
$npa[0] = '' unless @npa;
my @rate_prefix = map {
my @npa = split(/\s*,\s*/, $cgi->param('npa'));
$npa[0] = '' unless @npa;
my @rate_prefix = map {
- my($npa,$nxx) = split('-', $_);
+ #my($npa,$nxx) = split('-', $_);
+ s/\D//g;
new FS::rate_prefix {
'countrycode' => $countrycode,
new FS::rate_prefix {
'countrycode' => $countrycode,
- 'npa' => $npa,
- 'nxx' => $nxx,
+ #'npa' => $npa,
+ #'nxx' => $nxx,
+ 'npa' => $_,
}
} @npa;
}
} @npa;
-
-my @dest_detail = map {
- my $ratenum = $_->ratenum;
- new FS::rate_detail {
- 'ratenum' => $ratenum,
- map { $_ => $cgi->param("$_$ratenum") }
- qw( min_included min_charge sec_granularity classnum )
- };
-} qsearch('rate', {} );
-
-
+# we no longer process dest_detail records here
my $error;
if ( $regionnum ) {
my $error;
if ( $regionnum ) {
- $error = $new->replace($old, 'rate_prefix' => \@rate_prefix,
- 'dest_detail' => \@dest_detail, );
+ $error = $new->replace($old, 'rate_prefix' => \@rate_prefix );
} else {
} else {
- $error = $new->insert( 'rate_prefix' => \@rate_prefix,
- 'dest_detail' => \@dest_detail, );
+ $error = $new->insert( 'rate_prefix' => \@rate_prefix );
$regionnum = $new->getfield('regionnum');
}
$regionnum = $new->getfield('regionnum');
}