This commit was generated by cvs2svn to compensate for changes in r6252,
[freeside.git] / httemplate / edit / process / quick-cust_pkg.cgi
1 %if ($error) {
2 %  $cgi->param('error', $error);
3 <% $cgi->redirect(popurl(2). 'misc/order_pkg.html?'. $cgi->query_string ) %>
4 %} else {
5 %  my $frag = "cust_pkg". $cust_pkg[0]->pkgnum;
6 <% header('Package ordered') %>
7   <SCRIPT TYPE="text/javascript">
8     // XXX fancy ajax rebuild table at some point, but a page reload will do for now
9
10     // XXX chop off trailing #target and replace... ?
11     window.top.location = '<% popurl(3). "view/cust_main.cgi?keywords=$custnum;fragment=$frag#$frag" %>';
12
13   </SCRIPT>
14
15   </BODY></HTML>
16 %}
17 <%init>
18
19 die "access denied"
20   unless $FS::CurrentUser::CurrentUser->access_right('Order customer package');
21
22 #untaint custnum
23 $cgi->param('custnum') =~ /^(\d+)$/
24   or die 'illegal custnum '. $cgi->param('custnum');
25 my $custnum = $1;
26 $cgi->param('pkgpart') =~ /^(\d+)$/
27   or die 'illegal pkgpart '. $cgi->param('pkgpart');
28 my $pkgpart = $1;
29
30 my @cust_pkg = ();
31 my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, [ $cgi->param('refnum') ] );
32
33 </%init>