From acd8edaf5852735359e32c70b78dabfeb7b32a89 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 4 Mar 2008 19:15:05 +0000 Subject: [PATCH] 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 --- httemplate/edit/cust_pkg.cgi | 8 ++------ httemplate/edit/process/cust_pkg.cgi | 8 +++++--- httemplate/misc/change_pkg.cgi | 1 + 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi index ecc21195d..f927e1042 100755 --- a/httemplate/edit/cust_pkg.cgi +++ b/httemplate/edit/cust_pkg.cgi @@ -3,15 +3,12 @@ <% include('/elements/error.html') %>
- + -% + %#current packages %my @cust_pkg = qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ); -% %if (@cust_pkg) { -% - Current packages - select to remove (services are moved to a new package below) @@ -151,4 +148,3 @@ if ( $cgi->param('error') ) { my $p1 = popurl(1); - 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); diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi index 7c88876d4..d6a24fb32 100755 --- a/httemplate/misc/change_pkg.cgi +++ b/httemplate/misc/change_pkg.cgi @@ -3,6 +3,7 @@ <% include('/elements/error.html') %> + -- 2.11.0