diff options
Diffstat (limited to 'httemplate/edit/process/quick-cust_pkg.cgi')
| -rw-r--r-- | httemplate/edit/process/quick-cust_pkg.cgi | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi new file mode 100644 index 000000000..66d02e307 --- /dev/null +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -0,0 +1,27 @@ +%#untaint custnum +%$cgi->param('custnum') =~ /^(\d+)$/ +% or die 'illegal custnum '. $cgi->param('custnum'); +%my $custnum = $1; +%$cgi->param('pkgpart') =~ /^(\d+)$/ +% or die 'illegal pkgpart '. $cgi->param('pkgpart'); +%my $pkgpart = $1; +% +%my @cust_pkg = (); +%my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, [ $cgi->param('refnum') ] ); +% +%if ($error) { +% $cgi->param('error', $error); +% print $cgi->redirect(popurl(2). 'misc/order_pkg.html?'. $cgi->query_string ); +%} else { +% my $frag = "cust_pkg". $cust_pkg[0]->pkgnum; +<% header('Package ordered') %> + <SCRIPT TYPE="text/javascript"> + // XXX fancy ajax rebuild table at some point, but a page reload will do for now + + // XXX chop off trailing #target and replace... ? + window.top.location = '<% popurl(3). "view/cust_main.cgi?keywords=$custnum;fragment=$frag#$frag" %>'; + + </SCRIPT> + + </BODY></HTML> +%} |
