Bug 15533 [QA Followup] - Itemtype limit missing from tables
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 28 Apr 2016 18:20:28 +0000 (18:20 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 10:26:04 +0000 (10:26 +0000)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

koha-tmpl/intranet-tmpl/prog/en/js/holds.js
reserve/request.pl
svc/holds

index c009ba7..959eed2 100644 (file)
@@ -62,6 +62,10 @@ $(document).ready(function() {
                                 data += "</p>";
                             }
 
+                            if ( oObj.itemtype_limit ) {
+                                data += _("<b> Next available %s item").format( oObj.itemtype_limit );
+                            }
+
                             if ( oObj.barcode ) {
                                 data += "<em>";
                                 if ( oObj.found == "W" ) {
index 1e8ff18..1826e00 100755 (executable)
@@ -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() ) ];
index 9c90f8c..1db9338 100755 (executable)
--- 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)