optimize CDR rating after timed rate perf regression, RT#15739
[freeside.git] / httemplate / misc / delay_susp_pkg.html
1 %# if ( $link eq 'popup' ) { 
2   <% include('/elements/header-popup.html', $title ) %>
3 %# } else { 
4 %#  <%  include("/elements/header.html", $title, '') %>
5 %# } 
6
7 <% include('/elements/init_calendar.html') %>
8
9 <% include('/elements/error.html') %>
10
11 <FORM NAME="ds_popup" ACTION="<% popurl(1) %>process/delay_susp_pkg.html" METHOD=POST>
12 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
13
14 <BR><BR>
15 <% "Delay automatic suspension of " .$part_pkg->pkg_comment %>
16 <% ntable("#cccccc", 2) %>
17
18 <TR>
19   <TD>Delay until</TD>
20     <TD><INPUT TYPE="text" NAME="date" ID="dun_date" VALUE="<% $date |h %>">
21         <IMG SRC="<% $p %>images/calendar.png" ID="dun_button" STYLE="cursor:pointer" TITLE="Select date">
22         <BR><I>m/d/y</I>
23     </TD>
24 </TR>
25 <SCRIPT TYPE="text/javascript">
26   Calendar.setup({
27     inputField: "dun_date",
28     ifFormat:   "<% $date_format %>",
29     button:     "dun_button",
30     align:      "BR"
31   });
32 </SCRIPT>
33
34 </TABLE>
35
36 <BR>
37 <INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>">
38
39 </FORM>
40 </BODY>
41 </HTML>
42
43 <%init>
44
45 my $conf = new FS::Conf;
46 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
47
48 my $date = time2str($date_format, time);
49
50 my($pkgnum);
51 if ( $cgi->param('error') ) {
52   $pkgnum    = $cgi->param('pkgnum');
53   $date      = $cgi->param('date');
54 } elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
55   $pkgnum    = $1;
56 } else {
57   die "illegal query ". $cgi->keywords;
58 }
59
60 my $submit = 'Delay Suspension';
61 my $right  = 'Delay suspension events';
62
63 my $curuser = $FS::CurrentUser::CurrentUser;
64 die "access denied" unless $curuser->access_right($right);
65
66 my $title = 'Delay Suspension of Package';
67
68 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum})
69   or die "Unknown pkgnum: $pkgnum";
70
71 $date = time2str($date_format, $cust_pkg->dundate) 
72   if $cust_pkg->dundate
73   && ! $cgi->param('error');
74
75 my $part_pkg = $cust_pkg->part_pkg;
76
77 </%init>