FFZG variant of Bug 21320 - honor syspref AllowHoldsOnDamagedItems
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 7 Sep 2018 09:53:22 +0000 (11:53 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 7 Sep 2018 09:53:22 +0000 (11:53 +0200)
circ/pendingreserves.pl

index ae0d42c..1b25eb0 100755 (executable)
@@ -170,6 +170,10 @@ if ($enddate_iso) {
 
 my $item_type = C4::Context->preference('item-level_itypes') ? "items.itype" : "biblioitems.itemtype";
 
+if ( ! C4::Context->preference('AllowHoldsOnDamagedItems') ) {
+    $sqldatewhere .= " AND damaged = 0";
+} 
+
 my $strsth =
     "SELECT min(reservedate) as l_reservedate,
             reserves.reserve_id,
@@ -216,7 +220,7 @@ my $strsth =
     AND issues.itemnumber IS NULL
     AND reserves.priority <> 0 
     AND reserves.suspend = 0
-    AND notforloan >= 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0
+    AND notforloan >= 0 AND itemlost = 0 AND withdrawn = 0
     ";
     # GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when 
     #    multiple patrons have a hold on an item