summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_main.cgi5
-rw-r--r--httemplate/view/cust_main/billing.html16
-rw-r--r--httemplate/view/cust_main/contacts.html119
-rw-r--r--httemplate/view/cust_main/contacts_new.html37
-rw-r--r--httemplate/view/cust_main/misc.html4
5 files changed, 107 insertions, 74 deletions
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index dcadf9912..fda4db0d9 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -150,6 +150,11 @@ function areyousure(href, message) {
</TD>
</TR>
+<TR>
+ <TD COLSPAN = 2>
+ <& cust_main/contacts_new.html, $cust_main &>
+ </TD>
+</TR>
</TABLE>
% }
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index f1add6fcc..522c6db86 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -1,4 +1,4 @@
-<% mt('Billing information') |h %>
+<FONT CLASS="fsinnerbox-title"><% mt('Billing information') |h %></FONT>
%# If we can't see the unencrypted card, then bill now is an exercise in
%# frustration (without some sort of job queue magic to send it to a secure
%# machine, anyway)
@@ -6,14 +6,14 @@
% && ! $cust_main->is_encrypted($cust_main->payinfo)
% ) {
%# (<A HREF="<% $p %>misc/bill.cgi?<% $cust_main->custnum %>"><% mt('Bill now') |h %></A>)
- (<& /elements/bill.html,
- custnum => $cust_main->custnum,
- label => emt('Bill now'),
- url => $p.'view/cust_main.cgi?'.$cust_main->custnum,
- &>)
+ <& /elements/bill.html,
+ custnum => $cust_main->custnum,
+ label => emt('Bill now'),
+ url => $p.'view/cust_main.cgi?'.$cust_main->custnum,
+ &>
% }
-<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
+<TABLE CLASS="fsinnerbox">
%( my $balance = $cust_main->balance )
% =~ s/^(\-?)(.*)$/<FONT SIZE=+1>$1<\/FONT>$money_char$2/;
@@ -285,7 +285,7 @@
% }
-</TABLE></TD></TR></TABLE>
+</TABLE>
<%once>
my $paystate_label = FS::Msgcat::_gettext('paystate');
diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html
index 68e3b17ad..b3e52b556 100644
--- a/httemplate/view/cust_main/contacts.html
+++ b/httemplate/view/cust_main/contacts.html
@@ -5,8 +5,8 @@
% foreach my $which ( '', 'ship_' ) {
% my $pre = $cust_main->get("${which}last") ? $which : '';
-<% $which{$which} %> <% mt('address') |h %>
-<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
+<FONT CLASS="fsinnerbox-title"><% $which{$which} %> <% mt('address') |h %></FONT>
+<TABLE CLASS="fsinnerbox">
<TR>
<TD ALIGN="right"><% mt('Contact name') |h %></TD>
<TD COLSPAN=5 BGCOLOR="#ffffff">
@@ -17,18 +17,23 @@
<TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || '&nbsp' %></TD>
% }
</TR>
+
% if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
-<TR>
- <TD ALIGN="right"><% mt('Email invoices') |h %></TD>
- <TD BGCOLOR="#ffff00">
- <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
- </TD>
-</TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Email invoices') |h %></TD>
+ <TD BGCOLOR="#ffff00">
+ <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
+ </TD>
+ </TR>
% }
-<TR>
- <TD ALIGN="right"><% mt('Company') |h %></TD>
- <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
-</TR>
+
+% if ( $cust_main->get("${pre}company") ) {
+ <TR>
+ <TD ALIGN="right"><% mt('Company') |h %></TD>
+ <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
+ </TR>
+% }
+
<TR>
<TD ALIGN="right"><% mt('Address') |h %></TD>
<TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD>
@@ -74,42 +79,30 @@
&>
% }
-<TR>
- <TD ALIGN="right"><% $daytime_label %></TD>
- <TD COLSPAN=3 BGCOLOR="#ffffff">
- <& /elements/phonenumber.html,
- $cust_main->get("${pre}daytime"),
- 'callable'=>1,
- 'calling_list_exempt'=>$cust_main->calling_list_exempt,
- &>
- </TD>
-</TR>
-<TR>
- <TD ALIGN="right"><% $night_label %></TD>
- <TD COLSPAN=3 BGCOLOR="#ffffff">
- <& /elements/phonenumber.html,
- $cust_main->get("${pre}night"),
- 'callable'=>1,
- 'calling_list_exempt'=>$cust_main->calling_list_exempt,
- &>
- </TD>
-</TR>
-<TR>
- <TD ALIGN="right"><% $mobile_label %></TD>
- <TD COLSPAN=3 BGCOLOR="#ffffff">
- <& /elements/phonenumber.html,
- $cust_main->get("${pre}mobile"),
- 'callable'=>1,
- 'calling_list_exempt'=>$cust_main->calling_list_exempt,
- &>
- </TD>
-</TR>
-<TR>
- <TD ALIGN="right"><% mt('Fax') |h %></TD>
- <TD COLSPAN=3 BGCOLOR="#ffffff">
- <% $cust_main->get("${pre}fax") || '&nbsp' %>
- </TD>
-</TR>
+% foreach my $phone (grep $cust_main->get($pre.$_), qw( daytime night mobile )){
+
+ <TR>
+ <TD ALIGN="right"><% $phone_label{$phone} %></TD>
+ <TD COLSPAN=3 BGCOLOR="#ffffff">
+ <& /elements/phonenumber.html,
+ $cust_main->get($pre.$phone),
+ 'callable'=>1,
+ 'calling_list_exempt'=>$cust_main->calling_list_exempt,
+ &>
+ </TD>
+ </TR>
+
+% }
+
+% if ( $cust_main->get("${pre}fax") ) {
+ <TR>
+ <TD ALIGN="right"><% mt('Fax') |h %></TD>
+ <TD COLSPAN=3 BGCOLOR="#ffffff">
+ <% $cust_main->get("${pre}fax") || '&nbsp' %>
+ </TD>
+ </TR>
+% }
+
% if ( $which eq '' && $conf->exists('show_stateid') ) {
<TR>
<TD ALIGN="right"><% $stateid_label %></TD>
@@ -118,23 +111,31 @@
<TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
</TR>
% }
-</TABLE></TD></TR></TABLE>
+
+</TABLE>
% if ( $which ne 'ship_' ) {
<BR>
% }
% }
-<& contacts_new.html, $cust_main &>
<%once>
-my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
- ? 'Day&nbsp;Phone'
- : FS::Msgcat::_gettext('daytime');
-my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
- ? 'Night&nbsp;Phone'
- : FS::Msgcat::_gettext('night');
-my $mobile_label = FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
- ? 'Mobile&nbsp;Phone'
- : FS::Msgcat::_gettext('Mobile');
+my %phone_label = (
+
+ 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
+ ? 'Day&nbsp;Phone'
+ : FS::Msgcat::_gettext('daytime')
+ ),
+
+ 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
+ ? 'Night&nbsp;Phone'
+ : FS::Msgcat::_gettext('night')
+ ),
+
+ 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
+ ? 'Mobile&nbsp;Phone'
+ : FS::Msgcat::_gettext('Mobile')
+ ),
+);
my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
? 'Driver&rsquo;s&nbsp;License'
diff --git a/httemplate/view/cust_main/contacts_new.html b/httemplate/view/cust_main/contacts_new.html
index bd812c7e7..155490fe1 100644
--- a/httemplate/view/cust_main/contacts_new.html
+++ b/httemplate/view/cust_main/contacts_new.html
@@ -1,17 +1,44 @@
-% if ( @contacts ) {
<BR>
-Contacts
-<% ntable("#cccccc",2) %>
+<FONT CLASS="fsinnerbox-title">Contacts</FONT>
+<A HREF="<%$p%>/edit/cust_main-contacts.html?<% $cust_main->custnum %>">Edit contacts</A>
+<TABLE CLASS="fsinnerbox">
% foreach my $contact ( @contacts ) {
+% #XXX maybe this should be a table with alternating colors instead
<TR>
- <TD ALIGN="right">Contact</TD>
+ <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD>
<TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
+
+% my @contact_email = $contact->contact_email;
+% if (@contact_email) {
+ <TD ALIGN="right">&nbsp;&nbsp;&nbsp;Email</TD>
+ <TD BGCOLOR="#FFFFFF"><% join(', ', map $_->emailaddress, @contact_email) %></TD>
+% }
+
+% foreach my $phone_type (@phone_type) {
+% my $contact_phone =
+% qsearchs('contact_phone', {
+% 'contactnum' => $contact->contactnum,
+% 'phonetypenum' => $phone_type->phonetypenum,
+% })
+% or next;
+ <TD ALIGN="right">&nbsp;&nbsp;&nbsp;<% $phone_type->typename %> phone</TD>
+ <TD BGCOLOR="#FFFFFF"><% $contact_phone->phonenum |h %></TD>
+% }
+
+% if ( $contact->comment ) {
+ <TD ALIGN="right">&nbsp;&nbsp;&nbsp;Comment</TD>
+ <TD BGCOLOR="#FFFFFF"><% $contact->comment |h %></TD>
+
+% }
+
</TR>
% }
</TABLE>
+<%once>
-% }
+my @phone_type = qsearch({table=>'phone_type', order_by=>'weight'});
+</%once>
<%init>
my( $cust_main ) = @_;
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
index 28414ef2d..295328721 100644
--- a/httemplate/view/cust_main/misc.html
+++ b/httemplate/view/cust_main/misc.html
@@ -1,4 +1,4 @@
-<% ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
+<TABLE CLASS="fsinnerbox">
<TR>
<TD ALIGN="right"><% mt('Customer number') |h %></TD>
@@ -150,7 +150,7 @@
<% $cust_main->pvf($_)->widget('HTML', 'view', $cust_main->getfield($_)) %>
% }
-</TABLE></TD></TR></TABLE>
+</TABLE>
<%init>
my( $cust_main ) = @_;