commit_none: function(){ },
commit_one: function(){ $('#update_button').click(); },
commit_many: function(){ self.open_dialog(); }
- }
+ },
+ multiple_limit: 100
}, $real.data('part-picker-data'), options);
this.$real = $real;
this.real_id = $real.attr('id');
this.last_dummy = this.$dummy.val();
this.timer = undefined;
this.dialog = undefined;
+ this.multiple_default = this.o.multiple;
this.init();
};
},
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;
+ var filter_name = 'all';
+ if (this.o.with_makemodel) {
+ filter_name = 'all_with_makemodel';
+ }
+ if (this.o.with_customer_partnumber) {
+ filter_name = 'all_with_customer_partnumber';
+ }
+ data['filter.' + filter_name + ':substr:multi::ilike'] = term;
+
return data;
},
set_item: function(item) {
},
open_dialog: function() {
if (this.o.multiple) {
+ this.o.multiple = this.multiple_default;
this.dialog = new ns.PickerMultiPopup(this);
} else {
this.dialog = new ns.PickerPopup(this);
var self = this;
kivi.popup_dialog({
url: 'controller.pl?action=Part/part_picker_search',
- data: self.pp.ajax_data(this.pp.$dummy.val()),
+ data: $.extend({
+ real_id: self.pp.real_id,
+ }, self.pp.ajax_data(this.pp.$dummy.val())),
id: 'part_selection',
dialog: {
title: kivi.t8('Part picker'),
update_results: function() {
var self = this;
var data = $('#multi_items_form').serializeArray();
- data.push({ name: 'type', value: self.pp.type });
+ data.push({ name: 'type', value: self.pp.type });
+ data.push({ name: 'limit', value: self.pp.o.multiple_limit });
var ppdata = self.pp.ajax_data(function(){
var val = $('#multi_items_filter').val();
return val === undefined ? '' : val