X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-authorities-home.pl;h=4e9f9ab4fbe4f5e759561720ceedd39a536c8bb1;hb=8cef238d3ab2886826c1aaac7b9e4ea2476d5ec4;hp=a87030ef98d74b2b1ca7261f3fde24f70a77c928;hpb=b06a289173d0f2e299b0c8652d59d47dc196062c;p=koha.git diff --git a/opac/opac-authorities-home.pl b/opac/opac-authorities-home.pl index a87030ef98..4e9f9ab4fb 100755 --- a/opac/opac-authorities-home.pl +++ b/opac/opac-authorities-home.pl @@ -41,18 +41,20 @@ $startfrom = 0 if ( !defined $startfrom ); my ( $template, $loggedinuser, $cookie ); my $resultsperpage; -my $authtypes = getauthtypes; -my @authtypesloop; -foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'} } - keys %$authtypes ) -{ - my $selected = 1 if $thisauthtype eq $authtypecode; - my %row = ( - value => $thisauthtype, - selected => $selected, - authtypetext => $authtypes->{$thisauthtype}{'authtypetext'}, - ); - push @authtypesloop, \%row; +my $authtypes = getauthtypes(); +my @authtypesloop = (); +foreach my $thisauthtype ( + sort { + $authtypes->{$a}->{'authtypetext'} + cmp $authtypes->{$b}->{'authtypetext'} + } + keys %{$authtypes} + ) { + push @authtypesloop, + { value => $thisauthtype, + selected => $thisauthtype eq $authtypecode, + authtypetext => $authtypes->{$thisauthtype}->{'authtypetext'}, + }; } if ( $op eq "do_search" ) { @@ -125,6 +127,10 @@ if ( $op eq "do_search" ) { else { $to = ( ( $startfrom + 1 ) * $resultsperpage ); } + unless (C4::Context->preference('OPACShowUnusedAuthorities')) { + my @usedauths = grep { $_->{used} > 0 } @$results; + $results = \@usedauths; + } $template->param( result => $results ) if $results; $template->param( FIELDS => \@fields ); $template->param( orderby => $orderby ); @@ -136,9 +142,11 @@ if ( $op eq "do_search" ) { startfromnext => $startfrom + 1, startfromprev => $startfrom - 1, searchdata => \@field_data, + countfuzzy => !(C4::Context->preference('OPACShowUnusedAuthorities')), total => $total, from => $from, to => $to, + resultcount => scalar @$results, numbers => \@numbers, authtypecode => $authtypecode, authtypetext => $authtypes->{$authtypecode}{'authtypetext'},