1 namespace('kivi.ShopOrder', function(ns) {
2 ns.massTransferInitialize = function() {
4 id: 'status_mass_transfer',
6 title: kivi.t8('Status Shoptransfer'),
11 ns.get_orders_one = function() {
13 var data = $('#get_one_order_form').serializeArray();
14 data.push({ name: 'type', value: 'get_one'});
15 data.push({ name: 'action', value: 'ShopOrder/get_orders' });
17 $.post("controller.pl", data, kivi.eval_json_result);
20 ns.get_orders_next = function() {
22 $.post("controller.pl", { action: 'ShopOrder/get_orders', type: 'get_next'}, kivi.eval_json_result);
25 ns.getOneOrderInitialize = function() {
29 title: kivi.t8('Get one shoporder'),
35 ns.get_one_order_setup = function() {
36 kivi.ShopOrder.getOneOrderInitialize();
37 kivi.submit_ajax_form('controller.pl?action=ShopOrder/get_orders', $('#shoporder'));
40 ns.massTransferStarted = function() {
41 $('#status_mass_transfer').data('timerId', setInterval(function() {
42 $.get("controller.pl", {
43 action: 'ShopOrder/transfer_status',
44 job_id: $('#smt_job_id').val()
45 }, kivi.eval_json_result);
49 ns.massTransferFinished = function() {
50 clearInterval($('#status_mass_transfer').data('timerId'));
51 $('.ui-dialog-titlebar button.ui-dialog-titlebar-close').prop('disabled', '')
54 ns.processClose = function() {
55 $('#status_mass_transfer').dialog('close');
56 window.location.href = 'controller.pl?filter.obsolete=0&filter.transferred=0&action=ShopOrder%2flist&db=shop_orders&sort_by=shop_ordernumber';
59 ns.setup = function() {
60 kivi.ShopOrder.massTransferInitialize();
61 kivi.submit_ajax_form('controller.pl?action=ShopOrder/mass_transfer','[name=shop_orders_list]');