From 0b49ae3fbea95c2e8741c500bbbd1e9a163c9d23 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 Signed-off-by: Brendan Lawlor --- .../data/mysql/atomicupdate/bug_37883.pl | 21 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 3 ++- .../admin/preferences/staff_interface.pref | 8 ++++++- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 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 100644 index 00000000000..ba14a6b278b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37883.pl @@ -0,0 +1,21 @@ +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 682b9fb950b..0d260f8cb72 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -276,6 +276,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'), @@ -873,4 +874,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/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref index 8da36fceb14..a1e5398f72b 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 @@ -134,6 +134,12 @@ Staff interface: - Open Document Spreadsheet (ODS) as download format in reports. 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: @@ -216,4 +222,4 @@ Staff interface: "enforced": Enforce "enabled": Enable "disabled": "Don't enable" - - two-factor authentication (2FA) for staff members. + - two-factor authentication (2FA) for staff members. \ No newline at end of file -- 2.39.5