[Koha-patches] [PATCH] Bug 9294 [Follow-up] Move JavaScript out of circulation template

Owen Leonard oleonard at myacpl.org
Mon Mar 18 19:26:15 CET 2013


From: Jonathan Druart <jonathan.druart at biblibre.com>

This patch corrects a JavaScript error in the original patch caused by
an incorrectly named variable. Instead of correcting the name I'm
removing the error-handling around missing CSV profiles alltogether in
favor of Jonathan's suggestion to simply hide the CSV option if no
formats are specified.

To test this follow-up perform exports of checkouts with
ExportRemoveFields filled and with ExportWithCsvProfile both empty and
not empty.
---
 .../intranet-tmpl/prog/en/js/pages/circulation.js  |    3 ---
 .../prog/en/modules/circ/circulation.tt            |    6 ++----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js
index 8285cde..b64d7f8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/circulation.js
@@ -112,9 +112,6 @@ function export_checkouts(format) {
         $("#dont_export_item").val(0);
     } else if (format == 'iso2709') {
         $("#dont_export_item").val(1);
-    } else if (format === '') {
-            alert(MSG_DEFINE_CSV_FORMAT);
-            return false;
     }
     document.issues.action="/cgi-bin/koha/tools/export.pl";
     document.getElementById("export_format").value = format;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index f83fe25..fcd87d3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -16,7 +16,7 @@
 //<![CDATA[
 var MSG_ADD_MESSAGE = _("Add a new message");
 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
-var MSG_EXPORT_DEFINE_CSV_FORMAT = _("You must define a CSV profile for export (in tools -> CSV export profiles) and fill the 'ExportWithCsvProfile' system preference");
+
 [% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
 [% IF ( UseTablesortForCirc ) %]$.tablesorter.addParser({
     id: 'articles',
@@ -813,9 +813,7 @@ No patron matched <span class="ex">[% message %]</span>
                 <option value="iso2709_995">ISO2709 with items</option>
                 <option value="iso2709">ISO2709 without items</option>
                 [% IF ( export_with_csv_profile ) %]
-                <option value="csv">CSV</option>
-                [% ELSE %]
-                <option value="">CSV</option>
+                  <option value="csv">CSV</option>
                 [% END %]
             </select>
            <label for="export_remove_fields">Don't export fields:</label> <input type="text" id="export_remove_fields" name="export_remove_fields" value="[% export_remove_fields %]" title="Use for iso2709 exports" />
-- 
1.7.9.5


More information about the Koha-patches mailing list