From 7471f4c017518284f1b1bb552b2ad8133d3f0643 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Sat, 24 Nov 2007 23:52:31 -0600 Subject: [PATCH] add OPAC hidelostitems and suppression from dev_week Signed-off-by: Joshua Ferraro --- etc/zebradb/biblios/etc/bib1.att | 1 + etc/zebradb/biblios/etc/record.abs | 1 + etc/zebradb/ccl.properties | 1 + opac/opac-search.pl | 11 +++++++++++ 4 files changed, 14 insertions(+) diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att index e4ed301fd2..3fa27219df 100644 --- a/etc/zebradb/biblios/etc/bib1.att +++ b/etc/zebradb/biblios/etc/bib1.att @@ -115,6 +115,7 @@ att 9007 cn-class att 9008 cn-item att 9009 cn-prefix att 9010 cn-suffix +att 9011 Suppress # Items Index att 8001 withdrawn diff --git a/etc/zebradb/biblios/etc/record.abs b/etc/zebradb/biblios/etc/record.abs index f356fe68be..646d62e03c 100644 --- a/etc/zebradb/biblios/etc/record.abs +++ b/etc/zebradb/biblios/etc/record.abs @@ -233,6 +233,7 @@ melm 942$0 totalissues:n,totalissues:s melm 942$2 cn-bib-source melm 942$6 cn-bib-sort:n,cn-bib-sort:s melm 942$c itemtype:w +melm 942$d Suppress:w,Suppress:n # need to check bib1 melm 942$h cn-class diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties index 1897565d82..6224a174e2 100644 --- a/etc/zebradb/ccl.properties +++ b/etc/zebradb/ccl.properties @@ -908,6 +908,7 @@ cn-class 1=9007 cn-item 1=9008 cn-prefix 1=9009 cn-suffix 1=9010 +Suppress 1=9011 # Items Index withdrawn 1=8001 diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 21272b7ec1..b70606ebd2 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -432,6 +432,17 @@ for my $this_cgi ( split('&',$limit_cgi) ) { $input_name =~ s/=$//; push @limit_inputs, { input_name => $input_name, input_value => $input_value }; } + +# add OPAC 'hidelostitems' +# not items with +if (C4::Context->preference('hidelostitems')) { + $query ="($query) not ((lost,st-numeric gt 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches=''))"; + warn "Q".$query; +} +# add OPAC suppression - requires at least one item indexed with Suppress +if (C4::Context->preference('OpacSuppression')) { + $query = "($query) not Suppress=1"; +} $template->param ( LIMIT_INPUTS => \@limit_inputs ); ## II. DO THE SEARCH AND GET THE RESULTS -- 2.39.5