@@ -, +, @@ --- C4/HoldsQueue.pm | 18 +++++++++++++++++- circ/view_holdsqueue.pl | 4 +--- .../prog/en/modules/circ/view_holdsqueue.tt | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) --- a/C4/HoldsQueue.pm +++ a/C4/HoldsQueue.pm @@ -133,7 +133,13 @@ sub GetHoldsQueueItems { my $dbh = C4::Context->dbh; my @bind_params = (); - my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, biblioitems.itemtype, items.location, + my $query = q/SELECT borrowers.surname, + borrowers.othernames, + borrowers.firstname, + borrowers.cardnumber, + borrowers.borrowernumber, + borrowers.title AS borrower_title, + tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, biblioitems.itemtype, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode, biblio.copyrightdate, biblio.subtitle, biblio.medium, biblio.part_number, biblio.part_name, @@ -143,6 +149,7 @@ sub GetHoldsQueueItems { JOIN biblio USING (biblionumber) LEFT JOIN biblioitems USING (biblionumber) LEFT JOIN items USING ( itemnumber) + LEFT JOIN borrowers USING (borrowernumber) WHERE 1=1 /; if ($params->{branchlimit}) { @@ -172,6 +179,15 @@ sub GetHoldsQueueItems { } delete $row->{itemtype}; + $row->{borrower} = { + borrowernumber => $row->{borrowernumber}, + cardnumber => $row->{cardnumber}, + firstname => $row->{firstname}, + othernames => $row->{othernames}, + surname => $row->{surname}, + title => $row->{borrower_title}, + }; + push @$items, $row; } return $items; --- a/circ/view_holdsqueue.pl +++ a/circ/view_holdsqueue.pl @@ -54,9 +54,7 @@ if ( $run_report ) { ccodeslimit => $ccodeslimit, locationslimit => $locationslimit }); - for my $item ( @$items ) { - $item->{patron} = Koha::Patrons->find( $item->{borrowernumber} ); - } + $template->param( branchlimit => $branchlimit, itemtypeslimit => $itemtypeslimit, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -187,7 +187,7 @@

- [% INCLUDE 'patron-title.inc' invert_name=1 patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %] + [% INCLUDE 'patron-title.inc' invert_name=1 borrower=itemsloo.borrower hide_patron_infos_if_needed=0 link_to="circulation_reserves" %]

[% UNLESS Koha.Preference('HidePatronName') %]

[% itemsloo.patron.phone | html %]

--