From 7f4d9cb61ee3d482b8ac5a1c2621ba1366062630 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 10 Sep 2024 19:40:20 +0000 Subject: [PATCH] Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference --- .../data/mysql/atomicupdate/bug_37883.pl | 19 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/staff_interface.pref | 6 ++++++ 3 files changed, 26 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_37883.pl diff --git a/installer/data/mysql/atomicupdate/bug_37883.pl b/installer/data/mysql/atomicupdate/bug_37883.pl new file mode 100755 index 00000000000..cc9d07e4bd5 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37883.pl @@ -0,0 +1,19 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "37883", + description => "Add system preference FilterSearchResultsByLoggedInBranch", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) + VALUES ('FilterSearchResultsByLoggedInBranch','0','','Option to filter location column on staff search results by logged in branch','YesNo') + }); + + say $out "Added new system preference 'FilterSearchResultsByLoggedInBranch'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index a865f86cb2a..372b5c46211 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -274,6 +274,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('FallbackToSMSIfNoEmail', 0, 'Enable|Disable', 'Send messages by SMS if no patron email is defined', 'YesNo'), ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is charged','YesNo'), ('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'), +('FilterSearchResultsByLoggedInBranch','0','','Option to filter location column on staff search results by logged in branch','YesNo'), ('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'), ('FinePaymentAutoPopup','0',NULL,'If enabled, automatically display a print dialog for a payment receipt when making a payment.','YesNo'), ('finesCalendar','noFinesWhenClosed','ignoreCalendar|noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','Choice'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref index c8f3f5e1e7a..b5147d1dc4d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref @@ -127,6 +127,12 @@ Staff interface: 0: Don't highlight - words searched for in the staff interface search results pages. Options: + - + - pref: FilterSearchResultsByLoggedInBranch + choices: + 1: Do + 0: "Don't" + - add a filter to the location column on staff interface search results to filter items by the logged in user branch. - - pref: viewMARC choices: -- 2.39.2