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

(-)a/installer/data/mysql/atomicupdate/bug-35153-move-IntranetmainUserblock-to-additional-contents.pl (+40 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35153",
5
    description => "Move IntranetmainUserblock 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 IntranetmainUserblock system preference
11
        my ($intranetmainuserblock) = $dbh->selectrow_array(
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='IntranetmainUserblock';
14
        |
15
        );
16
        if ($intranetmainuserblock) {
17
18
            $dbh->do(
19
                "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'IntranetmainUserblock', 'IntranetmainUserblock', 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 = 'IntranetmainUserblock' AND location = 'IntranetmainUserblock' LIMIT 1",
24
                {}
25
            );
26
27
            $dbh->do(
28
                "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'IntranetmainUserblock default', ?, 'default' )",
29
                undef, $insert_id, $intranetmainuserblock
30
            );
31
32
            say $out "Added 'IntranetmainUserblock' HTML customization";
33
        }
34
35
        # Remove old system preference
36
        $dbh->do("DELETE FROM systempreferences WHERE variable='IntranetmainUserblock'");
37
        say $out "Removed system preference 'IntranetmainUserblock'";
38
39
    },
40
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 328-334 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
328
('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff interface', 'YesNo'),
328
('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff interface', 'YesNo'),
329
('intranetcolorstylesheet','','50','Define the color stylesheet to use in the staff interface','free'),
329
('intranetcolorstylesheet','','50','Define the color stylesheet to use in the staff interface','free'),
330
('IntranetFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the staff interface','free'),
330
('IntranetFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the staff interface','free'),
331
('IntranetmainUserblock','','70|10','Add a block of HTML that will display on the intranet home page','Textarea'),
332
('IntranetNav','','70|10','Use HTML tabs to add navigational links to the top-hand navigational bar in the staff interface','Textarea'),
331
('IntranetNav','','70|10','Use HTML tabs to add navigational links to the top-hand navigational bar in the staff interface','Textarea'),
333
('IntranetNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number staff interface searches','YesNo'),
332
('IntranetNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number staff interface searches','YesNo'),
334
('intranetreadinghistory','1','','If ON, Checkout history is enabled for all patrons','YesNo'),
333
('intranetreadinghistory','1','','If ON, Checkout history is enabled for all patrons','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc (+4 lines)
Lines 18-23 Link Here
18
    Include this content in the popup message which is displayed in the OPAC when the CookieConsent system preference is enabled and the user clicks the "Your cookies" menu item in the header.
18
    Include this content in the popup message which is displayed in the OPAC when the CookieConsent system preference is enabled and the user clicks the "Your cookies" menu item in the header.
19
</div>
19
</div>
20
20
21
<div id="IntranetmainUserblock_notes" class="hint customization_note">
22
    Include this content in its own section on the main page of the staff interface
23
</div>
24
21
<div id="opaccredits_notes" class="hint customization_note">
25
<div id="opaccredits_notes" class="hint customization_note">
22
    Include this content in the footer of all pages in the OPAC.
26
    Include this content in the footer of all pages in the OPAC.
23
</div>
27
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref (-6 lines)
Lines 49-60 Staff interface: Link Here
49
            - pref: intranet_includes
49
            - pref: intranet_includes
50
              class: file
50
              class: file
51
            - directory in the template directory, instead of <code>includes/</code>. (Leave blank to disable)
51
            - directory in the template directory, instead of <code>includes/</code>. (Leave blank to disable)
52
        -
53
            - "Show the following HTML in its own column on the main page of the staff interface:"
54
            - pref: IntranetmainUserblock
55
              type: textarea
56
              syntax: text/html
57
              class: code
58
        -
52
        -
59
            - "Show the following HTML to the left of the More menu at the top of each page on the staff interface (should be a list of links or blank):"
53
            - "Show the following HTML to the left of the More menu at the top of each page on the staff interface (should be a list of links or blank):"
60
            - pref: IntranetNav
54
            - pref: IntranetNav
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (-9 / +14 lines)
Lines 3-8 Link Here
3
[% USE Koha %]
3
[% USE Koha %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE KohaDates %]
5
[% USE KohaDates %]
6
[% USE AdditionalContents %]
6
[% PROCESS 'i18n.inc' %]
7
[% PROCESS 'i18n.inc' %]
7
[% SET footerjs = 1 %]
8
[% SET footerjs = 1 %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
[% INCLUDE 'doc-head-open.inc' %]
Lines 277-293 Link Here
277
                    </div> <!-- /.col-sm-12 -->
278
                    </div> <!-- /.col-sm-12 -->
278
                </div> <!-- /.row -->
279
                </div> <!-- /.row -->
279
280
280
                [% IF ( IntranetmainUserblock ) %]
281
                [% SET IntranetmainUserblock = AdditionalContents.get( location => "IntranetmainUserblock", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
282
283
                [% IF ( IntranetmainUserblock.content && IntranetmainUserblock.content.count > 0 ) %]
281
                    <div class="row">
284
                    <div class="row">
282
                        <div class="col-sm-12">
285
                        <div class="col-sm-12">
283
                            <div id="area-userblock" class="page-section">
286
                            <div id="[% IntranetmainUserblock.location | html %]" class="page-section">
284
                                <div class="user-info">
287
                                [% FOREACH n IN IntranetmainUserblock.content %]
285
                                    [% IntranetmainUserblock | $raw %]
288
                                    <div class="[% n.lang | html %]_item">
286
                                </div>
289
                                        <div class="[% n.lang | html %]_body">[% n.content | $raw %]</div>
287
                            </div>
290
                                    </div>
288
                        </div>
291
                                [% END %]
289
                    </div>
292
                            </div> <!-- /#IntranetmainUserblock -->
290
                [% END %]
293
                        </div> <!-- /.col-sm-12 -->
294
                    </div> <!-- /.row -->
295
                [% END # /IF IntranetmainUserblock %]
291
296
292
                <div class="row">
297
                <div class="row">
293
                    <div class="col-sm-12">
298
                    <div class="col-sm-12">
(-)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 = [ 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', 'StaffPatronsHome', 'StaffPOSHome', 'StaffSerialsHome' ] %]
537
        [% SET staff_available_options = [ 'IntranetmainUserblock', 'StaffAcquisitionsHome', 'StaffAuthoritiesHome', 'StaffCataloguingHome', 'StaffListsHome', '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 35153