-<TR>
- <TH CLASS="grid" BGCOLOR="#cccccc">User</TH>
- <TH CLASS="grid" BGCOLOR="#cccccc">Date</TH>
- <TH CLASS="grid" BGCOLOR="#cccccc">Time</TH>
- <TH CLASS="grid" BGCOLOR="#cccccc">Item</TH>
- <TH CLASS="grid" BGCOLOR="#cccccc">Action</TH>
- <TH CLASS="grid" BGCOLOR="#cccccc">Description</TH>
-</TR>
-
-% foreach my $item ( sort { $a->history_date <=> $b->history_date
-% #|| table order
-% || $a->historynum <=> $b->historynum
-% }
-% @history
-% )
-% {
-%
-% my $history_other = '';
-% my $act = $item->history_action;
-% if ( $act =~ /^replace/ ) {
-% my $pkey = $item->primary_key;
-% my $date = $item->history_date;
-% $history_other = qsearchs({
-% 'table' => $item->table,
-% 'hashref' => { $pkey => $item->$pkey(),
-% 'history_action' => $replace_other{$act},
-% 'historynum' => { 'op' => $replace_dir{$act},
-% 'value' => $item->historynum
-% },
-% },
-% 'extra_sql' => "
-% AND history_date $replace_direq{$act} $date
-% AND ($date $replace_op{$act} $fuzz) $replace_direq{$act} history_date
-% ORDER BY historynum $replace_ord{$act} LIMIT 1
-% ",
-% });
-% }
-%
-% if ( $bgcolor eq $bgcolor1 ) {
-% $bgcolor = $bgcolor2;
-% } else {
-% $bgcolor = $bgcolor1;
-% }
-
- <TR>
- <TD ALIGN="left" CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% my $otaker = $item->history_user;
-% $otaker = '<i>auto billing</i>' if $otaker eq 'fs_daily';
-% $otaker = '<i>customer self-service</i>' if $otaker eq 'fs_selfservice';
-% $otaker = '<i>job queue</i>' if $otaker eq 'fs_queue';
- <% $otaker %>
- </TD>
- <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% my $d = time2str('%b %o, %Y', $item->history_date );
-% $d =~ s/ / /g;
- <% $d %>
- </TD>
- <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% my $t = time2str('%r', $item->history_date );
-% $t =~ s/ / /g;
- <% $t %>
- </TD>
- <TD ALIGN="center" CLASS="grid" BGCOLOR="<% $bgcolor %>">
-% my $label = $h_tables{$item->table};
-% $label = &{ $h_table_labelsub{$item->table} }( $item, $label )
-% if $h_table_labelsub{$item->table};
- <% $label %>
- </TD>
- <TD ALIGN="left" CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <% $action{$item->history_action} %>
- </TD>
- <TD ALIGN="left" CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <% join(', ',
- map { my $value = ( $_ =~ /(^pay(info|cvv)|^ss|_password)$/ )
- ? 'N/A'
- : $item->get($_);
- $value = substr($value, 0, 77).'...' if length($value) > 80;
- $value = encode_entities($value);
- "<I>$_</I>:<B>$value</B>";
- }
- grep { $history_other
- ? ( $item->get($_) ne $history_other->get($_) )
- : ( $item->get($_) =~ /\S/ )
- }
- grep { ! /^(history|custnum$)/i }
- $item->fields
- )
- %>
- </TD>
- </TR>
-
-% }
-
-</TABLE>
-<%once>
-
-# length-switching