$type_stats->{_count_each_type}->{$type}++;
if ( $type =~ m/(edt|trl|com|ctb)/ ) {
- push @{ $authors->{$authid}->{_sec}->{ $category } }, $row->{biblionumber};
+ push @{ $authors->{$authid}->{__sec}->{ $category } }, $row->{biblionumber};
push @{ $authors->{$authid}->{$type}->{ $category } }, $row->{biblionumber};
$type =~ s/(com|ctb)/_ostalo/;
push @{ $authors->{$authid}->{$type}->{ $category } }, $row->{biblionumber};
}
}
+my @toc_type_label = (
+'aut' => 'Primarno autorstvo',
+'edt' => 'Uredništva',
+'trl' => 'Prijevodi',
+'_ostalo' => 'Ostalo',
+);
+
sub count_author_years {
my $years = shift;
my ($authid) = @_;
foreach my $type ( keys %{ $authors->{$authid} } ) {
+ next if $type =~ m/^_/;
foreach my $category ( keys %{ $authors->{$authid}->{$type} } ) {
- next if $category =~ m/^_/;
- foreach my $biblionumber ( @{ $authors->{$authid}->{$type}->{$category} } ) {
+ foreach my $biblionumber ( unique_biblionumber @{ $authors->{$authid}->{$type}->{$category} } ) {
$years->{ $biblio_year->{ $biblionumber } }->{ $type . '-' . $category }++;
}
}
return $years;
}
-my @toc_type_label = (
-'aut' => 'Primarno autorstvo',
-'edt' => 'Uredništva',
-'trl' => 'Prijevodi',
-'_ostalo' => 'Ostalo',
-);
-
sub html_year_selection {
my $fh = shift;
my @authids = @_;
+ debug 'html_year_selection authids=', [ @authids ];
+
print $fh qq|<span id="years">Godine:\n|;
my $type_cat_count = {};
my $years;
$years = count_author_years( $years, $authid );
}
+ debug 'years' => $years;
+
foreach my $year ( sort { $b <=> $a } keys %$years ) {
print $fh qq|<label><input name="year_selection" value="$year" type=checkbox onClick="toggle_year($year, this)" checked="checked">$year</label> \n|;
foreach my $type_cat ( keys %{ $years->{$year} } ) {
|;
+ debug 'type_cat_count' => $type_cat_count;
+
# TOC
print $fh qq|<ul id="toc">\n|;
my $i = 0;
foreach my $department ( sort keys %$auth_department ) {
foreach my $authid ( sort @{ $auth_department->{$department} } ) {
my @categories = keys %{ $authors->{$authid}->{aut} };
- push @categories, keys %{ $authors->{$authid}->{_sec} };
+ push @categories, keys %{ $authors->{$authid}->{__sec} };
foreach my $category ( sort @categories ) {
push @{ $department_category_author->{$department}->{$category} }, $authid;
push @{ $department_category_author->{'AAA_ukupno'}->{$category} }, $authid if $department_in_sum->{$department};