Browse Source

Bug 32272: Restore last and previous borrowers on moredetail

GetItemsInfo added a card0, card1 and card2 info with the cardnumbers of
the last 3 borrowers.
But 31315 forgot to adjust the code when it has been moved to using
Koha::Items

Test plan:
Check an item in and out to several patrons
Go to the moredetail page (items) and confirm that the "last borrowers"
info is displayed

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
master
Jonathan Druart 2 months ago
committed by Martin Renvoize
parent
commit
e680471414
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 9
      catalogue/moredetail.pl
  2. 23
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt

9
catalogue/moredetail.pl

@ -235,6 +235,15 @@ foreach my $item (@items){
$item_info->{'nomod'}=1;
}
}
$item_info->{old_issues} = Koha::Old::Checkouts->search(
{ itemnumber => $item->itemnumber },
{
order_by => { '-desc' => 'returndate' },
limit => 3
}
);
push @item_data, $item_info;
}

23
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt

@ -406,22 +406,15 @@
<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.object.last_returned_by.borrowernumber | uri %]">[% ITEM_DAT.object.last_returned_by.cardnumber | html %]</a>
</li>
[% END %]
[% IF ( ITEM_DAT.card0 ) %]
[% FOR i IN ITEM_DAT.old_issues %]
[% SET b = i.patron %]
<li>
<span class="label">Last borrower:</span>
<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.borrower0 | uri %]">[% ITEM_DAT.card0 | html %]</a>&nbsp;
</li>
[% END %]
[% IF ( ITEM_DAT.card1 ) %]
<li>
<span class="label">Previous borrower:</span>
<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.borrower1 | uri %]">[% ITEM_DAT.card1 | html %]</a>&nbsp;
</li>
[% END %]
[% IF ( ITEM_DAT.card2 ) %]
<li>
<span class="label">Previous borrower:</span>
<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% ITEM_DAT.borrower2 | uri %]">[% ITEM_DAT.card2 | html %]</a>&nbsp;
[% IF loop.first %]
<span class="label">Last borrower:</span>
[% ELSE %]
<span class="label">Previous borrower:</span>
[% END %]
<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% b.borrowernumber | uri %]">[% b.cardnumber | html %]</a>&nbsp;
</li>
[% END %]
[% IF ( ITEM_DAT.paidfor ) %]

Loading…
Cancel
Save