From b9625bbc8ba3562602a8fe0e2375a5972f6d0cbd Mon Sep 17 00:00:00 2001
From: Kyle M Hall
Date: Thu, 28 Apr 2016 18:20:28 +0000
Subject: [PATCH] Bug 15533 [QA Followup] - Itemtype limit missing from tables
Signed-off-by: Katrin Fischer
Signed-off-by: Kyle M Hall
---
koha-tmpl/intranet-tmpl/prog/en/js/holds.js | 4 ++++
reserve/request.pl | 2 +-
svc/holds | 7 +++++++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js b/koha-tmpl/intranet-tmpl/prog/en/js/holds.js
index c009ba7651..959eed2380 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/holds.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/holds.js
@@ -62,6 +62,10 @@ $(document).ready(function() {
data += "
";
}
+ if ( oObj.itemtype_limit ) {
+ data += _(" Next available %s item").format( oObj.itemtype_limit );
+ }
+
if ( oObj.barcode ) {
data += "";
if ( oObj.found == "W" ) {
diff --git a/reserve/request.pl b/reserve/request.pl
index 1e8ff184df..1826e0014a 100755
--- a/reserve/request.pl
+++ b/reserve/request.pl
@@ -567,7 +567,7 @@ foreach my $biblionumber (@biblionumbers) {
$reserve{'suspend'} = $res->suspend();
$reserve{'suspend_until'} = $res->suspend_until();
$reserve{'reserve_id'} = $res->reserve_id();
- $reserve{itemtype} = $res->{itemtype};
+ $reserve{itemtype} = $res->itemtype();
if ( C4::Context->preference('IndependentBranches') && $flags->{'superlibrarian'} != 1 ) {
$reserve{'branchloop'} = [ Koha::Libraries->find( $res->branchcode() ) ];
diff --git a/svc/holds b/svc/holds
index 9c90f8ce09..1db9338eaf 100755
--- a/svc/holds
+++ b/svc/holds
@@ -73,6 +73,12 @@ while ( my $h = $holds_rs->next() ) {
my $biblionumber = $h->biblio()->biblionumber();
+ my $itemtype_limit;
+ if ( $h->itemtype ) {
+ my $itemtype = C4::Koha::getitemtypeinfo( $h->itemtype );
+ $itemtype_limit = $itemtype->{translated_description};
+ }
+
my $hold = {
DT_RowId => $h->reserve_id(),
biblionumber => $biblionumber,
@@ -89,6 +95,7 @@ while ( my $h = $holds_rs->next() ) {
waiting_at => $h->branch()->branchname(),
waiting_here => $h->branch()->branchcode() eq $branch,
priority => $h->priority(),
+ itemtype_limit => $itemtype_limit,
subtitle => GetRecordValue(
'subtitle', GetMarcBiblio($biblionumber),
GetFrameworkCode($biblionumber)
--
2.39.5