[freeside-commits] freeside/httemplate/edit/process cust_pkg.cgi, 1.8, 1.9

Ivan,,, ivan at wavetail.420.am
Tue Mar 4 11:15:07 PST 2008


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv1411/edit/process

Modified Files:
	cust_pkg.cgi 
Log Message:
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

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_pkg.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_pkg.cgi	13 Jan 2008 21:35:53 -0000	1.8
+++ cust_pkg.cgi	4 Mar 2008 19:15:05 -0000	1.9
@@ -30,9 +30,9 @@
 
 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 @@
   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 @@
     }
   }
 
+} else {
+  die "guru exception #5: action is neither change nor bulk!";
 }
 
 $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);



More information about the freeside-commits mailing list