From 3c92dac38f7510712ba9891f70430ce066b929f9 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Fri, 27 Jun 2025 04:17:55 +0000 Subject: [PATCH] Bug 40258: Option to only use item-level recalls and disable record-level recalls This enhancement adds a new system preference, RecallsRecordLevel, which can be turned off to only allow item-level recalls to be placed. It is enabled by default to match current default behaviour. When disabled, the option to 'recall next available item' is not shown. To test: 1) Apply patch, install database updates and restart services 2) Log in to the staff interface and go to Koha Administration. Search for the UseRecalls system preference and ensure it is enabled. Notice the new RecallsRecordLevel system preference. Confirm the description makes sense. Make sure any recalls related circulation rules are set as needed. 3) Search for an item and check it out to Patron B. 4) Log in to the OPAC as Patron A and search for the item you just checked out to Patron B. 5) Go to Place a recall on this record. You should see both options - 'recall next available item' and 'recall a specific item'. Toggle between the options and confirm the items table shows when choosing the 'recall a specific item' option. Do not actually submit the recall request. 6) Go back to the staff interface and change the RecallsRecordLevel to 'item-level only' and Save. 7) Refresh the OPAC recall page. Notice that the 'recall next available item' option no longer shows, and the items table is already showing. Sponsored-by: Auckland University of Technology --- ..._40258_-_add_RecallsRecordLevel_syspref.pl | 17 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 12 ++++++++--- .../bootstrap/en/modules/opac-recall.tt | 20 ++++++++++++++++--- 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_40258_-_add_RecallsRecordLevel_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_40258_-_add_RecallsRecordLevel_syspref.pl b/installer/data/mysql/atomicupdate/bug_40258_-_add_RecallsRecordLevel_syspref.pl new file mode 100755 index 00000000000..a07c174fa16 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_40258_-_add_RecallsRecordLevel_syspref.pl @@ -0,0 +1,17 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "40258", + description => "Option to only use item-level recalls and disable record-level 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 ('RecallsRecordLevel', '1', NULL, 'If disabled, only item-level recalls could be requested, rather than a record-level recall for the next available item.', 'YesNo')} + ); + + say_success( $out, "Added new system preference 'RecallsRecordLevel'" ); + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 35a5d15dd8f..bfae3e81f1e 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -670,6 +670,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RealTimeHoldsQueue', '0', NULL, 'Enable updating the holds queue in real time', 'YesNo'), ('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'), +('RecallsRecordLevel', '1', NULL, 'If disabled, only item-level recalls could be requested, rather than a record-level recall for the next available item.', 'YesNo'), ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), ('RecordStaffUserOnCheckout', '0', '', 'If enabled, when an item is checked out, the user who checked out the item is recorded', 'YesNo'), ('RedirectGuaranteeEmail', '0', NULL, 'Enable the ability to redirect guarantee email messages to guarantor.', 'YesNo'), 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 82070552d6c..0786c307775 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 @@ -1494,11 +1494,17 @@ Circulation: - class: integer - days. - + - Recalls - pref: UseRecalls choices: - 1: Use - 0: "Don't use" - - recalls. Make sure you configure circulation and fine rules for recalls once enabled. + 1: "are enabled" + 0: "are disabled" + - . When enabled, recalls can be placed + - pref: RecallsRecordLevel + choices: + 1: "at both the item-level and the record-level" + 0: "at the item-level only" + - . Make sure you configure circulation and fine rules for recalls once enabled. SIP2: - diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt index 9c58aa7343a..1618673940e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-recall.tt @@ -91,8 +91,18 @@ [% INCLUDE 'date-format.inc' %] - - + [% IF Koha.Preference('RecallsRecordLevel') %] + + [% END %] + @@ -197,7 +207,11 @@