@@ -, +, @@
checks
---
C4/XSLT.pm | 5 +++--
Koha/Biblio.pm | 10 ++++++++--
Koha/Recall.pm | 2 +-
Koha/Recalls.pm | 2 +-
koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc | 2 +-
.../prog/en/modules/admin/preferences/circulation.pref | 4 ++--
.../intranet-tmpl/prog/en/modules/admin/preferences/logs.pref | 4 ++--
misc/cronjobs/recalls/expire_recalls.pl | 2 +-
opac/opac-recall.pl | 2 +-
recalls/recalls_waiting.pl | 2 +-
recalls/request.pl | 4 ++--
t/db_dependent/Holds.t | 2 +-
t/db_dependent/Koha/Recall.t | 2 +-
t/db_dependent/Koha/Recalls.t | 2 +-
t/db_dependent/XSLT.t | 4 ++--
15 files changed, 28 insertions(+), 21 deletions(-)
--- a/C4/XSLT.pm
+++ a/C4/XSLT.pm
@@ -352,7 +352,8 @@ sub buildKohaItemsNamespace {
if ( $recalls->count ) {
# recalls take priority over holds
- $status = 'Waiting';
+ $status = 'other';
+ $substatus = 'Recall waiting';
}
elsif ( $item->has_pending_hold ) {
$status = 'other';
@@ -360,7 +361,7 @@ sub buildKohaItemsNamespace {
}
elsif ( $item->holds->waiting->count ) {
$status = 'other';
- $substatus = 'Waiting';
+ $substatus = 'Hold waiting';
}
elsif ($item->get_transfer) {
$status = 'other';
--- a/Koha/Biblio.pm
+++ a/Koha/Biblio.pm
@@ -951,7 +951,11 @@ Return all active recalls attached to this biblio, sorted by oldest first
=cut
sub recalls {
- my ( $self ) = @_;
+ my ( $self, $params ) = @_;
+ if ( $params->{borrowernumber} ) {
+ my @recalls_rs = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef, borrowernumber => $params->{borrowernumber} }, { order_by => { -asc => 'recalldate' } });
+ return @recalls_rs;
+ }
my @recalls_rs = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } });
return @recalls_rs;
}
@@ -984,7 +988,9 @@ sub can_be_recalled {
my @itemtypes;
my @itemnumbers;
my @items;
+ my @all_itemnumbers;
foreach my $item ( @all_items ) {
+ push( @all_itemnumbers, $item->itemnumber );
if ( $item->can_be_recalled({ patron => $patron }) ) {
push( @itemtypes, $item->effective_itemtype );
push( @itemnumbers, $item->itemnumber );
@@ -1031,7 +1037,7 @@ sub can_be_recalled {
return 0 if ( $patron->recalls({ biblionumber => $self->biblionumber })->count >= $recalls_per_record );
# check if any of the items under this biblio are already checked out by this borrower
- return 0 if ( Koha::Checkouts->search({ itemnumber => [ @itemnumbers ], borrowernumber => $patron->borrowernumber })->count > 0 );
+ return 0 if ( Koha::Checkouts->search({ itemnumber => [ @all_itemnumbers ], borrowernumber => $patron->borrowernumber })->count > 0 );
}
# check item availability
--- a/Koha/Recall.pm
+++ a/Koha/Recall.pm
@@ -20,7 +20,7 @@ package Koha::Recall;
use Modern::Perl;
use Koha::Database;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
use Koha::Patron;
use Koha::Biblio;
use Koha::Item;
--- a/Koha/Recalls.pm
+++ a/Koha/Recalls.pm
@@ -21,7 +21,7 @@ use Modern::Perl;
use Koha::Database;
use Koha::Recall;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
use C4::Stats qw( UpdateStats );
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/recalls.inc
@@ -43,7 +43,7 @@
[% UNLESS specific_patron %]
- [% recall.patron.firstname | html %] [% recall.patron.surname | html %] ([% recall.patron.cardnumber | html %])
+ [% INCLUDE 'patron-title.inc' patron=recall.patron hide_patron_infos_if_needed=1 link_to="circulation_recalls" %]
|
[% END %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
@@ -1281,6 +1281,6 @@ Circulation:
-
- pref: UseRecalls
choices:
- yes: Use
- no: "Don't use"
+ 1: Use
+ 0: "Don't use"
- recalls. Make sure you configure circulation and fines rules for recalls once enabled.
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref
@@ -111,8 +111,8 @@ Logging:
-
- pref: RecallsLog
choices:
- on: Log
- off: "Don't log"
+ 1: Log
+ 0: "Don't log"
- any actions on recalls (create, cancel, expire, fulfill).
Debugging:
--- a/misc/cronjobs/recalls/expire_recalls.pl
+++ a/misc/cronjobs/recalls/expire_recalls.pl
@@ -31,7 +31,7 @@ BEGIN {
# - recalls that have been awaiting pickup for longer than the specified recall_shelf_time circulation rule, or the RecallsMaxPickUpDelay if circ rule is unset
use Koha::Script -cron;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
use Koha::Recalls;
use C4::Log;
--- a/opac/opac-recall.pl
+++ a/opac/opac-recall.pl
@@ -46,7 +46,7 @@ if ( C4::Context->preference('UseRecalls') ) {
my $items = Koha::Items->search({ biblionumber => $biblionumber });
# check if already recalled
- my $recalled = scalar $biblio->recalls;
+ my $recalled = scalar $biblio->recalls({ borrowernumber => $borrowernumber });
if ( defined $recalled and $recalled > 0 ) {
my $recalls_per_record = Koha::CirculationRules->get_effective_rule({
categorycode => $patron->categorycode,
--- a/recalls/recalls_waiting.pl
+++ a/recalls/recalls_waiting.pl
@@ -22,7 +22,7 @@ use C4::Auth qw( get_template_and_user );
use C4::Output qw( output_html_with_http_headers );
use Koha::Recalls;
use Koha::BiblioFrameworks;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
use Koha::Patrons;
my $query = CGI->new;
--- a/recalls/request.pl
+++ a/recalls/request.pl
@@ -18,8 +18,8 @@
use Modern::Perl;
use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
use C4::Search;
use Koha::Recalls;
use Koha::Biblios;
--- a/t/db_dependent/Holds.t
+++ a/t/db_dependent/Holds.t
@@ -7,7 +7,7 @@ use t::lib::TestBuilder;
use C4::Context;
-use Test::More tests => 72;
+use Test::More tests => 73;
use MARC::Record;
use C4::Biblio;
--- a/t/db_dependent/Koha/Recall.t
+++ a/t/db_dependent/Koha/Recall.t
@@ -21,7 +21,7 @@ use Test::More tests => 27;
use t::lib::TestBuilder;
use t::lib::Mocks;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
BEGIN {
require_ok('Koha::Recall');
--- a/t/db_dependent/Koha/Recalls.t
+++ a/t/db_dependent/Koha/Recalls.t
@@ -21,7 +21,7 @@ use Test::More tests => 19;
use t::lib::TestBuilder;
use t::lib::Mocks;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
BEGIN {
require_ok('Koha::Recall');
--- a/t/db_dependent/XSLT.t
+++ a/t/db_dependent/XSLT.t
@@ -131,7 +131,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub {
}
});
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
- like($xml,qr{Waiting},"Waiting status takes precedence over In transit (holds)");
+ like($xml,qr{Hold waiting},"Waiting status takes precedence over In transit (holds)");
$hold->cancel;
$builder->build({ source => "TmpHoldsqueue", value => {
@@ -151,7 +151,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub {
}});
$recall->set_waiting;
$xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]);
- like($xml,qr{Waiting},"Waiting status takes precedence over In transit (recalls)");
+ like($xml,qr{Recall waiting},"Waiting status takes precedence over In transit (recalls)");
};
--