diff --git a/lib/GADS.pm b/lib/GADS.pm index 2d2a4b69c..5d414d547 100644 --- a/lib/GADS.pm +++ b/lib/GADS.pm @@ -4794,4 +4794,16 @@ sub _process_edit } +Sub::Install::install_sub({ + code => sub { + my $self= shift; + my $clone = $self->clone; + $clone->time_zone->is_floating && $clone->set_time_zone('UTC'); + $clone->set_time_zone('Europe/London'); + $clone->strftime('%e %b %Y %H:%M:%S'); + }, + into => 'DateTime', + as => 'gads_time', +}); + true; diff --git a/lib/GADS/Audit.pm b/lib/GADS/Audit.pm index 89b92ee32..f0413e3d2 100644 --- a/lib/GADS/Audit.pm +++ b/lib/GADS/Audit.pm @@ -160,14 +160,21 @@ sub logs -desc => 'datetime', }, }); - $rs->result_class('DBIx::Class::ResultClass::HashRefInflator'); + my @logs = $rs->all; my $site = $self->schema->resultset('Site')->next; - $_->{user} = GADS::Datum::Person->new( - schema => $self->schema, - init_value => $_->{user}, - )->presentation(type => 'person', site => $site) foreach @logs; - \@logs; + + my @result = map { + +{ + id => $_->id, + type => $_->type, + datetime => $_->datetime->gads_time, + description => $_->description, + user => $_->user, + } + } @logs; + + \@result; } sub csv @@ -191,5 +198,3 @@ sub csv } 1; - - diff --git a/views/admin/audit.tt b/views/admin/audit.tt index b5082978f..e593c8482 100644 --- a/views/admin/audit.tt +++ b/views/admin/audit.tt @@ -35,7 +35,7 @@ label = log.id },{ type = "text" - label = log.user.text + label = log.user.value filter = "html" },{ type = "text"