Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/search.tt
Michael Hafen 6d1748ed4c
Bug 34209: Follow up on Bug 28726 - move whole 'select all ...' header into condition
Move the whole search header div into the checkbox column condition, so
that other patron search popups don't have an empty div.

To test:
* Activate the ERM module
* Create a new agreement
* Search for a user using the pop-up search
* Verify there is an empty div showing as grey box above the table
* Go to tools > label creator > new batch
* Search for patrons
* Verify the box isn't empty and shows the select all ... options
* Apply patch
* Repeat steps, verify the empty div is gone and the options remain

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 c2e5a32425)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2023-07-18 12:44:42 +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">
[% IF columns.grep('checkbox').size %]
<div class="searchheader fh-fixedHeader" id="searchheader" style="display:none;">
<div>
<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 %]
</div>
</div>
[% END %]
[% 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' %]