From: Bernd Bleßmann Date: Sun, 9 Jun 2019 13:46:58 +0000 (+0200) Subject: PartPicker: auch nach ungültigen oder allen Artikeln suchen können. X-Git-Tag: release-3.5.4~53 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2de6b9633d8b9d2cec532920ecd7dfb3a2d76df7;p=kivitendo-erp.git PartPicker: auch nach ungültigen oder allen Artikeln suchen können. Dazu kann ein Parameter "status" (active/obsolete/all) übergeben werden. Ohne diesen Parameter ist das Verhalten wie zuvor (nur gültige). --- diff --git a/SL/Presenter/Part.pm b/SL/Presenter/Part.pm index 4f2105caa..145d9128f 100644 --- a/SL/Presenter/Part.pm +++ b/SL/Presenter/Part.pm @@ -229,6 +229,11 @@ If C<%params> contains C only parts of this type will be used for autocompletion. You may comma separate multiple types as in C. +If C<%params> contains C only parts of this status will be used +for autocompletion. C can be one of the following strings: +C, C or C. C is the default if C is +not given. + If C<%params> contains C only parts with this unit will be used for autocompletion. You may comma separate multiple units as in C. diff --git a/js/kivi.Part.js b/js/kivi.Part.js index 9fa071839..0b0185bf3 100644 --- a/js/kivi.Part.js +++ b/js/kivi.Part.js @@ -335,13 +335,18 @@ namespace('kivi.Part', function(ns) { ajax_data: function(term) { var data = { 'filter.all:substr:multi::ilike': term, - 'filter.obsolete': 0, current: this.$real.val(), }; if (this.o.part_type) data['filter.part_type'] = this.o.part_type.split(','); + if (this.o.status) { + if (this.o.status == 'active') data['filter.obsolete'] = 0; + if (this.o.status == 'obsolete') data['filter.obsolete'] = 1; + } else + data['filter.obsolete'] = 0; + if (this.o.classification_id) data['filter.classification_id'] = this.o.classification_id.split(','); diff --git a/templates/webpages/part/test_page.html b/templates/webpages/part/test_page.html index fb7853f3f..02d54d900 100644 --- a/templates/webpages/part/test_page.html +++ b/templates/webpages/part/test_page.html @@ -24,6 +24,15 @@ Artikel-Klassifizierung: Produktion
[% P.part.picker('part_id13', undef, classification_id='4') %]
Artikel-Klassifizierung: Eink.,Verk.,Prod.
[% P.part.picker('part_id14', undef, classification_id='1,2,4') %]
+Artikel-Status: Aktiv (default)
+[% P.part.picker('part_id15') %]
+Artikel-Status: Aktiv< (explizit)
+[% P.part.picker('part_id16', undef, status="active") %]
+Artikel-Status: Ungültig
+[% P.part.picker('part_id17', undef, status="obsolete") %]
+Artikel-Status: Alle
+[% P.part.picker('part_id18', undef, status="all") %]
+ Pre-filled:
[% P.part.picker('part_id6', pre_filled_part) %]
Convertible unit 'Std': (only select parts with unit Tag/Std/Min)