[Koha-patches] [PATCH] Bug 5825 - Add Item Type column to Holds Queue report

Owen Leonard oleonard at myacpl.org
Thu Aug 8 22:10:15 CEST 2013


The hold queue report shows collection code but not item type. This
patch adds it. Also added is use of the KohaAuthorisedValues template
plugin to display the collection code description instead of code.

To test, apply the patch and view the holds queue. There should be a new
item type column showing an item type description for each row. The
collection column should now show the collection description instead of
code.
---
 C4/HoldsQueue.pm                                   |    2 +-
 .../prog/en/modules/circ/view_holdsqueue.tt        |    8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm
index 2052f09..1242fc5 100755
--- a/C4/HoldsQueue.pm
+++ b/C4/HoldsQueue.pm
@@ -119,7 +119,7 @@ sub GetHoldsQueueItems {
     my $dbh   = C4::Context->dbh;
 
     my @bind_params = ();
-    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber
+    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber
                   FROM tmp_holdsqueue
                        JOIN biblio      USING (biblionumber)
                   LEFT JOIN biblioitems USING (biblionumber)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
index 4c5f8d1..3482de6 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
@@ -1,3 +1,5 @@
+[% USE ItemTypes %]
+[% USE KohaAuthorisedValues %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha › Circulation › Holds queue</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -13,7 +15,7 @@
 <script type="text/javascript">//<![CDATA[
 $(document).ready(function() {
     $("#holdst").dataTable({
-        "aaSorting": [[ 2, "asc" ]],
+        "aaSorting": [[ 3, "asc" ]],
         "bPaginate": false,
         "bLengthChange": false,
         "bFilter": false,
@@ -53,6 +55,7 @@ $(document).ready(function() {
 	<tr>
         <th class="hq-title">Title</th>
         <th class="hq-collection">Collection</th>
+        <th class="hq-itemtype">Item type</th>
         <th class="hq-callnumber">Call number</th>
         <th class="hq-copynumber">Copy number</th>
         <th class="hq-enumchron">Enumeration</th>
@@ -74,7 +77,8 @@ $(document).ready(function() {
                                          [% IF ( itemsloo.size ) %][% itemsloo.size %][% END %] [% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn %][% END %]</p>
 			</div>
 			</td>
-            <td class="hq-collection">[% itemsloo.ccode %]</td>
+            <td class="hq-collection">[% KohaAuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) %]</td>
+            <td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.itype ) %]</td>
             <td class="hq-callnumber">[% itemsloo.location %] [% itemsloo.itemcallnumber %]</td>
             <td class="hq-copynumber">[% itemsloo.copynumber %]</td>
             <td class="hq-enumchron">[% itemsloo.enumchron %]</td>
-- 
1.7.9.5


More information about the Koha-patches mailing list