From 509b4db25a5215b7c22e0b1eb6480df1d8256346 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 1 Feb 2023 04:20:47 +0000 Subject: [PATCH] Bug 32776: Add ConvertSelectedReservesToRecalls system preference --- ...d_ConvertSelectedReservesToRecalls_syspref.pl | 16 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 3 ++- .../modules/admin/preferences/circulation.pref | 9 +++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_32776_-_add_ConvertSelectedReservesToRecalls_syspref.pl diff --git a/installer/data/mysql/atomicupdate/bug_32776_-_add_ConvertSelectedReservesToRecalls_syspref.pl b/installer/data/mysql/atomicupdate/bug_32776_-_add_ConvertSelectedReservesToRecalls_syspref.pl new file mode 100755 index 00000000000..4bc3299cd19 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_32776_-_add_ConvertSelectedReservesToRecalls_syspref.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "32776", + description => "Convert selected reserves to 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 ('ConvertSelectedReservesToRecalls', 'oldest', 'oldest|recallable', 'Choose whether the convert_reserves_to_recalls.pl cronjob should convert only the oldest reserve on the record to a recall, or one reserve for each item available to be recalled', 'Choice') } + ); + + say $out "Added system preference 'ConvertSelectedReservesToRecalls'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 7d439094387..161804af2be 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -180,6 +180,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ConsiderLibraryHoursInCirculation', 'close', 'close|open|ignore', "Take library opening hours into consideration to calculate due date when circulating.", 'Choice'), ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), ('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'), +('ConvertSelectedReservesToRecalls', 'oldest', 'oldest|recallable', 'Choose whether the convert_reserves_to_recalls.pl cronjob should convert only the oldest reserve on the record to a recall, or one reserve for each item available to be recalled', 'Choice'), ('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'), ('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'), ('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'), @@ -889,4 +890,4 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), ('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea') -; \ No newline at end of file +; 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 b1be2eb030b..27d0c4cfc3e 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 @@ -1497,6 +1497,15 @@ Circulation: 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. + - + - Automatically convert + - pref: ConvertSelectedReservesToRecalls + default: oldest + choices: + oldest: the oldest reserve placed on the record + recallable: one reserve for each item available to be recalled + - to a recall, once a specific number of reserves have been requested on the record. + - This system preference is used by the convert_reserves_to_recalls.pl cronjob. SIP2: - -- 2.39.5