diff options
author | ivan <ivan> | 2008-03-04 19:15:05 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-03-04 19:15:05 +0000 |
commit | acd8edaf5852735359e32c70b78dabfeb7b32a89 (patch) | |
tree | b23656cdef41c18fbf3ce79a9a9d5316ba4a9e5b /httemplate/edit/process/cust_pkg.cgi | |
parent | 00c53199f47413deee33cac3abffc25d0fa9463c (diff) |
fix edit/process/cust_pkg getting confused about the two different places that would be calling it... i.e. with an empty new_pkgnum it would redirect the popup back the customer view, hehe
Diffstat (limited to 'httemplate/edit/process/cust_pkg.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_pkg.cgi | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index bdade321f..0dc82a600 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -30,9 +30,9 @@ my @remove_pkgnums = map { my $curuser = $FS::CurrentUser::CurrentUser; -my( $action, $error_redirect ); +my( $action, $error_redirect ) = ( '', '' ); my @pkgparts = (); -if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi +if ( $cgi->param('action') eq 'change' ) { #came from misc/change_pkg.cgi $action = 'change'; $error_redirect = "misc/change_pkg.cgi"; @@ -41,7 +41,7 @@ if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi die "access denied" unless $curuser->access_right('Change customer package'); -} else { #came from edit/cust_pkg.cgi +} elsif ( $cgi->param('action') eq 'bulk' ) { #came from edit/cust_pkg.cgi $action = 'bulk'; $error_redirect = "edit/cust_pkg.cgi"; @@ -61,6 +61,8 @@ if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi } } +} else { + die "guru exception #5: action is neither change nor bulk!"; } $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); |