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 384-390 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
384
('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'),
384
('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'),
385
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
385
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
386
('OpacNavBottom','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
386
('OpacNavBottom','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
387
('OpacNavRight','','70|10','Show the following HTML in the right hand column of the main page under the main login form','Textarea'),
388
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
387
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
389
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
388
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
390
('OPACNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number OPAC searches','YesNo'),
389
('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 40-47 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
40
[% END %]
40
[% END %]
41
41
42
[% IF ( add_form ) %]
42
[% IF ( add_form ) %]
43
    [% IF ( op == 'add' ) %][% default_lang = lang | html %]
43
    [% IF ( op == 'add' ) %]
44
    [% ELSE %][% default_lang = new_detail.lang | html %]
44
        [% default_lang = lang %]
45
    [% ELSE %]
46
        [% default_lang = new_detail.lang %]
45
    [% END %]
47
    [% END %]
46
        <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
48
        <form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
47
            <input type="hidden" name="op" value="[% op | html %]" />
49
            <input type="hidden" name="op" value="[% op | html %]" />
Lines 67-77 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
67
                <option value="slip"                    >Slip</option>
69
                <option value="slip"                    >Slip</option>
68
                [% END %]
70
                [% END %]
69
                [% FOREACH lang_lis IN lang_list %]
71
                [% FOREACH lang_lis IN lang_list %]
70
                [% IF ( lang_lis.language == default_lang ) %]
72
                    <optgroup label="[% lang_lis.language | html %]">
71
                    <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
73
                        [% FOREACH location IN [ '', 'OpacNavRight' ] %]
72
                [% ELSE %]
74
                            [% IF ( location == '' ) %]
73
                    <option value="[% lang_lis.language | html %]"                    >OPAC ([% lang_lis.language | html %])</option>
75
                                [% SET location_lang = lang_lis.language %]
74
                [% END %]
76
                                [% SET location = "OPAC news" %]
77
                            [% ELSE %]
78
                                [% SET location_lang = location _ "_" _ lang_lis.language %]
79
                            [% END %]
80
                            [% IF ( location_lang == default_lang ) %]
81
                                <option value="[% location_lang | html %]" selected="selected">[% location | html %] ([% lang_lis.language | html %])</option>
82
                            [% ELSE %]
83
                                <option value="[% location_lang | html %]">[% location | html %] ([% lang_lis.language | html %])</option>
84
                            [% END %]
85
                        [% END %]
86
                    </optgroup>
75
                [% END %]
87
                [% END %]
76
            </select>
88
            </select>
77
            </li>
89
            </li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-5 / +2 lines)
Lines 2-7 Link Here
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE Branches %]
3
[% USE Branches %]
4
[% USE Price %]
4
[% USE Price %]
5
[% USE KohaNews %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
7
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
Lines 168-178 Link Here
168
                        [% END %]
169
                        [% END %]
169
                    [% END # /loggedinusername %]
170
                    [% END # /loggedinusername %]
170
                [% END # /opacuserlogin %]
171
                [% END # /opacuserlogin %]
171
                [% IF ( OpacNavRight ) %]
172
                [% PROCESS koha_news_block news => KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %]
172
                    <div id="opacnavright">
173
                        [% OpacNavRight | $raw %]
174
                    </div>
175
                [% END # /OpacNavRight %]
176
            </div> <!-- / .span3 -->
173
            </div> <!-- / .span3 -->
177
        [% END # /opacuserlogin || OpacNavRight %]
174
        [% END # /opacuserlogin || OpacNavRight %]
178
175
(-)a/opac/opac-main.pl (-1 / +1 lines)
Lines 92-97 if ( $patron ) { Link Here
92
$template->param(
92
$template->param(
93
    koha_news           => $all_koha_news,
93
    koha_news           => $all_koha_news,
94
    koha_news_count     => $koha_news_count,
94
    koha_news_count     => $koha_news_count,
95
    news_lang           => $news_lang,
95
    branchcode          => $homebranch,
96
    branchcode          => $homebranch,
96
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
97
    display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
97
    daily_quote         => $quote,
98
    daily_quote         => $quote,
98
- 

Return to bug 22318