From 70adfcd668b1a5eef656b3d73e9131952fbde079 Mon Sep 17 00:00:00 2001
From: Victor Grousset <victor.grousset@biblibre.com>
Date: Thu, 1 Feb 2018 11:05:21 +0100
Subject: [PATCH] Bug 19928: Acquisitions: show the precise kind of CSV on
 export buttons

That is to say on the 4 "export as CSV" buttons found, now when can read
"export as semicolon separated text (.csv)". It follows the "delimiter"
syspref.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
---
 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 14 +++++++++++++-
 .../intranet-tmpl/prog/en/modules/acqui/basketgroup.tt  | 17 +++++++++++++++--
 .../intranet-tmpl/prog/en/modules/acqui/lateorders.tt   | 15 ++++++++++++++-
 3 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
index 81d07ff34e..ce2e0b1016 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
@@ -1,6 +1,18 @@
+[% USE Koha %]
 [% BLOCK csv_export %]
     <div class="btn-group">
-        <a id="exportbutton" class="btn btn-default btn-sm" href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]"><i class="fa fa-download"></i> Export as CSV</a>
+        <a id="exportbutton" class="btn btn-default btn-sm" href="[% script_name %]?op=export&amp;basketno=[% basketno %]&amp;booksellerid=[% booksellerid %]">
+            <i class="fa fa-download"></i>
+            Export as
+            [% SWITCH Koha.Preference('delimiter') %]
+                [% CASE '#' %] pound (#) separated text (.csv)
+                [% CASE ',' %] comma separated text (.csv)
+                [% CASE '/' %] slash separated text (.csv)
+                [% CASE ';' %] semicolon separated text (.csv)
+                [% CASE '\\' %] backslash separated text (.csv)
+                [% CASE 'tabulation' %] tab separated text (.csv)
+            [% END %]
+        </a>
       <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
       <ul class="dropdown-menu" id="export-csv-menu">
           <li><a href="#">Default</a></li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
index 1ee708331a..b387486c54 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
@@ -1,4 +1,17 @@
 [% USE Branches %]
+
+[% USE Koha %]
+[% BLOCK syspref_delimiter %]
+    [%- SWITCH Koha.Preference('delimiter') -%]
+        [%- CASE '#' %] pound (#) separated text (.csv)
+        [%- CASE ',' %] comma separated text (.csv)
+        [%- CASE '/' %] slash separated text (.csv)
+        [%- CASE ';' %] semicolon separated text (.csv)
+        [%- CASE '\\' %] backslash separated text (.csv)
+        [%- CASE 'tabulation' %] tab separated text (.csv)
+    [%- END -%]
+[% END %]
+
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Basket grouping for [% booksellername |html %]</title>
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
@@ -142,7 +155,7 @@ function submitForm(form) {
                     [% IF (closedbg) %]
                         <div id="toolbar" class="btn-toolbar">
                             <div class="btn-group"><a href="[% script_name %]?op=reopen&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]&amp;mode=singlebg" class="btn btn-default btn-sm" id="reopenbutton"><i class="fa fa-download"></i> Reopen this basket group</a></div>
-                            <div class="btn-group"><a href="[% script_name %]?op=export&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-default btn-sm" id="exportbutton"><i class="fa fa-download"></i> Export this basket group as CSV</a></div>
+                            <div class="btn-group"><a href="[% script_name %]?op=export&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-default btn-sm" id="exportbutton"><i class="fa fa-download"></i> Export this basket group as[%- PROCESS syspref_delimiter -%]</a></div>
                             <div class="btn-group"><a href="[% script_name %]?op=print&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-default btn-sm" id="printbutton"><i class="fa fa-download"></i> Print this basket group in PDF</a></div>
                             <div class="btn-group"><a href="[% script_name %]?op=ediprint&amp;basketgroupid=[% basketgroupid %]&amp;booksellerid=[% booksellerid %]" class="btn btn-default btn-sm" id="printbutton"><i class="fa fa-download"></i> Generate EDIFACT order</a></div>
                         </div>
@@ -366,7 +379,7 @@ function submitForm(form) {
                                                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="add" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="View" /></form>
                                                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="reopen" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Reopen" /></form>
                                                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="print" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Export as PDF" /></form>
-                                                    <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="export" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Export as CSV" /></form>
+                                                    <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="export" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Export as[%- PROCESS syspref_delimiter -%]" /></form>
                                                     <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="ediprint" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Generate EDIFACT order" /></form>
                                                 </td>
                                             </tr>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
index 2363765509..23c7374132 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
@@ -1,6 +1,19 @@
 [% USE KohaDates %]
 [% USE Branches %]
 [% USE ColumnsSettings %]
+
+[% USE Koha %]
+[% BLOCK syspref_delimiter %]
+    [%- SWITCH Koha.Preference('delimiter') -%]
+        [%- CASE '#' %] pound (#) separated text (.csv)
+        [%- CASE ',' %] comma separated text (.csv)
+        [%- CASE '/' %] slash separated text (.csv)
+        [%- CASE ';' %] semicolon separated text (.csv)
+        [%- CASE '\\' %] backslash separated text (.csv)
+        [%- CASE 'tabulation' %] tab separated text (.csv)
+    [%- END -%]
+[% END %]
+
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Late orders</title>
 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
@@ -205,7 +218,7 @@ $(document).ready(function() {
     <div class="spacer"></div>
 
     <p style="display:block;">
-        <input type="button" value="Export as CSV" id="ExportSelected" />
+        <input type="button" value="Export as[%- PROCESS syspref_delimiter -%]" id="ExportSelected" />
         [% UNLESS lateorder.budget_lock %]
             <input type="submit"  value="Claim order" />
         [% END %]
-- 
2.14.1