From 2279380b5459b09bd0b959d6d6fe23b2d28f5924 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Mon, 7 Dec 2009 11:17:55 +0100 Subject: [PATCH] Revert "2298 2299 : Search.pm and opac-search.pl" This reverts commit e1b6555032d7035a3114746a0cb19c01cd17c9d7. --- C4/Search.pm | 25 ++++++++++++------------- opac/opac-search.pl | 10 +++++----- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 202f6d5ac9..dea8b57b07 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1244,21 +1244,20 @@ sub buildQuery { my $group_OR_limits; my $availability_limit; foreach my $this_limit (@limits) { -# if ( $this_limit =~ /available/ ) { -# -## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) -## In English: -## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 -# $availability_limit .= -#"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; -# $limit_cgi .= "&limit=available"; -# $limit_desc .= ""; -# } -# + if ( $this_limit =~ /available/ ) { + +# 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) +# In English: +# all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 + $availability_limit .= +"( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) )"; #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) )"; + $limit_cgi .= "&limit=available"; + $limit_desc .= ""; + } + # group_OR_limits, prefixed by mc- # OR every member of the group -# elsif ( $this_limit =~ /mc/ ) { - if ( $this_limit =~ /mc/ ) { + elsif ( $this_limit =~ /mc/ ) { $group_OR_limits .= " or " if $group_OR_limits; $limit_desc .= " or " if $group_OR_limits; $group_OR_limits .= "$this_limit"; diff --git a/opac/opac-search.pl b/opac/opac-search.pl index e460f161b5..558604a7e1 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -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"; -- 2.39.5