Bug 5251 : Enhancement: [3.2] (Resubmission) Adding code to support using gmail as...
[koha.git] / opac / opac-search.pl
index c145729..778c7ca 100755 (executable)
@@ -84,6 +84,9 @@ else {
     authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
     }
 );
+if ($template_name eq '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);
@@ -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'},
@@ -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',