Bug 30905: Show waiting recalls in patron account

This enhancement shows recalls ready for pick-up on the patron's account
so they can't be missed.

To test:
1) Enable the UseRecalls system preference and set up your
recalls-related circulation rules.
2) Check out an item to Patron B.
3) Log into the OPAC as Patron A and search for the item.
4) Place a recall on that item. Note the pickup library.
5) Go back to the staff client. At the top right of the page, confirm
your logged in library matches the recall pickup library. Set the
library to the recall pickup library if needed.
6) Check in the recalled item and confirm the recall as waiting for
Patron A.
7) Go to Patron A's account (members/moremember.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
8) Go to Patron A's checkouts (circ/circulation.pl). Confirm the recall
shows under 'Recalls waiting here' and all the information is correct.
9) Click on the menu at the top right of the page and choose 'Set
library'. Change the library to some other library.
10) Repeat steps 7 and 8, however this time the recall should show under
'Recalls waiting at other libraries'.

Sponsored-by: Catalyst IT

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 952f00f20b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Aleisha Amohia 2022-06-06 23:36:38 +00:00 committed by Lucas Gass
parent c1cc0c0737
commit 8c667c13c2
3 changed files with 65 additions and 0 deletions

View file

@ -452,10 +452,13 @@ if ($patron) {
holds_count => $holds->count(),
WaitingHolds => $waiting_holds,
);
if ( C4::Context->preference('UseRecalls') ) {
my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
$template->param(
recalls => $patron->recalls->filter_by_current->search({},{ order_by => { -asc => 'created_date' } }),
specific_patron => 1,
waiting_recalls => $waiting_recalls,
);
}
}

View file

@ -129,6 +129,63 @@
[% END # /F ( has_modifications || warndeparture... %]
[% IF waiting_recalls.count %]
<div id="recallswaiting" class="circmessage">
[% SET waiting_here = 0 %]
[% SET waiting_elsewhere = 0 %]
[% FOREACH w IN waiting_recalls %]
[% IF ( w.pickup_library_id == Branches.GetLoggedInBranchcode() ) %]
[% waiting_here = waiting_here + 1 %]
[% ELSE %]
[% waiting_elsewhere = waiting_elsewhere + 1 %]
[% END %]
[% END %]
[% IF ( waiting_here > 0 ) %]
<h4>Recalls waiting here ([% waiting_here | html %])</h4>
<ul>
[% FOREACH w IN waiting_recalls %]
[% IF ( w.pickup_library_id == Branches.GetLoggedInBranchcode() ) %]
<li>
<a href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% w.biblio_id | uri %]">[% w.biblio.title | html %]</a>
([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),
[% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
[% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %]
<span>Recall placed on [% w.created_date | $KohaDates %].</span>
<br />
<strong class="waitinghere">
[% SET expires_on = w.expiration_date %]
Waiting here [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %]
</strong>
</li>
[% END %]
[% END %]
</ul>
[% END %]
[% IF ( waiting_elsewhere > 0 ) %]
<h4>Recalls waiting at other libraries ([% waiting_elsewhere | html %])</h4>
<ul>
[% FOREACH w IN waiting_recalls %]
[% IF ( w.pickup_library_id != Branches.GetLoggedInBranchcode() ) %]
<li>
<a href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% w.biblio_id | uri %]">[% w.biblio.title | html %]</a>
([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]),
[% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
[% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %]
<span>Recall placed on [% w.created_date | $KohaDates %].</span>
<br />
<strong>
[% SET expires_on = w.expiration_date %]
Waiting at [% Branches.GetName( w.pickup_library_id ) | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %]
</strong>
</li>
[% END %]
[% END %]
</ul>
[% END %]
</div>
[% END # /IF waiting_recalls.count %]
[% IF WaitingHolds.count %]
<div id="holdswaiting" class="circmessage">

View file

@ -199,6 +199,11 @@ $template->param(
WaitingHolds => $waiting_holds,
);
if ( C4::Context->preference('UseRecalls') ) {
my $waiting_recalls = $patron->recalls->search({ status => 'waiting' });
$template->param( waiting_recalls => $waiting_recalls );
}
my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees");
$no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees );
if ( defined $no_issues_charge_guarantees ) {