From d647e72f22abc6715b6597d17a68851409b53d0b Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 15 May 2015 14:45:54 -0700 Subject: [PATCH] customer view UI --- httemplate/elements/header.html | 7 ++++--- httemplate/view/cust_main.cgi | 25 +++++++++++++++++++------ httemplate/view/cust_main/misc.html | 20 +------------------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 30a6189f6..858be71da 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -23,7 +23,7 @@ Example: - <% $title |h %> + <% $title %> @@ -162,7 +162,7 @@ Example: - <% $title |h %> + <% $title_noescape || encode_entities($title) %> % unless ( $nobr ) { @@ -172,7 +172,7 @@ Example: <% $menubar !~ /^\s*$/ ? "$menubar

" : '' %> <%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}; diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 081b96bed..637c015ca 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -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) { @@ -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. ' ('. $status. ')'; +$title .= " ($status)"; #false laziness w/pref/pref.html and Conf.pm (cust_main-default_view) tie my %views, 'Tie::IxHash', diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index fe0e329c3..f0ecf8f70 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -1,15 +1,6 @@ +<% mt('Miscellaneous information') |h %>
+ <& cust_main/contacts.html, $cust_main &> +
<& cust_main/misc.html, $cust_main &> -
<& cust_main/contacts.html, $cust_main &>
<& cust_main/billing.html, $cust_main &> -
<& cust_main/cust_payby.html, $cust_main &> +
+ <& cust_main/cust_payby.html, $cust_main &>
- - - - - - - - - - % my @part_tag = $cust_main->part_tag; % if ( $conf->config('cust_tag-location') =~ /^(cust_misc|)$/ && @part_tag ) { @@ -26,15 +17,6 @@ % } -%unless ( scalar(@agentnums) == 1 -% && !$curuser->access_right('View customers of all agents') ) { -% my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); - - - - -% } - % if ( $cust_main->agent_custid % && ! $conf->exists('cust_main-default_agent_custid') ) { -- 2.11.0
<% mt('Customer number') |h %><% $cust_main->display_custnum %>
<% mt('Status') |h %><% $status_label %>
<% mt('Agent') |h %><% $agent->agentnum %>: <% $agent->agent %>