summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/packages/hidden.html
blob: e1ffb365e95e6950d27ace68a2f6ed79100d0f35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
% if (!$iopt{noframe}) {
%   # then start the block here, and assign a suitable ID (cust_pkgX_block)
<TABLE CLASS="hiddenrows" STYLE="display: none" ID="<% $id %>_block">
% }
  <TR ID="<% $id %>">
    <TD>
      <A NAME="<% $id %>"/>
      <% $pkgnum %>
    </TD>
    <TD>
%     if ( $pkgpart_change and $location_change ) {
      <% emt('Package and location change') %>
%     } elsif ( $pkgpart_change ) {
      <% emt('Package change') %>
%     } elsif ( $location_change ) {
      <% emt('Location change') %>
%     } else { # in case the package was somehow replaced with itself
      <% emt('Other package change') %>
%     }
      <B><% time2str('%b %o, %Y', $cust_pkg->get('cancel')) %></B>
    </TD><TD>
%     if ( $pkgpart_change ) {
      <% emt('from') %> <% $popup_link |n %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->custom_comment |h %></A>
%     }
%     if ( $pkgpart_change and $location_change ) {
      <BR>
%     }
%     if ( $location_change ) {
      <% emt('from') %> <I><% $popup_link |n %><% $cust_pkg->location_label %></A></I>
%     }
%     if ( !$pkgpart_change and !$location_change ) {
%     # have to show _something_
      <% $popup_link |n %><% emt('Details') %></A>
%     }
    </TD>
  </TR>
% if ( $cust_pkg->get('changed_from_pkg') ) {
<& hidden.html, $cust_pkg->get('changed_from_pkg'),
                %iopt,
                'next_pkg' => $cust_pkg,
                'noframe' => 1
&>
% }
% if ( !$iopt{noframe} ) {
</TABLE>
% }
<%init>
my $cust_pkg = shift;
my $part_pkg = $cust_pkg->part_pkg;
my %iopt = @_;
my $next = delete($iopt{'next_pkg'});
my $curuser = $FS::CurrentUser::CurrentUser;
my $pkgnum = $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '';

my $id = "cust_pkg".$cust_pkg->pkgnum;

my $pkgpart_change = ($next->pkgpart != $cust_pkg->pkgpart);
my $location_change = ($next->locationnum != $cust_pkg->locationnum);
my $both_change = $pkgpart_change && $location_change;

my $onclick =
  include('/elements/popup_link_onclick.html',
    'action'      => $fsurl.'view/cust_pkg-popup.html?' . $cust_pkg->pkgnum,
    'actionlabel' => 'Package #'.$cust_pkg->pkgnum,
    'width'       => '1000',
    'height'      => '310',
    'color'       => $cust_pkg->statuscolor,
  );
my $popup_link = qq(<A HREF="#" onclick="$onclick">);

</%init>