@@ -, +, @@
---
C4/Reserves.pm | 20 ++
Koha/Item.pm | 4 +-
.../intranet-tmpl/prog/en/includes/holds_table.inc | 6 +
.../prog/en/modules/recalls/request.tt | 233 +++++++++++++++++++--
.../prog/en/modules/reserve/request.tt | 8 +
.../intranet-tmpl/prog/js/patron-autocomplete.js | 5 +-
recalls/request.pl | 107 +++++++++-
reserve/modrequest.pl | 11 +
reserve/request.pl | 5 +
9 files changed, 375 insertions(+), 24 deletions(-)
--- a/C4/Reserves.pm
+++ a/C4/Reserves.pm
@@ -1119,6 +1119,26 @@ sub ModReserve {
if ( $rank eq "del" ) {
$hold->cancel({ cancellation_reason => $cancellation_reason });
}
+ elsif ( $rank eq "recall" ) {
+ if ( !$biblionumber ) {
+ $biblionumber = $hold->biblionumber;
+ }
+ my $biblio = Koha::Biblios->find( $biblionumber );
+ if ( !$borrowernumber ) {
+ $borrowernumber = $hold->borrowernumber;
+ }
+ my $patron = Koha::Patrons->find( $borrowernumber );
+ if ( $biblio->can_be_recalled({ patron => $patron }) ) {
+ my ( $recall, $due_interval, $due_date ) = Koha::Recalls->add_recall({
+ patron => $patron,
+ biblio => $biblio,
+ branchcode => $branchcode,
+ expirationdate => $date,
+ interface => 'intranet',
+ });
+ $hold->cancel({ cancellation_reason => 'RECALLED' });
+ }
+ }
elsif ($hold->found && $hold->priority eq '0' && $date) {
logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold )
if C4::Context->preference('HoldsLog');
--- a/Koha/Item.pm
+++ a/Koha/Item.pm
@@ -1839,10 +1839,12 @@ sub can_be_waiting_recall {
$branchcode = ( C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ) ? $self->homebranch : $self->holdingbranch;
}
+ my $maybe_recall = $self->check_recalls;
+
# Check the circulation rule for each relevant itemtype for this item
my $rule = Koha::CirculationRules->get_effective_rules({
branchcode => $branchcode,
- categorycode => undef,
+ categorycode => $maybe_recall ? $maybe_recall->patron->categorycode : undef,
itemtype => $self->effective_itemtype,
rules => [
'recalls_allowed',
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc
@@ -64,6 +64,9 @@
[% END %]
+ [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
+
+ [% END %]
[% ELSE %]
@@ -79,6 +82,9 @@
[% ELSE %]
[% END %]
+ [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %]
+
+ [% END %]
[% END %]
[% ELSE %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt
@@ -2,8 +2,17 @@
[% USE Asset %]
[% USE Koha %]
[% USE KohaDates %]
+[% USE TablesSettings %]
+[% USE Branches %]
+[% USE Categories %]
+[% USE AuthorisedValues %]
+[% USE ItemTypes %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
+[% SET libraries = Branches.all %]
+[% SET categories = Categories.all.unblessed %]
+[% SET columns = ['name', 'cardnumber', 'dateofbirth', 'category', 'branch', 'address', 'phone'] %]
+[% PROCESS "patron-search.inc" %]
Confirm recalls › Recalls › Koha
[% INCLUDE 'doc-head-close.inc' %]
@@ -11,35 +20,193 @@
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
-
+
- Existing recalls
+ Place a recall on [% INCLUDE 'biblio-title.inc' link = 1 %]
- [% IF Koha.Preference('UseRecalls') %]
- [% IF recalls.count %]
-
+
+ [% ELSE %]
+
+ [% IF Koha.Preference('RecallsInterface') == 'opac' %]
+
[% ELSE %]
- No recalls have been made.
+
+
+
[% END %]
- [% ELSE %]
- Recalls have not been enabled. Enable the
UseRecalls system preference to use recalls.
+
+ Existing recalls
+
+ [% IF Koha.Preference('UseRecalls') %]
+ [% IF recalls.count %]
+
+ [% ELSE %]
+ No recalls have been made.
+ [% END %]
+ [% ELSE %]
+ Recalls have not been enabled. Enable the
UseRecalls system preference to use recalls.
+ [% END %]
+
[% END %]
@@ -58,6 +225,38 @@
[% Asset.js("js/recalls.js") | $raw %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
+ [% INCLUDE 'calendar.inc' %]
+ [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %]
+ [% PROCESS patron_search_js table_id => 'table_borrowers', categories => categories, libraries => libraries, extended_attribute_types => attribute_type_codes, columns => columns, open_on_row_click => 1, on_click_url => '/cgi-bin/koha/recalls/request.pl?' _ url_biblio_params, redirect_if_one_result => 1, redirect_url => '/cgi-bin/koha/recalls/request.pl?' _ url_biblio_params, redirect_if_attribute_equal => 'cardnumber' %]
+
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
@@ -216,6 +216,14 @@
No club with this name, please, try another
[% END %]
+
+ [% IF ( recallerror ) %]
+
+ [% END %]
+