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

(-)a/C4/Auth.pm (-1 lines)
Lines 571-577 sub get_template_and_user { Link Here
571
            OpacBrowser                           => C4::Context->preference("OpacBrowser"),
571
            OpacBrowser                           => C4::Context->preference("OpacBrowser"),
572
            OpacCloud                             => C4::Context->preference("OpacCloud"),
572
            OpacCloud                             => C4::Context->preference("OpacCloud"),
573
            OpacKohaUrl                           => C4::Context->preference("OpacKohaUrl"),
573
            OpacKohaUrl                           => C4::Context->preference("OpacKohaUrl"),
574
            OpacMainUserBlock                     => "" . C4::Context->preference("OpacMainUserBlock"),
575
            OpacNav                               => "" . C4::Context->preference("OpacNav"),
574
            OpacNav                               => "" . C4::Context->preference("OpacNav"),
576
            OpacNavBottom                         => "" . C4::Context->preference("OpacNavBottom"),
575
            OpacNavBottom                         => "" . C4::Context->preference("OpacNavBottom"),
577
            OpacPasswordChange                    => C4::Context->preference("OpacPasswordChange"),
576
            OpacPasswordChange                    => C4::Context->preference("OpacPasswordChange"),
(-)a/installer/data/mysql/atomicupdate/bug_23794-move-opacmainuserblock-to-news.perl (+30 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    # get list of installed translations
5
    require C4::Languages;
6
    my @langs;
7
    my $tlangs = C4::Languages::getTranslatedLanguages();
8
9
    foreach my $language ( @$tlangs ) {
10
        foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) {
11
            push @langs, $sublanguage->{'rfc4646_subtag'};
12
        }
13
    }
14
15
    # Get any existing value from the OpacMainUserBlock system preference
16
    my ($opacmainuserblock) = $dbh->selectrow_array( q|
17
        SELECT value FROM systempreferences WHERE variable='OpacMainUserBlock';
18
    |);
19
    if( $opacmainuserblock ){
20
        foreach my $lang ( @langs ) {
21
            print "Inserting OpacMainUserBlock contents into $lang news item...\n";
22
            # If there is a value in the OpacMainUserBlock preference, insert it into opac_news
23
            $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "OpacMainUserBlock_$lang", $opacmainuserblock);
24
        }
25
    }
26
    # Remove the OpacMainUserBlock system preference
27
    $dbh->do("DELETE FROM systempreferences WHERE variable='OpacMainUserBlock'");
28
    SetVersion ($DBversion);
29
    print "Upgrade to $DBversion done (Bug 23794: Move contents of OpacMainUserBlock preference to Koha news system)\n";
30
}
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 406-412 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
406
('OpacLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'),
406
('OpacLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'),
407
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
407
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
408
('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'),
408
('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'),
409
('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','70|10','A user-defined block of HTML  in the main content area of the opac main page','Textarea'),
410
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
409
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
411
('OpacMoreSearches', '', NULL, 'Add additional elements to the OPAC more searches bar', 'Textarea'),
410
('OpacMoreSearches', '', NULL, 'Add additional elements to the OPAC more searches bar', 'Textarea'),
412
('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'),
411
('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 232-243 OPAC: Link Here
232
              type: textarea
232
              type: textarea
233
              syntax: css
233
              syntax: css
234
              class: code
234
              class: code
235
        -
236
            - "Show the following HTML in its own column on the main page of the OPAC:"
237
            - pref: OpacMainUserBlock
238
              type: textarea
239
              syntax: text/html
240
              class: code
241
        -
235
        -
242
            - "Show the following HTML on the left hand column of the main page and patron account on the OPAC (generally navigation links):"
236
            - "Show the following HTML on the left hand column of the main page and patron account on the OPAC (generally navigation links):"
243
            - pref: OpacNav
237
            - pref: OpacNav
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-1 / +1 lines)
Lines 327-333 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
327
    [% END %]
327
    [% END %]
328
    [% FOREACH lang_lis IN lang_list %]
328
    [% FOREACH lang_lis IN lang_list %]
329
        <optgroup label="[% lang_lis.language | html %]">
329
        <optgroup label="[% lang_lis.language | html %]">
330
            [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader' ] %]
330
            [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacMainUserBlock' ] %]
331
                [% IF ( location == '' ) %]
331
                [% IF ( location == '' ) %]
332
                    [% SET location_lang = lang_lis.language %]
332
                    [% SET location_lang = lang_lis.language %]
333
                    [% location = BLOCK %]OPAC news[% END %]
333
                    [% location = BLOCK %]OPAC news[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-3 / +7 lines)
Lines 5-10 Link Here
5
[% USE Categories %]
5
[% USE Categories %]
6
[% USE Price %]
6
[% USE Price %]
7
[% USE KohaNews %]
7
[% USE KohaNews %]
8
[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
9
[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
8
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
9
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
11
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
10
[% INCLUDE 'doc-head-close.inc' %]
12
[% INCLUDE 'doc-head-close.inc' %]
Lines 42-48 Link Here
42
        </div>
44
        </div>
43
    [% END %]
45
    [% END %]
44
46
45
    [% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
46
    [% IF ( OpacNav ||  OpacNavBottom  ) && (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
47
    [% IF ( OpacNav ||  OpacNavBottom  ) && (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
47
        <div class="span7">
48
        <div class="span7">
48
    [% ELSIF (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
49
    [% ELSIF (Koha.Preference( 'opacuserlogin' ) == 1 || OpacNavRight) %]
Lines 150-156 Link Here
150
                </div>
151
                </div>
151
            [% END %]
152
            [% END %]
152
153
153
            [% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock">[% OpacMainUserBlock | $raw %]</div>[% END %]
154
            [% IF ( OpacMainUserBlock ) %]
155
                <div id="opacmainuserblock">
156
                    [% PROCESS koha_news_block news => OpacMainUserBlock %]
157
                </div>
158
            [% END %]
154
        [% END %]
159
        [% END %]
155
160
156
        </div> <!-- / .span 7/9 -->
161
        </div> <!-- / .span 7/9 -->
157
- 

Return to bug 23794