2 % $cgi->param('error', $error);
3 % $cgi->redirect(popurl(3). 'edit/cust_pkg.cgi?'. $cgi->query_string );
5 <% $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum") %>
9 my $curuser = $FS::CurrentUser::CurrentUser;
12 unless $curuser->access_right('Bulk change customer packages');
17 $cgi->param('custnum') =~ /^(\d+)$/;
20 my @remove_pkgnums = map {
21 /^(\d+)$/ or die "Illegal remove_pkg value!";
23 } $cgi->param('remove_pkg');
25 my( $action, $error_redirect ) = ( '', '' );
28 foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) {
29 if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) {
31 while ( $num_pkgs-- ) {
32 push @pkgparts,$pkgpart;
35 $error = "Illegal quantity";
40 $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);