diff options
author | ivan <ivan> | 2011-06-16 23:06:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-06-16 23:06:20 +0000 |
commit | dbe1f22d63052dbbfe8b3cb578a0d831213ebb75 (patch) | |
tree | 64d085d5a4045b5e95b84c09a13146e34cb4450e /httemplate/misc/process | |
parent | d01937e1d00012b5221f676178710e4e47618c2c (diff) |
rework suspension delays, RT#6956
Diffstat (limited to 'httemplate/misc/process')
-rwxr-xr-x | httemplate/misc/process/delay_susp_pkg.html | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/httemplate/misc/process/delay_susp_pkg.html b/httemplate/misc/process/delay_susp_pkg.html index 8649cc235..675da0496 100755 --- a/httemplate/misc/process/delay_susp_pkg.html +++ b/httemplate/misc/process/delay_susp_pkg.html @@ -1,4 +1,4 @@ -<% header("Package suspension delayed") %> +<% header($msg) %> <SCRIPT TYPE="text/javascript"> window.top.location.reload(); </SCRIPT> @@ -21,21 +21,27 @@ $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; $pkgnum = $1; #untaint date -parse_datetime($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; -my $date = $1; +my $date = ''; +my $msg = ''; +if ( $cgi->param('date') ) { + parse_datetime($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; + $date = $1; + $msg = 'Package suspension delayed'; +} else { + $msg = 'Suspension delay removed'; +} $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); if ($cust_pkg) { - $cust_main = $cust_pkg->cust_main; - $cust_main->dundate( $date ); - $error = $cust_main->replace; + $cust_pkg->dundate( $date ); + $error = $cust_pkg->replace; } else { - $error = "Invalid pkgnum"; + $error = "Unknown pkgnum"; } if ($error) { $cgi->param('error', $error); - print $cgi->redirect(popurl(2). "cancel_pkg.html?". $cgi->query_string ); + print $cgi->redirect(popurl(2). "delay_susp_pkg.html?". $cgi->query_string ); } </%init> |