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

(-)a/installer/data/mysql/atomicupdate/bug_22313-move-opacnavright-to-news.perl (+18 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    my $opaclang = C4::Context->preference("opaclanguages");
4
    my @langs;
5
    push @langs, split ( '\,', $opaclang );
6
    # Get any existing value from the OpacNavRight system preference
7
    my ($OpacNavRight) = $dbh->selectrow_array( q|
8
        SELECT value FROM systempreferences WHERE variable='OpacNavRight';
9
    |);
10
    if( $OpacNavRight ){
11
        # If there is a value in the OpacNavRight preference, insert it into opac_news
12
        $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')");
13
    }
14
    # Remove the OpacNavRight system preference
15
    $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'");
16
    SetVersion ($DBversion);
17
    print "Upgrade to $DBversion done (Bug 22318: Move contents of OpacNavRight preference to Koha news system)\n";
18
}
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 387-393 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
387
('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'),
387
('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'),
388
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
388
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
389
('OpacNavBottom','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
389
('OpacNavBottom','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
390
('OpacNavRight','','70|10','Show the following HTML in the right hand column of the main page under the main login form','Textarea'),
391
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
390
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
392
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
391
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
393
('OPACNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number OPAC searches','YesNo'),
392
('OPACNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number OPAC searches','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-5 lines)
Lines 224-234 OPAC: Link Here
224
              type: htmlarea
224
              type: htmlarea
225
              class: code
225
              class: code
226
        -
226
        -
227
            - "Show the following HTML in the right hand column of the main page under the main login form:"
228
            - pref: OpacNavRight
229
              type: htmlarea
230
              class: code
231
        -
232
            - "Show the following HTML on the left hand column of the main page and patron account on the OPAC, after OpacNav, and before patron account links if available:"
227
            - "Show the following HTML on the left hand column of the main page and patron account on the OPAC, after OpacNav, and before patron account links if available:"
233
            - pref: OpacNavBottom
228
            - pref: OpacNavBottom
234
              type: htmlarea
229
              type: htmlarea
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-7 / +19 lines)
Lines 39-46 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
39
[% END %]
39
[% END %]
40
40
41
[% IF ( add_form ) %]
41
[% IF ( add_form ) %]
42
    [% IF ( op == 'add' ) %][% default_lang = lang | html %]
42
    [% IF ( op == 'add' ) %]
43
    [% ELSE %][% default_lang = new_detail.lang | html %]
43
        [% default_lang = lang %]
44
    [% ELSE %]
45
        [% default_lang = new_detail.lang %]
44
    [% END %]
46
    [% END %]
45
        <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
47
        <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
46
            <input type="hidden" name="op" value="[% op | html %]" />
48
            <input type="hidden" name="op" value="[% op | html %]" />
Lines 66-76 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
66
                <option value="slip"                    >Slip</option>
68
                <option value="slip"                    >Slip</option>
67
                [% END %]
69
                [% END %]
68
                [% FOREACH lang_lis IN lang_list %]
70
                [% FOREACH lang_lis IN lang_list %]
69
                [% IF ( lang_lis.language == default_lang ) %]
71
                    <optgroup label="[% lang_lis.language | html %]">
70
                    <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
72
                        [% FOREACH location IN [ '', 'OpacNavRight' ] %]
71
                [% ELSE %]
73
                            [% IF ( location == '' ) %]
72
                    <option value="[% lang_lis.language | html %]"                    >OPAC ([% lang_lis.language | html %])</option>
74
                                [% SET location_lang = lang_lis.language %]
73
                [% END %]
75
                                [% SET location = "OPAC news" %]
76
                            [% ELSE %]
77
                                [% SET location_lang = location _ "_" _ lang_lis.language %]
78
                            [% END %]
79
                            [% IF ( location_lang == default_lang ) %]
80
                                <option value="[% location_lang | html %]" selected="selected">[% location | html %] ([% lang_lis.language | html %])</option>
81
                            [% ELSE %]
82
                                <option value="[% location_lang | html %]">[% location | html %] ([% lang_lis.language | html %])</option>
83
                            [% END %]
84
                        [% END %]
85
                    </optgroup>
74
                [% END %]
86
                [% END %]
75
            </select>
87
            </select>
76
            </li>
88
            </li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-5 / +2 lines)
Lines 3-8 Link Here
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Price %]
5
[% USE Price %]
6
[% USE KohaNews %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
7
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
8
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
8
[% INCLUDE 'doc-head-close.inc' %]
9
[% INCLUDE 'doc-head-close.inc' %]
Lines 191-201 Link Here
191
                        [% END %]
192
                        [% END %]
192
                    [% END # /loggedinusername %]
193
                    [% END # /loggedinusername %]
193
                [% END # /opacuserlogin %]
194
                [% END # /opacuserlogin %]
194
                [% IF ( OpacNavRight ) %]
195
                [% PROCESS koha_news_block news => KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %]
195
                    <div id="opacnavright">
196
                        [% OpacNavRight | $raw %]
197
                    </div>
198
                [% END # /OpacNavRight %]
199
            </div> <!-- / .span3 -->
196
            </div> <!-- / .span3 -->
200
        [% END # /opacuserlogin || OpacNavRight %]
197
        [% END # /opacuserlogin || OpacNavRight %]
201
198
(-)a/opac/opac-main.pl (-1 / +1 lines)
Lines 104-109 if ( $patron ) { Link Here
104
104
105
$template->param(
105
$template->param(
106
    koha_news           => @all_koha_news,
106
    koha_news           => @all_koha_news,
107
    news_lang           => $news_lang,
107
    branchcode          => $homebranch,
108
    branchcode          => $homebranch,
108
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
109
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
109
    daily_quote         => $quote,
110
    daily_quote         => $quote,
110
- 

Return to bug 22318