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

(-)a/installer/data/mysql/atomicupdate/bug-35154-move-StaffLoginInstructions-to-additional-contents.pl (+40 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35154",
5
    description => "Move StaffLoginInstructions to additional contents",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Get any existing value from the StaffLoginInstructions system preference
11
        my ($stafflogininstructions) = $dbh->selectrow_array(
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='StaffLoginInstructions';
14
        |
15
        );
16
        if ($stafflogininstructions) {
17
18
            $dbh->do(
19
                "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'StaffLoginInstructions', 'StaffLoginInstructions', NULL, CAST(NOW() AS date) )"
20
            );
21
22
            my ($insert_id) = $dbh->selectrow_array(
23
                "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'StaffLoginInstructions' AND location = 'StaffLoginInstructions' LIMIT 1",
24
                {}
25
            );
26
27
            $dbh->do(
28
                "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'StaffLoginInstructions default', ?, 'default' )",
29
                undef, $insert_id, $stafflogininstructions
30
            );
31
32
            say $out "Added 'StaffLoginInstructions' HTML customization";
33
        }
34
35
        # Remove old system preference
36
        $dbh->do("DELETE FROM systempreferences WHERE variable='StaffLoginInstructions'");
37
        say $out "Removed system preference 'StaffLoginInstructions'";
38
39
    },
40
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 754-760 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
754
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
754
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
755
('StaffInterfaceLanguages','en',NULL,'Set the default language in the staff interface.','Languages'),
755
('StaffInterfaceLanguages','en',NULL,'Set the default language in the staff interface.','Languages'),
756
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
756
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
757
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
758
('StaffLoginLibraryBasedOnIP', '1','', 'Set the logged in library for the user based on their current IP','YesNo'),
757
('StaffLoginLibraryBasedOnIP', '1','', 'Set the logged in library for the user based on their current IP','YesNo'),
759
('StaffLoginRestrictLibraryByIP','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses based on branch','YesNo'),
758
('StaffLoginRestrictLibraryByIP','0',NULL,'If ON, IP authentication is enabled, blocking access to the staff interface from unauthorized IP addresses based on branch','YesNo'),
760
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
759
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc (+4 lines)
Lines 118-123 Link Here
118
    Show this content on the lists home page in the staff interface.
118
    Show this content on the lists home page in the staff interface.
119
</div>
119
</div>
120
120
121
<div id="StaffLoginInstructions_notes" class="hint customization_note">
122
    Show this content on the staff interface login page.
123
</div>
124
121
<div id="StaffPatronsHome_notes" class="hint customization_note">
125
<div id="StaffPatronsHome_notes" class="hint customization_note">
122
    Show this content on the patrons home page in the staff interface.
126
    Show this content on the patrons home page in the staff interface.
123
</div>
127
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (-6 lines)
Lines 119-130 Staff interface: Link Here
119
              type: textarea
119
              type: textarea
120
              syntax: text/html
120
              syntax: text/html
121
              class: code
121
              class: code
122
        -
123
            - "Show the following HTML on the staff interface login page"
124
            - pref: StaffLoginInstructions
125
              type: textarea
126
              syntax: text/html
127
              class: code
128
        -
122
        -
129
            - pref: StaffHighlightedWords
123
            - pref: StaffHighlightedWords
130
              type: boolean
124
              type: boolean
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-1 / +14 lines)
Lines 6-11 Link Here
6
[% USE Categories %]
6
[% USE Categories %]
7
[% USE Registers %]
7
[% USE Registers %]
8
[% USE AuthClient %]
8
[% USE AuthClient %]
9
[% USE AdditionalContents %]
9
[% PROCESS 'i18n.inc' %]
10
[% PROCESS 'i18n.inc' %]
10
[% SET footerjs = 1 %]
11
[% SET footerjs = 1 %]
11
[% INCLUDE 'doc-head-open.inc' %]
12
[% INCLUDE 'doc-head-open.inc' %]
Lines 48-54 Link Here
48
49
49
<div id="login">
50
<div id="login">
50
<h1><a href="http://koha-community.org">Koha</a></h1>
51
<h1><a href="http://koha-community.org">Koha</a></h1>
51
[% IF (Koha.Preference('StaffLoginInstructions')) %]<div id="login_instructions">[% Koha.Preference('StaffLoginInstructions') | $raw %]</div>[% END %]
52
53
[% SET StaffLoginInstructions = AdditionalContents.get( location => "StaffLoginInstructions", lang => lang ) %]
54
55
[% IF ( StaffLoginInstructions.content && StaffLoginInstructions.content.count > 0 ) %]
56
    <div id="[% StaffLoginInstructions.location | html %]" class="page-section">
57
        [% FOREACH n IN StaffLoginInstructions.content %]
58
            <div class="[% n.lang | html %]_item">
59
                <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
60
            </div>
61
        [% END %]
62
    </div> <!-- /#StaffLoginInstructions -->
63
[% END # /IF StaffLoginInstructions %]
64
52
[% IF ( nopermission ) %]
65
[% IF ( nopermission ) %]
53
<div id="login_error">
66
<div id="login_error">
54
    <strong>Error:</strong>
67
    <strong>Error:</strong>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-2 / +1 lines)
Lines 538-544 Link Here
538
                [% END %]
538
                [% END %]
539
            [% END %]
539
            [% END %]
540
        </optgroup>
540
        </optgroup>
541
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
541
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
542
        <optgroup label="Staff interface">
542
        <optgroup label="Staff interface">
543
            [% FOREACH l IN staff_available_options.sort %]
543
            [% FOREACH l IN staff_available_options.sort %]
544
                [% IF l == location %]
544
                [% IF l == location %]
545
- 

Return to bug 35154