Bug 20495: Remove get_saved_report
[koha.git] / opac / opac-search.pl
index 0b61869..1d7615b 100755 (executable)
@@ -108,7 +108,7 @@ if ($format =~ /(rss|atom|opensearchdescription)/) {
 elsif (@params && $build_grouped_results) {
     $template_name = 'opac-results-grouped.tt';
 }
-elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) {
+elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) || @searchCategories ) {
     $template_name = 'opac-results.tt';
 }
 else {
@@ -226,7 +226,10 @@ my $itemtypes = GetItemTypesCategorized;
 # add translated_description to itemtypes
 foreach my $itemtype ( keys %{$itemtypes} ) {
     # Itemtypes search categories don't have (yet) translated descriptions, they are auth values (and could still have no descriptions too BZ 18400)
-    my $translated_description = Koha::ItemTypes->find( $itemtype )->translated_description;
+    # If 'iscat' (see ITEMTYPECAT) then there is no itemtype and the description is not translated
+    my $translated_description = $itemtypes->{$itemtype}->{iscat}
+      ? $itemtypes->{$itemtype}->{description}
+      : Koha::ItemTypes->find($itemtype)->translated_description;
     $itemtypes->{$itemtype}->{translated_description} = $translated_description || $itemtypes->{$itemtype}->{description} || q{};
 }
 
@@ -377,9 +380,6 @@ if ( $template_type && $template_type eq 'advsearch' ) {
         }
     }
 
-    if (C4::Context->preference('OPACNumbersPreferPhrase')) {
-        $template->param('numbersphr' => 1);
-    }
 
     output_html_with_http_headers $cgi, $cookie, $template->output;
     exit;
@@ -493,7 +493,7 @@ if (@searchCategories > 0) {
 if($params->{'multibranchlimit'}) {
     my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
     my @libraries = $search_group->all_libraries;
-    my $multibranch = '('.join( " or ", map { 'branch: ' . $_->id } @libraries ) .')';
+    my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')';
     push @limits, $multibranch if ($multibranch ne  '()');
 }