From ecc3a559179e041c97c38ae86ec70b4308a2638a Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 16 Mar 2018 09:57:06 +0100 Subject: [PATCH] Bug 20456: Switch routling list tab in staff to use Koha::Object MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug 20400 added a routing list tab to the patron account in the OPAC using Koha::Object. This patch switches the routing list tab in the patron account in intranet over to the new code. It also adds an additional column showing the position of the patron on the routing list and fixes the search. To test: - Create some subscriptions with routing lists - Take a look at the patron accounts of several patrons having - no entries on routing lists - 1 entry on a routing list - entries on several routing lists - Make sure the display works correctly. - Search for a subscription and make sure search works. Signed-off-by: Séverine QUEUNE Signed-off-by: Nick Clemens --- .../prog/en/modules/members/routing-lists.tt | 79 ++++++++++--------- members/routing-lists.pl | 19 ----- 2 files changed, 41 insertions(+), 57 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt index 1cbbfa674c..c79d3bb8c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt @@ -22,60 +22,63 @@

Search subscriptions:

-
[% IF ( routing ) %][% END %] +[% IF ( routing ) %][% END %]

-[% IF ( countSubscrip ) %] -[% countSubscrip %] Subscription routing list(s) +[% UNLESS ( routinglists ) %] +0 subscription routing lists +[% ELSIF ( routinglists.size() == 1 ) %] +[% routinglists.size() %] subscription routing list [% ELSE %] -0 Subscription routing lists +[% routinglists.size() %] subscription routing lists [% END %]

- - diff --git a/members/routing-lists.pl b/members/routing-lists.pl index 793317d9c7..c9b514f6f0 100755 --- a/members/routing-lists.pl +++ b/members/routing-lists.pl @@ -51,25 +51,6 @@ my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" my $patron = Koha::Patrons->find( $borrowernumber ); output_and_exit_if_error( $query, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); -my $count; -my @borrowerSubscriptions; -($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber ); -my @subscripLoop; - -foreach my $num_res (@borrowerSubscriptions) { - my %getSubscrip; - $getSubscrip{subscriptionid} = $num_res->{'subscriptionid'}; - $getSubscrip{title} = $num_res->{'title'}; - $getSubscrip{borrowernumber} = $num_res->{'borrowernumber'}; - push( @subscripLoop, \%getSubscrip ); -} - -$template->param( - countSubscrip => scalar @subscripLoop, - subscripLoop => \@subscripLoop, - routinglistview => 1 -); - $template->param( patron => $patron, findborrower => $findborrower, -- 2.39.5