|
Lines 313-319
Acquisitions › Koha
Link Here
|
| 313 |
[% INCLUDE 'calendar.inc' %] |
313 |
[% INCLUDE 'calendar.inc' %] |
| 314 |
[% INCLUDE 'datatables.inc' %] |
314 |
[% INCLUDE 'datatables.inc' %] |
| 315 |
[% INCLUDE 'columns_settings.inc' %] |
315 |
[% INCLUDE 'columns_settings.inc' %] |
| 316 |
[% Asset.js("js/autocomplete/patrons.js") | $raw %] |
|
|
| 317 |
[% Asset.js("js/acq.js") | $raw %] |
316 |
[% Asset.js("js/acq.js") | $raw %] |
| 318 |
[% Asset.js("js/funds_sorts.js") | $raw %] |
317 |
[% Asset.js("js/funds_sorts.js") | $raw %] |
| 319 |
<script> |
318 |
<script> |
|
Lines 335-346
Acquisitions › Koha
Link Here
|
| 335 |
}); |
334 |
}); |
| 336 |
|
335 |
|
| 337 |
[% IF op == 'search' OR op == 'select' %] |
336 |
[% IF op == 'search' OR op == 'select' %] |
| 338 |
patron_autocomplete({ |
337 |
function AddPatron( patron_name, value, container, input_name ) { |
| 339 |
patron_container: $("#basket_creators"), |
338 |
div = "<div id='borrower_" + value + "'>" + patron_name + " ( <a href='#' class='removePatron'><i class='fa fa-trash' aria-hidden='true'></i> " + MSG_REMOVE_PATRON + " </a> ) <input type='hidden' name='" + input_name + "' value='" + value + "' /></div>"; |
| 340 |
input_autocomplete: $("#find_patron"), |
339 |
$(container).append( div ); |
| 341 |
patron_input_name: 'created_by', |
340 |
|
| 342 |
field_to_retrieve: 'borrowernumber' |
341 |
$(container).parent().show( 800 ); |
|
|
342 |
} |
| 343 |
function RemovePatron( cardnumber, container ) { |
| 344 |
$( '#borrower_' + cardnumber ).remove(); |
| 345 |
|
| 346 |
if ( ! $(container).html() ) { |
| 347 |
$(container).parent("fieldset").hide( 800 ); |
| 348 |
} |
| 349 |
} |
| 350 |
patron_autocomplete($("#find_patron"), { |
| 351 |
'on-select-callback': function( event, ui ) { |
| 352 |
var field = ui.item.borrowernumber; |
| 353 |
AddPatron( ui.item.firstname + " " + ( ui.item.middle_name || "" ) + " " + ui.item.surname, field, $("#basket_creators"), 'created_by' ); |
| 354 |
$("#find_patron").val('').focus(); |
| 355 |
return false; |
| 356 |
} |
| 357 |
}); |
| 358 |
$("body").on("click",".removePatron",function(e){ |
| 359 |
e.preventDefault(); |
| 360 |
var divid = $(this).parent().attr("id"); |
| 361 |
var cardnumber = divid.replace("borrower_",""); |
| 362 |
RemovePatron(cardnumber, $("#basket_creators")); |
| 343 |
}); |
363 |
}); |
|
|
364 |
|
| 344 |
[% END %] |
365 |
[% END %] |
| 345 |
|
366 |
|
| 346 |
$("#show_orders_filters, #hide_orders_filters").on('click', function(e) { |
367 |
$("#show_orders_filters, #hide_orders_filters").on('click', function(e) { |
| 347 |
- |
|
|