X-Git-Url: http://git.rot13.org/?p=koha-bibliografija;a=blobdiff_plain;f=html.pl;h=cc7089cde1726d2d4ce1056b4567b95c785d54b2;hp=10ad3d5710958fbf17d593e2dc8ae31a1aee0a29;hb=ecddab314838f4d90e959753acf934d9f27cd8c6;hpb=484e46d3c0a4ce14c36b5190220cd15892db22e4 diff --git a/html.pl b/html.pl index 10ad3d5..cc7089c 100755 --- a/html.pl +++ b/html.pl @@ -318,7 +318,7 @@ while( my $row = $sth_select_authors->fetchrow_hashref ) { $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}; @@ -433,14 +433,21 @@ sub author_html { } } +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 }++; } } @@ -448,17 +455,12 @@ sub count_author_years { 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|Godine:\n|; my $type_cat_count = {}; my $years; @@ -467,6 +469,8 @@ sub html_year_selection { $years = count_author_years( $years, $authid ); } + debug 'years' => $years; + foreach my $year ( sort { $b <=> $a } keys %$years ) { print $fh qq| \n|; foreach my $type_cat ( keys %{ $years->{$year} } ) { @@ -495,6 +499,8 @@ var type_cat_count = |, encode_json($type_cat_count), q|; |; + debug 'type_cat_count' => $type_cat_count; + # TOC print $fh qq|