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

(-)a/installer/data/mysql/atomicupdate/bug-34561-move-StaffReportsHomeHTML-to-additional-contents.pl (-7 / +7 lines)
Lines 8-35 return { Link Here
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
9
10
        # Get any existing value from the IntranetReportsHomeHTML system preference
10
        # Get any existing value from the IntranetReportsHomeHTML system preference
11
        my ($staffreportshomehtml) = $dbh->selectrow_array(
11
        my ($staffreportshome) = $dbh->selectrow_array(
12
            q|
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='IntranetReportsHomeHTML';
13
            SELECT value FROM systempreferences WHERE variable='IntranetReportsHomeHTML';
14
        |
14
        |
15
        );
15
        );
16
        if ($staffreportshomehtml) {
16
        if ($staffreportshome) {
17
17
18
            $dbh->do(
18
            $dbh->do(
19
                "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'StaffReportsHomeHTML', 'StaffReportsHomeHTML', NULL, CAST(NOW() AS date) )"
19
                "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'StaffReportsHome', 'StaffReportsHome', NULL, CAST(NOW() AS date) )"
20
            );
20
            );
21
21
22
            my ($insert_id) = $dbh->selectrow_array(
22
            my ($insert_id) = $dbh->selectrow_array(
23
                "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'StaffReportsHomeHTML' AND location = 'StaffReportsHomeHTML' LIMIT 1",
23
                "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'StaffReportsHome' AND location = 'StaffReportsHome' LIMIT 1",
24
                {}
24
                {}
25
            );
25
            );
26
26
27
            $dbh->do(
27
            $dbh->do(
28
                "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'StaffReportsHomeHTML default', ?, 'default' )",
28
                "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'StaffReportsHome default', ?, 'default' )",
29
                undef, $insert_id, $staffreportshomehtml
29
                undef, $insert_id, $staffreportshome
30
            );
30
            );
31
31
32
            say $out "Added 'StaffReportsHomeHTML' HTML customization";
32
            say $out "Added 'StaffReportsHome' HTML customization";
33
        }
33
        }
34
34
35
        # Remove old system preference
35
        # Remove old system preference
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc (-1 / +1 lines)
Lines 16-22 Link Here
16
16
17
<div id="IntranetmainUserblock_notes" class="hint customization_note"> Include this content in its own section on the main page of the staff interface </div>
17
<div id="IntranetmainUserblock_notes" class="hint customization_note"> Include this content in its own section on the main page of the staff interface </div>
18
18
19
<div id="StaffReportsHomeHTML_notes" class="hint customization_note"> Include this content in its own section on the reports home page</div>
19
<div id="StaffReportsHome_notes" class="hint customization_note"> Include this content in its own section on the reports home page</div>
20
20
21
<div id="opaccredits_notes" class="hint customization_note"> Include this content in the footer of all pages in the OPAC. </div>
21
<div id="opaccredits_notes" class="hint customization_note"> Include this content in the footer of all pages in the OPAC. </div>
22
22
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt (-6 / +6 lines)
Lines 128-151 Link Here
128
            </div>
128
            </div>
129
            <!-- /.row -->
129
            <!-- /.row -->
130
130
131
            [% SET StaffReportsHomeHTML = AdditionalContents.get( location => "StaffReportsHomeHTML", lang => lang, library => Branches.GetLoggedInBranchcode || default_branch ) %]
131
            [% SET StaffReportsHome = AdditionalContents.get( location => "StaffReportsHome", lang => lang, library => Branches.GetLoggedInBranchcode || default_branch ) %]
132
132
133
            [% IF ( StaffReportsHomeHTML.content && StaffReportsHomeHTML.content.count > 0 ) %]
133
            [% IF ( StaffReportsHome.content && StaffReportsHome.content.count > 0 ) %]
134
                <div class="row">
134
                <div class="row">
135
                    <div class="col-sm-12">
135
                    <div class="col-sm-12">
136
                        <div id="[% StaffReportsHomeHTML.location | html %]">
136
                        <div id="[% StaffReportsHome.location | html %]">
137
                            [% FOREACH n IN StaffReportsHomeHTML.content %]
137
                            [% FOREACH n IN StaffReportsHome.content %]
138
                                <div class="[% n.lang | html %]_item">
138
                                <div class="[% n.lang | html %]_item">
139
                                    <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
139
                                    <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
140
                                </div>
140
                                </div>
141
                            [% END %]
141
                            [% END %]
142
                        </div>
142
                        </div>
143
                        <!-- /#StaffReportsHomeHTML -->
143
                        <!-- /#StaffReportsHome -->
144
                    </div>
144
                    </div>
145
                    <!-- /.col-sm-12 -->
145
                    <!-- /.col-sm-12 -->
146
                </div>
146
                </div>
147
                <!-- /.row -->
147
                <!-- /.row -->
148
            [% END # /IF StaffReportsHomeHTML %]
148
            [% END # /IF StaffReportsHome %]
149
        </div>
149
        </div>
150
    </div>
150
    </div>
151
</div>
151
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-2 / +1 lines)
Lines 542-548 Link Here
542
                [% END %]
542
                [% END %]
543
            [% END %]
543
            [% END %]
544
        </optgroup>
544
        </optgroup>
545
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffReportsHomeHTML', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
545
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffReportsHome', 'RoutingListNote', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffLoginInstructions', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
546
        <optgroup label="Staff interface">
546
        <optgroup label="Staff interface">
547
            [% FOREACH l IN staff_available_options.sort %]
547
            [% FOREACH l IN staff_available_options.sort %]
548
                [% IF l == location %]
548
                [% IF l == location %]
549
- 

Return to bug 34561