WebshopApi: template und js überarbeitet
authorTamino <tamino.steinert@web.de>
Fri, 4 Sep 2020 14:40:58 +0000 (16:40 +0200)
committerWerner Hahn <wh@futureworldsearch.net>
Wed, 7 Apr 2021 14:42:12 +0000 (16:42 +0200)
js/kivi.ShopOrder.js
templates/webpages/shop_order/_get_one.html [new file with mode: 0644]
templates/webpages/shop_order/list.html

index 21ac487..467fcbd 100644 (file)
@@ -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 (file)
index 0000000..6a368d3
--- /dev/null
@@ -0,0 +1,18 @@
+[%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
+[% USE Dumper %]
+[% L.stylesheet_tag('webshop') %]
+[%- INCLUDE 'common/flash.html' %]
+<form id="get_one_order_form" action="controller.pl" method="post" style="padding-left:1em;">
+ <table>
+    <tr>
+     <th align="right">[% 'Shop' | $T8 %]</th>
+     <td>[% L.select_tag('shop_id', SELF.shops, value_key = 'value', title_key = 'title', default=1) %]</td>
+    </tr>
+    <tr>
+     <th align="right">[% 'Shop ordernumber' | $T8 %]</th>
+     <td>[% L.input_tag('shop_ordernumber', "") %]</td>
+    </tr>
+ </table>
+  [%  L.hidden_tag("action", "ShopOrder/dispatch") %]
+  [%  L.button_tag("kivi.ShopOrder.get_orders_one()", LxERP.t8('Fetch order')) %]
+</form>
index f30644c..e8c1034 100644 (file)
     [%- INCLUDE 'shop_order/_transfer_status.html' %]
   </div>
  </form>
+ <div id="get_one" style="display:none;">
+   [% INCLUDE 'shop_order/_get_one.html' %]
+ </div>
 <script type="text/javascript">
 <!--