From c7cde70b75d49b6da32c1a5cfc8e9657e0f8b57f 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 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. --- .../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 1cbbfa6..c79d3bb 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 %]

-[% IF ( subscripLoop ) %] - - - - - - - - -[% FOREACH subscripLoop IN subscripLoop %] - - + + [% END %] + +
Subscription titleRouting list
- - [% subscripLoop.title %] - + +[% SET routinglists = logged_in_user.get_routing_lists %] +[% IF ( routinglists ) %] + + + + + + + + + + [% FOREACH routinglist IN routinglists %] + + - + + - - [% END %] - -
Subscription titlePositionRouting list
+ + [% routinglist.subscription.biblio.title %] - - - Edit routing list - + + [% routinglist.ranking %] + + + Edit routing list - - -
- - [% ELSE %] -

Patron does not belong to any subscription routing lists.

- + - [% END %] +
+[% ELSE %] +

Patron does not belong to any subscription routing lists.

+ + +[% END %]
- - diff --git a/members/routing-lists.pl b/members/routing-lists.pl index 793317d..c9b514f 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.1.4