6 $cgi->param('custnum') =~ /^(\d+)$/;
9 my @remove_pkgnums = map {
10 /^(\d+)$/ or die "Illegal remove_pkg value!";
12 } $cgi->param('remove_pkg');
16 if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi
17 $error_redirect = "misc/change_pkg.cgi";
19 } else { #came from edit/cust_pkg.cgi
20 $error_redirect = "edit/cust_pkg.cgi";
21 foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) {
22 if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) {
24 while ( $num_pkgs-- ) {
25 push @pkgparts,$pkgpart;
28 $error = "Illegal quantity";
34 $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);
37 $cgi->param('error', $error);
38 print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string );
40 print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");