|
Lines 250-257
Link Here
|
| 250 |
|
250 |
|
| 251 |
<fieldset class="action"> |
251 |
<fieldset class="action"> |
| 252 |
<div class="btn-group"> |
252 |
<div class="btn-group"> |
| 253 |
<a id="exportbutton" class="btn btn-default" href="/cgi-bin/koha/acqui/lateorders-export.pl"><i class="fa fa-download"></i> Export as CSV</a> |
253 |
<a id="exportbutton" class="btn btn-default disabled" aria-disabled="true" href="/cgi-bin/koha/acqui/lateorders-export.pl"><i class="fa fa-download"></i> Export as CSV</a> |
| 254 |
<a class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"></a> |
254 |
<a id="export-csv-trigger" class="btn btn-default dropdown-toggle disabled" aria-disabled="true" data-bs-toggle="dropdown" aria-expanded="false"></a> |
| 255 |
<ul class="dropdown-menu" id="export-csv-menu"> |
255 |
<ul class="dropdown-menu" id="export-csv-menu"> |
| 256 |
<li><a class="dropdown-item dropdown-menu-end" href="#">Default</a></li> |
256 |
<li><a class="dropdown-item dropdown-menu-end" href="#">Default</a></li> |
| 257 |
[% IF csv_profiles.count %] |
257 |
[% IF csv_profiles.count %] |
|
Lines 262-268
Link Here
|
| 262 |
</ul> |
262 |
</ul> |
| 263 |
</div> |
263 |
</div> |
| 264 |
|
264 |
|
| 265 |
<input type="submit" class="btn btn-default" value="Claim order" /> |
265 |
<input id="claim-order" type="submit" class="btn btn-default disabled" aria-disabled="true" disabled value="Claim order" /> |
| 266 |
</fieldset> |
266 |
</fieldset> |
| 267 |
</form> |
267 |
</form> |
| 268 |
[% ELSE %] |
268 |
[% ELSE %] |
|
Lines 377-413
Link Here
|
| 377 |
<script> |
377 |
<script> |
| 378 |
var late_orderst; |
378 |
var late_orderst; |
| 379 |
function check_uncheck() { |
379 |
function check_uncheck() { |
| 380 |
var all_nodes = late_orderst.DataTable().rows().nodes(); |
380 |
if( typeof late_orderst != 'undefined'){ |
| 381 |
if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) { |
381 |
var all_nodes = late_orderst.DataTable().rows().nodes(); |
| 382 |
var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid"); |
382 |
if ( $(all_nodes).find("input:checkbox[name=ordernumber]:checked").length > 0) { |
| 383 |
$(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true); |
383 |
enableBatchActions(true); |
|
|
384 |
var booksellerid = $(all_nodes).find("input:checkbox[name=ordernumber]:checked:first").attr("data-booksellerid"); |
| 385 |
$(all_nodes).find("input:checkbox[name=ordernumber][data-booksellerid!="+booksellerid+"]").prop('disabled', true); |
| 386 |
} else { |
| 387 |
enableBatchActions(false); |
| 388 |
$("input:checkbox[name=ordernumber]").prop('disabled', false); |
| 389 |
} |
| 390 |
} |
| 391 |
} |
| 392 |
|
| 393 |
function enableBatchActions( op ){ |
| 394 |
if( op ){ |
| 395 |
$("#exportbutton, #export-csv-trigger, #claim-order").prop("disabled", false).removeClass("disabled").attr("aria-disabled", op ); |
| 384 |
} else { |
396 |
} else { |
| 385 |
$("input:checkbox[name=ordernumber]").prop('disabled', false); |
397 |
$("#exportbutton, #export-csv-trigger, #claim-order").prop("disabled", true).addClass("disabled").attr("aria-disabled", op ); |
| 386 |
} |
398 |
} |
| 387 |
} |
399 |
} |
| 388 |
|
400 |
|
| 389 |
$(document).ready(function() { |
401 |
$(document).ready(function() { |
| 390 |
|
|
|
| 391 |
var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'lateorders', 'late_orders', 'json' ) | $raw %]; |
402 |
var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'lateorders', 'late_orders', 'json' ) | $raw %]; |
| 392 |
late_orderst = $("#late_orders").kohaTable({ |
403 |
late_orderst = $("#late_orders").kohaTable({ |
| 393 |
order: [[ 1, "asc" ]], |
404 |
order: [[ 1, "asc" ]], |
| 394 |
pagingType: "full", |
405 |
pagingType: "full", |
| 395 |
autoWidth: false, |
406 |
autoWidth: false, |
| 396 |
drawCallback: function() { |
407 |
drawCallback: function() { |
| 397 |
if ( typeof late_orderst != 'undefined' ) { |
408 |
check_uncheck(); |
| 398 |
check_uncheck(); |
409 |
$('input:checkbox[name=ordernumber]').bind('click', check_uncheck); |
| 399 |
$('input:checkbox[name=ordernumber]').bind('click', check_uncheck); |
|
|
| 400 |
}; |
| 401 |
} |
410 |
} |
| 402 |
}, table_settings ); |
411 |
}, table_settings ); |
|
|
412 |
|
| 413 |
check_uncheck(); |
| 414 |
|
| 403 |
$('input:checkbox[name=ordernumber]').bind('click', check_uncheck); |
415 |
$('input:checkbox[name=ordernumber]').bind('click', check_uncheck); |
| 404 |
$('#CheckAll').click(function(e){ |
416 |
$('#CheckAll').click(function(e){ |
| 405 |
e.preventDefault(); |
417 |
e.preventDefault(); |
| 406 |
$("#late_orders input:checkbox").prop("checked", true); |
418 |
$('input:checkbox[name=ordernumber]').prop("checked", true); |
|
|
419 |
check_uncheck(); |
| 407 |
}); |
420 |
}); |
| 408 |
$('#CheckNone').click(function(e){ |
421 |
$('#CheckNone').click(function(e){ |
| 409 |
e.preventDefault(); |
422 |
e.preventDefault(); |
| 410 |
$("#late_orders input:checkbox").prop("checked", false); |
423 |
$('input:checkbox[name=ordernumber]').prop("checked", false); |
|
|
424 |
check_uncheck(); |
| 411 |
}); |
425 |
}); |
| 412 |
|
426 |
|
| 413 |
// Generates a dynamic link for exporting the selection's data as CSV |
427 |
// Generates a dynamic link for exporting the selection's data as CSV |
| 414 |
- |
|
|