diff options
author | ivan <ivan> | 2002-10-04 12:56:36 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-10-04 12:56:36 +0000 |
commit | 86f41071c9f7a088e89998b87b65822ca32d3bcd (patch) | |
tree | 2208746a35ed3c78cbc5bced0934e00e96be0739 /httemplate/edit/process/cust_pkg.cgi | |
parent | e98319438189ccb880db60393f0f8d63c0739e14 (diff) |
working on the road:
- easier "change package" link for changing one package to another
- sqlradius export now compatible with Pg
- indices on phone numbers
- install instructions specify Pg 7.1 (at least until ILIKE thing is changed)
- searching on phone number fragments
Diffstat (limited to 'httemplate/edit/process/cust_pkg.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_pkg.cgi | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index f8c9f5151..df8471c27 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -11,16 +11,23 @@ my @remove_pkgnums = map { $1; } $cgi->param('remove_pkg'); +my $error_redirect; my @pkgparts; -foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { - if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { - my $num_pkgs = $1; - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; +if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi + $error_redirect = "misc/change_pkg.cgi"; + @pkgparts = ($1); +} else { #came from edit/cust_pkg.cgi + $error_redirect = "edit/cust_pkg.cgi"; + foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { + if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { + my $num_pkgs = $1; + while ( $num_pkgs-- ) { + push @pkgparts,$pkgpart; + } + } else { + $error = "Illegal quantity"; + last; } - } else { - $error = "Illegal quantity"; - last; } } @@ -28,7 +35,7 @@ $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); if ($error) { $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string ); + print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string ); } else { print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); } |