RT# 75817 - updated UI to be more intuitive
[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 ".
16      $part_pkg->pkg_comment( cust_pkg=>$cust_pkg )
17 %>
18 <% ntable("#cccccc", 2) %>
19
20 <TR>
21   <TD>Delay until</TD>
22     <TD><INPUT TYPE="text" NAME="date" ID="dun_date" VALUE="<% $date |h %>">
23         <IMG SRC="<% $p %>images/calendar.png" ID="dun_button" STYLE="cursor:pointer" TITLE="Select date">
24         <BR><I>m/d/y</I>
25     </TD>
26 </TR>
27 <SCRIPT TYPE="text/javascript">
28   Calendar.setup({
29     inputField: "dun_date",
30     ifFormat:   "<% $date_format %>",
31     button:     "dun_button",
32     align:      "BR"
33   });
34 </SCRIPT>
35
36 </TABLE>
37
38 <BR>
39 <INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>">
40
41 </FORM>
42 </BODY>
43 </HTML>
44
45 <%init>
46
47 my $conf = new FS::Conf;
48 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
49
50 my $date = time2str($date_format, time);
51
52 my($pkgnum);
53 if ( $cgi->param('error') ) {
54   $pkgnum    = $cgi->param('pkgnum');
55   $date      = $cgi->param('date');
56 } elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
57   $pkgnum    = $1;
58 } else {
59   die "illegal query ". $cgi->keywords;
60 }
61
62 my $submit = 'Delay Suspension';
63 my $right  = 'Delay suspension events';
64
65 my $curuser = $FS::CurrentUser::CurrentUser;
66 die "access denied" unless $curuser->access_right($right);
67
68 my $title = 'Delay Suspension of Package';
69
70 my $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum})
71   or die "Unknown pkgnum: $pkgnum";
72
73 $date = time2str($date_format, $cust_pkg->dundate) 
74   if $cust_pkg->dundate
75   && ! $cgi->param('error');
76
77 my $part_pkg = $cust_pkg->part_pkg;
78
79 </%init>