X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fchange_history_common.html;h=f22e093605fd02fa45d8f422b2ca936d5c44f4dd;hp=dfcfcb9588e0df3d225a76c89f8865f5ec15a2e8;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=3d07673d44b50749619bdf1f2b6b931c7ca30d8d diff --git a/httemplate/elements/change_history_common.html b/httemplate/elements/change_history_common.html index dfcfcb958..f22e09360 100644 --- a/httemplate/elements/change_history_common.html +++ b/httemplate/elements/change_history_common.html @@ -44,6 +44,42 @@ % } 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 { +% my @fields = $item->fields; +% push @fields, 'message_dest' if $item->table eq 'h_contact'; +% $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 } +% @fields +% ); +% if ( $single_cust && $h_table_descripsub{$item->table} ) { +% $description = &{ $h_table_descripsub{$item->table} }( $item ); +% } +% } #else +% if (!$description) { next; } @@ -102,39 +138,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 +212,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 +230,8 @@ my %h_table_labelsub = ( 'h_svc_phone' => $svc_labelsub, #'h_phone_device' #'h_cust_tag' => $tag_labelsub, + 'h_contact' => $contact_labelsub, + 'h_cust_contact' => $contact_labelsub, ); my $tag_descripsub = sub {