e41ea2b1ae43481012cbf385659e646274dac8e6
[freeside.git] / httemplate / misc / bulk_suspend_pkg.cgi
1 <% include('/elements/header-popup.html', "Suspend Packages") %>
2
3 % if ( $cgi->param('error') ) {
4   <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
5   <BR><BR>
6 % }
7
8 <FORM ACTION="<% $p %>misc/process/bulk_suspend_pkg.cgi" METHOD=POST>
9
10 %# some false laziness w/search/cust_pkg.cgi
11
12 <INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
13 % for my $param (
14 %   qw(
15 %     agentnum cust_status cust_main_salesnum salesnum custnum magic status
16 %     custom pkgbatch zip reasonnum
17 %     477part 477rownum date
18 %     report_option
19 %   ),
20 %   grep { /^location_\w+$/ || /^report_option_any/ } $cgi->param
21 % ) {
22   <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
23 % }
24 %
25 % for my $param (qw( censustract censustract2 ) ) {
26 %   next unless grep { $_ eq $param } $cgi->param;
27   <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
28 % }
29 %
30 % for my $param (qw( pkgpart classnum refnum towernum )) {
31 %   foreach my $value ($cgi->param($param)) {
32       <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $value |h %>">
33 %   }
34 % }
35 %
36 % foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
37
38   <INPUT TYPE="hidden" NAME="<% $field %>_null" VALUE="<% $cgi->param("${field}_null") |h %>">
39   <INPUT TYPE="hidden" NAME="<% $field %>_begin" VALUE="<% $cgi->param("${field}_begin") |h %>">
40   <INPUT TYPE="hidden" NAME="<% $field %>_beginning" VALUE="<% $cgi->param("${field}_beginning") |h %>">
41   <INPUT TYPE="hidden" NAME="<% $field %>_end" VALUE="<% $cgi->param("${field}_end") |h %>">
42   <INPUT TYPE="hidden" NAME="<% $field %>_ending" VALUE="<% $cgi->param("${field}_ending") |h %>">
43 % }
44
45 <% ntable('#cccccc') %>
46
47 % my $date_init = 0;
48   <& /elements/tr-input-date-field.html, {
49       'name'    => 'suspend_date',
50       'value'   => $date,
51       'label'   => mt("Suspend package on"),
52       'format'  => $date_format,
53   } &>
54 %   $date_init = 1;
55
56   <& /elements/tr-select-reason.html,
57        field          => 'suspend_reasonnum',
58        reason_class   => 'S',
59   &>
60
61 % if ( $FS::CurrentUser::CurrentUser->access_right('Unsuspend customer package')) {
62
63   <& /elements/tr-input-date-field.html, {
64       'name'    => 'suspend_resume_date',
65       'value'   => '',
66       'label'   => mt('Unsuspend on'),
67       'format'  => $date_format,
68       'noinit'  => $date_init,
69   } &>
70 % }
71
72 </TABLE>
73
74 <BR>
75 <INPUT TYPE="submit" VALUE="Suspend Packages">
76
77 </FORM>
78 </BODY>
79 </HTML>
80
81 <%init>
82
83 die "access denied"
84   unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages');
85
86 #use Date::Parse qw(str2time);
87 #<table style="background-color: #cccccc; border-spacing: 2; width: 100%">
88
89 my $conf = new FS::Conf;
90 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
91
92 my $date = time;
93
94 </%init>