Link Here
|
82 |
<li> |
82 |
<li> |
83 |
<label for="basketbooksellerid">Vendor: </label> |
83 |
<label for="basketbooksellerid">Vendor: </label> |
84 |
<select name="basketbooksellerid" id="basketbooksellerid"> |
84 |
<select name="basketbooksellerid" id="basketbooksellerid"> |
85 |
[% FOREACH b IN booksellers %] |
85 |
<option value="[% booksellerid | html %]" selected="selected">Current vendor ([% booksellername | html %])</option> |
86 |
[% IF booksellerid == b.id %] |
86 |
</select> |
87 |
<option value="[% b.id | html %]" selected="selected">[% b.name | html %]</option> |
|
|
88 |
[% ELSE %] |
89 |
<option value="[% b.id | html %]">[% b.name | html %]</option> |
90 |
[% END %] |
91 |
[% END %] |
92 |
</select> |
93 |
</li> |
87 |
</li> |
94 |
<li> |
88 |
<li> |
95 |
<label for="basketnote">Internal note: </label> |
89 |
<label for="basketnote">Internal note: </label> |
Link Here
|
163 |
[% MACRO jsinclude BLOCK %] |
157 |
[% MACRO jsinclude BLOCK %] |
164 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
158 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
165 |
[% Asset.js("js/acq.js") | $raw %] |
159 |
[% Asset.js("js/acq.js") | $raw %] |
|
|
160 |
[% INCLUDE 'select2.inc' %] |
161 |
<script> |
162 |
|
163 |
$(document).ready(function() { |
164 |
|
165 |
function display_bookseller (state) { |
166 |
var $text; |
167 |
$text = $('<span>'+state.text+'</span>'); |
168 |
|
169 |
return $text; |
170 |
}; |
171 |
|
172 |
$("#basketbooksellerid").kohaSelect({ |
173 |
width: 'resolve', |
174 |
allowClear: false, |
175 |
ajax: { |
176 |
url: '/api/v1/acquisitions/vendors', |
177 |
delay: 300, // wait 300 milliseconds before triggering the request |
178 |
cache: true, |
179 |
dataType: 'json', |
180 |
data: function (params) { |
181 |
var search_term = (params.term === undefined) ? '' : params.term; |
182 |
var query = { |
183 |
"q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}), |
184 |
"_order_by": "name", |
185 |
"_page": params.page |
186 |
}; |
187 |
|
188 |
return query; |
189 |
}, |
190 |
processResults: function (data) { |
191 |
var results = []; |
192 |
data.results.forEach( function ( vendor ) { |
193 |
results.push( |
194 |
{ |
195 |
"id": vendor.id, |
196 |
"text": vendor.name.escapeHtml() |
197 |
} |
198 |
); |
199 |
}); |
200 |
return { "results": results, "pagination": { "more": data.pagination.more } }; |
201 |
} |
202 |
}, |
203 |
template: display_bookseller |
204 |
}); |
205 |
}); |
206 |
</script> |
166 |
[% END %] |
207 |
[% END %] |
167 |
|
208 |
|
168 |
[% INCLUDE 'intranet-bottom.inc' %] |
209 |
[% INCLUDE 'intranet-bottom.inc' %] |
169 |
- |
|
|