summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-04-14 17:08:36 -0700
committerIvan Kohler <ivan@freeside.biz>2013-04-14 17:08:36 -0700
commit2e761a72c380dc9d7320ccd822cfe8476534b369 (patch)
tree4c26f3391325c2f0a3a6a117b7dc2b0ae94993b2 /httemplate/view
parenta9f4e76c1d2392514c4172dd869fd101e3a9c6ec (diff)
package contacts / "name per packages", RT#22185
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_main/packages.html7
-rw-r--r--httemplate/view/cust_main/packages/contact.html48
-rw-r--r--httemplate/view/cust_main/packages/location.html4
-rw-r--r--httemplate/view/cust_main/packages/package.html5
-rwxr-xr-xhttemplate/view/cust_main/packages/section.html17
-rw-r--r--httemplate/view/cust_main/packages/status.html2
6 files changed, 57 insertions, 26 deletions
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 24a12cc..546dd89 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -101,7 +101,7 @@ table.usage {
<TR>
<TD COLSPAN=2>
-% if ( $conf->exists('cust_pkg-group_by_location') and $show_location ) {
+% if ( $conf->exists('cust_pkg-group_by_location') ) {
<& locations.html,
'cust_main' => $cust_main,
'packages' => $packages,
@@ -113,7 +113,6 @@ table.usage {
<& packages/section.html,
'cust_main' => $cust_main,
'packages' => $packages,
- 'show_location' => $show_location,
&>
</TABLE>
% }
@@ -140,10 +139,6 @@ my $curuser = $FS::CurrentUser::CurrentUser;
my( $packages, $num_old_packages ) = get_packages($cust_main, $conf);
-
-my $show_location = $conf->exists('cust_pkg-always_show_location')
- || (grep $_->locationnum ne $cust_main->ship_locationnum, @$packages);
-
my $countrydefault = scalar($conf->config('countrydefault')) || 'US';
#subroutines
diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html
new file mode 100644
index 0000000..a6f8a42
--- /dev/null
+++ b/httemplate/view/cust_main/packages/contact.html
@@ -0,0 +1,48 @@
+% if ( $contact ) {
+ <% $contact->line |h %>
+% }
+
+% if ( ! $cust_pkg->get('cancel')
+% && $FS::CurrentUser::CurrentUser->access_right('Change customer package')
+% )
+% {
+ <FONT SIZE=-1>
+%#XXX (&nbsp;<%pkg_change_contact_link($cust_pkg)%>&nbsp;)
+%# % if ( $cust_pkg->contactnum ) {
+%# (&nbsp;<%edit_contact_link($cust_pkg->contactnum)%>&nbsp;)
+%# % }
+ </FONT>
+% }
+
+</TD>
+<%init>
+
+my $conf = new FS::Conf;
+my %opt = @_;
+
+my $cust_pkg = $opt{'cust_pkg'};
+
+my $contact = $cust_pkg->contact;
+
+sub pkg_change_contact_link {
+ my $cust_pkg = shift;
+ my $pkgpart = $cust_pkg->pkgpart;
+ include( '/elements/popup_link-cust_pkg.html',
+#XXX
+ 'action' => $p. "misc/change_pkg.cgi?contactnum=-1",
+ 'label' => emt('Change contact'),
+ 'actionlabel' => emt('Change'),
+ 'cust_pkg' => $cust_pkg,
+ );
+}
+
+sub edit_contact_link {
+ my $contactnum = shift;
+ include( '/elements/popup_link.html',
+ 'action' => $p. "edit/cust_contact.cgi?contactnum=$contactnum",
+ 'label' => emt('Edit contact'),
+ 'actionlabel' => emt('Edit'),
+ );
+}
+
+</%init>
diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html
index 9569485..f2d3798 100644
--- a/httemplate/view/cust_main/packages/location.html
+++ b/httemplate/view/cust_main/packages/location.html
@@ -1,5 +1,3 @@
-<TD CLASS="inv" BGCOLOR="<% $bgcolor %>" WIDTH="20%">
-
% if ( $default ) {
<DIV STYLE="font-style: italic; font-size: small">
% }
@@ -41,13 +39,11 @@
</FONT>
% }
-</TD>
<%init>
my $conf = new FS::Conf;
my %opt = @_;
-my $bgcolor = $opt{'bgcolor'};
my $cust_pkg = $opt{'cust_pkg'};
my $countrydefault = $opt{'countrydefault'} || 'US';
my $statedefault = $opt{'statedefault'}
diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html
index 0b72d19..520305a 100644
--- a/httemplate/view/cust_main/packages/package.html
+++ b/httemplate/view/cust_main/packages/package.html
@@ -186,11 +186,6 @@
% !$supplemental and
% $part_pkg->freq ne '0' ) {
<TR>
-% if ( !$opt{'show_location'} ) {
- <TD><FONT SIZE="-1">
- (&nbsp;<% pkg_change_location_link($cust_pkg) %>&nbsp;)
- </FONT></TD>
-% }
% if ( FS::Conf->new->exists('invoice-unitprice') ) {
<TD><FONT SIZE="-1">
(&nbsp;<% pkg_change_quantity_link($cust_pkg) %>&nbsp;)
diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html
index 8ea7a7d..5f54c0a 100755
--- a/httemplate/view/cust_main/packages/section.html
+++ b/httemplate/view/cust_main/packages/section.html
@@ -3,9 +3,7 @@
% #my $width = $show_location ? 'WIDTH="25%"' : 'WIDTH="33%"';
<TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Package') |h %></TH>
<TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Status') |h %></TH>
-% if ( $show_location ) {
- <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Location') |h %></TH>
-% }
+ <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Contact/Location') |h %></TH>
<TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Services') |h %></TH>
</TR>
@@ -13,6 +11,7 @@
% foreach my $cust_pkg (@$packages) {
<& .packagerow, $cust_pkg,
'cust_main' => $opt{'cust_main'},
+ 'bgcolor' => $opt{'bgcolor'},
%conf_opt
&>
% }
@@ -27,10 +26,11 @@
<!--pkgnum: <% $cust_pkg->pkgnum %>-->
<TR CLASS="row<%$row % 2%>">
<& package.html, %iopt &>
- <& status.html, %iopt &>
-% if ( $iopt{'show_location'} ) {
- <& location.html, %iopt &>
-% }
+ <& status.html, %iopt &>
+ <TD CLASS="inv" BGCOLOR="<% $iopt{bgcolor} %>" WIDTH="20%" VALIGN="top">
+ <& contact.html, %iopt &>
+ <& location.html, %iopt &>
+ </TD>
<& services.html, %iopt &>
</TR>
% $row++;
@@ -51,7 +51,6 @@ my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
my $packages = $opt{'packages'};
-my $show_location = $opt{'show_location'};
# Sort order is hardcoded for now, can change this if needed.
@$packages = sort {
@@ -86,8 +85,6 @@ my %conf_opt = (
'maestro-status_test' => $conf->exists('maestro-status_test'),
'cust_pkg-large_pkg_size' => scalar($conf->config('cust_pkg-large_pkg_size')),
- # for packages.html Change location link
- 'show_location' => $show_location,
);
</%init>
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index 6be0296..9d5a88e 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -1,4 +1,4 @@
-<TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
+<TD CLASS="inv" BGCOLOR="<% $bgcolor %>" VALIGN="top">
<TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
%#this should use cust_pkg->status and cust_pkg->statuscolor eventually