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) { unless ($confirm_required) {
my $switch_onsite_checkout = exists $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}; 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( my $recall = Koha::Recalls->find(
{ {
biblio_id => $item->biblionumber, biblio_id => $item->biblionumber,
@ -681,7 +681,7 @@ if ($patron) {
WaitingHolds => $waiting_holds, WaitingHolds => $waiting_holds,
); );
if ( C4::Context->preference('UseRecalls') ) { if ( C4::Context->preference('UseRecalls') ne "off" ) {
my $waiting_recalls = $patron->recalls->search( { status => 'waiting' } ); my $waiting_recalls = $patron->recalls->search( { status => 'waiting' } );
$template->param( $template->param(
recalls => $patron->recalls->filter_by_current->search( {}, { order_by => { -asc => 'created_date' } } ), 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); my $transfer = Koha::Item::Transfers->find($transit);
if ($canceltransfer) { if ($canceltransfer) {
$transfer->cancel( { reason => 'Manual', force => 1 } ); $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' } ); my $recall_transfer_deleted = Koha::Recalls->find( { item_id => $itemnumber, status => 'in_transit' } );
if ( defined $recall_transfer_deleted ) { if ( defined $recall_transfer_deleted ) {
$recall_transfer_deleted->revert_transfer; $recall_transfer_deleted->revert_transfer;
@ -257,7 +257,7 @@ if ( $transit && $op eq 'cud-transfer' ) {
my $item = Koha::Items->find($itemnumber); my $item = Koha::Items->find($itemnumber);
my $transfer = $item->get_transfer; my $transfer = $item->get_transfer;
$transfer->cancel( { reason => 'Manual', force => 1 } ); $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' } ); my $recall_transfer_deleted = Koha::Recalls->find( { item_id => $itemnumber, status => 'in_transit' } );
if ( defined $recall_transfer_deleted ) { if ( defined $recall_transfer_deleted ) {
$recall_transfer_deleted->revert_transfer; $recall_transfer_deleted->revert_transfer;

View File

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

View File

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

View File

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

View File

@ -137,7 +137,7 @@
LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %], LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %],
OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %], OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %],
EnableItemGroups: [% Koha.Preference('EnableItemGroups') ? 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 %], UseCourseReserves: [% Koha.Preference('UseCourseReserves') ? 1 : 0 | html %],
ClaimReturnedLostValue: [% Koha.Preference('ClaimReturnedLostValue') || 0 | html %], ClaimReturnedLostValue: [% Koha.Preference('ClaimReturnedLostValue') || 0 | html %],
EasyAnalyticalRecords: [% Koha.Preference('EasyAnalyticalRecords') ? 1 : 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 !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.Patron_Expiry && (category.enforce_expiry_notice || patron.category.enforce_expiry_notice) %]
[% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] [% 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 %]"> <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
<td <td
>[% IF ( messaging_preference.Item_Due ) %] >[% IF ( messaging_preference.Item_Due ) %]

View File

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

View File

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

View File

@ -726,7 +726,7 @@
<span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span> <span>Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %])</span>
[% END %] [% END %]
[% END # /IF SEARCH_RESULT.norequests %] [% 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 %]" <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 >Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %])</a

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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