From 1f3dda5fde9b278b113fc21005adc2af8c8ed7f4 Mon Sep 17 00:00:00 2001 From: Tamino Date: Fri, 4 Sep 2020 16:40:58 +0200 Subject: [PATCH] =?utf8?q?WebshopApi:=20template=20und=20js=20=C3=BCberarb?= =?utf8?q?eitet?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/kivi.ShopOrder.js | 29 +++++++++++++++++++++ templates/webpages/shop_order/_get_one.html | 18 +++++++++++++ templates/webpages/shop_order/list.html | 3 +++ 3 files changed, 50 insertions(+) create mode 100644 templates/webpages/shop_order/_get_one.html diff --git a/js/kivi.ShopOrder.js b/js/kivi.ShopOrder.js index 21ac4873c..467fcbd89 100644 --- a/js/kivi.ShopOrder.js +++ b/js/kivi.ShopOrder.js @@ -8,6 +8,35 @@ namespace('kivi.ShopOrder', function(ns) { }); }; + ns.get_orders_one = function() { + + var data = $('#get_one_order_form').serializeArray(); + data.push({ name: 'type', value: 'get_one'}); + data.push({ name: 'action', value: 'ShopOrder/get_orders' }); + + $.post("controller.pl", data, kivi.eval_json_result); + }; + + ns.get_orders_next = function() { + + $.post("controller.pl", { action: 'ShopOrder/get_orders', type: 'get_next'}, kivi.eval_json_result); + }; + + ns.getOneOrderInitialize = function() { + kivi.popup_dialog({ + id: 'get_one', + dialog: { + title: kivi.t8('Get one shoporder'), + } + }); + }; + + + ns.get_one_order_setup = function() { + kivi.ShopOrder.getOneOrderInitialize(); + kivi.submit_ajax_form('controller.pl?action=ShopOrder/get_orders', $('#shoporder')); + }; + ns.massTransferStarted = function() { $('#status_mass_transfer').data('timerId', setInterval(function() { $.get("controller.pl", { diff --git a/templates/webpages/shop_order/_get_one.html b/templates/webpages/shop_order/_get_one.html new file mode 100644 index 000000000..6a368d3df --- /dev/null +++ b/templates/webpages/shop_order/_get_one.html @@ -0,0 +1,18 @@ +[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%] +[% USE Dumper %] +[% L.stylesheet_tag('webshop') %] +[%- INCLUDE 'common/flash.html' %] +
+ + + + + + + + + +
[% 'Shop' | $T8 %][% L.select_tag('shop_id', SELF.shops, value_key = 'value', title_key = 'title', default=1) %]
[% 'Shop ordernumber' | $T8 %][% L.input_tag('shop_ordernumber', "") %]
+ [% L.hidden_tag("action", "ShopOrder/dispatch") %] + [% L.button_tag("kivi.ShopOrder.get_orders_one()", LxERP.t8('Fetch order')) %] +
diff --git a/templates/webpages/shop_order/list.html b/templates/webpages/shop_order/list.html index f30644c96..e8c10340c 100644 --- a/templates/webpages/shop_order/list.html +++ b/templates/webpages/shop_order/list.html @@ -192,6 +192,9 @@ [%- INCLUDE 'shop_order/_transfer_status.html' %] +