diff options
author | jeff <jeff> | 2008-09-26 03:54:25 +0000 |
---|---|---|
committer | jeff <jeff> | 2008-09-26 03:54:25 +0000 |
commit | f411189684b0ca7cc1b4b3e9be1895607245b595 (patch) | |
tree | 8d219fe11c5554a304b8d6c56407a1922cb370ca /httemplate/misc/process | |
parent | e2d78a94d7806862da7fcea0025cd380d49d5a75 (diff) |
push out event triggered suspensions
Diffstat (limited to 'httemplate/misc/process')
-rwxr-xr-x | httemplate/misc/process/delay_susp_pkg.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/httemplate/misc/process/delay_susp_pkg.html b/httemplate/misc/process/delay_susp_pkg.html new file mode 100755 index 000000000..c7cc7de7c --- /dev/null +++ b/httemplate/misc/process/delay_susp_pkg.html @@ -0,0 +1,41 @@ +<% header("Package suspension delayed") %> + <SCRIPT TYPE="text/javascript"> + window.top.location.reload(); + </SCRIPT> + </BODY> +</HTML> +<%once> + +my $right = 'Delay suspension events'; + +</%once> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right($right); + +my ($pkgnum, $date, $cust_pkg, $cust_main, $error); + +#untaint pkgnum +$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; +$pkgnum = $1; + +#untaint date +str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; +my $date = $1; + +$cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); +if ($cust_pkg) { + $cust_main = $cust_pkg->cust_main; + $cust_main->dundate( $date ); + $error = $cust_main->replace; +} else { + $error = "Invalid pkgnum"; +} + +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cancel_pkg.html?". $cgi->query_string ); +} + +</%init> |