<% header($msg) %>
<%once> my $right = 'Delay suspension events'; <%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 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_pkg->dundate( $date ); $error = $cust_pkg->replace; } else { $error = "Unknown pkgnum"; } if ($error) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "delay_susp_pkg.html?". $cgi->query_string ); }