Revision d8acfbcb
Von Bernd Bleßmann vor mehr als 5 Jahren hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
# since we need a second get models instance with different filters for that,
|
||
# we only modify the original filter temporarily in place
|
||
if ($::form->{prefer_exact}) {
|
||
local $::form->{filter}{'all::ilike'} = delete local $::form->{filter}{'all:substr:multi::ilike'};
|
||
local $::form->{filter}{'all::ilike'} = delete local $::form->{filter}{'all:substr:multi::ilike'};
|
||
local $::form->{filter}{'all_with_makemodel::ilike'} = delete local $::form->{filter}{'all_with_makemodel:substr:multi::ilike'};
|
||
local $::form->{filter}{'all_with_customer_partnumber::ilike'} = delete local $::form->{filter}{'all_with_customer_partnumber:substr:multi::ilike'};
|
||
|
||
my $exact_models = SL::Controller::Helper::GetModels->new(
|
||
controller => $self,
|
js/kivi.Part.js | ||
---|---|---|
},
|
||
ajax_data: function(term) {
|
||
var data = {
|
||
'filter.all:substr:multi::ilike': term,
|
||
current: this.$real.val(),
|
||
};
|
||
|
||
... | ... | |
if (this.o.convertible_unit)
|
||
data['filter.unit_obj.convertible_to'] = this.o.convertible_unit;
|
||
|
||
if (this.o.vendor_selector || this.o.customer_selector) {
|
||
if (this.o.vendor_selector) {
|
||
data['filter.all_with_makemodel:substr:multi::ilike'] = term;
|
||
if ($(this.o.vendor_selector).val()) {
|
||
data['filter.makemodels.make'] = $(this.o.vendor_selector).val().split(',');
|
||
}
|
||
}
|
||
if (this.o.customer_selector) {
|
||
data['filter.all_with_customer_partnumber:substr:multi::ilike'] = term;
|
||
if ($(this.o.customer_selector).val()) {
|
||
data['filter.customerprices.customer_id'] = $(this.o.customer_selector).val().split(',');
|
||
}
|
||
}
|
||
} else {
|
||
data['filter.all:substr:multi::ilike'] = term;
|
||
}
|
||
|
||
return data;
|
||
},
|
||
set_item: function(item) {
|
templates/webpages/part/test_page.html | ||
---|---|---|
<br>
|
||
Alle: <br>
|
||
[% P.part.picker('part_id') %] text<br>
|
||
Alle mit Lieferanten-Artikel-Nr aller Lieferanten: <br>
|
||
[% P.hidden_tag('vendor_ids_empty', '') %]
|
||
[% P.part.picker('part_id', undef, vendor_selector='#vendor_ids_empty') %] text<br>
|
||
Alle mit Lieferanten-Artikel-Nr bestimmter Lieferanten: <br>
|
||
[% P.hidden_tag('vendor_ids', '1015,11545') %]
|
||
[% P.part.picker('part_id', undef, vendor_selector='#vendor_ids') %] text<br>
|
||
Alle mit Kunden-Artikel-Nr bestimmter Kunden: <br>
|
||
[% P.hidden_tag('customer_ids', '1323') %]
|
||
[% P.part.picker('part_id', undef, customer_selector='[name="customer_ids"]') %] text<br>
|
||
Nur Waren: <br>
|
||
[% P.part.picker('part_id2', undef, part_type='part') %]<br>
|
||
Nur Dienstleistungen: <br>
|
Auch abrufbar als: Unified diff
PartPicker nach Kunden- und Lieferanten-Artikel-Nr. suchen und filtern können