From ac76e5822a197c3ec99465436384787dd5b32dc8 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 7 Dec 2020 17:03:40 +0100 Subject: [PATCH] Bug 27164: Double quotes everywhere in item search CSV export In item search CSV export, data cells are exported with double quotes. There should also be double quotes in header cells. Also some spaces can be removed. This may help to open the CSV with any table/calc software. Test plan : 1.0) Without patch 1.1) Perform an item search 1.2) Export as a CSV file and save the file locally 1.3) Open the file with a table/calc software 2.0) Apply patch 2.1) Perform same item search 2.2) Export as a CSV file and save the file locally 2.3) Open the file with a table/calc software 3.0) Compare files with diff/meld => you see only double quotes arround header cells and removal of space after coma 3.1) In table/calc software they should look the same --- .../prog/en/includes/catalogue/itemsearch_item.csv.inc | 2 +- .../prog/en/includes/csv_headers/catalogue/itemsearch.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 bb625bae23..52745004e6 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 @@ -4,4 +4,4 @@ [%- USE AuthorisedValues -%] [%- 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 %]", "[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]", "[% item.barcode | html %]", "[% item.itemcallnumber | html %]", "[% Branches.GetName(item.homebranch) | html %]", "[% Branches.GetName(item.holdingbranch) | html %]", "[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.location) | html %]", "[% ItemTypes.GetDescription(item.itype) | html %]", "[% item.stocknumber | html %]", "[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]","[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]","[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | 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 %]","[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]","[% item.barcode | html %]","[% item.itemcallnumber | html %]","[% Branches.GetName(item.homebranch) | html %]","[% Branches.GetName(item.holdingbranch) | html %]","[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.location', authorised_value => item.location) | html %]","[% ItemTypes.GetDescription(item.itype) | html %]","[% item.stocknumber | html %]","[% AuthorisedValues.GetDescriptionByKohaField(frameworkcode => biblio.frameworkcode, kohafield => 'items.notforloan', authorised_value => item.notforloan) | html %]","[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) || "" | html %]","[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) || "" | 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 aa1ce57f5f..36856f0205 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 library, Shelving location, Item type, Inventory number, Not for loan status, Lost status, Withdrawn status, Checkouts[%- END -%] +[%- BLOCK -%]"Title","Publication date","Publisher","Collection","Barcode","Call number","Home library","Current library","Shelving location","Item type","Inventory number","Not for loan status","Lost status","Withdrawn status","Checkouts"[%- END -%] -- 2.29.2