X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fquick-cust_pkg.cgi;h=6b65653c23113f6a20af3e40224eae907d0eff3c;hb=3a17b276638200475d54201fa62566b7440e819a;hp=c4f5172ad0ab9413ff509b273da3645c7037e794;hpb=34678d474a3710a38e42fd681607fe98edb56658;p=freeside.git diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index c4f5172ad..6b65653c2 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -1,34 +1,33 @@ -<% -# +%if ($error) { +% $cgi->param('error', $error); +<% $cgi->redirect(popurl(2). 'misc/order_pkg.html?'. $cgi->query_string ) %> +%} else { +% my $frag = "cust_pkg". $cust_pkg[0]->pkgnum; +<% header('Package ordered') %> + + + +%} +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Order customer package'); #untaint custnum $cgi->param('custnum') =~ /^(\d+)$/ - or eidiot 'illegal custnum '. $cgi->param('custnum'); -$custnum = $1; + or die 'illegal custnum '. $cgi->param('custnum'); +my $custnum = $1; $cgi->param('pkgpart') =~ /^(\d+)$/ - or eidiot 'illegal pkgpart '. $cgi->param('pkgpart'); -$pkgpart = $1; + or die 'illegal pkgpart '. $cgi->param('pkgpart'); +my $pkgpart = $1; my @cust_pkg = (); -$error ||= FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, ); - -if ($error) { - eidiot($error); -} else { - print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum ); -} - -%> +my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, [ $cgi->param('refnum') ] ); +