--- /dev/null
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+
+ # get list of installed translations
+ require C4::Languages;
+ my @langs;
+ my $tlangs = C4::Languages::getTranslatedLanguages();
+
+ foreach my $language ( @$tlangs ) {
+ foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) {
+ push @langs, $sublanguage->{'rfc4646_subtag'};
+ }
+ }
+
+ # Get any existing value from the OpacLoginInstructions system preference
+ my ($opaclogininstructions) = $dbh->selectrow_array( q|
+ SELECT value FROM systempreferences WHERE variable='OpacLoginInstructions';
+ |);
+ if( $opaclogininstructions ){
+ foreach my $lang ( @langs ) {
+ print "Inserting OpacLoginInstructions contents into $lang news item...\n";
+ # If there is a value in the OpacLoginInstructions preference, insert it into opac_news
+ $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "OpacLoginInstructions_$lang", $opaclogininstructions);
+ }
+ }
+ # Remove the OpacLoginInstructions system preference
+ $dbh->do("DELETE FROM systempreferences WHERE variable='OpacLoginInstructions'");
+ SetVersion ($DBversion);
+ print "Upgrade to $DBversion done (Bug 23797: Convert OpacLoginInstructions system preference to news block)\n";
+}
\ No newline at end of file
('OPACLocalCoverImages','0','1','Display local cover images on OPAC search and details pages.','YesNo'),
('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'),
('OpacLocationOnDetail','holding','holding|home|both|column','In the OPAC detail, display the shelving location on its own column or under a library columns.', 'Choice'),
-('OpacLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'),
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'),
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
class: integer
- items on the bibliographic record detail page (if the bibliographic record has more items than this, a link is displayed instead that allows the user to choose to display all items).
-
- - "Show the following HTML on the OPAC login form when a patron is not logged in:"
- - pref: OpacLoginInstructions
- type: textarea
- syntax: text/html
- class: code
- -
- "Display language selector on "
- pref: OpacLangSelectorMode
choices:
[% END %]
[% FOREACH lang_lis IN lang_list %]
<optgroup label="[% lang_lis.language | html %]">
- [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits' ] %]
+ [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions'] %]
[% IF ( location == '' ) %]
[% SET location_lang = lang_lis.language %]
[% location = BLOCK %]OPAC news[% END %]
[% USE raw %]
[% USE Koha %]
[% USE Categories %]
+[% USE KohaNews %]
+[% PROCESS 'html_helpers.inc' %]
+[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog ›
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
</div>
[% END %]
<div id="nologininstructions">
- [% IF Koha.Preference('OpacLoginInstructions') %]
- [% Koha.Preference('OpacLoginInstructions') | $raw %]
+ [% IF ( OpacLoginInstructions ) %]
+ [% PROCESS koha_news_block news => OpacLoginInstructions %]
[% ELSE %]
<h3>Don't have a password yet?</h3>
<p>If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
[% USE KohaNews %]
[% SET OpacNavRight = KohaNews.get( location => "OpacNavRight", lang => lang, library => branchcode ) %]
[% SET OpacMainUserBlock = KohaNews.get( location => "OpacMainUserBlock", lang => lang, library => branchcode ) %]
+[% SET OpacLoginInstructions = KohaNews.get( location => "OpacLoginInstructions", lang => lang, library => branchcode ) %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
<fieldset class="action">
<input type="submit" value="Log in" class="btn" />
</fieldset>
- [% IF Koha.Preference( 'OpacLoginInstructions' ) %]
+ [% IF ( OpacLoginInstructions ) %]
<div id="nologininstructions-main" class="nologininstructions">
- [% Koha.Preference( 'OpacLoginInstructions' ) | $raw %]
+ [% PROCESS koha_news_block news => OpacLoginInstructions %]
</div>
[% END %]
[% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]