X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fchange_history_common.html;h=4c05f4e3a2907b9e5824545dbd00428d74715028;hp=dfcfcb9588e0df3d225a76c89f8865f5ec15a2e8;hb=833cfe5c9938d33c3e6b97ed610c25a7afa6eb04;hpb=3d07673d44b50749619bdf1f2b6b931c7ca30d8d diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html index dfcfcb958..4c05f4e3a 100644 --- a/httemplate/elements/change_history_common.html +++ b/httemplate/elements/change_history_common.html @@ -44,6 +44,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; } @@ -102,39 +136,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 %> @@ -208,6 +210,12 @@ my $tag_labelsub = sub { $label. ': '. encode_entities($part_tag->tagname). ''; }; +my $contact_labelsub = sub { + my($item, $label) = @_; + my $contact = qsearchs('h_contact',{ contactnum => $item->contactnum }); + $label. ': '. encode_entities($contact->first). ' ' . encode_entities($contact->last) . ''; +}; + my %h_table_labelsub = ( 'h_cust_pkg' => $pkg_labelsub, 'h_svc_acct' => $svc_labelsub, @@ -220,6 +228,7 @@ my %h_table_labelsub = ( 'h_svc_phone' => $svc_labelsub, #'h_phone_device' #'h_cust_tag' => $tag_labelsub, + 'h_contact' => $contact_labelsub, ); my $tag_descripsub = sub {