From: Bernd Bleßmann Date: Tue, 26 Jan 2021 15:25:02 +0000 (+0100) Subject: PartPicker: Mehrfachauswahl: Option um Positions-Eingabefed anzuzeigen X-Git-Tag: kivitendo-mebil_0.1-0~9^2~497 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4af0680de7454195d92003613a03dc3eca4d94d2;p=kivitendo-erp.git PartPicker: Mehrfachauswahl: Option um Positions-Eingabefed anzuzeigen Die Eingabe kann im Callback verwendet werden, um die Artikel an bestimmte Positionen zu setzen. --- diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index ef962ec79..2f8624d74 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -256,6 +256,11 @@ where C is the dom id of the part picker. Or you can even do it the other way round setting C to 1 on creation and open a single selection popup with js. +If C<%params> contains C an input field with the dom id +C will be rendered in the alternative popup. +This can be used in the callback for C to controll the +input postion for the items. + If C<%params> contains C the alternative popup will not show any results if there are more than C results. A warning message is displayed in this case. Set C to 0 to disable diff --git a/js/kivi.Part.js b/js/kivi.Part.js index 3f64c3a59..8daaf8c33 100644 --- a/js/kivi.Part.js +++ b/js/kivi.Part.js @@ -668,6 +668,7 @@ namespace('kivi.Part', function(ns) { url: 'controller.pl?action=Part/show_multi_items_dialog', data: $.extend({ real_id: self.pp.real_id, + show_pos_input: self.pp.o.multiple_pos_input, }, self.pp.ajax_data(this.pp.$dummy.val())), id: 'jq_multi_items_dialog', dialog: { @@ -736,12 +737,12 @@ namespace('kivi.Part', function(ns) { $('#jq_multi_items_dialog').dialog('close'); }, disable_continue: function() { - $('#multi_items_result input').off("keydown"); + $('#multi_items_result input, #multi_items_position').off("keydown"); $('#continue_button').prop('disabled', true); }, enable_continue: function() { var self = this; - $('#multi_items_result input').keydown(function(event) { + $('#multi_items_result input, #multi_items_position').keydown(function(event) { if(event.keyCode == KEY.ENTER) { event.preventDefault(); self.add_multi_items(); diff --git a/templates/webpages/part/_multi_items_dialog.html b/templates/webpages/part/_multi_items_dialog.html index 49916e039..a8628289d 100644 --- a/templates/webpages/part/_multi_items_dialog.html +++ b/templates/webpages/part/_multi_items_dialog.html @@ -18,6 +18,10 @@

+[%- IF FORM.show_pos_input -%] + [% 'At position' | $T8 %] + [% L.input_tag('multi_items.position', '', id='multi_items_position', size=5, class="numeric") %] +[%- END -%] [% L.button_tag('', LxERP.t8('Continue'), id='continue_button') %]