diff options
author | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-08-23 22:25:39 +0000 |
commit | 3ce7691203a7737406bf2d4442f7fd84b81f847e (patch) | |
tree | 90658b097da96772224f04771888ac6ca1a940aa /httemplate/edit/process/cust_pkg.cgi | |
parent | 15e561850b61b10a92a46d8f3e316d53d4970087 (diff) |
Will things ever be the same again?
It's the final masonize
Diffstat (limited to 'httemplate/edit/process/cust_pkg.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_pkg.cgi | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index df8471c27..817c88087 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -1,43 +1,44 @@ -<% +% +% +%my $error = ''; +% +%#untaint custnum +%$cgi->param('custnum') =~ /^(\d+)$/; +%my $custnum = $1; +% +%my @remove_pkgnums = map { +% /^(\d+)$/ or die "Illegal remove_pkg value!"; +% $1; +%} $cgi->param('remove_pkg'); +% +%my $error_redirect; +%my @pkgparts; +%if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi +% $error_redirect = "misc/change_pkg.cgi"; +% @pkgparts = ($1); +%} else { #came from edit/cust_pkg.cgi +% $error_redirect = "edit/cust_pkg.cgi"; +% foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { +% if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { +% my $num_pkgs = $1; +% while ( $num_pkgs-- ) { +% push @pkgparts,$pkgpart; +% } +% } else { +% $error = "Illegal quantity"; +% last; +% } +% } +%} +% +%$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); +% +%if ($error) { +% $cgi->param('error', $error); +% print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string ); +%} else { +% print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); +%} +% +% -my $error = ''; - -#untaint custnum -$cgi->param('custnum') =~ /^(\d+)$/; -my $custnum = $1; - -my @remove_pkgnums = map { - /^(\d+)$/ or die "Illegal remove_pkg value!"; - $1; -} $cgi->param('remove_pkg'); - -my $error_redirect; -my @pkgparts; -if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi - $error_redirect = "misc/change_pkg.cgi"; - @pkgparts = ($1); -} else { #came from edit/cust_pkg.cgi - $error_redirect = "edit/cust_pkg.cgi"; - foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { - if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { - my $num_pkgs = $1; - while ( $num_pkgs-- ) { - push @pkgparts,$pkgpart; - } - } else { - $error = "Illegal quantity"; - last; - } - } -} - -$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); - -if ($error) { - $cgi->param('error', $error); - print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string ); -} else { - print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -} - -%> |