6 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 [% SET libraries = Branches.all %]
10 [% SET categories = Categories.all.unblessed %]
11 [% PROCESS 'patron-search.inc' %]
12 <title>[% FILTER collapse %]
13 [% t("Patron search") | html %] ›
14 [% t("Patrons") | html %] ›
15 [% t("Koha") | html %]
17 [% INCLUDE 'doc-head-close.inc' %]
18 <style> .modal-body .close { display: none; } </style>[%# FIXME This is not great, we should make members/memberentrygen.tt use a modal as well and we won't need that here %]
21 <body id="common_patron_search" class="common">
22 <div id="patron_search">
23 <div class="container-fluid">
25 [% PROCESS patron_search_filters categories => categories, libraries => libraries, filters => ['branch','category','sort1','sort2'], search_filter => searchmember %]
28 <div id="searchresults">
29 [% IF columns.grep('checkbox').size %]
30 <div class="searchheader fh-fixedHeader" id="searchheader" style="display:none;">
32 <a href="#" class="btn btn-link" id="select_all"><i class="fa fa-check"></i> Select all</a>
34 <a href="#" class="btn btn-link" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
35 [% IF selection_type == 'add' %]
36 <button id="add-selected" class="btn btn-sm btn-default" type="submit">Add selected patrons</button>
41 [% PROCESS patron_search_table table_id => 'memberresultst' columns => columns %]
44 <div id="closewindow"><a href="#" class="btn btn-default btn-default close">Close</a></div>
49 [% MACRO jsinclude BLOCK %]
50 [% INCLUDE 'select2.inc' %]
52 $(document).ready(function() {
53 $("#select_all").on("click",function(e){
55 $(".selection").prop("checked", true).change();
57 $("#clear_all").on("click",function(e){
59 $(".selection").prop("checked", false).change();
61 $("#searchheader").hide();
62 $("#patron_search_form").on('submit', function(){$("#searchheader").show();});
63 $("#clear_search").on("click",function(e){$("#searchheader").hide();});
65 $('#add-selected').on('click', function(e) {
68 $('tr:has(.selection:checked) .add_user').each(function(){
69 var borrowernumber = $(this).data('borrowernumber');
70 var firstname = $(this).data('firstname');
71 var surname = $(this).data('surname');
72 add_user( borrowernumber, firstname + ' ' + surname );
75 $('#info').html(_("%s Patrons added.").format(counter));
80 [% PROCESS patron_search_js table_id => 'memberresultst', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, filter => filter, actions => [selection_type], preview_on_name_click => 1, callback => callback %]
83 [% SET popup_window = 1 %]
84 [% INCLUDE 'intranet-bottom.inc' %]