summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/packages
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_main/packages')
-rw-r--r--httemplate/view/cust_main/packages/hidden.html55
-rwxr-xr-xhttemplate/view/cust_main/packages/section.html19
2 files changed, 74 insertions, 0 deletions
diff --git a/httemplate/view/cust_main/packages/hidden.html b/httemplate/view/cust_main/packages/hidden.html
new file mode 100644
index 000000000..e3bd0fabf
--- /dev/null
+++ b/httemplate/view/cust_main/packages/hidden.html
@@ -0,0 +1,55 @@
+% 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 ) {
+ Package type and location change
+% } elsif ( $pkgpart_change ) {
+ Package type change
+% } elsif ( $location_change ) {
+ Location change
+% } # or else what?
+ <B><% time2str('%b %o, %Y', $cust_pkg->get('cancel')) %></B>
+ </TD><TD>
+% if ( $pkgpart_change ) {
+ from <B><% $part_pkg->pkg |h %></B></A> - <% $part_pkg->custom_comment |h %>
+% }
+% if ( $pkgpart_change and $location_change ) {
+ <BR>
+% }
+% if ( $location_change ) {
+ from <I><% $cust_pkg->location_label %></I>
+% }
+ </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;
+
+</%init>
diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html
index 152ccaa5d..730bb2cf0 100755
--- a/httemplate/view/cust_main/packages/section.html
+++ b/httemplate/view/cust_main/packages/section.html
@@ -35,6 +35,25 @@
</TD>
<& services.html, %iopt &>
</TR>
+% # insert hidden predecessors to this package, if any
+% # and a rolldown button to show them
+% # (we'll make it do something later)
+% if ( $cust_pkg->get('changed_from_pkg') ) {
+ <TR CLASS="row<% $row % 2 %>">
+ <TD COLSPAN=4>
+ <BUTTON CLASS="rolldown_button"
+ ID="rolldown_<% $cust_pkg->change_pkgnum %>">
+ History &#x2b07;
+ </BUTTON>
+% # the hidden block here has ID="cust_pkgX" where X is the first pkgnum
+% # it contains.
+ <& hidden.html, $cust_pkg->get('changed_from_pkg'),
+ %iopt,
+ 'next_pkg' => $cust_pkg,
+ &>
+ </TD>
+ </TR>
+% }
% $row++;
% # show the change target, if there is one
% if ( $cust_pkg->change_to_pkg ) {