Lines 17-39
Link Here
|
17 |
|
17 |
|
18 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div> |
18 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div> |
19 |
|
19 |
|
|
|
20 |
[% url_params = [] %] |
21 |
[% FOREACH param IN CGI.params.pairs %] |
22 |
[% escaped_value = BLOCK %][% param.value | uri %][% END %] |
23 |
[% url_params.push(param.key _ '=' _ escaped_value) %] |
24 |
[% END %] |
25 |
[% SET referrer = '/cgi-bin/koha/serials/serials-search.pl?' %] |
26 |
[% referrer = BLOCK %][% referrer | url %][% url_params.join("&") |uri %][% END %] |
27 |
[% SET edit_action_link = '/cgi-bin/koha/serials/subscription-batchedit.pl?referrer=' _ referrer %] |
20 |
|
28 |
|
21 |
[% BLOCK subscriptions_table %] |
29 |
[% BLOCK subscriptions_table %] |
22 |
<form method="post"> |
30 |
<form method="post"> |
23 |
|
31 |
|
24 |
[% url_params = [] %] |
32 |
[% IF closed %] |
25 |
[% FOREACH param IN CGI.params.pairs %] |
33 |
[% SET tab = 'closed' %] |
26 |
[% escaped_value = BLOCK %][% param.value | uri %][% END %] |
34 |
[% ELSE %] |
27 |
[% url_params.push(param.key _ '=' _ escaped_value) %] |
35 |
[% SET tab = 'opened' %] |
28 |
[% END %] |
36 |
[% END %] |
29 |
<input type="hidden" name="referrer" value="/cgi-bin/koha/serials/serials-search.pl?[% url_params.join('&') %]"/> |
|
|
30 |
|
31 |
<div class="actions"> |
37 |
<div class="actions"> |
32 |
<a class="select-all" href="#"><i class="fa fa-check"></i> Select all</a> |
38 |
<a class="select-all" href="#" data-tab="[% tab %]"><i class="fa fa-check"></i> Select all</a> |
33 |
| |
|
|
34 |
<a class="clear-all" href="#"><i class="fa fa-remove"></i> Clear all</a> |
35 |
| |
39 |
| |
36 |
<button class="btn btn-default btn-xs" type="submit" formaction="/cgi-bin/koha/serials/subscription-batchedit.pl"><i class="fa fa-pencil"></i> Edit</button> |
40 |
<a class="clear-all" href="#" data-tab="[% tab %]"><i class="fa fa-remove"></i> Clear all</a> |
|
|
41 |
<span class="itemselection_actions"> |
42 |
| Actions: |
43 |
<a class="itemselection_action_modify"><i class="fa fa-pencil"></i> Modify selected serials</a> |
44 |
</span> |
37 |
</div> |
45 |
</div> |
38 |
<table> |
46 |
<table> |
39 |
<thead> |
47 |
<thead> |
Lines 392-397
Link Here
|
392 |
</script> |
400 |
</script> |
393 |
[% Asset.js("js/serials-toolbar.js") %] |
401 |
[% Asset.js("js/serials-toolbar.js") %] |
394 |
<script type="text/javascript"> |
402 |
<script type="text/javascript"> |
|
|
403 |
|
404 |
function itemSelectionBuildModifyLink(div) { |
405 |
var subscription_ids = new Array(); |
406 |
$("input[name='subscriptionid'][type='checkbox']:checked", div).each(function() { |
407 |
subscription_ids.push($(this).val()); |
408 |
}); |
409 |
if (subscription_ids.length > 0) { |
410 |
var url = "[% edit_action_link %]"; |
411 |
url += '&subscriptionid=' + subscription_ids.join('&subscriptionid='); |
412 |
$('a.itemselection_action_modify').attr('href', url); |
413 |
} else { |
414 |
return false; |
415 |
} |
416 |
return true; |
417 |
} |
418 |
|
419 |
function itemSelectionBuildActionLinks(tab) { |
420 |
var div = $("#" + tab); |
421 |
var modify_link_ok = itemSelectionBuildModifyLink(div); |
422 |
if (modify_link_ok) { |
423 |
$('.itemselection_actions', div).show(); |
424 |
} else { |
425 |
$('.itemselection_actions', div).hide(); |
426 |
} |
427 |
} |
428 |
|
395 |
$(document).ready(function() { |
429 |
$(document).ready(function() { |
396 |
var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, { |
430 |
var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, { |
397 |
"sPaginationType": "four_button", |
431 |
"sPaginationType": "four_button", |
Lines 423-429
Link Here
|
423 |
e.preventDefault(); |
457 |
e.preventDefault(); |
424 |
var checkboxes = $(this).parents('form').find('input[type="checkbox"]'); |
458 |
var checkboxes = $(this).parents('form').find('input[type="checkbox"]'); |
425 |
checkboxes.prop('checked', $(this).hasClass('select-all')); |
459 |
checkboxes.prop('checked', $(this).hasClass('select-all')); |
|
|
460 |
var tab = $(this).data("tab"); |
461 |
itemSelectionBuildActionLinks(tab); |
462 |
}); |
463 |
|
464 |
itemSelectionBuildActionLinks("opened"); |
465 |
itemSelectionBuildActionLinks("closed"); |
466 |
$("input[name='subscriptionid'][type='checkbox']").change(function() { |
467 |
var div = $(this).parents('form').parent().attr("id"); |
468 |
itemSelectionBuildActionLinks(div); |
426 |
}); |
469 |
}); |
|
|
470 |
|
427 |
}); |
471 |
}); |
428 |
</script> |
472 |
</script> |
429 |
[% END %] |
473 |
[% END %] |