Revision 8f7bb9d5
Von Bernd Bleßmann vor fast 4 Jahren hinzugefügt
js/autocomplete_project.js | ||
---|---|---|
25 | 25 |
var o = $.extend({ |
26 | 26 |
limit: 20, |
27 | 27 |
delay: 50, |
28 |
}, options); |
|
28 |
}, $real.data('project-picker-data'), options);
|
|
29 | 29 |
var STATES = { |
30 | 30 |
PICKED: CLASSES.PICKED, |
31 | 31 |
UNDEFINED: CLASSES.UNDEFINED |
... | ... | |
70 | 70 |
function ajax_data(term) { |
71 | 71 |
var data = { |
72 | 72 |
'filter.all:substr:multi::ilike': term, |
73 |
'filter.valid': 'valid', |
|
74 |
'filter.active': 'active', |
|
75 | 73 |
no_paginate: $('#no_paginate').prop('checked') ? 1 : 0, |
76 | 74 |
current: $real.val(), |
77 | 75 |
}; |
78 | 76 |
|
79 |
if ($customer_id && $customer_id.val()) |
|
80 |
data['filter.customer_id'] = $customer_id.val().split(','); |
|
77 |
if (o.customer_id) |
|
78 |
data['filter.customer_id'] = o.customer_id.split(','); |
|
79 |
|
|
80 |
if (o.active) { |
|
81 |
if (o.active === 'active') data['filter.active'] = 'active'; |
|
82 |
if (o.active === 'inactive') data['filter.active'] = 'inactive'; |
|
83 |
// both => no filter |
|
84 |
} else { |
|
85 |
data['filter.active'] = 'active'; // default |
|
86 |
} |
|
87 |
|
|
88 |
if (o.valid) { |
|
89 |
if (o.valid === 'valid') data['filter.valid'] = 'valid'; |
|
90 |
if (o.valid === 'invalid') data['filter.valid'] = 'invalid'; |
|
91 |
// both => no filter |
|
92 |
} else { |
|
93 |
data['filter.valid'] = 'valid'; // default |
|
94 |
} |
|
95 |
|
|
81 | 96 |
return data; |
82 | 97 |
} |
83 | 98 |
|
... | ... | |
245 | 260 |
var pp = { |
246 | 261 |
real: function() { return $real }, |
247 | 262 |
dummy: function() { return $dummy }, |
248 |
customer_id: function() { return $customer_id }, |
|
249 | 263 |
update_results: update_results, |
250 | 264 |
result_timer: result_timer, |
251 | 265 |
set_item: set_item, |
Auch abrufbar als: Unified diff
Projekt-Picker: Parameter f. aktiv/gültig
und Filter-Daten via data an js übergeben