Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2de6b963

Von Bernd Bleßmann vor fast 5 Jahren hinzugefügt

  • ID 2de6b9633d8b9d2cec532920ecd7dfb3a2d76df7
  • Vorgänger 78282bbd
  • Nachfolger ee4f84f3

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).

Unterschiede anzeigen:

SL/Presenter/Part.pm
229 229
for autocompletion. You may comma separate multiple types as in
230 230
C<part,assembly>.
231 231

  
232
If C<%params> contains C<status> only parts of this status will be used
233
for autocompletion. C<status> can be one of the following strings:
234
C<active>, C<obsolete> or C<all>. C<active> is the default if C<status> is
235
not given.
236

  
232 237
If C<%params> contains C<unit> only parts with this unit will be used
233 238
for autocompletion. You may comma separate multiple units as in
234 239
C<h,min>.
js/kivi.Part.js
335 335
    ajax_data: function(term) {
336 336
      var data = {
337 337
        'filter.all:substr:multi::ilike': term,
338
        'filter.obsolete': 0,
339 338
        current:  this.$real.val(),
340 339
      };
341 340

  
342 341
      if (this.o.part_type)
343 342
        data['filter.part_type'] = this.o.part_type.split(',');
344 343

  
344
      if (this.o.status) {
345
        if (this.o.status == 'active')   data['filter.obsolete'] = 0;
346
        if (this.o.status == 'obsolete') data['filter.obsolete'] = 1;
347
      } else
348
        data['filter.obsolete'] = 0;
349

  
345 350
      if (this.o.classification_id)
346 351
        data['filter.classification_id'] = this.o.classification_id.split(',');
347 352

  
templates/webpages/part/test_page.html
24 24
[% P.part.picker('part_id13', undef, classification_id='4') %]<br>
25 25
Artikel-Klassifizierung: Eink.,Verk.,Prod. <br>
26 26
[% P.part.picker('part_id14', undef, classification_id='1,2,4') %]<br>
27
Artikel-Status: Aktiv (default)<br>
28
[% P.part.picker('part_id15') %]<br>
29
Artikel-Status: Aktiv< (explizit)<br>
30
[% P.part.picker('part_id16', undef, status="active") %]<br>
31
Artikel-Status: Ungültig<br>
32
[% P.part.picker('part_id17', undef, status="obsolete") %]<br>
33
Artikel-Status: Alle<br>
34
[% P.part.picker('part_id18', undef, status="all") %]<br>
35

  
27 36
Pre-filled:<br>
28 37
[% P.part.picker('part_id6', pre_filled_part) %]<br>
29 38
Convertible unit 'Std': (only select parts with unit Tag/Std/Min)<br>

Auch abrufbar als: Unified diff