[Koha-patches] [PATCH] bug 4306: respect item-level_itypes when displaying item label batches

Galen Charlton gmcharlt at gmail.com
Thu Feb 10 22:07:02 CET 2011


Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
 C4/Creators/Lib.pm |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/C4/Creators/Lib.pm b/C4/Creators/Lib.pm
index ded0a5d..8fd25fd 100644
--- a/C4/Creators/Lib.pm
+++ b/C4/Creators/Lib.pm
@@ -306,7 +306,7 @@ sub get_label_summary {
     my %params = @_;
     my $label_number = 0;
     my @label_summaries = ();
-    my $query = "     SELECT b.title, b.author, bi.itemtype, i.barcode, i.biblionumber
+    my $query = "     SELECT b.title, b.author, bi.itemtype, i.barcode, i.biblionumber, i.itype
                       FROM creator_batches AS c LEFT JOIN items AS i ON (c.item_number=i.itemnumber)
                       LEFT JOIN biblioitems AS bi ON (i.biblioitemnumber=bi.biblioitemnumber)
                       LEFT JOIN biblio AS b ON (bi.biblionumber=b.biblionumber)
@@ -329,7 +329,7 @@ sub get_label_summary {
         # should not know that it's part of a web app
         $record->{'title'} = '<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=' . $record->{'biblionumber'} . '"> ' . $record->{'title'} . '</a>';
         $label_summary->{'_summary'} = $record->{'title'} . " | " . ($record->{'author'} ? $record->{'author'} : 'N/A');
-        $label_summary->{'_item_type'} = $record->{'itemtype'};
+        $label_summary->{'_item_type'} = C4::Context->preference("item-level_itypes") ? $record->{'itype'} : $record->{'itemtype'};
         $label_summary->{'_barcode'} = $record->{'barcode'};
         $label_summary->{'_item_number'} = $item->{'item_number'};
         $label_summary->{'_label_id'} = $item->{'label_id'};
-- 
1.7.2.3



More information about the Koha-patches mailing list