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

(-)a/C4/Auth.pm (-2 lines)
Lines 584-590 sub get_template_and_user { Link Here
584
            hidelostitems                         => C4::Context->preference("hidelostitems"),
584
            hidelostitems                         => C4::Context->preference("hidelostitems"),
585
            mylibraryfirst                        => ( C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv ) ? C4::Context->userenv->{'branch'} : '',
585
            mylibraryfirst                        => ( C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv ) ? C4::Context->userenv->{'branch'} : '',
586
            opacbookbag                           => "" . C4::Context->preference("opacbookbag"),
586
            opacbookbag                           => "" . C4::Context->preference("opacbookbag"),
587
            opaccredits                           => "" . C4::Context->preference("opaccredits"),
588
            OpacFavicon                           => C4::Context->preference("OpacFavicon"),
587
            OpacFavicon                           => C4::Context->preference("OpacFavicon"),
589
            opaclanguagesdisplay                  => "" . C4::Context->preference("opaclanguagesdisplay"),
588
            opaclanguagesdisplay                  => "" . C4::Context->preference("opaclanguagesdisplay"),
590
            opacreadinghistory                    => C4::Context->preference("opacreadinghistory"),
589
            opacreadinghistory                    => C4::Context->preference("opacreadinghistory"),
Lines 1259-1265 sub checkauth { Link Here
1259
        opacuserlogin                         => C4::Context->preference("opacuserlogin"),
1258
        opacuserlogin                         => C4::Context->preference("opacuserlogin"),
1260
        OpacNav                               => C4::Context->preference("OpacNav"),
1259
        OpacNav                               => C4::Context->preference("OpacNav"),
1261
        OpacNavBottom                         => C4::Context->preference("OpacNavBottom"),
1260
        OpacNavBottom                         => C4::Context->preference("OpacNavBottom"),
1262
        opaccredits                           => C4::Context->preference("opaccredits"),
1263
        OpacFavicon                           => C4::Context->preference("OpacFavicon"),
1261
        OpacFavicon                           => C4::Context->preference("OpacFavicon"),
1264
        opacreadinghistory                    => C4::Context->preference("opacreadinghistory"),
1262
        opacreadinghistory                    => C4::Context->preference("opacreadinghistory"),
1265
        opaclanguagesdisplay                  => C4::Context->preference("opaclanguagesdisplay"),
1263
        opaclanguagesdisplay                  => C4::Context->preference("opaclanguagesdisplay"),
(-)a/installer/data/mysql/atomicupdate/bug_23795-move-opaccredits-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 opaccredits system preference
16
    my ($opaccredits) = $dbh->selectrow_array( q|
17
        SELECT value FROM systempreferences WHERE variable='opaccredits';
18
    |);
19
    if( $opaccredits ){
20
        foreach my $lang ( @langs ) {
21
            print "Inserting opaccredits contents into $lang news item...\n";
22
            # If there is a value in the opaccredits preference, insert it into opac_news
23
            $dbh->do("INSERT INTO opac_news (branchcode, lang, title, content ) VALUES (NULL, ?, '', ?)", undef, "opaccredits_$lang", $opaccredits);
24
        }
25
    }
26
    # Remove the opaccredits system preference
27
    $dbh->do("DELETE FROM systempreferences WHERE variable='opaccredits'");
28
    SetVersion ($DBversion);
29
    print "Upgrade to $DBversion done (Bug 23795: Convert OpacCredits system preference to news block)\n";
30
}
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 377-383 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
377
('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'),
377
('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'),
378
('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'),
378
('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'),
379
('OpacCustomSearch','','70|10','Replace the search box on the OPAC with the provided HTML','Textarea'),
379
('OpacCustomSearch','','70|10','Replace the search box on the OPAC with the provided HTML','Textarea'),
380
('opaccredits','','70|10','Define HTML Credits at the bottom of the OPAC page','Textarea'),
381
('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
380
('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
382
('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'),
381
('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'),
383
('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
382
('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 253-264 OPAC: Link Here
253
              syntax: text/html
253
              syntax: text/html
254
              class: code
254
              class: code
255
        -
255
        -
256
            - "Include the following HTML in the footer of all pages in the OPAC:"
257
            - pref: opaccredits
258
              type: textarea
259
              syntax: text/html
260
              class: code
261
        -
262
            - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):'
256
            - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):'
263
            - '<br />Note: The placeholders {BIBLIONUMBER}, {CONTROLNUMBER}, {TITLE}, {ISBN}, {ISSN} and {AUTHOR} will be replaced with information from the displayed record.'
257
            - '<br />Note: The placeholders {BIBLIONUMBER}, {CONTROLNUMBER}, {TITLE}, {ISBN}, {ISSN} and {AUTHOR} will be replaced with information from the displayed record.'
264
            - pref: OPACSearchForTitleIn
258
            - pref: OPACSearchForTitleIn
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-1 / +1 lines)
Lines 331-337 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
331
    [% END %]
331
    [% END %]
332
    [% FOREACH lang_lis IN lang_list %]
332
    [% FOREACH lang_lis IN lang_list %]
333
        <optgroup label="[% lang_lis.language | html %]">
333
        <optgroup label="[% lang_lis.language | html %]">
334
            [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacMainUserBlock' ] %]
334
            [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'OpacMainUserBlock', 'opaccredits' ] %]
335
                [% IF ( location == '' ) %]
335
                [% IF ( location == '' ) %]
336
                    [% SET location_lang = lang_lis.language %]
336
                    [% SET location_lang = lang_lis.language %]
337
                    [% location = BLOCK %]OPAC news[% END %]
337
                    [% location = BLOCK %]OPAC news[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-5 / +6 lines)
Lines 1-16 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Koha %]
2
[% USE Koha %]
3
[% USE KohaNews %]
4
[% PROCESS 'html_helpers.inc' %]
3
[%- USE KohaPlugins -%]
5
[%- USE KohaPlugins -%]
4
[% USE Asset %]
6
[% USE Asset %]
7
[% SET opaccredits = KohaNews.get( location => "opaccredits", lang => lang, library => branchcode ) %]
8
[% PROCESS 'html_helpers.inc' %]
5
[% UNLESS ( is_popup ) %]
9
[% UNLESS ( is_popup ) %]
6
    [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
10
    [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %]
7
    [% IF ( opaccredits ) %]
11
    [% IF ( opaccredits ) %]
8
        <div class="container-fluid">
12
        <div class="container-fluid">
9
            <div class="row-fluid">
13
            <div class="row-fluid">
10
                <div class="span12">
14
                <div id="opaccredits">
11
                    <div id="opaccredits" class="noprint">
15
                    [% PROCESS koha_news_block news => opaccredits %]
12
                        [% opaccredits | $raw %]
13
                    </div>
14
                </div>
16
                </div>
15
            </div>
17
            </div>
16
        </div>
18
        </div>
17
- 

Return to bug 23795