From: Ivan Kohler Date: Mon, 30 Apr 2012 03:38:20 +0000 (-0700) Subject: self-service small_custview obeys selfservice-box_color and selfservice-text_color... X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=cace6fef1d121d43d76166851aaa30c6c15857e5 self-service small_custview obeys selfservice-box_color and selfservice-text_color now, RT#17534 --- diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 08e3f7e4b..46ea66ad5 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -115,7 +115,7 @@ sub skin_info { ( map { $_ => scalar( $conf->config($_, $agentnum) ) } qw( company_name date_format ) ), ( map { $_ => scalar( $conf->config("selfservice-$_", $agentnum ) ) } - qw( body_bgcolor box_bgcolor + qw( body_bgcolor box_bgcolor stripe1_bgcolor stripe2_bgcolor text_color link_color vlink_color hlink_color alink_color font title_color title_align title_size menu_bgcolor menu_fontsize ) @@ -418,15 +418,21 @@ sub customer_info { $return{open_invoices} = \@open; } + $return{countrydefault} = scalar($conf->config('countrydefault')); + $return{small_custview} = small_custview( $cust_main, - scalar($conf->config('countrydefault')), + $return{countrydefault}, ( $session->{'pkgnum'} ? 1 : 0 ), #nobalance ); $return{name} = $cust_main->first. ' '. $cust_main->get('last'); $return{ship_name} = $cust_main->ship_first. ' '. $cust_main->get('ship_last'); + $return{has_ship_address} = $cust_main->has_ship_address; + $return{status} = $cust_main->status; + $return{statuscolor} = $cust_main->statuscolor; + for (@cust_main_editable_fields) { $return{$_} = $cust_main->get($_); } @@ -509,9 +515,11 @@ sub customer_info_short { my $cust_main = qsearchs('cust_main', $search ) or return { 'error' => "unknown custnum $custnum" }; + $return{countrydefault} = scalar($conf->config('countrydefault')); + $return{small_custview} = small_custview( $cust_main, - scalar($conf->config('countrydefault')), + $return{countrydefault}, 1, ##nobalance ); diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 82e5ea89c..39ca9c908 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -4026,6 +4026,23 @@ and customer address. Include units.', }, { + 'key' => 'selfservice-stripe1_bgcolor', + 'section' => 'self-service', + 'description' => 'HTML color for self-service interface lists (primary stripe), for example, #FFFFFF', + 'type' => 'text', + 'per_agent' => 1, + }, + + { + 'key' => 'selfservice-stripe2_bgcolor', + 'section' => 'self-service', + 'description' => 'HTML color for self-service interface lists (alternate stripe), for example, #DDDDDD', + 'type' => 'text', + 'per_agent' => 1, + }, + + + { 'key' => 'selfservice-text_color', 'section' => 'self-service', 'description' => 'HTML text color for the self-service interface, for example, #000000', diff --git a/FS/FS/UI/Web/small_custview.pm b/FS/FS/UI/Web/small_custview.pm index 36dd30c6d..53a3b5e33 100644 --- a/FS/FS/UI/Web/small_custview.pm +++ b/FS/FS/UI/Web/small_custview.pm @@ -29,7 +29,7 @@ sub small_custview { : qsearchs('cust_main', { 'custnum' => $arg } ) or die "unknown custnum $arg"; - my $html; + my $html = '
'; $html = qq!View ' if $url; @@ -129,6 +129,8 @@ sub small_custview { # last payment might be good here too? + $html .= '
'; + $html; } diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html index d27f688e3..5370f7c22 100644 --- a/fs_selfservice/FS-SelfService/cgi/myaccount.html +++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html @@ -2,7 +2,9 @@ <%= include('header', 'My Account') %> Hello <%= $name %>!

-<%= $small_custview %> + +<%= include('small_custview') %> +
<%= if ( $access_pkgnum ) { $OUT .= qq!Balance: \$$balance

!; @@ -34,17 +36,17 @@ Hello <%= $name %>!

$OUT .= ''. ''; my $link = qq!!; + my $td = qq!$td${a}Invoice #". $invoice->{'invnum'}. "$td". "$td$a". $invoice->{'date'}. "$td". - qq!'. ''; $col = $col eq $col1 ? $col2 : $col1; @@ -61,12 +63,12 @@ Hello <%= $name %>!

''. ''. ''; - my $col1 = "ffffff"; - my $col2 = "dddddd"; + my $col1 = $stripe1_bgcolor || '#ffffff'; + my $col2 = $stripe2_bgcolor || '#dddddd'; my $col = $col1; foreach my $support ( @support_services ) { - my $td = qq!
Open Invoices
!; my $a=qq!'; $OUT .= "
$a\$!. $invoice->{'owed'}. + qq!$a\$!. $invoice->{'owed'}. '
Support Time Remaining
PackageTime Remaining
!; + my $td = qq!!; my $a = qq!'; $OUT .= diff --git a/fs_selfservice/FS-SelfService/cgi/small_custview.html b/fs_selfservice/FS-SelfService/cgi/small_custview.html new file mode 100644 index 000000000..8d6e07368 --- /dev/null +++ b/fs_selfservice/FS-SelfService/cgi/small_custview.html @@ -0,0 +1,69 @@ +
+ +Customer #<%= $custnum %> + - <%= ucfirst($status)%> + + + + + +<%= if ( $has_ship_address ) { + + $OUT .= ''. + '
+ <%= $has_ship_address + ? 'Billing Address
' + : '' + %> + <%= $first %> <%= $last %>
+ <%= $company ? $company.'
' : '' %> + <%= $address1 %>
+ <%= $address2 ? $address2.'
' : '' %> + <%= $city %>, <%= $state %> <%= $zip %>
+ <%= $country && $country ne ($countrydefault||'US') + ? $country.'
' + : '' + %> + <%= if ( $daytime && $night ) { + $OUT .= "
Day Phone $daytime
Night Phone $night"; + } elsif ( $daytime || $night ) { + $OUT .= '
'. ($daytime || $night); + } + ''; + %> + <%= $fax ? "
Fax $fax" : '' %> + +
 '. + 'Service Address
'. + "$ship_first $ship_last
"; + $OUT .= "$ship_company
" if $ship_company; + $OUT .= "$ship_address1
"; + $OUT .= "$ship_address2
" if $ship_address2; + $OUT .= "$ship_city, $ship_state $ship_zip
"; + $OUT .= "$ship_country
" + if $ship_country && $ship_country ne ($countrydefault||'US'); + + + if ( $ship_daytime && $ship_night ) { + $OUT .= "
Day Phone $ship_daytime
Night Phone $ship_night"; + } elsif ( $ship_daytime || $ship_night ) { + $OUT .= ' + +
+ +<%= unless ( $access_pkgnum ) { + $OUT .= '
Balance: $'. $balance. '
'; + } + ''; +%> + +
+ diff --git a/fs_selfservice/FS-SelfService/cgi/ticket_summary.html b/fs_selfservice/FS-SelfService/cgi/ticket_summary.html index c840ca9d6..4333c4e92 100644 --- a/fs_selfservice/FS-SelfService/cgi/ticket_summary.html +++ b/fs_selfservice/FS-SelfService/cgi/ticket_summary.html @@ -1,10 +1,10 @@ - + <%= -my $col1 = "ffffff"; -my $col2 = "dddddd"; +my $col1 = $stripe1_bgcolor || "#ffffff"; +my $col2 = $stripe2_bgcolor || "#dddddd"; my $col = $col1; my $can_set_priority = @@ -26,12 +26,15 @@ my @titles = ('#', qw(Subject Queue Status Created Due)); push @titles, 'Estimated
Hours'; push @titles, 'Priority'; -$OUT .= join("\n", map { "" } @titles) +$box_bgcolor ||= '#c0c0c0'; +my $th = qq($th> " } @titles) . ''; foreach my $ticket ( @tickets ) { my $id = $ticket->{'id'}; - my $td = qq!'; my $link = qq!!; $OUT .= '' . @@ -41,31 +44,34 @@ $td. $ticket->{'queue'} . ''. $space . $td. $ticket->{'status'} . ''. $space . $td. $date_formatter->($ticket->{'created'}) . ''. $space . $td. $date_formatter->($ticket->{'due'}) . ''. $space . -qq!'. $space . -qq!'; if ( exists($ticket_error{$id}) ) { # display error message compactly - $OUT .= ''; + } else { + $OUT .= $td.''; } } else { - $OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . ''; + $OUT .= ($ticket->{'content'} || $ticket->{'priority'}) . ''. + $td.''; } $OUT .= ''; $col = $col eq $col1 ? $col2 : $col1; } #foreach my $ticket if ( $can_set_priority ) { - $OUT .= ''; } %>
Open Tickets
Open Tickets
$_ $_
!; + my $td = qq!!; my $space = $td.' 
!. +qq!!. ($ticket->{'timeestimated'} ? sprintf('%.1f', $ticket->{'timeestimated'} / 60.0) # .1f? : '' ) . '!; +qq!!; if ( $can_set_priority ) { $OUT .= '' . '*
+ $OUT .= '