From 9cd7b0f3b17ae20c32d20fe25da6ebb67c164625 Mon Sep 17 00:00:00 2001
From: Lucas Gass
Date: Fri, 14 Jan 2022 21:37:49 +0000
Subject: [PATCH] Bug 29887: Add system preference
IndependentBranchesLoggedInLibrary
To test:
1. Have a user who has staff access and circulate privileges but is not a super librarian
2. Apply the patches and run updatedatabase.pl
3. From a superlibrarian account enable IndependentBranches and IndependentBranchesLoggedInLibrary set to Yes.
4. Also turn on the system preference 'CircSidebar'
5. Prepare to login as the non-superlibrarian user. Before logging on notice on auth.tt there is no dropdown allowing you to choose a branch.
6. Log in as the non-superlibrarian.
7. In the top left hand corner notice you are logged in under that users homebranch.
8. Click the dropdown, there is no link for 'Set library'.
9. Go to circulation-home.pl, there is no link for 'Set library' under the heading 'Circulation'
10. With 'CircSidebar' turned on look at the left navigation bar on some of the circulation pages ( Holds queue, Holds to pull, Holds awaiting pickup ). There should be no 'Set library' link on any of these pages.
11. Direct your browser to /cgi-bin/koha/circ/set-library.pl and notice there is no option to change your logged in branch
12. From a superlibrarian account, Turn off IndependentBranches but leave IndependentBranchesLoggedInLibrary set to Yes.
13. Repeat steps 5-11. Nothing should change, the non-superlibrarian should still see no 'Set library' links.
14. From a superlibrarian account, Turn on IndependentBranches and IndependentBranchesLoggedInLibrary set to No
15. Going through steps 5-11 again the non-superlibrarian should see all of the 'Set library' links and be able to successfully switch branches
Signed-off-by: Bob Bennhoff
---
installer/data/mysql/mandatory/sysprefs.sql | 1 +
.../prog/en/modules/admin/preferences/admin.pref | 7 +++++++
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 2 +-
.../intranet-tmpl/prog/en/modules/circ/circulation-home.tt | 3 +--
4 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql
index deaf6b6fc2..fcd7ef0969 100644
--- a/installer/data/mysql/mandatory/sysprefs.sql
+++ b/installer/data/mysql/mandatory/sysprefs.sql
@@ -267,6 +267,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('IndependentBranches','0',NULL,'If ON, increases security between libraries','YesNo'),
('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'),
('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'),
+('IndependentBranchesLoggedInLibrary','0', NULL, 'Allow only superlibrarians the ability to set or change their logged in location','YesNo'),
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
('RecordedBooksClientSecret','','30','Client key for RecordedBooks integration','Free'),
('RecordedBooksDomain','','','RecordedBooks domain','Free'),
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
index 2eab55ae03..858bbd57be 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
@@ -131,6 +131,13 @@ Administration:
choices:
1: "Yes"
0: "No"
+ -
+ - "Prevent staff (but not superlibrarians) from setting or changing their logged in location:"
+ - pref: IndependentBranchesLoggedInLibrary
+ default: 0
+ choices:
+ 1: "Yes"
+ 0: "No"
-
- "Prevent staff (but not superlibrarians) from transfering items to other libraries: "
- pref: IndependentBranchesTransfers
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
index 499c5bdbd3..88bceca4a0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
@@ -75,7 +75,7 @@