From 50c68497a26f50a66c59b182cae50bade708faf4 Mon Sep 17 00:00:00 2001
From: Jonathan Druart
ISSN | Title | [% IF can_change_library %]Library | [% END %] @@ -73,6 +85,9 @@|
---|---|---|---|
+ + | [% subscriptions_loo.issn %] | @@ -123,6 +138,43 @@ var subscriptionid = $(this).data("subscriptionid"); popup( subscriptionid ); }); + function itemSelectionBuildRenewLink() { + var subscription_ids= new Array(); + $("input[name='subscriptionid'][type='checkbox']:checked").each(function() { + subscription_ids.push($(this).val()); + }); + if (subscription_ids.length > 0) { + var url = '/cgi-bin/koha/serials/subscription-renew.pl?op=multi_renew'; + url += '&subscriptionid=' + subscription_ids.join('&subscriptionid='); + $('a.itemselection_action_renew').attr('href', url); + } else { + return false; + } + return true; + } + + function itemSelectionBuildActionLinks() { + var export_link_ok = itemSelectionBuildRenewLink(); + if (export_link_ok) { + $('.itemselection_actions').show(); + } else { + $('.itemselection_actions').hide(); + } + } + + itemSelectionBuildActionLinks(); + + $("input[name='subscriptionid'][type='checkbox']").change(function() { + itemSelectionBuildActionLinks(); + }); + + $(".SelectAll, .ClearAll").on("click",function(e){ + e.preventDefault(); + var checkboxes = $(this).parent().siblings('table').first().find('input[type="checkbox"]'); + checkboxes.prop('checked', $(this).hasClass('SelectAll')); + itemSelectionBuildActionLinks(); + }); + }); function popup(subscriptionid) { newin=window.open("subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes,resize=yes'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt index 6f854e7f0b..3639e57961 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt @@ -1,18 +1,23 @@ [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -