Bugzilla – Attachment 153563 Details for
Bug 34188
Require library selection when logging in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34188: Require Library Branch Selection when Logging in
Bug-34188-Require-Library-Branch-Selection-when-Lo.patch (text/plain), 5.99 KB, created by
Sam Lau
on 2023-07-17 15:51:44 UTC
(
hide
)
Description:
Bug 34188: Require Library Branch Selection when Logging in
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2023-07-17 15:51:44 UTC
Size:
5.99 KB
patch
obsolete
>From d037edd88a54c42923687aa2e92864c8dcd1fec9 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Thu, 6 Jul 2023 19:59:50 +0000 >Subject: [PATCH] Bug 34188: Require Library Branch Selection when Logging in > >This patch adds the ability to force staff to select a library when logging into the staff interface. This is done via a new system preference: 'ForcedLibrarySelection' > >To test: >1) Apply patch, restart_all, and updatedatabase >2) Log out of the staff interface. Notice the login form looks the same and the "Library:" dropdown has 'My Library" selected as default. Log back into the staff interface. >3) In Administration, search for the system preference "ForcedLibrarySelection". Set it to 'Force' and press save. >4) Log out of the staff interface. Notice that this time, the "Library:" dropdown is required and has a blank selection as the default. >5) Fill in the username and password but do not select a library. Click 'Log in' >6) Notice you cannot log in and are asked to 'Please select an item in the list' >7) Select a library from the drop down and click 'Log in' >8) Notice the login was successful and you were logged in to the library you selected. >9) Try loggin in with some other libraries to verify it works as expected >10) Sign-off :) >--- > installer/data/mysql/atomicupdate/bug_34188.pl | 17 +++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../en/modules/admin/preferences/admin.pref | 7 +++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 15 ++++++++++++--- > 4 files changed, 37 insertions(+), 3 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_34188.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_34188.pl b/installer/data/mysql/atomicupdate/bug_34188.pl >new file mode 100755 >index 0000000000..a8dcbd8fd3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_34188.pl >@@ -0,0 +1,17 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "34188", >+ description => "Force staff to select a library when logging into the staff interface.", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+ VALUES ('ForcedLibrarySelection', '0', NULL,'Force staff to select a library when logging into the staff interface.', 'YesNo')}); >+ >+ # sysprefs >+ say $out "Added new system preference 'ForcedLibrarySelection'"; >+ >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 38a756f817..f83b76b175 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -255,6 +255,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'), > ('FinesLog','1',NULL,'If ON, log fines','YesNo'), > ('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines). Requires accruefines cronjob.','Choice'), >+('ForcedLibrarySelection','0',NULL,'Force staff to select a library when logging into the staff interface.','YesNo'), > ('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), > ('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'), > ('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', '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 c25ee18962..af54800354 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 >@@ -138,6 +138,13 @@ Administration: > choices: > 1: "Yes" > 0: "No" >+ - >+ - pref: ForcedLibrarySelection >+ choices: >+ 1: "Force" >+ 0: "Don't force" >+ - "library selection when logging into the staff interface." >+ > CAS authentication: > - > - "Use CAS for login authentication: " >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index 23b70b29b4..9943bc105c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -116,13 +116,22 @@ > > [% UNLESS IndependentBranches %] > <p> >- <label for="branch">Library:</label> >- <select name="branch" id="branch" class="input" tabindex="3"> >- <option value="">My library</option> >+ [% IF Koha.Preference('ForcedLibrarySelection') %] >+ <label for="branch" class="required">Library:</label> >+ <select name="branch" id="branch" class="input" tabindex="3" required="required"> >+ <option value=""></option> >+ [% ELSE %] >+ <label for="branch">Library:</label> >+ <select name="branch" id="branch" class="input" tabindex="3"> >+ <option value="">My Library</option> >+ [% END %] > [% FOREACH l IN Branches.all( unfiltered => 1 ) %] > <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> > [% END %] > </select> >+ [% IF Koha.Preference('ForcedLibrarySelection') %] >+ <span class="required">Required</span> >+ [% END %] > </p> > > [% IF Koha.Preference('UseCirculationDesks') && Desks.all %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34188
:
153337
|
153338
|
153348
|
153563
|
153605
|
157285
|
158408
|
158409
|
158410
|
158411
|
158412