From 080408df8ee717de8764ea3de8a7940603e75b7c Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Thu, 5 Apr 2018 14:16:47 +0000 Subject: [PATCH] Bug 17047 - Move mana JS and put correct subscription id when sharing Rebased-by: Alex Arnaud (2018-07-04) --- koha-tmpl/intranet-tmpl/prog/en/includes/mana.inc | 2 +- .../prog/en/includes/serials-toolbar.inc | 40 ---------------------- .../prog/en/modules/serials/subscription-detail.tt | 1 + koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js | 2 +- .../intranet-tmpl/prog/js/subscription-add.js | 2 +- serials/subscription-detail.pl | 4 +-- 6 files changed, 6 insertions(+), 45 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/mana.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/mana.inc index d57290c..04e4181 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/mana.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/mana.inc @@ -41,4 +41,4 @@ $(document).ready(function() { }); }); //]]> - \ No newline at end of file + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc index 8bb49c1..e41477a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc @@ -1,44 +1,4 @@ [% INCLUDE 'blocking_errors.inc' %] -[% INCLUDE 'mana.inc' %] - [% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
[% IF CAN_user_serials_create_subscription %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index 06308f0..3e15c5e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -430,6 +430,7 @@ var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?"); var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?"); + [% INCLUDE 'mana.inc' %] [% Asset.js("js/serials-toolbar.js") | $raw %] [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js b/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js index fe575d0..9a3a5f1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js +++ b/koha-tmpl/intranet-tmpl/prog/js/serials-toolbar.js @@ -41,6 +41,6 @@ function popup(subscriptionid) { return false; }); $("#mana-subscription-share").click(function() { - window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=share"; + window.location="subscription-detail.pl?subscriptionid=" + subscriptionid + "&op=share"; }); }); diff --git a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js index 3981995..da8abd1 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js +++ b/koha-tmpl/intranet-tmpl/prog/js/subscription-add.js @@ -650,4 +650,4 @@ $(document).ready(function() { $('#save-subscription').on("click", function(e){ $('select:disabled').removeAttr('disabled'); }); -}); \ No newline at end of file +}); diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 2dccd58..192a511 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -62,7 +62,6 @@ my ($template, $loggedinuser, $cookie) debug => 1, }); - my $subs = GetSubscription($subscriptionid); $subs->{enddate} ||= GetExpirationDate($subscriptionid); @@ -96,7 +95,8 @@ if ($op eq 'del') { } } elsif ( $op and $op eq "share" ) { - my $result = Koha::SharedContent::manaPostRequest($query->param('mana_language'), $loggedinuser, $subscriptionid, 'subscription'); + my $mana_language = $query->param('mana_language'); + my $result = Koha::SharedContent::manaPostRequest($mana_language, $loggedinuser, $subscriptionid, 'subscription'); $template->param( mana_code => $result->{msg} ); $subs->{mana_id} = $result->{id}; } -- 2.7.4