diff options
| author | Mark Wells <mark@freeside.biz> | 2013-07-15 18:25:13 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2013-07-15 18:25:13 -0700 |
| commit | ebcfdd04f1fe69028836d231238845801aa69505 (patch) | |
| tree | 8c2bbc29c554709d3e0576d3626630f58ca89d82 /httemplate/misc/change_pkg_now.cgi | |
| parent | 8e84773c2e9107185f0a0cf629cf357d7b8979f5 (diff) | |
future package change, #20687
Diffstat (limited to 'httemplate/misc/change_pkg_now.cgi')
| -rwxr-xr-x | httemplate/misc/change_pkg_now.cgi | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/httemplate/misc/change_pkg_now.cgi b/httemplate/misc/change_pkg_now.cgi new file mode 100755 index 000000000..73ee74020 --- /dev/null +++ b/httemplate/misc/change_pkg_now.cgi @@ -0,0 +1,22 @@ +%if ( $error ) { +% errorpage($error); +%} else { +<% $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')) %> +%} +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Change customer package'); + +#untaint pkgnum +my ($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal pkgnum"; +my $pkgnum = $1; + +my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +my $change_to = FS::cust_pkg->by_key($cust_pkg->change_to_pkgnum); + +my $err_or_pkg = $cust_pkg->change({ 'cust_pkg' => $change_to }); +my $error = $err_or_pkg unless ref($err_or_pkg); + +</%init> |
