fix for bug 1781 for NOZebra=OFF
authorJoshua Ferraro <jmf@liblime.com>
Tue, 18 Mar 2008 03:33:44 +0000 (23:33 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 18 Mar 2008 03:35:19 +0000 (22:35 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Auth.pm
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
opac/opac-detail.pl

index ac24b79..7ed68b4 100755 (executable)
@@ -319,6 +319,7 @@ sub get_template_and_user {
             reviewson              => C4::Context->preference("reviewson"),
             hide_marc              => C4::Context->preference("hide_marc"),
             patronimages           => C4::Context->preference("patronimages"),
+            hidelostitems          => C4::Context->preference("hidelostitems"),
             mylibraryfirst   => C4::Context->preference("SearchMyLibraryFirst"),
             "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
             OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"),
index d45d0b0..f0cddd2 100644 (file)
@@ -212,7 +212,7 @@ $(document).ready(function(){
                                        <span class="unavailable">
                                        <!-- TMPL_IF NAME="onloancount" --> On loan (<!-- TMPL_VAR NAME="onloancount" -->), <!-- /TMPL_IF -->
                                        <!-- TMPL_IF NAME="wthdrawncount" --> Withdrawn (<!-- TMPL_VAR NAME="wthdrawncount" -->), <!-- /TMPL_IF -->
-                                       <!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->),<!-- /TMPL_IF -->
+                                       <!-- TMPL_UNLESS NAME="hidelostitems" --><!-- TMPL_IF NAME="itemlostcount" --> Lost (<!-- TMPL_VAR NAME="itemlostcount" -->),<!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
                                        <!-- TMPL_IF NAME="damagedcount" --> Damaged (<!-- TMPL_VAR NAME="damagedcount" -->),<!-- /TMPL_IF -->
                                        <!-- TMPL_IF NAME="orderedcount" --> On order (<!-- TMPL_VAR NAME="orderedcount" -->),<!-- /TMPL_IF -->
                                        </span>
index b442e3a..6c4f7a5 100755 (executable)
@@ -50,7 +50,16 @@ my $biblionumber = $query->param('biblionumber') || $query->param('bib');
 $template->param( biblionumber => $biblionumber );
 
 # change back when ive fixed request.pl
-my @items = &GetItemsInfo( $biblionumber, 'opac' );
+my @all_items = &GetItemsInfo( $biblionumber, 'opac' );
+my @items;
+@items = @all_items unless C4::Context->preference('hidelostitems');
+
+if (C4::Context->preference('hidelostitems')) {
+    # Hide host items
+    for my $itm (@all_items) {
+        push @items, $itm unless $itm->{itemlost};
+    }
+}
 my $dat = &GetBiblioData($biblionumber);
 
 if (!$dat) {