|
Lines 596-608
Link Here
|
| 596 |
[% FOR action IN actions %] |
596 |
[% FOR action IN actions %] |
| 597 |
[% SWITCH action %] |
597 |
[% SWITCH action %] |
| 598 |
[% CASE 'select' %] |
598 |
[% CASE 'select' %] |
| 599 |
let patron_str = JSON.stringify(row); |
|
|
| 600 |
action_node += '<a href="#" class="btn btn-default btn-xs select_user" data-borrowernumber="' + patron_id + '">' + _("Select") + '</a>'; |
599 |
action_node += '<a href="#" class="btn btn-default btn-xs select_user" data-borrowernumber="' + patron_id + '">' + _("Select") + '</a>'; |
| 601 |
let input_node = $('<input type="hidden" id="borrower_data' + patron_id + '" name="borrower_data'+ patron_id + '"/>'); |
|
|
| 602 |
$(input_node).val(patron_str); |
| 603 |
action_node += $(input_node).prop('outerHTML'); |
| 604 |
[% CASE 'add' %] |
600 |
[% CASE 'add' %] |
| 605 |
action_node += '<a href="#" class="btn btn-default btn-xs add_user" data-borrowernumber="' + patron_id + '" data-firstname="' + encodeURIComponent(row.firstname) + '" data-surname="' + encodeURIComponent(row.surname) + '">' + _("Add") + '</a><input type="hidden" id="borrower_data' + patron_id + '" name="borrower_data'+ patron_id + '" />'; |
601 |
action_node += '<a href="#" class="btn btn-default btn-xs add_user" data-borrowernumber="' + patron_id + '">' + _("Add") + '</a>'; |
| 606 |
[% CASE 'edit' %] |
602 |
[% CASE 'edit' %] |
| 607 |
action_node += '<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=' + patron_id + '" class="btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' + _("Edit") + '</a>'; |
603 |
action_node += '<a href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=' + patron_id + '" class="btn btn-default btn-xs"><i class="fa-solid fa-pencil" aria-hidden="true"></i> ' + _("Edit") + '</a>'; |
| 608 |
[% CASE 'checkout' %] |
604 |
[% CASE 'checkout' %] |
|
Lines 611-616
Link Here
|
| 611 |
[% END %] |
607 |
[% END %] |
| 612 |
[% END %] |
608 |
[% END %] |
| 613 |
[% END %] |
609 |
[% END %] |
|
|
610 |
|
| 611 |
let patron_str = JSON.stringify(row); |
| 612 |
let input_node = $('<input type="hidden" id="borrower_data' + patron_id + '" name="borrower_data'+ patron_id + '"/>'); |
| 613 |
$(input_node).val(patron_str); |
| 614 |
action_node += $(input_node).prop('outerHTML'); |
| 615 |
|
| 614 |
return action_node; |
616 |
return action_node; |
| 615 |
}, |
617 |
}, |
| 616 |
"searchable": false, |
618 |
"searchable": false, |
|
Lines 647-662
Link Here
|
| 647 |
$("body").on("click",".add_user",function(e){ |
649 |
$("body").on("click",".add_user",function(e){ |
| 648 |
e.preventDefault(); |
650 |
e.preventDefault(); |
| 649 |
var borrowernumber = $(this).data("borrowernumber"); |
651 |
var borrowernumber = $(this).data("borrowernumber"); |
| 650 |
var firstname = $(this).data("firstname"); |
652 |
var borrower_data = JSON.parse($("#borrower_data"+borrowernumber).val()); |
| 651 |
var surname = $(this).data("surname"); |
653 |
add_user( borrowernumber, borrower_data.firstname + " " + borrower_data.surname ); |
| 652 |
add_user( borrowernumber, firstname + " " + surname ); |
|
|
| 653 |
}); |
654 |
}); |
| 654 |
|
655 |
|
| 655 |
$("body").on("click",".select_user",function(e){ |
656 |
$("body").on("click",".select_user",function(e){ |
| 656 |
e.preventDefault(); |
657 |
e.preventDefault(); |
| 657 |
var borrowernumber = $(this).data("borrowernumber"); |
658 |
var borrowernumber = $(this).data("borrowernumber"); |
| 658 |
var borrower_data = $("#borrower_data"+borrowernumber).val(); |
659 |
var borrower_data = JSON.parse($("#borrower_data"+borrowernumber).val()); |
| 659 |
select_user( borrowernumber, JSON.parse(borrower_data) ); |
660 |
select_user( borrowernumber, borrower_data ); |
| 660 |
}); |
661 |
}); |
| 661 |
|
662 |
|
| 662 |
$("body").on("click",".patron_preview", function( e ){ |
663 |
$("body").on("click",".patron_preview", function( e ){ |
| 663 |
- |
|
|