View | Details | Raw Unified | Return to bug 34188
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_34188.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "34188",
5
    description => "Force staff to select a library when logging into the staff interface.",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{
10
                INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
11
                VALUES ('ForcedLibrarySelection', '0', NULL,'Force staff to select a library when logging into the staff interface.', 'YesNo')});
12
13
        # sysprefs
14
        say $out "Added new system preference 'ForcedLibrarySelection'";
15
16
    },
17
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 250-255 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
250
('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'),
250
('FinesIncludeGracePeriod','1',NULL,'If enabled, fines calculations will include the grace period.','YesNo'),
251
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
251
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
252
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
252
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
253
('ForcedLibrarySelection','0',NULL,'Force staff to select a library when logging into the staff interface.','YesNo'),
253
('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'),
254
('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'),
254
('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'),
255
('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'),
255
('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'),
256
('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'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+7 lines)
Lines 138-143 Administration: Link Here
138
              choices:
138
              choices:
139
                  1: "Yes"
139
                  1: "Yes"
140
                  0: "No"
140
                  0: "No"
141
        -
142
            - pref: ForcedLibrarySelection
143
              choices:
144
                  1: "Force"
145
                  0: "Don't force"
146
            - "library selection when logging into the staff interface."
147
141
    CAS authentication:
148
    CAS authentication:
142
        -
149
        -
143
            - "Use CAS for login authentication: "
150
            - "Use CAS for login authentication: "
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-4 / +12 lines)
Lines 115-128 Link Here
115
    </p>
115
    </p>
116
116
117
    [% UNLESS IndependentBranches %]
117
    [% UNLESS IndependentBranches %]
118
        [% SET libraryClass = Koha.Preference('ForcedLibrarySelection') ? 'required' : '' %]
119
        [% SET libraryRequired = Koha.Preference('ForcedLibrarySelection') ? 'required="required"' : '' %]
118
        <p>
120
        <p>
119
            <label for="branch">Library:</label>
121
            <label for="branch" class="[% libraryClass %]">Library:</label>
120
            <select name="branch" id="branch" class="input" tabindex="3">
122
            <select name="branch" id="branch" class="input" tabindex="3" [% libraryRequired %]>
121
                <option value="">My library</option>
123
                [% IF Koha.Preference('ForcedLibrarySelection') %]
124
                    <option value=""></option>
125
                [% ELSE %]
126
                    <option value="">My Library</option>
127
                [% END %]
122
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
128
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
123
                    <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
129
                    <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
124
                 [% END %]
130
                 [% END %]
125
            </select>
131
            </select>
132
            [% IF Koha.Preference('ForcedLibrarySelection') %]
133
                <span class="required">Required</span>
134
            [% END %]
126
        </p>
135
        </p>
127
136
128
        [% IF Koha.Preference('UseCirculationDesks') && Desks.all %]
137
        [% IF Koha.Preference('UseCirculationDesks') && Desks.all %]
129
- 

Return to bug 34188