Bugzilla – Attachment 39533 Details for
Bug 14263
Export of CSV from item search form does only work in English
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14263: Fix export of item search results when translated
Bug-14263-Fix-export-of-item-search-results-when-t.patch (text/plain), 4.61 KB, created by
Frédéric Demians
on 2015-05-26 15:50:30 UTC
(
hide
)
Description:
Bug 14263: Fix export of item search results when translated
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2015-05-26 15:50:30 UTC
Size:
4.61 KB
patch
obsolete
>From 968c6eda1cd90c4792f5b44e5617e8018ae68404 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@koha-community.org> >Date: Sun, 24 May 2015 18:00:57 +0200 >Subject: [PATCH] Bug 14263: Fix export of item search results when translated > >This csv does not use the correct way to display headers. >They should be put in a separate file to get a correct display. >Without this patch, the first line of the generated file contains the >headers + data > >Test plan: >1/ choose a language and update + translate the templates >for instance: > cd misc/translate; > ./translate update es-ES; ./translate install es-ES >2/ Go to the item search form using this language >3/ Launch a search and select CSV to display the results. >The CSV headers should be correct > >Signed-off-by: Frederic Demians <f.demians@tamil.fr> > Seen the bug. Works as described. >--- > catalogue/itemsearch.pl | 5 ++++- > .../intranet-tmpl/prog/en/includes/catalogue/itemsearch_item.csv.inc | 2 +- > .../prog/en/includes/csv_headers/catalogue/itemsearch.tt | 1 + > koha-tmpl/intranet-tmpl/prog/en/includes/empty_line.inc | 0 > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.csv.tt | 2 +- > 5 files changed, 7 insertions(+), 3 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/empty_line.inc > >diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl >index 35d1a00..e66aa4f 100755 >--- a/catalogue/itemsearch.pl >+++ b/catalogue/itemsearch.pl >@@ -303,7 +303,10 @@ if ($format eq 'csv') { > type => 'text/csv', > attachment => 'items.csv', > }); >- print $template->output; >+ >+ for my $line ( split '\n', $template->output ) { >+ print "$line\n" unless $line =~ m|^\s*$|; >+ } > } else { > output_with_http_headers $cgi, $cookie, $template->output, $content_type; > } >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 fd6e835..9cc781c 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,4 +1,4 @@ > [%- USE Branches -%] > [%- biblio = item.biblio -%] > [%- biblioitem = item.biblioitem -%] >-"[% biblio.title |html %] by [% biblio.author |html %]", "[% biblioitem.publicationyear |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 %] by [% biblio.author |html %]", "[% biblioitem.publicationyear |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 %]"[% INCLUDE 'empty_line.inc' %] >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 >new file mode 100644 >index 0000000..28fabe7 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/catalogue/itemsearch.tt >@@ -0,0 +1 @@ >+Title, Publication Date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Inventory number, Status, Checkouts >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/empty_line.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/empty_line.inc >new file mode 100644 >index 0000000..e69de29 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.csv.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.csv.tt >index 45cfd32..49878c4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.csv.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.csv.tt >@@ -1,4 +1,4 @@ >-Title, Publication Date, Publisher, Collection, Barcode, Call number, Home library, Current location, Shelving location, Inventory number, Status, Checkouts >+[% INCLUDE csv_headers/catalogue/itemsearch.tt %] > [% FOREACH item IN results -%] > [%- INCLUDE 'catalogue/itemsearch_item.csv.inc' item = item -%] > [%- END -%] >-- >2.3.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14263
:
39465
|
39532
|
39533
|
39718