From 0c631934de5adf5c8d9d35aaaf94a19134f4a166 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 7 Nov 2013 10:22:49 +0100 Subject: [PATCH] Bug 11214: improve create/edit routing list links in serial collection page When a subscription has no routing list yet, the page serials/subscription-detail.pl shows in left menu : "Create routing list". In serials/serials-collection.pl page, the link in table is always "Edit routing list", even when there is no routing list. This patch adds a conditionnal link "Edit routing list"/"Create routing list" into serials/serials-collection.pl page. Test plan : - Create a subscription no. 1 without routing list and a subscription no. 2 with a routing list - Go to serials/serials-collection.pl of subscription no. 1 => You see "Create routing list" link - Click on link => You see "Create routing list for" - Go to serials/serials-collection.pl of subscription no. 2 => You see "Edit routing list" link - Click on link => You see "Edit routing list for ..." Signed-off-by: Liz Rea Functional and automated tests pass. Passes koha-qa.pl. Signed-off-by: Katrin Fischer Passes all tests and QA script. With the patch applied the serial collection page shows the right link depending on the existance of a routing list. Signed-off-by: Galen Charlton --- .../prog/en/modules/serials/serials-collection.tt | 6 +++++- serials/serials-collection.pl | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt index bd94f71b84..060ecaf291 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt @@ -140,7 +140,11 @@ $(document).ready(function() { [% IF ( routing && CAN_user_serials_routing ) %] [% UNLESS subscription.closed %] - Edit routing list + [% IF ( subscription.hasRouting ) %] + Edit routing list + [% ELSE %] + Create routing list + [% END %] [% END %] [% END %] diff --git a/serials/serials-collection.pl b/serials/serials-collection.pl index bb1967ba6f..ba97163f55 100755 --- a/serials/serials-collection.pl +++ b/serials/serials-collection.pl @@ -128,6 +128,7 @@ if (@subscriptionid){ my $numberpattern = C4::Serials::Numberpattern::GetSubscriptionNumberpattern($subs->{numberpattern}); $subs->{frequency} = $frequency; $subs->{numberpattern} = $numberpattern; + $subs->{'hasRouting'} = check_routing($subscriptionid); push @$subscriptiondescs,$subs; my $tmpsubscription= GetFullSubscription($subscriptionid); @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation); -- 2.39.5