From 0be50f17aa68ea24800a31055fa5a4109565bcce 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 --- koha-tmpl/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 effb431..ddd0bd2 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 511a891..2d153ec 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 e1bbf92..855a0ca 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 cc735ee..c3abed5 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 60eddb1..3f34af5 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.1.4