Lines 155-160
Link Here
|
155 |
<div class="modal-footer"> |
155 |
<div class="modal-footer"> |
156 |
<button type="submit" id="add_to_patron_list_submit" class="btn btn-default approve">Submit</button> |
156 |
<button type="submit" id="add_to_patron_list_submit" class="btn btn-default approve">Submit</button> |
157 |
<button type="button" class="btn btn-default deny" data-dismiss="modal">Cancel</button> |
157 |
<button type="button" class="btn btn-default deny" data-dismiss="modal">Cancel</button> |
|
|
158 |
[% PROCESS 'members-patron-selections.inc' id="new-patron-list_form" %] |
158 |
</div> <!-- /.modal-footer --> |
159 |
</div> <!-- /.modal-footer --> |
159 |
</form> <!-- /#new-patron-list_form --> |
160 |
</form> <!-- /#new-patron-list_form --> |
160 |
</div> <!-- /.modal-content --> |
161 |
</div> <!-- /.modal-content --> |
Lines 166-177
Link Here
|
166 |
[% INCLUDE 'columns_settings.inc' %] |
167 |
[% INCLUDE 'columns_settings.inc' %] |
167 |
[% INCLUDE 'str/members-menu.inc' %] |
168 |
[% INCLUDE 'str/members-menu.inc' %] |
168 |
[% Asset.js("js/members-menu.js") | $raw %] |
169 |
[% Asset.js("js/members-menu.js") | $raw %] |
|
|
170 |
[% Asset.js("js/members-patron-selections.js") | $raw %] |
169 |
[% INCLUDE 'select2.inc' %] |
171 |
[% INCLUDE 'select2.inc' %] |
170 |
<script> |
172 |
<script> |
171 |
function showPatronSelections( number ){ |
|
|
172 |
$("#table_search_selections").show().find("span").text(_("Patrons selected: " + number ) ); |
173 |
} |
174 |
|
175 |
$(document).ready(function() { |
173 |
$(document).ready(function() { |
176 |
$('#merge-patrons, #batch-mod-patrons').prop('disabled', true); |
174 |
$('#merge-patrons, #batch-mod-patrons').prop('disabled', true); |
177 |
$('#memberresultst').on('change', 'input.selection', function() { |
175 |
$('#memberresultst').on('change', 'input.selection', function() { |
Lines 335-340
Link Here
|
335 |
/* Add a new entry to the menu */ |
333 |
/* Add a new entry to the menu */ |
336 |
$("#patronlist-dropdown .divider").before('<li><a class="patron-list-add" href="#" data-listid="' + data.patron_list.patron_list_id + '">' + data.patron_list.name + '</li>'); |
334 |
$("#patronlist-dropdown .divider").before('<li><a class="patron-list-add" href="#" data-listid="' + data.patron_list.patron_list_id + '">' + data.patron_list.name + '</li>'); |
337 |
} |
335 |
} |
|
|
336 |
persistPatronSelections('new-patron-list_form'); |
337 |
prepSelections(); |
338 |
}, |
338 |
}, |
339 |
error: function() { |
339 |
error: function() { |
340 |
alert( _("An error occurred. Patron list could not be updated.") ); |
340 |
alert( _("An error occurred. Patron list could not be updated.") ); |
Lines 347-371
Link Here
|
347 |
} |
347 |
} |
348 |
} |
348 |
} |
349 |
|
349 |
|
350 |
function prepSelections(){ |
|
|
351 |
var selected_patrons = JSON.parse( localStorage.getItem("patron_search_selections") ); |
352 |
if( selected_patrons && selected_patrons.length > 0 ){ |
353 |
showPatronSelections( selected_patrons.length ); |
354 |
|
355 |
$('#merge-patrons').prop('disabled', true); |
356 |
$("input.selection").each(function(){ |
357 |
var cardnumber = $(this).val(); |
358 |
if( selected_patrons.indexOf( cardnumber ) >= 0 ){ |
359 |
$(this).prop("checked", true ); |
360 |
} |
361 |
}); |
362 |
|
363 |
if( selected_patrons.length > 1 ){ |
364 |
$('#batch-mod-patrons, #merge-patrons, #patronlist-menu').removeClass("disabled").prop('disabled', false); |
365 |
} |
366 |
} |
367 |
} |
368 |
|
369 |
$('#memberresultst tbody').on('click','td',function(e){ |
350 |
$('#memberresultst tbody').on('click','td',function(e){ |
370 |
var $checkbox = $(this).find("input[type=checkbox]"); |
351 |
var $checkbox = $(this).find("input[type=checkbox]"); |
371 |
if (e.target.type != "checkbox") { |
352 |
if (e.target.type != "checkbox") { |