9efe3fc713e1cae88d71d50fb509cc0b41a59d82
[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       <% emt('Package type and location change') %>
13 %     } elsif ( $pkgpart_change ) {
14       <% emt('Package type change') %>
15 %     } elsif ( $location_change ) {
16       <% emt('Location change') %>
17 %     } else { # in case the package was somehow replaced with itself
18       <% emt('Other package change') %>
19 %     }
20       <B><% time2str('%b %o, %Y', $cust_pkg->get('cancel')) %></B>
21     </TD><TD>
22 %     if ( $pkgpart_change ) {
23       <% emt('from') %> <% $popup_link |n %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->custom_comment |h %></A>
24 %     }
25 %     if ( $pkgpart_change and $location_change ) {
26       <BR>
27 %     }
28 %     if ( $location_change ) {
29       <% emt('from') %> <I><% $popup_link |n %><% $cust_pkg->location_label %></A></I>
30 %     }
31 %     if ( !$pkgpart_change and !$location_change ) {
32 %     # have to show _something_
33       <% $popup_link |n %><% emt('Details') %></A>
34 %     }
35     </TD>
36   </TR>
37 % if ( $cust_pkg->get('changed_from_pkg') ) {
38 <& hidden.html, $cust_pkg->get('changed_from_pkg'),
39                 %iopt,
40                 'next_pkg' => $cust_pkg,
41                 'noframe' => 1
42 &>
43 % }
44 % if ( !$iopt{noframe} ) {
45 </TABLE>
46 % }
47 <%init>
48 my $cust_pkg = shift;
49 my $part_pkg = $cust_pkg->part_pkg;
50 my %iopt = @_;
51 my $next = delete($iopt{'next_pkg'});
52 my $curuser = $FS::CurrentUser::CurrentUser;
53 my $pkgnum = $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '';
54
55 my $id = "cust_pkg".$cust_pkg->pkgnum;
56
57 my $pkgpart_change = ($next->pkgpart != $cust_pkg->pkgpart);
58 my $location_change = ($next->locationnum != $cust_pkg->locationnum);
59 my $both_change = $pkgpart_change && $location_change;
60
61 my $onclick =
62   include('/elements/popup_link_onclick.html',
63     'action'      => $fsurl.'view/cust_pkg-popup.html?' . $cust_pkg->pkgnum,
64     'actionlabel' => 'Package #'.$cust_pkg->pkgnum,
65     'width'       => '1000',
66     'height'      => '310',
67     'color'       => $cust_pkg->statuscolor,
68   );
69 my $popup_link = qq(<A HREF="#" onclick="$onclick">);
70
71 </%init>