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

Signed-off-by: Axel Amghar <axel.amghar@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Katrin Fischer 2019-04-06 12:42:39 +00:00 committed by Nick Clemens
parent b969ccbf97
commit ac6dc3b2c1
5 changed files with 13 additions and 3 deletions

View File

@ -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 {

View File

@ -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 %]"

View File

@ -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 %]",

View File

@ -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 -%]

View File

@ -269,6 +269,7 @@
+ ' <th id="items_homebranch">' + _("Home library") + '</th>'
+ ' <th id="items_holdingbranch">' + _("Current location") + '</th>'
+ ' <th id="items_location">' + _("Shelving location") + '</th>'
+ ' <th id="items_itype">' + _("Itemtype") + '</th>'
+ ' <th id="item_inventoryno">' + _("Inventory number") + '</th>'
+ ' <th id="items_status">' + _("Status") + '</th>'
+ ' <th id="items_checkouts">' + _("Checkouts") + '</th>'
@ -370,6 +371,7 @@
{ 'sName': 'homebranch' },
{ 'sName': 'holdingbranch' },
{ 'sName': 'location' },
{ 'sName': 'itype'},
{ 'sName': 'stocknumber' },
{ 'sName': 'notforloan' },
{ 'sName': 'issues' },
@ -396,6 +398,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 %] },