From 594ec6f3bd1dd0ed3656ea5b77bc5c2e030dabbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 27 Jan 2021 12:59:12 +0100 Subject: [PATCH] Auftrags-Controller: Artikel-Mehrfachauswahl: js-Code aus Template ausgelagert --- js/kivi.Order.js | 6 ++++++ templates/webpages/order/tabs/basic_data.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/js/kivi.Order.js b/js/kivi.Order.js index 622675541..021ed373b 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -458,6 +458,12 @@ namespace('kivi.Order', function(ns) { $.post("controller.pl", data, kivi.eval_json_result); }; + ns.open_multi_items_dialog = function() { + var pp = $("#add_item_parts_id").data("part_picker"); + pp.o.multiple=1; + pp.open_dialog(); + }; + ns.add_multi_items = function(data) { var insert_before_item_id = ns.get_insert_before_item_id($('#multi_items_position').val()); data = data.concat($('#order_form').serializeArray()); diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index 18aed5ad4..c4bcda06c 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -227,7 +227,7 @@ [%- PROCESS order/tabs/_item_input.html SELF=SELF %] - [% L.button_tag('$("#add_item_parts_id").data("part_picker").o.multiple=1; $("#add_item_parts_id").data("part_picker").open_dialog()', LxERP.t8('Add multiple items')) %] + [% L.button_tag('kivi.Order.open_multi_items_dialog()', LxERP.t8('Add multiple items')) %] -- 2.20.1