Recalls history
- [% IF Koha.Preference('UseRecalls') %]
+ [% IF Koha.Preference('UseRecalls') != "off" %]
[% IF RECALLS.count %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
index b6a401d8fc..8cb8a24028 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt
@@ -13,7 +13,7 @@
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
-[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
+[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
index 51172432a5..8a0f10f416 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt
@@ -16,7 +16,7 @@
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
-[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
+[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
[% SET CoverImagePlugins = KohaPlugins.get_plugins_opac_cover_images %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt
index fd9a7fc209..87319ebb95 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt
@@ -14,7 +14,7 @@
[% SET CartEnabled = ( Koha.Preference('opacbookbag') == 1 ) %]
[% SET ListsEnabled = ( Koha.Preference('virtualshelves') == 1 ) && LoginEnabled %]
[% SET HoldsEnabled = ( Koha.Preference('OPACHoldRequests') == 1 ) && LoginEnabled %]
-[% SET RecallsEnabled = ( Koha.Preference('UseRecalls') == 1 ) && LoginEnabled %]
+[% SET RecallsEnabled = ( Koha.Preference('UseRecalls').match('opac') ) && LoginEnabled %]
[% SET ArticleRequestsEnabled = ( Koha.Preference('ArticleRequests') == 1 ) && LoginEnabled %]
[% SET MultiHolds = ( Koha.Preference('DisplayMultiPlaceHold') == 1 ) && HoldsEnabled %]
[% INCLUDE 'doc-head-open.inc' %]
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 91ed175a27..4fa9967d7d 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
@@ -305,7 +305,7 @@
Holds ([% reserves_count | html %])
[% END %]
[% END %]
- [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
+ [% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
[% WRAPPER tab_item tabname= "opac-user-recalls" %]
Recalls ([% RECALLS.count | html %])
[% END %]
@@ -840,7 +840,7 @@
[% END # /tab_panel#opac-user-holds %]
[% END # / #RESERVES.count %]
- [% IF Koha.Preference('UseRecalls') && RECALLS.count %]
+ [% IF Koha.Preference('UseRecalls') != "off" && RECALLS.count %]
[% WRAPPER tab_panel tabname="opac-user-recalls" %]
Recalls ([% RECALLS.count | html %])
diff --git a/opac/opac-recall.pl b/opac/opac-recall.pl
index aba53ae86e..7c7a8bcca5 100755
--- a/opac/opac-recall.pl
+++ b/opac/opac-recall.pl
@@ -36,7 +36,13 @@ my $op = $query->param('op') || '';
my $biblionumber = $query->param('biblionumber');
my $biblio = Koha::Biblios->find($biblionumber);
-if ( C4::Context->preference('UseRecalls') ) {
+if ( $op eq 'cud-cancel' ) {
+ my $recall_id = $query->param('recall_id');
+ Koha::Recalls->find($recall_id)->set_cancelled;
+ print $query->redirect('/cgi-bin/koha/opac-user.pl');
+}
+
+if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) {
my $patron = Koha::Patrons->find($borrowernumber);
my $error;
@@ -123,10 +129,6 @@ if ( C4::Context->preference('UseRecalls') ) {
$error = 'failed';
}
}
- } elsif ( $op eq 'cud-cancel' ) {
- my $recall_id = $query->param('recall_id');
- Koha::Recalls->find($recall_id)->set_cancelled;
- print $query->redirect('/cgi-bin/koha/opac-user.pl');
}
my $branches = Koha::Libraries->search();
diff --git a/opac/opac-user.pl b/opac/opac-user.pl
index 4641ee278b..894903ea00 100755
--- a/opac/opac-user.pl
+++ b/opac/opac-user.pl
@@ -311,7 +311,7 @@ if ( $pending_checkouts->count ) { # Useless test
$issue->{normalized_oclc} = $extractor->get_normalized_oclc;
}
- if ( C4::Context->preference('UseRecalls') ) {
+ if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $maybe_recalls = Koha::Recalls->search(
{ biblio_id => $issue->{biblionumber}, item_id => [ undef, $issue->{itemnumber} ], completed => 0 } );
while ( my $recall = $maybe_recalls->next ) {
@@ -350,7 +350,7 @@ $template->param(
showpriority => $show_priority,
);
-if ( C4::Context->preference('UseRecalls') ) {
+if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $recalls = Koha::Recalls->search( { patron_id => $borrowernumber, completed => 0 } );
$template->param( RECALLS => $recalls );
}