blob: 675da04961958d67d551ba63b4c1197e3e219e91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
<% header($msg) %>
<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
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 );
}
</%init>
|