Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt
Lucas Gass 93877a3f8f
Bug 34233: Move select2 include out of patron-search.inc
1. Apply patch
2. Place a hold and make sure the patron pickup locations are
   populating correctly again/
3. Work through the test plan on Bug 28726 to make sure it still works.
4. Enable ArticleRequests, make sure you can still do a patron search
   there.
5. Do a patron search from members.tt, make sure that still works.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c92c893c12)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 10:46:29 +01:00

79 lines
3.2 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE Branches %]
[% USE Categories %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
[% SET libraries = Branches.all %]
[% SET categories = Categories.all.unblessed %]
[% PROCESS 'patron-search.inc' %]
<title>Patron search &rsaquo; Koha</title>
[% INCLUDE 'doc-head-close.inc' %]
<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 %]
</head>
<body id="common_patron_search" class="common">
<div id="patron_search">
<div class="container-fluid">
[% PROCESS patron_search_filters categories => categories, libraries => libraries, filters => ['branch','category','sort1','sort2'], search_filter => searchmember %]
</form>
<div id="searchresults">
<div class="searchheader fh-fixedHeader" id="searchheader" style="display:none;">
<div>
[% IF columns.grep('checkbox').size %]
<a href="#" class="btn btn-link" id="select_all"><i class="fa fa-check"></i> Select all</a>
|
<a href="#" class="btn btn-link" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
[% IF selection_type == 'add' %]
<button id="add-selected" class="btn btn-sm btn-default" type="submit">Add selected patrons</button>
[% END %]
[% END %]
</div>
</div>
[% PROCESS patron_search_table table_id => 'memberresultst' columns => columns %]
</div>
<div id="closewindow"><a href="#" class="btn btn-default btn-default close">Close</a></div>
</div>
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'select2.inc' %]
<script>
$(document).ready(function() {
$("#select_all").on("click",function(e){
e.preventDefault();
$(".selection").prop("checked", true).change();
});
$("#clear_all").on("click",function(e){
e.preventDefault();
$(".selection").prop("checked", false).change();
});
$("#searchheader").hide();
$("#patron_search_form").on('submit', function(){$("#searchheader").show();});
$("#clear_search").on("click",function(e){$("#searchheader").hide();});
$('#add-selected').on('click', function(e) {
e.preventDefault();
var counter = 0;
$('tr:has(.selection:checked) .add_user').each(function(){
var borrowernumber = $(this).data('borrowernumber');
var firstname = $(this).data('firstname');
var surname = $(this).data('surname');
add_user( borrowernumber, firstname + ' ' + surname );
counter++;
});
$('#info').html(_("%s Patrons added.").format(counter));
});
});
</script>
[% 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 %]
[% END %]
[% SET popup_window = 1 %]
[% INCLUDE 'intranet-bottom.inc' %]