* GetItemsInfo now includes a notforloan_per_itemtype key
  with the value of the item type's notforloan setting, correctly
  set based on the value of the item-level_itypes syspref
* Adjusted OPAC details item status display to use that
  notforloan_per_itemtype key

NOTE: one of the assumptions of item-level_itypes is that
      you can have either bib-level item types or item-level
      item types, but not both in the same database.  In particular,
      it does not establish a hierarchy where Koha checks the
      item-level itemtype first, then the bib-level.

Signed-off-by: Galen Charlton <gmcha...@gmail.com>
---
 C4/Items.pm                                        |    2 +-
 .../opac-tmpl/prog/en/includes/item-status.inc     |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/C4/Items.pm b/C4/Items.pm
index ee6bf3a..2969c9b 100644
--- a/C4/Items.pm
+++ b/C4/Items.pm
@@ -1272,6 +1272,7 @@ sub GetItemsInfo {
            biblioitems.url,
            items.notforloan as itemnotforloan,
            itemtypes.description,
+           itemtypes.notforloan as notforloan_per_itemtype,
            branchurl
      FROM items
      LEFT JOIN branches ON items.homebranch = branches.branchcode
@@ -1355,7 +1356,6 @@ sub GetItemsInfo {
             my ($lib) = $sthnflstatus->fetchrow;
             $data->{notforloanvalue} = $lib;
         }
-               $data->{itypenotforloan} = $data->{notforloan} if 
(C4::Context->preference('item-level_itypes'));
 
         # my stack procedures
         my $stackstatus = $dbh->prepare(
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc 
b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
index f242f01..af71a99 100644
--- a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
+++ b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc
@@ -1,6 +1,4 @@
-<!-- TMPL_IF name="bi_notforloan" -->
-    Not for loan <!-- TMPL_IF NAME="notforloanvalue" -->(<!-- TMPL_VAR 
NAME="notforloanvalue" -->)<!-- /TMPL_IF -->
-<!-- TMPL_ELSIF NAME="itypenotforloan" -->
+<!-- TMPL_IF name="notforloan_per_itemtype" -->
     Not for loan <!-- TMPL_IF NAME="notforloanvalue" -->(<!-- TMPL_VAR 
NAME="notforloanvalue" -->)<!-- /TMPL_IF -->
 <!-- TMPL_ELSE -->
     <!-- TMPL_IF name="datedue" -->
-- 
1.7.0

_______________________________________________
Koha-patches mailing list
Koha-patches@lists.koha.org
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to