From 016ff1020b1c0f1c4258c17209a9a7e48402dd5c Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Fri, 2 Jun 2017 09:08:36 -0400 Subject: [PATCH] RT# 74122 - updated change history to not show data with out a description --- httemplate/elements/change_history_common.html | 68 +++++++++++++------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html index 7300707d1..63337cb6a 100644 --- a/httemplate/elements/change_history_common.html +++ b/httemplate/elements/change_history_common.html @@ -42,6 +42,40 @@ % } else { % $bgcolor = $bgcolor1; % } +% +% ## Create Description and check to see it is not empty, no need to display a record with no description, so skip it. +% my $description = ''; +% if ( $item->table eq 'legacy_cust_history' ) { +% $description = $item->description; +% } elsif ( $item->table eq 'h_cust_tag' ) { +% $description = &{ $h_table_descripsub{$item->table} }( $item, $tables{'cust_tag'} ) +% if $single_cust && $h_table_descripsub{$item->table}; +% } else { +% $description = join(', ', +% map { my $value = ( $_ =~ /(^pay(info|cvv)|^ss|_password)$/ ) +% ? 'N/A' +% : $item->get($_); +% $value = time2str($cust_pkg_date_format, $value) +% if $item->table eq 'h_cust_pkg' +% && $cust_pkg_date_fields{$_} +% && $value; +% +% $value = substr($value, 0, 77).'...' if length($value) > 80; +% $value = encode_entities($value); +% "$_:$value"; +% } +% grep { $history_other +% ? ( $item->get($_) ne $history_other->get($_) ) +% : ( $item->get($_) =~ /\S/ ) +% } +% grep { ! /^(history|custnum$)/i } +% $item->fields +% ); +% if ( $single_cust && $h_table_descripsub{$item->table} ) { +% $description = &{ $h_table_descripsub{$item->table} }( $item ); +% } +% } #else +% if (!$description) { next; } @@ -100,39 +134,7 @@ -% my $description = ''; -% if ( $item->table eq 'legacy_cust_history' ) { - <% $item->description |h %> -% } elsif ( $item->table eq 'h_cust_tag' ) { -% $description = &{ $h_table_descripsub{$item->table} }( $item, $tables{'cust_tag'} ) -% if $single_cust && $h_table_descripsub{$item->table}; - <% $description %> -% } else { - <% join(', ', - map { my $value = ( $_ =~ /(^pay(info|cvv)|^ss|_password)$/ ) - ? 'N/A' - : $item->get($_); - $value = time2str($cust_pkg_date_format, $value) - if $item->table eq 'h_cust_pkg' - && $cust_pkg_date_fields{$_} - && $value; - - $value = substr($value, 0, 77).'...' if length($value) > 80; - $value = encode_entities($value); - "$_:$value"; - } - grep { $history_other - ? ( $item->get($_) ne $history_other->get($_) ) - : ( $item->get($_) =~ /\S/ ) - } - grep { ! /^(history|custnum$)/i } - $item->fields - ) - %> -% if ( $single_cust && $h_table_descripsub{$item->table} ) { - <% &{ $h_table_descripsub{$item->table} }( $item ) %> -% } -% } + <% $description %> -- 2.11.0