Bug 30716: Add collection to cn_browser results
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 6 May 2022 21:50:05 +0000 (21:50 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 5 Jul 2022 13:55:59 +0000 (10:55 -0300)
To test:
1. Go to MARC bibliographic framework, pick a framework and go to 952, subfield "o". Turn the cn_browser plugin on.
2. Pick or create an item in that framework, edit that item.
3. TO the right of the 952$o notice the "...". Click that start the call number browser.
4. Notice there is no column for collection.
5. Apply patch, restart_all
6. Notice there is now a column for with the items collection.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
cataloguing/value_builder/cn_browser.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/cn_browser.tt

index 8abdca7..832ca51 100755 (executable)
@@ -94,7 +94,7 @@ my $launcher = sub {
         my $green = 0;
 
         #Results before the cn_sort
-        $query = "SELECT b.title, b.subtitle, itemcallnumber, biblionumber, barcode, cn_sort, branchname, author
+        $query = "SELECT b.title, b.subtitle, itemcallnumber, biblionumber, barcode, cn_sort, branchname, author, ccode
         FROM items AS i
         JOIN biblio AS b USING (biblionumber)
         LEFT OUTER JOIN branches ON (branches.branchcode = homebranch)
@@ -124,7 +124,7 @@ my $launcher = sub {
         my $green = 0;
 
         #Results after the cn_sort
-        $query = "SELECT b.title, b.subtitle, itemcallnumber, biblionumber, barcode, cn_sort, branchname, author
+        $query = "SELECT b.title, b.subtitle, itemcallnumber, biblionumber, barcode, cn_sort, branchname, author, ccode
         FROM items AS i
         JOIN biblio AS b USING (biblionumber)
         LEFT OUTER JOIN branches ON (branches.branchcode = homebranch)
index c480e09..dc239e2 100644 (file)
@@ -1,4 +1,5 @@
 [% USE Asset %]
+[% USE AuthorisedValues %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Call number browser &rsaquo; Cataloging &rsaquo; Koha</title>
@@ -41,6 +42,7 @@
         <th>Call number</th>
         <th>Title</th>
         <th>Library</th>
+        <th>Collection</th>
     </tr></thead>
     <tbody>
 [% FOREACH cn_loo IN cn_loop %]
@@ -56,6 +58,7 @@
         </a>
     </td>
     <td style="background:[% cn_loo.background | html %];">[% cn_loo.branchname | html %]</td>
+    <td style="background:[% cn_loo.background | html %];">[% AuthorisedValues.GetByCode( 'CCODE', cn_loo.ccode ) | html %]</td>
     </tr>
 [% END %]
     </tbody>