--- /dev/null
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+ my $opaclang = C4::Context->preference("opaclanguages");
+ my @langs;
+ push @langs, split ( '\,', $opaclang );
+ # Get any existing value from the OpacNavRight system preference
+ my ($OpacNavRight) = $dbh->selectrow_array( q|
+ SELECT value FROM systempreferences WHERE variable='OpacNavRight';
+ |);
+ if( $OpacNavRight ){
+ # If there is a value in the OpacNavRight preference, insert it into opac_news
+ $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, 'OpacNavRight_$langs[0]', '', '$OpacNavRight')");
+ }
+ # Remove the OpacNavRight system preference
+ $dbh->do("DELETE FROM systempreferences WHERE variable='OpacNavRight'");
+ SetVersion ($DBversion);
+ print "Upgrade to $DBversion done (Bug 22318: Move contents of OpacNavRight preference to Koha news system)\n";
+}
('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'),
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
('OpacNavBottom','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
-('OpacNavRight','','70|10','Show the following HTML in the right hand column of the main page under the main login form','Textarea'),
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
('OPACNumbersPreferPhrase','0',NULL,'Control the use of phr operator in callnumber and standard number OPAC searches','YesNo'),
syntax: text/html
class: code
-
- - "Show the following HTML in the right hand column of the main page under the main login form:"
- - pref: OpacNavRight
- type: textarea
- syntax: text/html
- class: code
- -
- "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:"
- pref: OpacNavBottom
type: textarea
[% END %]
[% IF ( add_form ) %]
- [% IF ( op == 'add' ) %][% default_lang = lang | html %]
- [% ELSE %][% default_lang = new_detail.lang | html %]
+ [% IF ( op == 'add' ) %]
+ [% default_lang = lang %]
+ [% ELSE %]
+ [% default_lang = new_detail.lang %]
[% END %]
<form name="add_form" method="post" action="/cgi-bin/koha/tools/koha-news.pl" >
<input type="hidden" name="op" value="[% op | html %]" />
<option value="slip" >Slip</option>
[% END %]
[% FOREACH lang_lis IN lang_list %]
- [% IF ( lang_lis.language == default_lang ) %]
- <option value="[% lang_lis.language | html %]" selected="selected">OPAC ([% lang_lis.language | html %])</option>
- [% ELSE %]
- <option value="[% lang_lis.language | html %]" >OPAC ([% lang_lis.language | html %])</option>
- [% END %]
+ <optgroup label="[% lang_lis.language | html %]">
+ [% FOREACH location IN [ '', 'OpacNavRight' ] %]
+ [% IF ( location == '' ) %]
+ [% SET location_lang = lang_lis.language %]
+ [% SET location = "OPAC news" %]
+ [% ELSE %]
+ [% SET location_lang = location _ "_" _ lang_lis.language %]
+ [% END %]
+ [% IF ( location_lang == default_lang ) %]
+ <option value="[% location_lang | html %]" selected="selected">[% location | html %] ([% lang_lis.language | html %])</option>
+ [% ELSE %]
+ <option value="[% location_lang | html %]">[% location | html %] ([% lang_lis.language | html %])</option>
+ [% END %]
+ [% END %]
+ </optgroup>
[% END %]
</select>
</li>
[% USE Branches %]
[% USE Categories %]
[% USE Price %]
+[% USE KohaNews %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
[% END %]
[% END # /loggedinusername %]
[% END # /opacuserlogin %]
- [% IF ( OpacNavRight ) %]
- <div id="opacnavright">
- [% OpacNavRight | $raw %]
- </div>
- [% END # /OpacNavRight %]
+ [% PROCESS koha_news_block news => KohaNews.get( location => "OpacNavRight", lang => news_lang, library => branchcode ) %]
</div> <!-- / .span3 -->
[% END # /opacuserlogin || OpacNavRight %]
$template->param(
koha_news => @all_koha_news,
+ news_lang => $news_lang,
branchcode => $homebranch,
display_daily_quote => C4::Context->preference('QuoteOfTheDay'),
daily_quote => $quote,