add OPAC hidelostitems and suppression from dev_week
authorJoshua Ferraro <jmf@liblime.com>
Sun, 25 Nov 2007 05:52:31 +0000 (23:52 -0600)
committerJoshua Ferraro <jmf@liblime.com>
Sun, 25 Nov 2007 22:27:44 +0000 (16:27 -0600)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
etc/zebradb/biblios/etc/bib1.att
etc/zebradb/biblios/etc/record.abs
etc/zebradb/ccl.properties
opac/opac-search.pl

index e4ed301..3fa2721 100644 (file)
@@ -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
index f356fe6..646d62e 100644 (file)
@@ -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
index 1897565..6224a17 100644 (file)
@@ -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
index 21272b7..b70606e 100755 (executable)
@@ -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