Bugzilla – Attachment 135695 Details for
Bug 30886
Recall status cannot be correct on OPAC detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30886: Show pending recall on item on OPAC
Bug-30886-Show-pending-recall-on-item-on-OPAC.patch (text/plain), 3.19 KB, created by
David Nind
on 2022-06-03 21:43:41 UTC
(
hide
)
Description:
Bug 30886: Show pending recall on item on OPAC
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-06-03 21:43:41 UTC
Size:
3.19 KB
patch
obsolete
>From 74fba5bfe4399be4ba3556d692afb6282438b0dc Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 2 Jun 2022 22:59:56 +0000 >Subject: [PATCH] Bug 30886: Show pending recall on item on OPAC > >The 'completed' flag was causing the wrong status to be shown, but we >can also give a more useful message to the patron. > >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. >5) Go back to the staff client and check the item in. Confirm the recall >as waiting for Patron A. >6) Go back to the OPAC record page and look at the holdings table. >Notice the status still says the item is Available. >7) Apply patch, restart services, refresh the OPAC. >8) Confirm the holdings table status now says the item has a pending >recall. > >Sponsored-by: Catalyst IT > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../opac-tmpl/bootstrap/en/includes/item-status.inc | 5 +++++ > opac/opac-detail.pl | 10 +++++----- > 2 files changed, 10 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >index a0374c408b..7b5688c0e1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc >@@ -96,6 +96,11 @@ > <span class="item-status pendinghold">Pending hold</span> > [% END %] > >+[% IF item.has_pending_recall %] >+ [% SET itemavailable = 0 %] >+ <span class="item-status pendingrecall">Pending recall</span> >+[% END %] >+ > [% IF ( itemavailable ) %] > [% IF NOT item.isa('Koha::Item') %][% SET restrictedvalueopac = item.restrictedvalueopac %][% END %] > <span class="item-status available">Available [% IF restrictedvalueopac %]<span class="restricted">([% restrictedvalueopac | html %])</span>[% END %]</span> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index b281c958f6..0d2fa672fe 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -731,18 +731,18 @@ if ( not $viewallitems and @items > $max_items_to_display ) { > } > > my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber}); >- my $recall_status; >+ if ( $reserve_status eq "Waiting" ) { $itm->{'waiting'} = 1; } >+ if ( $reserve_status eq "Reserved" ) { $itm->{'onhold'} = 1; } >+ > if ( C4::Context->preference('UseRecalls') ) { >- my $recall_status = Koha::Recalls->search( >+ my $pending_recall_count = Koha::Recalls->search( > { > item_id => $itm->{itemnumber}, > status => 'waiting', >- completed => undef, > } > )->count; >+ if ( $pending_recall_count ) { $itm->{has_pending_recall} = 1; } > } >- if ( $reserve_status eq "Waiting" or $recall_status ) { $itm->{'waiting'} = 1; } >- if ( $reserve_status eq "Reserved" ) { $itm->{'onhold'} = 1; } > > my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber}); > if ( defined( $transfertwhen ) && $transfertwhen ne '' ) { >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30886
:
135635
|
135636
|
135695
|
135718