Bug 31391: Implement UseRecalls choices on staff interface

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Aleisha Amohia 2026-06-16 00:39:38 +00:00 committed by Pedro Amorim
parent b9b80b9471
commit 401a52b833
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
20 changed files with 27 additions and 27 deletions

View File

@ -568,7 +568,7 @@ if ( @$barcodes && $op eq 'cud-checkout' ) {
}
unless ($confirm_required) {
my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED};
if ( C4::Context->preference('UseRecalls') && !$recall_id ) {
if ( C4::Context->preference('UseRecalls') ne "off" && !$recall_id ) {
my $recall = Koha::Recalls->find(
{
biblio_id => $item->biblionumber,
@ -681,7 +681,7 @@ if ($patron) {
WaitingHolds => $waiting_holds,
);
if ( C4::Context->preference('UseRecalls') ) {
if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $waiting_recalls = $patron->recalls->search( { status => 'waiting' } );
$template->param(
recalls => $patron->recalls->filter_by_current->search( {}, { order_by => { -asc => 'created_date' } } ),

View File

@ -243,7 +243,7 @@ if ( $transit && $op eq 'cud-transfer' ) {
my $transfer = Koha::Item::Transfers->find($transit);
if ($canceltransfer) {
$transfer->cancel( { reason => 'Manual', force => 1 } );
if ( C4::Context->preference('UseRecalls') ) {
if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $recall_transfer_deleted = Koha::Recalls->find( { item_id => $itemnumber, status => 'in_transit' } );
if ( defined $recall_transfer_deleted ) {
$recall_transfer_deleted->revert_transfer;
@ -257,7 +257,7 @@ if ( $transit && $op eq 'cud-transfer' ) {
my $item = Koha::Items->find($itemnumber);
my $transfer = $item->get_transfer;
$transfer->cancel( { reason => 'Manual', force => 1 } );
if ( C4::Context->preference('UseRecalls') ) {
if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $recall_transfer_deleted = Koha::Recalls->find( { item_id => $itemnumber, status => 'in_transit' } );
if ( defined $recall_transfer_deleted ) {
$recall_transfer_deleted->revert_transfer;

View File

@ -91,7 +91,7 @@
</li>
[%- END -%]
[%- IF ( Koha.Preference('UseRecalls') && CAN_user_recalls ) -%]
[%- IF ( Koha.Preference('UseRecalls') != "off" && CAN_user_recalls ) -%]
<li [% IF recallsview %]class="active"[% END %]>
<a href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% biblio_object_id | url %]">Recalls ([% biblio.recalls.search( completed => 0 ).count | html %])</a>
</li>

View File

@ -254,7 +254,7 @@
<a href="/cgi-bin/koha/members/ill-requests.pl?borrowernumber=[% patron.borrowernumber | uri %]">ILL requests history</a>
</li>
[% END %]
[% IF Koha.Preference('UseRecalls') && CAN_user_recalls %]
[% IF Koha.Preference('UseRecalls') != "off" && CAN_user_recalls %]
<li [% IF recallsview %]class="active"[% END %]>
<a href="/cgi-bin/koha/members/recallshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Recalls history</a>
</li>

View File

@ -68,7 +68,7 @@
</li>
</ul>
[% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
[% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
<h5>Recalls</h5>
<ul>
<li>

View File

@ -137,7 +137,7 @@
LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %],
OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %],
EnableItemGroups: [% Koha.Preference('EnableItemGroups') ? 1 : 0 | html %],
UseRecalls: [% Koha.Preference('UseRecalls') ? 1 : 0 | html %],
UseRecalls: [% Koha.Preference('UseRecalls') != "off" ? 1 : 0 | html %],
UseCourseReserves: [% Koha.Preference('UseCourseReserves') ? 1 : 0 | html %],
ClaimReturnedLostValue: [% Koha.Preference('ClaimReturnedLostValue') || 0 | html %],
EasyAnalyticalRecords: [% Koha.Preference('EasyAnalyticalRecords') ? 1 : 0| html %],

View File

@ -25,7 +25,7 @@
[% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %]
[% NEXT IF messaging_preference.Patron_Expiry && (category.enforce_expiry_notice || patron.category.enforce_expiry_notice) %]
[% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
[% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
[% NEXT IF Koha.Preference('UseRecalls') == "off" && messaging_preference.message_name.match('^Recall_') %]
<tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
<td
>[% IF ( messaging_preference.Item_Due ) %]

View File

@ -49,7 +49,7 @@
[% END %]
[% END %]
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% WRAPPER tab_item tabname= "recalls" %]
<span>Recalls</span>
[% IF ( recalls.count ) %]
@ -239,7 +239,7 @@
[% END %]
[% END %]
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% WRAPPER tab_panel tabname="recalls" %]
[% INCLUDE 'recalls.inc' %]
[% END # /tab_panel# %]

View File

@ -161,7 +161,7 @@
<th>Article requests</th>
[% END %]
<th>Rental discount (%)</th>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
<th>Recalls allowed (total)</th>
<th>Recalls per record (count)</th>
<th>On shelf recalls allowed</th>
@ -435,7 +435,7 @@
</td>
[% END %]
<td>[% rentaldiscount | html %]</td>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
<td>[% recalls_allowed | html %]</td>
<td>[% recalls_per_record | html %]</td>
<td data-code="[% on_shelf_recalls | html %]">
@ -586,7 +586,7 @@
</td>
[% END %]
<td><input type="text" name="rentaldiscount" id="rentaldiscount" size="3" inputmode="decimal" pattern="^\d+(\.\d{2})?$" /></td>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
<td><input type="text" name="recalls_allowed" id="recalls_allowed" size="3" /></td>
<td><input type="text" name="recalls_per_record" id="recalls_per_record" size="3" /></td>
<td>
@ -652,7 +652,7 @@
<th>Article requests</th>
[% END %]
<th>Rental discount (%)</th>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
<th>Recalls allowed (total)</th>
<th>Recalls per record (count)</th>
<th>On shelf recalls allowed</th>

View File

@ -726,7 +726,7 @@
<span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
[% END %]
[% END # /IF SEARCH_RESULT.norequests %]
[% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
[% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
|
<a id="recall_[% SEARCH_RESULT.biblionumber | html %]" href="/cgi-bin/koha/recalls/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %]"
>Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %])</a

View File

@ -108,7 +108,7 @@
</ul>
</div>
[% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
[% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
<div class="recalls">
<h3>Recalls</h3>

View File

@ -39,7 +39,7 @@
[% WRAPPER 'main-container.inc' aside='circ-menu' %]
[% INCLUDE 'members-toolbar.inc' %]
<h1>Recalls history</h1>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% IF recalls.count %]
<input type="checkbox" id="hide_old" name="hide_old" checked="checked" />
<label for="hide_old">Show old recalls</label>

View File

@ -31,7 +31,7 @@
[% WRAPPER 'main-container.inc' aside='circ-nav' %]
<h1>Old recalls</h1>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
<div class="page-section"> [% INCLUDE 'recalls.inc' %] </div>
<!-- /.page-section -->
[% ELSE %]

View File

@ -31,7 +31,7 @@
[% WRAPPER 'main-container.inc' aside='circ-nav' %]
<h1>Overdue recalls</h1>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% IF recalls.count %]
<div class="page-section">
<form method="post" action="/cgi-bin/koha/recalls/recalls_overdue.pl">

View File

@ -31,7 +31,7 @@
[% WRAPPER 'main-container.inc' aside='circ-nav' %]
<h1>Recalls queue</h1>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% IF recalls.count %]
<div class="page-section">
<form method="post" action="/cgi-bin/koha/recalls/recalls_queue.pl">

View File

@ -35,7 +35,7 @@
[% WRAPPER 'main-container.inc' aside='circ-nav' %]
<h1>Recalls to pull</h1>
The following recalls could be fulfilled by available items.
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% IF recalls %]
<div id="recalls" class="page-section">
<table id="recalls-table">

View File

@ -32,7 +32,7 @@
[% WRAPPER 'main-container.inc' aside='circ-nav' %]
<h1>Recalls awaiting pickup</h1>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% WRAPPER tabs id= "results" %]
[% WRAPPER tabs_nav %]

View File

@ -35,7 +35,7 @@
[% WRAPPER 'main-container.inc' aside='biblio-view-menu' %]
<h1>Existing recalls</h1>
[% IF Koha.Preference('UseRecalls') %]
[% IF Koha.Preference('UseRecalls') != "off" %]
[% IF recalls.count %]
<div class="page-section">
<form method="post" action="/cgi-bin/koha/recalls/request.pl">

View File

@ -230,7 +230,7 @@ $template->param(
WaitingHolds => $waiting_holds,
);
if ( C4::Context->preference('UseRecalls') ) {
if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $waiting_recalls = $patron->recalls->search( { status => 'waiting' } );
$template->param( waiting_recalls => $waiting_recalls );
}
@ -325,7 +325,7 @@ $template->param(
patron_lists_count => $patron_lists_count,
);
if ( C4::Context->preference('UseRecalls') ) {
if ( C4::Context->preference('UseRecalls') ne "off" ) {
$template->param(
recalls => $patron->recalls( {}, { order_by => { -asc => 'recalldate' } } )->filter_by_current,
specific_patron => 1,

View File

@ -220,7 +220,7 @@ while ( my $c = $sth->fetchrow_hashref() ) {
my @subtitles = split( / \| /, $c->{'subtitle'} // '' );
my $recalled = 0;
if ( C4::Context->preference('UseRecalls') ) {
if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $item = Koha::Items->find( $c->{itemnumber} );
my $recall = undef;
$recall = $item->check_recalls if $item->can_be_waiting_recall;