Bug 19910: Use the delimiter syspref to name download link
authorNick Clemens <nick@bywatersolutions.com>
Wed, 3 Jan 2018 14:07:17 +0000 (14:07 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Apr 2018 18:45:44 +0000 (15:45 -0300)
To test:
1 - Set delimiter syspref to anything but comma
2 - Download report results as comma separated text
3 - They actually follow the syspref
4 - Apply patch
5 - Download link should now match pref selection
6 - Change pref, note link changes
7 - Verify things still work as expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/delimiter_text.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/delimiter_text.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/delimiter_text.inc
new file mode 100644 (file)
index 0000000..e6b4aca
--- /dev/null
@@ -0,0 +1,8 @@
+[% 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 %]
index 649fbe1..9b3a562 100644 (file)
                 [%- FOREACH param IN sql_params %]&amp;sql_params=[% param %][% END %]
             [%- END %]
 
+
             <div class="btn-group">
                 <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" id="format"><i class="fa fa-upload"></i> Download <span class="caret"></span></button>
                 <ul class="dropdown-menu">
-                    <li><a id="csv" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=csv&amp;report_id=[% id %]&amp;reportname=[% name |uri %][% PROCESS params %]">Comma separated text</a></li>
+                    <li><a id="csv" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=csv&amp;report_id=[% id %]&amp;reportname=[% name |uri %][% PROCESS params %]">[% PROCESS 'delimiter_text.inc' %]</a></li>
                     <li><a id="tab" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=tab&amp;report_id=[% id %]&amp;reportname=[% name |uri %][% PROCESS params %]">Tab separated text</a></li>
                     <li><a id="ods" href="/cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Export&amp;format=ods&amp;report_id=[% id %]&amp;reportname=[% name |uri %][% PROCESS params %]">Open Document Spreadsheet</a></li>
                 </ul>