3 % #my $width = $show_location ? 'WIDTH="25%"' : 'WIDTH="33%"';
4 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Package') |h %></TH>
5 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Status') |h %></TH>
6 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Contact/Location') |h %></TH>
7 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Services') |h %></TH>
10 % #$FS::cust_pkg::DEBUG = 2;
11 % foreach my $cust_pkg (@$packages) {
12 <& .packagerow, $cust_pkg,
13 ( map { $_ => $opt{$_} } qw(
15 no_links before_pkg_callback before_svc_callback after_svc_callback
20 % } else { # there are no packages
25 % my ($cust_pkg, %iopt) = @_;
26 % $iopt{'cust_pkg'} = $cust_pkg;
27 % $iopt{'part_pkg'} = $cust_pkg->part_pkg;
28 <!--pkgnum: <% $cust_pkg->pkgnum %>-->
29 <TR CLASS="row<%$row % 2%>">
30 <& package.html, %iopt &>
31 <& status.html, %iopt &>
32 <TD CLASS="inv" BGCOLOR="<% $iopt{bgcolor} %>" WIDTH="20%" VALIGN="top">
33 <& contact.html, %iopt &><BR>
34 <& location.html, %iopt &>
36 <& services.html, %iopt &>
38 % # insert hidden predecessors to this package, if any
39 % # and a rolldown button to show them
40 % # (we'll make it do something later)
41 % if ( $cust_pkg->get('changed_from_pkg') ) {
42 <TR CLASS="row<% $row % 2 %>">
44 <BUTTON CLASS="rolldown_button"
45 ID="rolldown_<% $cust_pkg->change_pkgnum %>">
48 % # the hidden block here has ID="cust_pkgX" where X is the first pkgnum
50 <& hidden.html, $cust_pkg->get('changed_from_pkg'),
52 'next_pkg' => $cust_pkg,
58 % # show the change target, if there is one
59 % if ( $cust_pkg->change_to_pkg ) {
60 <& .packagerow, $cust_pkg->change_to_pkg, %iopt, 'change_from' => 1 &>
62 % # include supplemental packages if any
63 % $iopt{'supplemental'} = ($iopt{'supplemental'} || 0) + 1;
64 % foreach my $supp_pkg ($cust_pkg->supplemental_pkgs) {
65 <& .packagerow, $supp_pkg, %iopt &>
74 my $conf = new FS::Conf;
76 my $curuser = $FS::CurrentUser::CurrentUser;
78 my $packages = $opt{'packages'};
80 # Sort order is hardcoded for now, can change this if needed.
82 ( $a->getfield('cancel') <=> $b->getfield('cancel') ) or
83 ( $a->getfield('setup') <=> $b->getfield('setup') ) or
84 ( $a->getfield('pkgnum') <=> $b->getfield('pkgnum') )
87 my %change_custnum = map { $_->change_custnum => 1 }
88 grep { $_->change_custnum }
89 grep { $_->getfield('cancel') }
92 my $pkg_attached = ( scalar(keys %change_custnum) == 1
93 && ! grep { ! $_->getfield('cancel') } @$packages
96 my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
100 'invoice-unitprice' => $conf->exists('invoice-unitprice'),
102 #for services.html and status.html
103 'cust_pkg-display_times' => ($conf->exists('cust_pkg-display_times')
104 || $curuser->option('cust_pkg-display_times')),
106 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'),
107 'pkg_attached' => $pkg_attached,
108 #for status.html pkg-balances
109 'pkg-balances' => $conf->exists('pkg-balances'),
110 'money_char' => ( $conf->config('money_char') || '$' ),
113 'countrydefault' => $countrydefault,
114 'statedefault' => ( scalar($conf->config('statedefault'))
115 || ($countrydefault eq 'US' ? 'CA' : '') ),
117 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'),
118 'legacy_link' => $conf->exists('legacy_link'),
119 'manage_link' => scalar($conf->config('svc_broadband-manage_link')),
120 'manage_link_text' => scalar($conf->config('svc_broadband-manage_link_text')),
121 'manage_link_loc' => scalar($conf->config('svc_broadband-manage_link_loc')),
122 'manage_link-new_window' => $conf->exists('svc_broadband-manage_link-new_window'),
123 'cust_pkg-large_pkg_size' => scalar($conf->config('cust_pkg-large_pkg_size')),