S:D:Helper:TransNumberGenerator: Warnung vermeiden.
[kivitendo-erp.git] / js / kivi.ShopOrder.js
1 namespace('kivi.ShopOrder', function(ns) {
2   ns.massTransferInitialize = function() {
3     kivi.popup_dialog({
4       id: 'status_mass_transfer',
5       dialog: {
6         title: kivi.t8('Status Shoptransfer'),
7       }
8     });
9   };
10
11   ns.massTransferStarted = function() {
12     $('#status_mass_transfer').data('timerId', setInterval(function() {
13       $.get("controller.pl", {
14         action: 'ShopOrder/transfer_status',
15         job_id: $('#smt_job_id').val()
16       }, kivi.eval_json_result);
17     }, 5000));
18   };
19
20   ns.massTransferFinished = function() {
21     clearInterval($('#status_mass_transfer').data('timerId'));
22     $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
23   };
24
25   ns.processClose = function() {
26     $('#status_mass_transfer').dialog('close');
27     window.location.href = 'controller.pl?filter.obsolete=0&filter.transferred=0&action=ShopOrder%2flist&db=shop_orders&sort_by=shop_ordernumber';
28   };
29
30   ns.setup = function() {
31     kivi.ShopOrder.massTransferInitialize();
32     kivi.submit_ajax_form('controller.pl?action=ShopOrder/mass_transfer','[name=shop_orders_list]');
33   };
34
35 });