<% include('/elements/error.html') %>
<FORM ACTION="<% $p1 %>process/cust_pkg.cgi" METHOD=POST>
-
+<INPUT TYPE="hidden" NAME="action" VALUE="bulk">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
-%
+
%#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)
<TABLE>
my $p1 = popurl(1);
</%init>
-
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";
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";
}
}
+} else {
+ die "guru exception #5: action is neither change nor bulk!";
}
$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);
<% include('/elements/error.html') %>
<FORM ACTION="<% $p %>edit/process/cust_pkg.cgi" METHOD=POST>
+<INPUT TYPE="hidden" NAME="action" VALUE="change">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
<INPUT TYPE="hidden" NAME="remove_pkg" VALUE="<% $pkgnum %>">