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