1 namespace('kivi.MassDeliveryOrderPrint', function(ns) {
3 ns.massConversionFinishProcess = function() {
4 $('#mass_print_dialog').dialog('close');
7 ns.massConversionStarted = function() {
8 $('#mdo_start_process_button,.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', 'disabled');
9 $('#mdo_start_process_abort_link').remove();
10 $('#mass_print_dialog').data('timerId', setInterval(function() {
11 $.get("controller.pl", {
12 action: 'MassDeliveryOrderPrint/mass_mdo_status',
13 job_id: $('#mdo_job_id').val()
14 }, kivi.eval_json_result);
18 ns.massConversionPopup = function() {
20 id: 'mass_print_dialog',
22 title: kivi.t8('Generate and print sales delivery orders')
27 ns.massConversionFinished = function() {
28 clearInterval($('#mass_print_dialog').data('timerId'));
29 $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
32 ns.submitMultiOrders = function () {
33 $("#old_table_id").remove();
34 var checkboxes = $('input[type=checkbox]').filter(function () { return $(this).prop('checked'); });
35 if (checkboxes.size() == 0) {
36 alert(kivi.t8("No delievery orders selected, please set one checkbox!"));
40 var tmpform = $("#report_table_id").clone();
42 tmpform.attr('id',"old_table_id");
43 tmpform.appendTo("#print_multi_id");
44 return kivi.submit_ajax_form('controller.pl?action=MassDeliveryOrderPrint/mass_mdo_print',$('#print_multi_id'));
47 ns.setup = function() {
48 $('#multi_all').checkall("input[name^='multi_id']");
49 $('#print_multi_button').click(kivi.MassDeliveryOrderPrint.submitMultiOrders);
53 $(kivi.MassDeliveryOrderPrint.setup);