customer view UI
authorIvan Kohler <ivan@freeside.biz>
Fri, 15 May 2015 21:45:54 +0000 (14:45 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 15 May 2015 21:45:54 +0000 (14:45 -0700)
httemplate/elements/header.html
httemplate/view/cust_main.cgi
httemplate/view/cust_main/misc.html

index 30a6189..858be71 100644 (file)
@@ -23,7 +23,7 @@ Example:
 <HTML>
   <HEAD>
     <TITLE>
-      <% $title |h %>
+      <% $title %>
     </TITLE>
     <!-- per RT, to prevent IE compatibility mode -->
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
@@ -162,7 +162,7 @@ Example:
         <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
 
           <FONT SIZE=6>
-            <% $title |h %>
+            <% $title_noescape || encode_entities($title) %>
           </FONT>
 
 % unless ( $nobr ) {
@@ -172,7 +172,7 @@ Example:
           <% $menubar !~ /^\s*$/ ? "$menubar<BR><BR>" : '' %>
 <%init>
 
-my( $title, $menubar, $etc, $head ) = ( '', '', '', '' );
+my( $title, $title_noescape, $menubar, $etc, $head ) = ( '', '', '', '', '' );
 my( $nobr, $nocss ) = ( 0, 0 );
 
 my $mobile;
@@ -180,6 +180,7 @@ my $mobile;
 if ( ref($_[0]) ) {
   my $opt = shift;
   $title   = $opt->{title};
+  $title_noescape = $opt->{title_noescape};
   $menubar = $opt->{menubar};
   $etc     = $opt->{etc};
   $head    = $opt->{head};
index 081b96b..637c015 100755 (executable)
@@ -1,5 +1,6 @@
 <& /elements/header.html, {
              'title' => $title,
+             'title_noescape' => $title_noescape,
              'head'  => $head,
              'nobr'  => 1,
           }
@@ -169,12 +170,14 @@ function areyousure(href, message) {
 <TABLE BORDER=0>
 <TR>
   <TD VALIGN="top">
+    <& cust_main/contacts.html, $cust_main &>
+    <BR>
     <& cust_main/misc.html, $cust_main &>
-    <BR><& cust_main/contacts.html, $cust_main &>
   </TD>
   <TD VALIGN="top" STYLE="padding-left: 54px">
     <& cust_main/billing.html, $cust_main &>
-    <BR><& cust_main/cust_payby.html, $cust_main &>
+    <BR>
+    <& cust_main/cust_payby.html, $cust_main &>
   </TD>
 </TR>
 <TR>
@@ -331,10 +334,20 @@ my $cust_main = qsearchs( {
 });
 die "Customer not found!" unless $cust_main;
 
-my $title = $cust_main->name;
-$title = '('. $cust_main->display_custnum. ") $title"
-  if $conf->exists('cust_main-title-display_custnum');
-$title = mt("Customer:")." ".$title;
+my $title = encode_entities($cust_main->name);
+$title = '#'. $cust_main->display_custnum. " $title";
+#  if $conf->exists('cust_main-title-display_custnum');
+$title = mt("Customer")." ".$title;
+
+my @agentnums = $curuser->agentnums;
+if (scalar(@agentnums) > 1 ) {
+  $title = encode_entities($cust_main->agent->agent). " $title";
+}
+
+my $status = $cust_main->status_label;
+$status .= ' (Cancelled)' if $cust_main->is_status_delay_cancel;
+my $title_noescape = $title. ' (<B><FONT COLOR="#'. $cust_main->statuscolor. '">'. $status.  '</FONT></B>)';
+$title .= " ($status)";
 
 #false laziness w/pref/pref.html and Conf.pm (cust_main-default_view)
 tie my %views, 'Tie::IxHash',
index fe0e329..f0ecf8f 100644 (file)
@@ -1,15 +1,6 @@
+<FONT CLASS="fsinnerbox-title"><% mt('Miscellaneous information') |h %></FONT>
 <TABLE CLASS="fsinnerbox">
 
-<TR>
-  <TD ALIGN="right"><% mt('Customer number') |h %></TD>
-  <TD BGCOLOR="#ffffff"><% $cust_main->display_custnum %></TD>
-</TR>
-
-<TR>
-  <TD ALIGN="right"><% mt('Status') |h %></TD>
-  <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% $status_label %></B></FONT></TD>
-</TR>
-
 % my @part_tag = $cust_main->part_tag;
 % if ( $conf->config('cust_tag-location') =~ /^(cust_misc|)$/ && @part_tag ) {
 <TR>
 </TR>
 % }
 
-%unless ( scalar(@agentnums) == 1
-%         && !$curuser->access_right('View customers of all agents')  ) {
-%  my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
-   <TR>
-     <TD ALIGN="right"><% mt('Agent') |h %></TD>
-     <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
-   </TR>
-% }
-
 %  if ( $cust_main->agent_custid
 %       && ! $conf->exists('cust_main-default_agent_custid') ) {