1 <& /elements/header.html, 'Edit package report classes' &>
2 %# change that title if we add any other editing controls
4 %# this should be centralized somewhere
5 <STYLE TYPE="text/css">
6 .row0 { background-color: #eeeeee; }
7 .row1 { background-color: #ffffff; }
10 <FORM ACTION="process/bulk-part_pkg.html" METHOD="POST">
12 The following packages will be changed:<BR>
13 % foreach my $pkgpart (sort keys(%part_pkg)) {
14 <INPUT TYPE="hidden" NAME="pkgpart" VALUE="<% $pkgpart %>">
15 <% $part_pkg{$pkgpart}->pkg_comment |h %><BR>
19 <& /elements/table-grid.html &>\
20 <& /elements/tr-justtitle.html, value => mt('Report classes') &>
22 % foreach my $num (sort keys %report_class) {
23 <TR CLASS="row<%$row % 2%>">
25 % if ( defined $initial_state{$num} ) {
26 <& /elements/checkbox.html,
27 field => 'report_option_'.$num,
29 curr_value => $initial_state{$num}
32 % # needs to be a tristate so that you can say "don't change it"
33 <& /elements/checkbox-tristate.html, field => 'report_option_'.$num &>
36 <TD><% $report_class{$num}->name %></TD>
44 <& /elements/footer.html &>
46 die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Bulk edit package definitions');
47 my @pkgparts = $cgi->param('pkgpart')
48 or die "no package definitions selected";
50 my %part_pkg = map { $_ => FS::part_pkg->by_key($_) } @pkgparts;
51 my %part_pkg_option = map { $_ => { $part_pkg{$_}->options } } @pkgparts;
52 my %report_class = map { $_->num => $_ }
53 qsearch('part_pkg_report_option', { disabled => '' });
56 foreach my $num (keys %report_class) {
59 foreach my $option (values %part_pkg_option) {
60 if ( $option->{"report_option_$num"} ) {
67 $initial_state{$num} = undef;
69 $initial_state{$num} = 1;
71 $initial_state{$num} = 0;
72 } # else, uh, you didn't provide any pkgparts