From 043be69e97b87dc9b5b40f9e9e5b47809a3b184a 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 Signed-off-by: Laura_Escamilla --- .../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 0000000000..ba14a6b278 --- /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 f9f419c39d..8460817436 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -282,6 +282,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'), @@ -887,4 +888,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 00b1b06912..8dd0817a3a 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 @@ -128,6 +128,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: @@ -210,4 +216,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