X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/js/kivi.MassDeliveryOrderPrint.js diff --git a/js/kivi.MassDeliveryOrderPrint.js b/js/kivi.MassDeliveryOrderPrint.js new file mode 100644 index 000000000..e0b538761 --- /dev/null +++ b/js/kivi.MassDeliveryOrderPrint.js @@ -0,0 +1,36 @@ +namespace('kivi.MassDeliveryOrderPrint', function(ns) { + "use strict"; + + ns.massConversionFinishProcess = function() { + $('#mass_print_dialog').dialog('close'); + }; + + ns.massConversionStarted = function() { + $('#mdo_start_process_button,.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', 'disabled'); + $('#mdo_start_process_abort_link').remove(); + $('#mass_print_dialog').data('timerId', setInterval(function() { + $.get("controller.pl", { + action: 'MassDeliveryOrderPrint/mass_mdo_status', + job_id: $('#mdo_job_id').val() + }, kivi.eval_json_result); + }, 5000)); + }; + + ns.massConversionPopup = function() { + kivi.popup_dialog({ + id: 'mass_print_dialog', + dialog: { + title: kivi.t8('Generate and print sales delivery orders') + } + }); + }; + + ns.massConversionFinished = function() { + clearInterval($('#mass_print_dialog').data('timerId')); + $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '') + }; + + ns.submitMultiOrders = function () { + return kivi.submit_ajax_form('controller.pl?action=MassDeliveryOrderPrint/mass_mdo_print', $('#form')); + }; +});