Bug 16485: collection column in Item search is always empty
authorMarc Véron <veron@veron.ch>
Tue, 27 Jun 2017 16:50:44 +0000 (18:50 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 1 Sep 2017 16:02:25 +0000 (13:02 -0300)
This patch fills the column 'Collection' in item search from the item values.

To test:
- Go to item search
- Reproduce issue from initial comment
- Apply patch
- Verify that the column 'Collection' is filled

Still to do, but outside of my datatable skills:
Filter by drop down in the column header does a substring search.
Example: Filter for 'Fiction" returns both 'Fiction' and 'Non-fiction' items.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt

index f098b0d..30b7178 100644 (file)
@@ -1,5 +1,6 @@
 [%- USE Branches -%]
 [%- USE Koha -%]
+[% USE AuthorisedValues %]
 [%- biblio = item.biblio -%]
 [%- biblioitem = item.biblioitem -%]
 [
@@ -8,7 +9,7 @@
   [%~ END %]",
   "[% (biblioitem.publicationyear || biblio.copyrightdate) |html %]",
   "[% biblioitem.publishercode |html %]",
-  "[% biblioitem.collectiontitle |html %]",
+  "[% AuthorisedValues.GetByCode( 'CCODE', item.ccode ) %]",
   "[% FILTER escape_quotes ~%]
     <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber %]#item[% item.itemnumber %]" title="Go to item details">[% item.barcode |html %]</a>
   [%~ END %]",
index bd47edf..10a48a7 100644 (file)
           { 'sName': 'title' },
           { 'sName': 'publicationyear' },
           { 'sName': 'publishercode' },
-          { 'sName': 'collectiontitle' },
+          { 'sName': 'ccode' },
           { 'sName': 'barcode' },
           { 'sName': 'itemcallnumber' },
           { 'sName': 'homebranch' },
           { 'type': 'text' },
           { 'type': 'text' },
           { 'type': 'text' },
-          { 'type': 'text' },
+          { 'type': 'select', 'values': [% ccodes.json %] },
           { 'type': 'text' },
           { 'type': 'text' },
           { 'type': 'select', 'values': [% branches.json %] },