644B; Perl | 2018-01-25 22:24:04+01 | Statements 17 | SLOC 17
1
package Ged2site::Display::history;
2
3
# Display the history page
4
5
use Ged2site::Display;
6
7 2
our @ISA = ('Ged2site::Display');
8
sub html {
9
	my $self = shift;
10
	my %args = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_;
11
12
	my $eventshash;	# hash of year to array of events in that year, each event is a hash of the event's details
13
14
	my $history = $args{'history'};	# Handle into the database
15
16
	# TODO: handle situation where look up fails
17
18
	my @events = $history->selectall_hash();
19
	foreach my $event(@events) {
20
		push @{$eventshash->{$event->{'year'}}}, $event;
21
	}
22
23
	return $self->SUPER::html({ events => $eventshash, updated => $history->updated() });
24
}
25
26
1;