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 372-378 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
372
('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'),
372
('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'),
373
('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'),
373
('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'),
374
('OpacCustomSearch','','70|10','Replace the search box on the OPAC with the provided HTML','Textarea'),
374
('OpacCustomSearch','','70|10','Replace the search box on the OPAC with the provided HTML','Textarea'),
375
('opaccredits','','70|10','Define HTML Credits at the bottom of the OPAC page','Textarea'),
376
('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
375
('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'),
377
('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'),
376
('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'),
378
('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'),
377
('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 251-262 OPAC: Link Here
251
              syntax: text/html
251
              syntax: text/html
252
              class: code
252
              class: code
253
        -
253
        -
254
            - "Include the following HTML in the footer of all pages in the OPAC:"
255
            - pref: opaccredits
256
              type: textarea
257
              syntax: text/html
258
              class: code
259
        -
260
            - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):'
254
            - 'Include a "More Searches" box on the detail pages of items on the OPAC, with the following HTML (leave blank to disable):'
261
            - '<br />Note: The placeholders {BIBLIONUMBER}, {CONTROLNUMBER}, {TITLE}, {ISBN}, {ISSN} and {AUTHOR} will be replaced with information from the displayed record.'
255
            - '<br />Note: The placeholders {BIBLIONUMBER}, {CONTROLNUMBER}, {TITLE}, {ISBN}, {ISSN} and {AUTHOR} will be replaced with information from the displayed record.'
262
            - pref: OPACSearchForTitleIn
256
            - pref: OPACSearchForTitleIn
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-1 / +1 lines)
Lines 327-333 Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> Link Here
327
    [% END %]
327
    [% END %]
328
    [% FOREACH lang_lis IN lang_list %]
328
    [% FOREACH lang_lis IN lang_list %]
329
        <optgroup label="[% lang_lis.language | html %]">
329
        <optgroup label="[% lang_lis.language | html %]">
330
            [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader' ] %]
330
            [% FOREACH location IN [ '', 'OpacNavRight', 'opacheader', 'opaccredits' ] %]
331
                [% IF ( location == '' ) %]
331
                [% IF ( location == '' ) %]
332
                    [% SET location_lang = lang_lis.language %]
332
                    [% SET location_lang = lang_lis.language %]
333
                    [% location = BLOCK %]OPAC news[% END %]
333
                    [% 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