From 1231ebdd74bd5ccbea2d517b84736e0221a3e35f Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Sat, 6 Apr 2019 12:42:39 +0000 Subject: [PATCH] Bug 22649: Add itemtype to item search results and CSV file The itemtype can be searched for in the item search form, but it is not displayed in the result list. This patch adds the itemtype to the display and the CSV export file. To test: - Try different item searches - Verify that the itemtype now shows in the result list - Export to CSV - Verify that the itemtype shows there correctly as well --- catalogue/itemsearch.pl | 2 +- .../prog/en/includes/catalogue/itemsearch_item.csv.inc | 3 ++- .../prog/en/includes/catalogue/itemsearch_item.json.inc | 2 ++ .../prog/en/includes/csv_headers/catalogue/itemsearch.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 7 +++++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index ab833db3e2..ed6abc9a9d 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -63,7 +63,7 @@ if (defined $format and $format eq 'json') { push @f, $columns[$i]; push @c, 'and'; - if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location notforloan ) ) { + if ( grep /^$columns[$i]$/, qw( ccode homebranch holdingbranch location itype notforloan ) ) { push @q, "$word"; push @op, '='; } else { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc index e0be3537a1..93379a9fd2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc @@ -1,5 +1,6 @@ [%- USE Branches -%] [%- USE Koha -%] +[%- USE ItemTypes -%] [%- SET biblio = item.biblio -%] [%- SET biblioitem = item.biblioitem -%] -"[% biblio.title | html %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | html %]", "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", "[% biblioitem.publishercode | html %]", "[% biblioitem.collectiontitle | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]", "[% (item.issues || 0) | html %]" +"[% biblio.title | html %] [% IF ( Koha.Preference( 'marcflavour' ) == 'UNIMARC' && biblio.author ) %]by [% END %][% biblio.author | html %]", "[% (biblioitem.publicationyear || biblio.copyrightdate) | html %]", "[% biblioitem.publishercode | html %]", "[% biblioitem.collectiontitle | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]", "[% (item.issues || 0) | html %]" diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc index 45b43f647b..0207f6b9ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.json.inc @@ -1,5 +1,6 @@ [%- USE Branches -%] [%- USE Koha -%] +[%- USE ItemTypes -%] [% USE AuthorisedValues %] [%- biblio = item.biblio -%] [%- biblioitem = item.biblioitem -%] @@ -17,6 +18,7 @@ "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% item.location | html %]", + "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% item.status | html %]", "[% (item.issues || 0) | html %]", diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt index 8add507eec..8659836ba6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt @@ -1 +1 @@ -[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Inventory number, Status, Checkouts[%- END -%] +[%- BLOCK -%]Title, Publication date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Itemtype, Inventory number, Status, Checkouts[%- END -%] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index ab3c027c5c..a097ea8f76 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -269,6 +269,7 @@ + ' ' + _("Home library") + '' + ' ' + _("Current location") + '' + ' ' + _("Shelving location") + '' + + ' ' + _("Itemtype") + '' + ' ' + _("Inventory number") + '' + ' ' + _("Status") + '' + ' ' + _("Checkouts") + '' @@ -372,6 +373,7 @@ { 'sName': 'homebranch' }, { 'sName': 'holdingbranch' }, { 'sName': 'location' }, + { 'sName': 'itype'}, { 'sName': 'stocknumber' }, { 'sName': 'notforloan' }, { 'sName': 'issues' }, @@ -398,6 +400,11 @@ [% ELSE %] null, [% END %] + [% IF itemtypes.size %] + { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => itemtypes %] }, + [% ELSE %] + null, + [% END %] { 'type': 'text' }, [% IF notforloans.size %] { 'type': 'select', 'values': [% INCLUDE escape_html_value_label elts => notforloans %] }, -- 2.11.0