# next if $type =~ m/^_/; # FIXME
foreach my $category ( keys %{ $authors->{$authid}->{$type} } ) {
foreach my $biblionumber ( unique_biblionumber @{ $authors->{$authid}->{$type}->{$category} } ) {
- push @{ $years->{ $biblio_year->{ $biblionumber } }->{ $type . '-' . $category } }, $biblionumber;
+ $years->{ $biblio_year->{ $biblionumber } }->{ $type . '-' . $category }->{ $biblionumber }++;
}
}
}
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} } ) {
- my $count = scalar unique @{ $years->{$year}->{$type_cat} };
+ my $count = scalar keys %{ $years->{$year}->{$type_cat} };
+ $years->{$year}->{$type_cat} = $count; # remove biblionumbers and use count
$type_cat_count->{ $type_cat } += $count;
my ($type,$cat) = split(/-/, $type_cat);
$type_cat_count->{_toc}->{$type}->{$cat}++;
console.error(selector, 'not found');
return;
}
- var old_val = e.text();
- var new_val = type_cat_count[type_cat];
+ var old_val = parseInt( e.text() );
+ var new_val = parseInt( type_cat_count[type_cat] );
if ( old_val != new_val ) {
e.text(new_val);
$('.y'+year).show();
console.debug('show', year);
for(var type_cat in years[year]) {
- if ( ( type_cat_count[ type_cat ] += years[year][type_cat] ) == years[year][type_cat]) {
+//console.log('year_show', type_cat, type_cat_count[ type_cat ], years[year][type_cat] );
+ if ( ( type_cat_count[ type_cat ] += parseInt(years[year][type_cat]) ) > 0 ) {
$('a[name="'+type_cat+'"]').show();
console.debug(type_cat, 'show');
}
$('.y'+year).hide();
console.debug('hide', year);
for(var type_cat in years[year]) {
- if ( ( type_cat_count[ type_cat ] -= years[year][type_cat] ) == 0 ) {
+//console.log('year_hide', type_cat, type_cat_count[ type_cat ], years[year][type_cat] );
+ if ( ( type_cat_count[ type_cat ] -= parseInt(years[year][type_cat]) ) == 0 ) {
$('a[name="'+type_cat+'"]').hide();
console.debug(type_cat, 'hide');
}