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 707-713 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
707
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
707
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
708
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
708
('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'),
709
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
709
('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'),
710
('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'),
711
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
710
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
712
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
711
('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'),
713
('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'),
712
('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc (+4 lines)
Lines 122-127 Link Here
122
    Show this content on the lists home page in the staff interface.
122
    Show this content on the lists home page in the staff interface.
123
</div>
123
</div>
124
124
125
<div id="StaffLoginInstructions_notes" class="hint customization_note">
126
    Show this content on the staff interface login page.
127
</div>
128
125
<div id="StaffPatronsHome_notes" class="hint customization_note">
129
<div id="StaffPatronsHome_notes" class="hint customization_note">
126
    Show this content on the patrons home page in the staff interface.
130
    Show this content on the patrons home page in the staff interface.
127
</div>
131
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (-6 lines)
Lines 113-124 Staff interface: Link Here
113
              type: textarea
113
              type: textarea
114
              syntax: text/html
114
              syntax: text/html
115
              class: code
115
              class: code
116
        -
117
            - "Show the following HTML on the staff interface login page"
118
            - pref: StaffLoginInstructions
119
              type: textarea
120
              syntax: text/html
121
              class: code
122
        -
116
        -
123
            - pref: StaffHighlightedWords
117
            - pref: StaffHighlightedWords
124
              type: boolean
118
              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 47-53 Link Here
47
48
48
<div id="login">
49
<div id="login">
49
<h1><a href="http://koha-community.org">Koha</a></h1>
50
<h1><a href="http://koha-community.org">Koha</a></h1>
50
[% IF (Koha.Preference('StaffLoginInstructions')) %]<div id="login_instructions">[% Koha.Preference('StaffLoginInstructions') | $raw %]</div>[% END %]
51
52
[% SET StaffLoginInstructions = AdditionalContents.get( location => "StaffLoginInstructions", lang => lang ) %]
53
54
[% IF ( StaffLoginInstructions.content && StaffLoginInstructions.content.count > 0 ) %]
55
    <div id="[% StaffLoginInstructions.location | html %]" class="page-section">
56
        [% FOREACH n IN StaffLoginInstructions.content %]
57
            <div class="[% n.lang | html %]_item">
58
                <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
59
            </div>
60
        [% END %]
61
    </div> <!-- /#StaffLoginInstructions -->
62
[% END # /IF StaffLoginInstructions %]
63
51
[% IF ( nopermission ) %]
64
[% IF ( nopermission ) %]
52
<div id="login_error">
65
<div id="login_error">
53
    <strong>Error:</strong>
66
    <strong>Error:</strong>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-2 / +1 lines)
Lines 534-540 Link Here
534
                [% END %]
534
                [% END %]
535
            [% END %]
535
            [% END %]
536
        </optgroup>
536
        </optgroup>
537
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
537
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
538
        <optgroup label="Staff">
538
        <optgroup label="Staff">
539
            [% FOREACH l IN staff_available_options.sort %]
539
            [% FOREACH l IN staff_available_options.sort %]
540
                [% IF l == location %]
540
                [% IF l == location %]
541
- 

Return to bug 35154