From 8b3ca6683582505d843864a20d980fb60cd6462e Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 27 Sep 2024 18:07:17 +0000 Subject: [PATCH] Bug 31391: Update the UseRecalls system preference to have choices Options are: * off * opac * staff * opac_and_staff This patch implements this all over the place. All recalls things should still work including the above test plan. Tests should pass: * t/db_dependent/Circulation.t * t/db_dependent/Circulation/transferbook.t * t/db_dependent/Holds.t * t/db_dependent/Koha/Biblio.t * t/db_dependent/Koha/Item.t * t/db_dependent/SIP/Transaction.t * t/db_dependent/Search.t * t/db_dependent/XSLT.t Sponsored-by: Auckland University of Technology Sponsored-by: Catalyst IT Signed-off-by: Pedro Amorim --- C4/Circulation.pm | 12 +++++----- C4/Search.pm | 2 +- C4/XSLT.pm | 2 +- Koha/Biblio.pm | 2 +- Koha/Item.pm | 4 ++-- circ/circulation.pl | 4 ++-- circ/returns.pl | 4 ++-- circ/transferstoreceive.pl | 3 +-- ...ug_31391_-_add_RecallsInterface_syspref.pl | 17 +------------- .../bug_31391_-_update_UseRecalls_syspref.pl | 22 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 3 +-- .../prog/en/includes/biblio-view-menu.inc | 2 +- .../prog/en/includes/circ-menu.inc | 5 ++--- .../prog/en/includes/circ-nav.inc | 2 +- .../prog/en/includes/holds_table.inc | 6 ++--- .../tables/items/catalogue_detail.inc | 4 ++-- .../en/includes/messaging-preference-form.inc | 2 +- .../prog/en/includes/patron-detail-tabs.inc | 4 ++-- .../admin/preferences/circulation.pref | 20 ++++++----------- .../prog/en/modules/admin/smart-rules.tt | 8 +++---- .../prog/en/modules/catalogue/results.tt | 2 +- .../prog/en/modules/circ/circulation-home.tt | 2 +- .../prog/en/modules/members/recallshistory.tt | 2 +- .../en/modules/recalls/recalls_old_queue.tt | 2 +- .../en/modules/recalls/recalls_overdue.tt | 2 +- .../prog/en/modules/recalls/recalls_queue.tt | 2 +- .../en/modules/recalls/recalls_to_pull.tt | 2 +- .../en/modules/recalls/recalls_waiting.tt | 2 +- .../prog/en/modules/recalls/request.tt | 10 ++++----- .../bootstrap/en/includes/item-status.inc | 4 ++-- .../en/includes/opac-detail-sidebar.inc | 2 +- .../bootstrap/en/includes/usermenu.inc | 2 +- .../bootstrap/en/modules/opac-messaging.tt | 2 +- .../bootstrap/en/modules/opac-recalls.tt | 2 +- .../bootstrap/en/modules/opac-results.tt | 2 +- .../bootstrap/en/modules/opac-shelves.tt | 2 +- .../bootstrap/en/modules/opac-tags.tt | 2 +- .../bootstrap/en/modules/opac-user.tt | 4 ++-- members/moremember.pl | 4 ++-- opac/opac-recall.pl | 2 +- opac/opac-user.pl | 4 ++-- recalls/request.pl | 8 ++----- svc/checkouts | 2 +- t/db_dependent/Circulation.t | 8 +++---- t/db_dependent/Circulation/transferbook.t | 2 +- t/db_dependent/Holds.t | 2 +- t/db_dependent/Koha/Biblio.t | 4 ++-- t/db_dependent/Koha/Item.t | 8 +++---- t/db_dependent/SIP/Transaction.t | 2 +- t/db_dependent/Search.t | 2 +- t/db_dependent/XSLT.t | 4 ++-- 51 files changed, 111 insertions(+), 117 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d546bc04f3f..ba38c075735 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -390,7 +390,7 @@ sub transferbook { } # find recall - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { my $recall = Koha::Recalls->find( { item_id => $itemnumber, status => 'in_transit' } ); if ( defined $recall ) { @@ -1155,7 +1155,7 @@ sub CanBookBeIssued { # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON # Only bother doing this if UseRecalls is enabled and the item is recallable # Don't look at recalls that are in transit - if ( C4::Context->preference('UseRecalls') and $item_object->can_be_waiting_recall ) { + if ( C4::Context->preference('UseRecalls') ne "off" and $item_object->can_be_waiting_recall ) { my @recalls = $biblio->recalls( {}, { order_by => { -asc => 'created_date' } } )->filter_by_current->as_list; foreach my $r (@recalls) { @@ -1676,7 +1676,7 @@ sub AddIssue { $item_object->discard_changes; } - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { Koha::Recalls->move_recall( { action => $cancel_recall, @@ -2485,7 +2485,7 @@ sub AddReturn { } # find recalls... - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled my $recall = undef; @@ -2566,7 +2566,7 @@ sub AddReturn { $request->status('RET') if $request; } - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { # all recalls that have triggered a transfer will have an allocated itemnumber my $transfer_recall = Koha::Recalls->find( { item_id => $item->itemnumber, status => 'in_transit' } ); @@ -3149,7 +3149,7 @@ sub CanBookBeRenewed { } - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { my $recall = undef; $recall = $item->check_recalls if $item->can_be_waiting_recall; if ( defined $recall ) { diff --git a/C4/Search.pm b/C4/Search.pm index 6ae9ddcc8d5..140355cd772 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1936,7 +1936,7 @@ sub searchResults { ) : ( '', '', '' ); $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { if ( Koha::Recalls->search( { item_id => $item->{itemnumber}, status => 'waiting' } )->count ) { $recallstatus = 'Waiting'; } diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 6f7d686d6b3..95b5d5773ce 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -309,7 +309,7 @@ sub buildKohaItemsNamespace { my $substatus = ''; my $recalls_count; - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { $recalls_count = Koha::Recalls->search( { item_id => $item->itemnumber, status => 'waiting' } )->count; } diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 42f051b1d31..cc16895b7df 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -2107,7 +2107,7 @@ if hold_convert $param is included, this is to say that this a check to convert sub can_be_recalled { my ( $self, $params ) = @_; - return 0 if !( C4::Context->preference('UseRecalls') ); + return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); my $patron = $params->{patron}; diff --git a/Koha/Item.pm b/Koha/Item.pm index 802437c4946..62900dc2d42 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -2319,7 +2319,7 @@ if hold_convert $param is included, this is to say that this a check to convert sub can_be_recalled { my ( $self, $params ) = @_; - return 0 if !( C4::Context->preference('UseRecalls') ); + return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); # check if this item is not for loan, withdrawn or lost return 0 if ( $self->notforloan != 0 ); @@ -2419,7 +2419,7 @@ At this point the item has already been recalled. We are now at the checkin and sub can_be_waiting_recall { my ($self) = @_; - return 0 if !( C4::Context->preference('UseRecalls') ); + return 0 if ( C4::Context->preference('UseRecalls') eq "off" ); # check if this item is not for loan, withdrawn or lost return 0 if ( $self->notforloan != 0 ); diff --git a/circ/circulation.pl b/circ/circulation.pl index 968470e6f17..29bcf3b50b6 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -519,7 +519,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, @@ -598,7 +598,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 2f7d5d03652..329cbe06d62 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -267,7 +267,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; @@ -281,7 +281,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/circ/transferstoreceive.pl b/circ/transferstoreceive.pl index 78b2db67848..559c45b0f3a 100755 --- a/circ/transferstoreceive.pl +++ b/circ/transferstoreceive.pl @@ -110,7 +110,7 @@ while ( my $library = $libraries->next ) { } # check for a recall for this transfer - if ( C4::Context->preference('UseRecalls') ) { + if ( C4::Context->preference('UseRecalls') ne "off" ) { my $recall = $item->recall; if ( defined $recall ) { $getransf{recall} = $recall; @@ -137,4 +137,3 @@ $template->param( $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find('FA'); output_html_with_http_headers $input, $cookie, $template->output; - diff --git a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl b/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl index 17c0896d332..a334f382971 100644 --- a/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl +++ b/installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl @@ -1,16 +1 @@ -use Modern::Perl; - -return { - bug_number => "31391", - description => "Staff-side recalls", - up => sub { - my ($args) = @_; - my ( $dbh, $out ) = @$args{qw(dbh out)}; - - $dbh->do( - q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice') } - ); - - say $out "Added system preference 'RecallsInterface'"; - }, -}; +rm 'installer/data/mysql/atomicupdate/bug_31391_-_add_RecallsInterface_syspref.pl' diff --git a/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl b/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl new file mode 100644 index 00000000000..d8606fade1c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_31391_-_update_UseRecalls_syspref.pl @@ -0,0 +1,22 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "31391", + description => "Staff-side recalls", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + try { + $dbh->do( + q{UPDATE systempreferences SET value = "off", options = "off|opac|staff|opac_and_staff", type="Choice" WHERE variable = "UseRecalls" AND value = "0"} + ); + $dbh->do( + q{UPDATE systempreferences SET value = "opac", options = "off|opac|staff|opac_and_staff", type="Choice" WHERE variable = "UseRecalls" AND value = "1"} + ); + say_success( $out, "Updated system preference 'UseRecalls' to include interface choices" ); + } catch { + say_failure( $out, "Database modification failed with errors: $_" ); + }; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index fba987b0bc9..fa579050562 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -650,7 +650,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'), ('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'), ('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'), -('RecallsInterface','opac','opac|staff|both','The interface that recalls can be placed through','Choice'), ('RecallsLog','1',NULL,'If ON, log create/cancel/expire/fulfill actions on recalls','YesNo'), ('RecallsMaxPickUpDelay','7',NULL,'Define the maximum time a recall can be awaiting pickup','Integer'), ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), @@ -856,7 +855,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'), ('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'), ('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'), -('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'), +('UseRecalls','off','off|opac|staff|opac_and_staff','Enable or disable recalls','Choice'), ('UseTransportCostMatrix','0','','Use Transport Cost Matrix when filling holds','YesNo'), ('UseWYSIWYGinSystemPreferences','0','','Show WYSIWYG editor when editing certain HTML system preferences.','YesNo'), ('viewISBD','1','','Allow display of ISBD view of bibiographic records','YesNo'), 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 5f11926d362..26b1ea2403d 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 @@ -78,7 +78,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 982428466d9..b511af63796 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -245,7 +245,7 @@ ILL requests history [% END %] - [% IF Koha.Preference('UseRecalls') && CAN_user_recalls %] + [% IF Koha.Preference('UseRecalls') != "off" && CAN_user_recalls %]
  • Recalls history
  • @@ -282,8 +282,7 @@
    [% patron.title | html %] [% patron.firstname | html %] [% patron.surname | html %] does not currently have an image available. To import an image for [% patron.title | html %] [% patron.firstname | html %] - [% patron.surname | html %], - enter the name of an image file to upload. + [% patron.surname | html %], enter the name of an image file to upload.
    [% END # /IF patron.image %]

    Only PNG, GIF, JPEG, XPM formats are supported.

    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 d2b9d245f79..d0cc7105f3d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc @@ -69,7 +69,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/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index 8a1e64f8879..9c59b88cd18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -70,7 +70,7 @@ [% END %] - [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] + [% IF ( Koha.Preference('UseRecalls').match('staff') ) %] [% END %] @@ -88,7 +88,7 @@ [% ELSE %] [% END %] - [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] + [% IF ( Koha.Preference('UseRecalls').match('staff') ) %] [% END %] @@ -367,7 +367,7 @@ [% END %] - [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'opac' %] + [% IF ( Koha.Preference('UseRecalls').match('staff') ) %] Mark for conversion to recall [% END %] 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 9e175e03a55..993c8f86efc 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 @@ -244,7 +244,7 @@ [% IF biblio.serial %] embed.push('serial_item.serial'); [% END %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] embed.push('recall', 'recall+strings', 'recall.patron') [% END %] embed.push('in_bundle', 'bundle_host', 'bundle_host.biblio', 'bundle_items_lost+count', 'bundle_items_not_lost+count'); @@ -549,7 +549,7 @@ } } - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] if ( row.recall && ( row.item_id === row.recall.item_id ) ) { if ( row.recall.waiting_date ) { nodes += '%s'.format(_("Waiting recall at %s since %s").format(escape_str(row.recall._strings.pickup_library_id.str), $date(row.recall.waiting_date))); 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 0f6eeca4fe2..8f77e653572 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 @@ -23,7 +23,7 @@ [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] [% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %] [% 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 60947807a74..fb96e7612cf 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 @@ -30,7 +30,7 @@ [% END %] [% END %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% WRAPPER tab_item tabname= "recalls" %] Recalls ([% recalls.count || 0 | html %]) [% END %] @@ -231,7 +231,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/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index ec4aa228002..fcf6966dd2c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -1468,21 +1468,15 @@ Circulation: - class: integer - days. - + - Recalls - pref: UseRecalls - type: boolean + default: off choices: - 1: Use - 0: "Don't use" - - recalls. Make sure you configure circulation and fine rules for recalls once enabled. - - - - Recalls can be placed through - - pref: RecallsInterface - default: opac - choices: - opac: the OPAC only - staff: the staff interface only - both: both the OPAC and the staff interface - - . (Requires UseRecalls.) + off: are disabled + opac: can be placed through the OPAC only + staff: can be placed through the staff interface only + opac_and_staff: can be placed through both the OPAC and staff interface + - . Make sure you configure circulation and fine rules for recalls when enabled. SIP2: - 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 9f58ef41c63..5e56107496e 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 @@ -150,7 +150,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 @@ -416,7 +416,7 @@ [% END %] [% rentaldiscount | html %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% recalls_allowed | html %] [% recalls_per_record | html %] @@ -566,7 +566,7 @@ [% END %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] @@ -631,7 +631,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 ade947fd89d..669c72976b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -694,7 +694,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 b6c4c24665f..d17d9e42dd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/recallshistory.tt @@ -25,7 +25,7 @@ [% WRAPPER 'main-container.inc' aside='circ-menu' %] [% INCLUDE 'members-toolbar.inc' %]

      Recalls history

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% INCLUDE 'recalls.inc' %] 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 b381db6d852..f32a7571266 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 @@ -32,7 +32,7 @@ [% SET aside = Koha.Preference('CircSidebar') ? 'circ-nav' : '' %] [% WRAPPER 'main-container.inc' aside=aside %]

      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 ed4eec6f488..33e25eaff5e 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 @@ -32,7 +32,7 @@ [% SET aside = Koha.Preference('CircSidebar') ? 'circ-nav' : '' %] [% WRAPPER 'main-container.inc' aside=aside %]

      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 911df1abc81..96adf3c12bd 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 @@ -32,7 +32,7 @@ [% SET aside = Koha.Preference('CircSidebar') ? 'circ-nav' : '' %] [% WRAPPER 'main-container.inc' aside=aside %]

      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 5df3b0cd831..c541abffa75 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 @@ -36,7 +36,7 @@ [% WRAPPER 'main-container.inc' aside=aside %]

      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 4f05c0a54d1..2221dfcc125 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 @@ -33,7 +33,7 @@ [% WRAPPER 'main-container.inc' aside=aside %]

      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 cf7ca499227..8981e3ff598 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/request.tt @@ -49,11 +49,11 @@ [% IF patron %] [% IF error %] -
      Unable to place a recall. Check your circulation rules.
      +
      Cannot place recalls: check your circulation rules.
      [% END %] [% IF patron_holds_count %] -
      Patron has placed one or more record-level holds. Convert a hold to a recall.
      +
      Patron has placed one or more record-level holds. Convert a hold to a recall.
      [% END %]
      @@ -188,8 +188,8 @@
      [% ELSE %] - [% IF Koha.Preference('RecallsInterface') == 'opac' %] -
      Due to the RecallsInterface system preference, recalls cannot be placed through the staff interface.
      + [% IF Koha.Preference('UseRecalls') == 'opac' %] +
      Due to the UseRecalls system preference, recalls cannot be placed through the staff interface.
      [% ELSE %]

      Search patrons

      @@ -211,7 +211,7 @@

      Existing recalls

      - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %] [% IF recalls.count %]
      diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index 33c41306350..2b7e5af6e09 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -63,7 +63,7 @@ Checked out [% END %] [% END %] - [% IF show_recall_link %] + [% IF show_recall_link != "off" %] [% IF logged_in_user.borrowernumber != issue.borrowernumber %] Recall [% END %] @@ -129,7 +129,7 @@ Pending hold [% END %] -[% IF Koha.Preference('UseRecalls') && item.has_pending_recall %] +[% IF Koha.Preference('UseRecalls') != "off" && item.has_pending_recall %] [% SET itemavailable = 0 %] Pending recall [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index 3105a1bbe01..d091239c31d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -13,7 +13,7 @@ [% END %] [% END %] - [% IF Koha.Preference('UseRecalls') AND Koha.Preference('RecallsInterface') != 'staff' %] + [% IF Koha.Preference('UseRecalls').match('opac') %]
    • Place recall
    • diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index cf37dcc1586..0f20d7fede9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -39,7 +39,7 @@
    • Holds history
    • [% END %] - [% IF Koha.Preference('UseRecalls') %] + [% IF Koha.Preference('UseRecalls') != "off" %]
    • Recalls history
    • [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt index 115f5e5c89a..87774e3aa1b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -69,7 +69,7 @@ [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] [% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %] [% 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/opac-tmpl/bootstrap/en/modules/opac-recalls.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt index 7de5d93ae3c..a75db182bf0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recalls.tt @@ -27,7 +27,7 @@

      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 e3c1e001646..74643dcbdcc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -11,7 +11,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 && ( Koha.Preference('RecallsInterface') != 'staff' ) %] +[% 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 26490bd58f8..c9e77c2f133 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.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 && ( Koha.Preference('RecallsInterface') != 'staff' ) %] +[% 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 68a6b31dd5c..93ce2425fd7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt @@ -12,7 +12,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 && ( Koha.Preference('RecallsInterface') != 'staff' ) %] +[% 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 438878a6f15..91d21d9a742 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -304,7 +304,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 %] @@ -851,7 +851,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" %]
      diff --git a/members/moremember.pl b/members/moremember.pl index d08cef77a0e..85055a412fc 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -209,7 +209,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 ); } @@ -304,7 +304,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/opac/opac-recall.pl b/opac/opac-recall.pl index 524977a277e..60d5d19ee67 100755 --- a/opac/opac-recall.pl +++ b/opac/opac-recall.pl @@ -42,7 +42,7 @@ if ( $op eq 'cud-cancel' ) { print $query->redirect('/cgi-bin/koha/opac-user.pl'); } -if ( C4::Context->preference('UseRecalls') and C4::Context->preference('RecallsInterface') ne 'staff' ) { +if ( C4::Context->preference('UseRecalls') =~ m/opac/ ) { my $patron = Koha::Patrons->find($borrowernumber); my $error; diff --git a/opac/opac-user.pl b/opac/opac-user.pl index b841afd8272..c1d11023264 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -313,7 +313,7 @@ if ( $pending_checkouts->count ) { # Useless test $issue->{normalized_oclc} = GetNormalizedOCLCNumber( $marcrecord, C4::Context->preference('marcflavour') ); } - 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 ) { @@ -351,7 +351,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 ); } diff --git a/recalls/request.pl b/recalls/request.pl index 22c509082fd..0113fff6422 100755 --- a/recalls/request.pl +++ b/recalls/request.pl @@ -49,10 +49,7 @@ if ( $op eq 'cud-cancel_multiple_recalls' ) { print $input->redirect( '/cgi-bin/koha/recalls/request.pl?biblionumber=' . $biblionumber ); } elsif ( $op eq 'cud-request' ) { - if ( C4::Context->preference('UseRecalls') - and C4::Context->preference('RecallsInterface') ne 'opac' - and $borrowernumber ) - { + if ( C4::Context->preference('UseRecalls') =~ m/staff/ and $borrowernumber ) { my $patron = Koha::Patrons->find($borrowernumber); unless ( $biblio->can_be_recalled( { patron => $patron } ) ) { $error = 'unavailable'; } @@ -130,8 +127,7 @@ if ( $op eq 'cud-cancel_multiple_recalls' ) { if ($borrowernumber) { my $patron = Koha::Patrons->find($borrowernumber); - if ( C4::Context->preference('UseRecalls') - and C4::Context->preference('RecallsInterface') ne 'opac' + if ( C4::Context->preference('UseRecalls') =~ m/staff/ and $patron and $patron->borrowernumber ) { diff --git a/svc/checkouts b/svc/checkouts index a8c92354d7d..2d91c9136dd 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -218,7 +218,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; diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index d3e7dea4f69..2bc6b4dbceb 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -1818,7 +1818,7 @@ subtest "CanBookBeRenewed tests" => sub { ); # Recalls - t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); Koha::CirculationRules->set_rules( { categorycode => undef, @@ -2651,7 +2651,7 @@ subtest 'AddIssue & AllowReturnToBranch' => sub { subtest 'AddIssue | recalls' => sub { plan tests => 3; - t::lib::Mocks::mock_preference( "UseRecalls", 1 ); + t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); t::lib::Mocks::mock_preference( "item-level_itypes", 1 ); my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } ); my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } ); @@ -5200,7 +5200,7 @@ subtest 'CanBookBeIssued | notforloan' => sub { subtest 'CanBookBeIssued | recalls' => sub { plan tests => 3; - t::lib::Mocks::mock_preference( "UseRecalls", 1 ); + t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); t::lib::Mocks::mock_preference( "item-level_itypes", 1 ); my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } ); my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } ); @@ -5365,7 +5365,7 @@ subtest 'AddReturn should clear items.onloan for unissued items' => sub { subtest 'AddReturn | recalls' => sub { plan tests => 3; - t::lib::Mocks::mock_preference( "UseRecalls", 1 ); + t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); t::lib::Mocks::mock_preference( "item-level_itypes", 1 ); my $patron1 = $builder->build_object( { class => 'Koha::Patrons' } ); my $patron2 = $builder->build_object( { class => 'Koha::Patrons' } ); diff --git a/t/db_dependent/Circulation/transferbook.t b/t/db_dependent/Circulation/transferbook.t index ad447dc0a60..6b114df6a66 100755 --- a/t/db_dependent/Circulation/transferbook.t +++ b/t/db_dependent/Circulation/transferbook.t @@ -167,7 +167,7 @@ subtest 'transfer already at destination' => sub { is( $messages->{ResFound}->{itemnumber}, $item->itemnumber, "We got the reserve info" ); # recalls - t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); my $recall = Koha::Recall->new( { biblio_id => $item->biblionumber, diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t index b1baba479c9..c99b36e1d71 100755 --- a/t/db_dependent/Holds.t +++ b/t/db_dependent/Holds.t @@ -2143,7 +2143,7 @@ subtest 'ModReserve to convert a hold to a recall' => sub { } )->store; - t::lib::Mocks::mock_preference( "UseRecalls", 1 ); + t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); t::lib::Mocks::mock_userenv( { branchcode => $branch } ); C4::Circulation::AddIssue( $patron2, $item->barcode ); diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t index 9d697b7850e..d1f223f1a99 100755 --- a/t/db_dependent/Koha/Biblio.t +++ b/t/db_dependent/Koha/Biblio.t @@ -1665,10 +1665,10 @@ subtest 'Recalls tests' => sub { is( $recalls->count, 3, 'Correctly get number of recalls for biblio' ); is( $recalls->filter_by_current->count, 1, 'Correctly get number of active recalls for biblio' ); - t::lib::Mocks::mock_preference( 'UseRecalls', 0 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'off' ); is( $biblio->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall with UseRecalls disabled" ); - t::lib::Mocks::mock_preference( "UseRecalls", 1 ); + t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); $item1->update( { notforloan => 1 } ); is( $biblio->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall with no available items" ); diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index bd3f43b5dc9..4130ab50cca 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -2635,7 +2635,7 @@ subtest 'Recalls tests' => sub { ); t::lib::Mocks::mock_userenv( { patron => $patron1 } ); - t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); my $recall1 = Koha::Recall->new( { @@ -2665,10 +2665,10 @@ subtest 'Recalls tests' => sub { $recall2->set_cancelled; - t::lib::Mocks::mock_preference( 'UseRecalls', 0 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'off' ); is( $item1->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall with UseRecalls disabled" ); - t::lib::Mocks::mock_preference( "UseRecalls", 1 ); + t::lib::Mocks::mock_preference( "UseRecalls", 'opac' ); $item1->update( { notforloan => 1 } ); is( $item1->can_be_recalled( { patron => $patron1 } ), 0, "Can't recall that is not for loan" ); @@ -2888,7 +2888,7 @@ subtest 'has_pending_recall() tests' => sub { my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); t::lib::Mocks::mock_userenv( { branchcode => $library->branchcode } ); - t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); C4::Circulation::AddIssue( $patron, $item->barcode ); diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index d7c4d8f5ac2..21449ee9783 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -1294,7 +1294,7 @@ subtest do_checkout_with_recalls => sub { } ); - t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); Koha::CirculationRules->set_rule( { branchcode => undef, diff --git a/t/db_dependent/Search.t b/t/db_dependent/Search.t index 4896f79e673..671f43fdfec 100755 --- a/t/db_dependent/Search.t +++ b/t/db_dependent/Search.t @@ -160,7 +160,7 @@ $contextmodule->mock( } elsif ( $pref eq 'SearchLimitLibrary' ) { return 'both'; } elsif ( $pref eq 'UseRecalls' ) { - return '0'; + return 'off'; } elsif ( $pref eq 'ContentWarningField' ) { return q{}; } elsif ( $pref eq 'AuthorLinkSortBy' ) { diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index a7ce290d642..c78c3b7b6af 100755 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -201,7 +201,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { my $library_name = $holdinglibrary->branchname; like( $xml, qr{${library_name}}, "Found resultbranch / holding branch" ); - t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'opac' ); my $recall = $builder->build_object( { class => 'Koha::Recalls', @@ -219,7 +219,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { $xml, qr{Recall waiting}, "Waiting status takes precedence over In transit (recalls)" ); - t::lib::Mocks::mock_preference( 'UseRecalls', 0 ); + t::lib::Mocks::mock_preference( 'UseRecalls', 'off' ); $schema->storage->txn_rollback; }; -- 2.34.1
      Recalls ([% RECALLS.count | html %])