From 973cd339e0ee2e97c3d0216892536eee6fd1dcd0 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 3 Aug 2006 10:24:09 +0000 Subject: [PATCH] fix for #1114 : Marking item lost doesn't hide it in OPAC when hidelostitems is set --- C4/Search.pm | 10 ++++------ C4/SearchMarc.pm | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 60a4062dac..6dba9983ad 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1306,12 +1306,10 @@ sub ItemInfo { WHERE items.biblionumber = ? AND biblioitems.biblioitemnumber = items.biblioitemnumber AND biblio.biblionumber = items.biblionumber"; -# buggy : opac & librarian interface can show the same info level & itemstatus should not be hardcoded -# if ($type ne 'intra'){ -# $query .= " and ((items.itemlost<>1 and items.itemlost <> 2) -# or items.itemlost is NULL) -# and (wthdrawn <> 1 or wthdrawn is NULL)"; -# } + if ($type ne 'intra' && C4::Context->preference('hidelostitems')) { + $query .= " and (items.itemlost<1 or items.itemlost is NULL) + and (wthdrawn <> 1 or wthdrawn is NULL)"; + } $query .= " order by items.homebranch, items.dateaccessioned desc"; my $sth=$dbh->prepare($query); $sth->execute($biblionumber); diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index 5e93aa16b6..bc0152c7e0 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -396,7 +396,7 @@ if (C4::Context->preference("sortbynonfiling")) { $sth_itemCN = $dbh->prepare(" SELECT items.holdingbranch, items.location, items.itemcallnumber, count(*) AS cnt, items.itemnumber, items.notforloan FROM items - WHERE biblionumber=? AND (itemlost = 0 OR itemlost IS NULL) AND (notforloan < 1 OR notforloan IS NULL) + WHERE biblionumber=? AND (itemlost = 0 OR itemlost IS NULL) GROUP BY items.holdingbranch, items.location, items.itemcallnumber ORDER BY homebranch"); } else { -- 2.39.5