From d68b8357d75cf2808d82a86ff5d6582403e6c51a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 13 Dec 2012 14:59:58 -0500 Subject: [PATCH] Bug 9283 - Change structure of export checkouts form This patch changes the structure of the export checkouts form so that it is a little more linear. This change moves generation of the export options from JavaScript to the markup, eliminating an instance of dependence on YUI menus. To test, enable checkout exports by specifying a value for ExportWithCsvProfile or ExportRemoveFields. Load a patron with checkouts in circulation. Try the various checkout export options. Each should function correctly. Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Jared Camins-Esakov --- .../prog/en/modules/circ/circulation.tt | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) 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 fb9e46ef1f..cb5a5488cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -158,8 +158,6 @@ var allcheckboxes = $(".checkboxed"); $("input.radio").click(function(){ radioCheckBox($(this)); }); - $("#exportmenuc").empty(); - initExportButton(); $("#newduedate").datetimepicker({ minDate: 1, // require that renewal date is after today @@ -171,25 +169,14 @@ var allcheckboxes = $(".checkboxed"); hour: 23, minute: 59 }); - + $("#export_submit").click(function(){ + var export_format = $("#export_formats").val(); + export_checkouts(export_format); + return false; + }) }); -function initExportButton() { - var exportmenu = [ - { text: _("ISO2709 with items"), onclick: {fn: function(){export_submit("iso2709_995")}} }, - { text: _("ISO2709 without items"), onclick: {fn: function(){export_submit("iso2709")}} }, - { text: _("CSV"), onclick: {fn: function(){export_submit("csv")}} }, - ]; - new YAHOO.widget.Button({ - type: "menu", - label: _("Export checkouts"), - name: "exportmenubutton", - menu: exportmenu, - container: "exportmenuc" - }); -} - -function export_submit(format) { +function export_checkouts(format) { if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){ alert(_("You must select a checkout to export")); return; @@ -959,16 +946,23 @@ No patron matched [% message %] [% END %] + [% IF export_remove_fields OR export_with_csv_profile %] -

- Don't export fields : - Export +
+ + + + +
[% END %] - [% END %] [% ELSE %] -- 2.39.5