MT2582: Fix user deletion without permission
[koha.git] / opac / opac-search.pl
index e460f16..63435a5 100755 (executable)
@@ -133,7 +133,7 @@ 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,
+               ccl => "$itype_or_itemtype,phr",
                 code => $thisitemtype,
                 selected => $selected,
                 description => $itemtypes->{$thisitemtype}->{'description'},
@@ -348,11 +348,11 @@ $template->param ( QUERY_INPUTS => \@query_inputs );
 my @limit_inputs = $limit_cgi ? _input_cgi_parse($limit_cgi) : ();
 
 # add OPAC 'hidelostitems'
-#if (C4::Context->preference('hidelostitems') == 1) {
-#    # either lost ge 0 or no value in the lost register
-#    $query ="($query) and ( (lost,st-numeric <= 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='') )";
-#}
-#
+if (C4::Context->preference('hidelostitems') == 1) {
+    # either lost ge 0 or no value in the lost register
+    $query ="($query) and ( (lost,st-numeric <= 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='') )";
+}
+
 # add OPAC suppression - requires at least one item indexed with Suppress
 if (C4::Context->preference('OpacSuppression')) {
     $query = "($query) not Suppress=1";
@@ -412,11 +412,11 @@ for (my $i=0;$i<=@servers;$i++) {
                 # we want as specified by $offset and $results_per_page,
                 # we need to set the offset parameter of searchResults to 0
                 my @group_results = searchResults( $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
-                                                   @{ $group->{"RECORDS"} }, C4::Context->preference('hidelostitems'));
+                                                   @{ $group->{"RECORDS"} });
                 push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
             }
         } else {
-            @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}},, C4::Context->preference('hidelostitems'));
+            @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}});
         }
                my $tag_quantity;
                if (C4::Context->preference('TagsEnabled') and