From 401a52b8334bac5578c1183c1c599ef9908fe9f5 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 16 Jun 2026 00:39:38 +0000 Subject: [PATCH] Bug 31391: Implement UseRecalls choices on staff interface Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Pedro Amorim --- circ/circulation.pl | 4 ++-- circ/returns.pl | 4 ++-- .../intranet-tmpl/prog/en/includes/biblio-view-menu.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc | 2 +- .../html_helpers/tables/items/catalogue_detail.inc | 2 +- .../prog/en/includes/messaging-preference-form.inc | 2 +- .../intranet-tmpl/prog/en/includes/patron-detail-tabs.inc | 4 ++-- .../intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 8 ++++---- .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 2 +- .../prog/en/modules/circ/circulation-home.tt | 2 +- .../prog/en/modules/members/recallshistory.tt | 2 +- .../prog/en/modules/recalls/recalls_old_queue.tt | 2 +- .../prog/en/modules/recalls/recalls_overdue.tt | 2 +- .../prog/en/modules/recalls/recalls_queue.tt | 2 +- .../prog/en/modules/recalls/recalls_to_pull.tt | 2 +- .../prog/en/modules/recalls/recalls_waiting.tt | 2 +- .../intranet-tmpl/prog/en/modules/recalls/request.tt | 2 +- members/moremember.pl | 4 ++-- svc/checkouts | 2 +- 20 files changed, 27 insertions(+), 27 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index b890226cbc..2822bd1ec7 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -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' } } ), diff --git a/circ/returns.pl b/circ/returns.pl index 24fac809f0..0c88893d3a 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -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; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc index adb5d1c377..6f5869a44a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc @@ -91,7 +91,7 @@ [%- END -%] - [%- IF ( Koha.Preference('UseRecalls') && CAN_user_recalls ) -%] + [%- IF ( Koha.Preference('UseRecalls') != "off" && CAN_user_recalls ) -%]
  • Recalls ([% biblio.recalls.search( completed => 0 ).count | html %])
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index 0cafe877ee..de19ba6f06 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -254,7 +254,7 @@ ILL requests history [% END %] - [% IF Koha.Preference('UseRecalls') && CAN_user_recalls %] + [% IF Koha.Preference('UseRecalls') != "off" && CAN_user_recalls %]
  • Recalls history
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc index 7f15bbe094..daceae3c90 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc @@ -68,7 +68,7 @@ - [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] + [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]
    Recalls
    • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 99f3f8d124..fef91e2279 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -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 %], diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 6b7c489618..d493a0ef57 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -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_') %] [% IF ( messaging_preference.Item_Due ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc index 9320839dfa..9351ec0d3d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc @@ -49,7 +49,7 @@ [% END %] [% END %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% WRAPPER tab_item tabname= "recalls" %] Recalls [% 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# %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index a1318db896..644d1ae408 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -161,7 +161,7 @@ Article requests [% END %] Rental discount (%) - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] Recalls allowed (total) Recalls per record (count) On shelf recalls allowed @@ -435,7 +435,7 @@ [% END %] [% rentaldiscount | html %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% recalls_allowed | html %] [% recalls_per_record | html %] @@ -586,7 +586,7 @@ [% END %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] @@ -652,7 +652,7 @@ Article requests [% END %] Rental discount (%) - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] Recalls allowed (total) Recalls per record (count) On shelf recalls allowed diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 56d436096a..e5330bbba3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -726,7 +726,7 @@ Holds ([% SEARCH_RESULT.biblio_object.holds.count | html %]) [% END %] [% END # /IF SEARCH_RESULT.norequests %] - [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] + [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %] | Recalls ([% SEARCH_RESULT.biblio_object.recalls.search( completed => 0 ).count | html %]) - [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %] + [% IF Koha.Preference('UseRecalls') != "off" and CAN_user_recalls %]

      Recalls

      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt index 50ea95454f..eae0a5b4b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt @@ -39,7 +39,7 @@ [% WRAPPER 'main-container.inc' aside='circ-menu' %] [% INCLUDE 'members-toolbar.inc' %]

      Recalls history

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% IF recalls.count %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt index 741ad52f3f..9235b7db57 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_old_queue.tt @@ -31,7 +31,7 @@ [% WRAPPER 'main-container.inc' aside='circ-nav' %]

      Old recalls

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %]
      [% INCLUDE 'recalls.inc' %]
      [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt index 933d08461b..d843ad4adb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_overdue.tt @@ -31,7 +31,7 @@ [% WRAPPER 'main-container.inc' aside='circ-nav' %]

      Overdue recalls

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% IF recalls.count %]
      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt index ced0feb94a..f94fed5882 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_queue.tt @@ -31,7 +31,7 @@ [% WRAPPER 'main-container.inc' aside='circ-nav' %]

      Recalls queue

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% IF recalls.count %]
      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt index 3663185e0a..35482b251e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt @@ -35,7 +35,7 @@ [% WRAPPER 'main-container.inc' aside='circ-nav' %]

      Recalls to pull

      The following recalls could be fulfilled by available items. - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% IF recalls %]
      diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt index 7160ac8dbc..f1f0afa650 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt @@ -32,7 +32,7 @@ [% WRAPPER 'main-container.inc' aside='circ-nav' %]

      Recalls awaiting pickup

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% WRAPPER tabs id= "results" %] [% WRAPPER tabs_nav %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt index 09798b5597..4fb0832668 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt @@ -35,7 +35,7 @@ [% WRAPPER 'main-container.inc' aside='biblio-view-menu' %]

      Existing recalls

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% IF recalls.count %]
      diff --git a/members/moremember.pl b/members/moremember.pl index 19d72f0f21..266a605306 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -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, diff --git a/svc/checkouts b/svc/checkouts index b3cf97d1df..1b64be8755 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -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;