collapse display of location-changed packages, #25130
[freeside.git] / httemplate / view / cust_main / packages / hidden.html
1 % if (!$iopt{noframe}) {
2 %   # then start the block here, and assign a suitable ID (cust_pkgX_block)
3 <TABLE CLASS="hiddenrows" STYLE="display: none" ID="<% $id %>_block">
4 % }
5   <TR ID="<% $id %>">
6     <TD>
7       <A NAME="<% $id %>"/>
8       <% $pkgnum %>
9     </TD>
10     <TD>
11 %     if ( $pkgpart_change and $location_change ) {
12       Package type and location change
13 %     } elsif ( $pkgpart_change ) {
14       Package type change
15 %     } elsif ( $location_change ) {
16       Location change
17 %     } # or else what?
18       <B><% time2str('%b %o, %Y', $cust_pkg->get('cancel')) %></B>
19     </TD><TD>
20 %     if ( $pkgpart_change ) {
21       from <B><% $part_pkg->pkg |h %></B></A> - <% $part_pkg->custom_comment |h %>
22 %     }
23 %     if ( $pkgpart_change and $location_change ) {
24       <BR>
25 %     }
26 %     if ( $location_change ) {
27       from <I><% $cust_pkg->location_label %></I>
28 %     }
29     </TD>
30   </TR>
31 % if ( $cust_pkg->get('changed_from_pkg') ) {
32 <& hidden.html, $cust_pkg->get('changed_from_pkg'),
33                 %iopt,
34                 'next_pkg' => $cust_pkg,
35                 'noframe' => 1
36 &>
37 % }
38 % if ( !$iopt{noframe} ) {
39 </TABLE>
40 % }
41 <%init>
42 my $cust_pkg = shift;
43 my $part_pkg = $cust_pkg->part_pkg;
44 my %iopt = @_;
45 my $next = delete($iopt{'next_pkg'});
46 my $curuser = $FS::CurrentUser::CurrentUser;
47 my $pkgnum = $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '';
48
49 my $id = "cust_pkg".$cust_pkg->pkgnum;
50
51 my $pkgpart_change = ($next->pkgpart != $cust_pkg->pkgpart);
52 my $location_change = ($next->locationnum != $cust_pkg->locationnum);
53 my $both_change = $pkgpart_change && $location_change;
54
55 </%init>