Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / view / cust_main.cgi
index d18c7f7..637c015 100755 (executable)
@@ -1,5 +1,6 @@
 <& /elements/header.html, {
              'title' => $title,
+             'title_noescape' => $title_noescape,
              'head'  => $head,
              'nobr'  => 1,
           }
@@ -170,13 +171,13 @@ function areyousure(href, message) {
 <TR>
   <TD VALIGN="top">
     <& cust_main/contacts.html, $cust_main &>
+    <BR>
+    <& cust_main/misc.html, $cust_main &>
   </TD>
   <TD VALIGN="top" STYLE="padding-left: 54px">
-    <& cust_main/misc.html, $cust_main &>
-% if ( $conf->config('payby-default') ne 'HIDE' ) { 
-      <BR><& cust_main/billing.html, $cust_main &>
-% } 
-
+    <& cust_main/billing.html, $cust_main &>
+    <BR>
+    <& cust_main/cust_payby.html, $cust_main &>
   </TD>
 </TR>
 <TR>
@@ -281,9 +282,7 @@ function areyousure(href, message) {
 
 % if ( $view eq 'payment_history' || $view eq 'jumbo' ) {
 
-% if ( $conf->config('payby-default') ne 'HIDE' ) { 
-  <& cust_main/payment_history.html, $cust_main &>
-% } 
+<& cust_main/payment_history.html, $cust_main &>
 
 % }
 
@@ -335,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',
@@ -352,8 +361,7 @@ if ( $conf->config('ticket_system') ) {
 }
 $views{emt('Quotations')}      =  'quotations';
 $views{emt('Packages')}        =  'packages';
-$views{emt('Payment History')} =  'payment_history'
-                               unless $conf->config('payby-default' eq 'HIDE');
+$views{emt('Payment History')} =  'payment_history';
 $views{emt('Change History')}  =  'change_history'
   if $curuser->access_right('View customer history');
 $views{$conf->config('cust_main-custom_title') || emt('Custom')} =  'custom'