X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-search.pl;h=6dde2fd29267d2877950f872051c7015357e9691;hb=700de9664d0e9016845d12916905e458cab9dbd4;hp=0f526502e6d4a34843d4cc50b3b6a6e34f650403;hpb=f46b03cf2da045c72d8294b7688b547ba9205893;p=koha_fer diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 0f526502e6..6dde2fd292 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -1,6 +1,7 @@ #!/usr/bin/perl # Copyright 2008 Garry Collum and the Koha Koha Development team +# Copyright 2010 BibLibre # # This file is part of Koha. # @@ -83,6 +84,9 @@ else { authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), } ); +if ($template_name = 'opac-results.tmpl') { + $template->param('COinSinOPACResults' => C4::Context->preference('COinSinOPACResults')); +} if ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom') { $template->param($format => 1); @@ -139,10 +143,9 @@ if (C4::Context->preference('TagsEnabled')) { #} # load the branches -my $mybranch = ( C4::Context->preference('SearchMyLibraryFirst') && C4::Context->userenv && C4::Context->userenv->{branch} ) ? C4::Context->userenv->{branch} : ''; + my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established $template->param( - branchloop => GetBranchesLoop($mybranch, 0), searchdomainloop => GetBranchCategories(undef,'searchdomain'), ); @@ -161,8 +164,8 @@ my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { - my %row =( number=>$cnt++, - ccl => $itype_or_itemtype, + my %row =( number=>$cnt++, + ccl => "$itype_or_itemtype,phr", code => $thisitemtype, selected => $selected, description => $itemtypes->{$thisitemtype}->{'description'}, @@ -317,7 +320,7 @@ my @limits; @limits = split("\0",$params->{'limit'}) if $params->{'limit'}; if($params->{'multibranchlimit'}) { -push @limits, join(" or ", map { "branch: $_ "} @{GetBranchesInCategory($params->{'multibranchlimit'})}) ; + push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')'; } my $available; @@ -468,9 +471,11 @@ for (my $i=0;$i<@servers;$i++) { limit=>$tag_quantity }); } } - foreach (@newresults) { - $_->{coins} = GetCOinSBiblio($_->{'biblionumber'}); - } + if (C4::Context->preference('COinSinOPACResults')) { + foreach (@newresults) { + $_->{coins} = GetCOinSBiblio($_->{'biblionumber'}); + } + } if ($results_hashref->{$server}->{"hits"}){ $total = $total + $results_hashref->{$server}->{"hits"}; @@ -504,6 +509,7 @@ for (my $i=0;$i<@servers;$i++) { $template->param(ShowOpacRecentSearchLink => 1); } + shift @recentSearches if (@recentSearches > 15); # Pushing the cookie back $newsearchcookie = $cgi->cookie( -name => 'KohaOpacRecentSearches', @@ -628,6 +634,7 @@ $template->param( total => $total, opacfacets => 1, facets_loop => $facets, + displayFacetCount=> C4::Context->preference('displayFacetCount')||0, scan => $scan, search_error => $error, );