X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=koha-tmpl%2Fintranet-tmpl%2Fprog%2Fen%2Fmodules%2Fcirc%2Fcirculation.tt;h=ee3a66662ca7ab17fbdd5a140a2ab0595954d757;hb=ea418af20558801d8ee6bad2e18327e4390df077;hp=8724e9dc5828c8f42e92427f9d4903256142dc82;hpb=2d3bb6e1d4fb6f3d270cf2c5aa467bedaa9d3e34;p=koha_fer 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 8724e9dc58..ee3a66662c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -82,6 +82,16 @@ var allcheckboxes = $(".checkboxed"); $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); return false; }); + $("#CheckAllexports").click(function(){ + $(".checkboxed").checkCheckboxes(":input[name*=biblionumbers]"); + $(".checkboxed").unCheckCheckboxes(":input[name*=items]"); + return false; + }); + $("#CheckNoexports").click(function(){ + $(".checkboxed").unCheckCheckboxes(":input[name*=biblionumbers]"); + return false; + }); + $("#relrenew_all").click(function(){ $(allcheckboxes).checkCheckboxes(":input[name*=items]"); $(allcheckboxes).unCheckCheckboxes(":input[name*=barcodes]"); @@ -144,18 +154,75 @@ var allcheckboxes = $(".checkboxed"); $("#add_message_form").show(); }); - $("input.radio").click(function(){ + $("input.radio").click(function(){ radioCheckBox($(this)); - }); - $("#newduedate").datepicker({ minDate: 1 }); // require that renewal date is after today + }); + $("#exportmenuc").empty(); + initExportButton(); + + $("#newduedate").datetimepicker({ + minDate: 1, // require that renewal date is after today + hour: 23, + minute: 59 + }); $("#duedatespec").datetimepicker({ - onSelect: function(dateText, inst) { $("#barcode").focus(); }, + onClose: function(dateText, inst) { $("#barcode").focus(); }, hour: 23, - minute: 59, + minute: 59 }); }); +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) { + if ($("input:checkbox[name='biblionumbers'][checked]").length < 1){ + alert(_("You must select a checkout to export")); + return; + } + + $("input:checkbox[name='biblionumbers']").each( function(){ + var input_item = $(this).siblings("input:checkbox"); + if ( $(this).is(":checked") ) { + $(input_item).attr("checked", "checked"); + } else { + $(input_item).attr("checked", ""); + } + } ); + + if (format == 'iso2709_995') { + format = 'iso2709'; + $("#dont_export_item").val(0); + } else if (format == 'iso2709') { + $("#dont_export_item").val(1); + } else { + [% UNLESS ( export_with_csv_profile ) %] + alert(_("You must define a csv profile for export (in tools>CSV export profiles) and fill the ExportWithCsvProfile system preference")); + return false; + [% END %] + } + document.issues.action="/cgi-bin/koha/tools/export.pl"; + document.getElementById("export_format").value = format; + document.issues.submit(); + + /* Reset form action to its initial value */ + document.issues.action="/cgi-bin/koha/reserve/renewscript.pl"; + +}; + function validate1(date) { var today = new Date(); if ( date < today ) { @@ -301,8 +368,19 @@ function validate1(date) { [% IF ( ITEM_LOST ) %]