From 89a6b0624465cc23de168b38815138290e3cb215 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 20 Nov 2017 00:32:14 +0000 Subject: [PATCH] Bug 19532: Only recall items checked out by other users ... shouldn't be able to recall items that are currently checked out by yourself. Signed-off-by: Nick Clemens --- .../intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt | 4 ++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 ++-- opac/opac-detail.pl | 4 ++++ opac/opac-user.pl | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt index effb4316a8..ddd0bd2f65 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/recalls_waiting.tt @@ -146,6 +146,10 @@ + [% ELSE %] + +
No recalls have been made.
+ [% END %] 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 511a8916de..2d153ec26c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -38,7 +38,7 @@ Checked out [% END %] [% END %] - [% IF loggedinusername %]Recall[% END %] + [% IF item.avail_for_recall %]Recall[% END %] [% END %] [% IF NOT ( item.isa('Koha::Item') ) AND item.transfertwhen %] [%# transfertwhen is set in C4::Search, do not have it for course reserves %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index e1bbf92ec0..855a0ca3fe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -246,11 +246,11 @@ [% ISSUE.title | html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield | html %][% END %] [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %] - [% IF ( ISSUE.recalled ) %]This item has been recalled. Please return by the new due date.[% END %] + [% IF ( ISSUE.recalled ) %]
This item has been recalled. Please return by the new due date.[% END %] [% ISSUE.author | html %] - [% IF ( ISSUE.overdue ) %] + [% IF ( ISSUE.overdue || ISSUE.recalled ) %] Date due: diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index cc735ee152..c3abed5da1 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -709,6 +709,10 @@ if ( not $viewallitems and @items > $max_items_to_display ) { if grep /^$itm->{itemnumber}$/, @itemnumbers_on_order; } + if ( $itm->{datedue} && $borrowernumber && $itm->{borrowernumber} != $borrowernumber ) { + $itm->{avail_for_recall} = 1; + } + my $itembranch = $itm->{$separatebranch}; if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) { if ($itembranch and $itembranch eq $currentbranch) { diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 60eddb1921..3f34af562e 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -248,7 +248,7 @@ if ( $pending_checkouts->count ) { # Useless test } } - my $recall = Koha::Recalls->find($issue->{itemnumber}); + my $recall = Koha::Recalls->find({ itemnumber => $issue->{itemnumber} }); if (defined $recall){ $issue->{recalled} = 1; } -- 2.19.1