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

(-)a/installer/data/mysql/atomicupdate/bug-34894-move-OpacSuppressionMessage-to-additional-contents.pl (+31 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34894",
5
    description => "Move OpacSuppressionMessage to additional contents",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Get any existing value from the OpacSuppressionMessage system preference
11
        my ($opacsuppressionmessage) = $dbh->selectrow_array(
12
            q|
13
            SELECT value FROM systempreferences WHERE variable='OpacSuppressionMessage';
14
        |
15
        );
16
        if ($opacsuppressionmessage) {
17
18
            # Insert any values found from system preference into additional_contents
19
            foreach my $lang ('default') {
20
                $dbh->do(
21
                    "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacSuppressionMessage', 'OpacSuppressionMessage', NULL, ?, ?, ?, CAST(NOW() AS date) )",
22
                    undef, "OpacSuppressionMessage $lang", $opacsuppressionmessage, $lang
23
                );
24
            }
25
26
            # Remove old system preference
27
            $dbh->do("DELETE FROM systempreferences WHERE variable='OpacSuppressionMessage'");
28
            say $out "Bug 34894 update done";
29
        }
30
    }
31
    }
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 521-527 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
521
('OPACSuggestionUnwantedFields',NULL,'','Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'),
521
('OPACSuggestionUnwantedFields',NULL,'','Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'),
522
('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'),
522
('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'),
523
('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'),
523
('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'),
524
('OpacSuppressionMessage','','Display this message on the redirect page for suppressed biblios','70|10','Textarea'),
525
('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo'),
524
('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo'),
526
('opacthemes','bootstrap','','Define the current theme for the OPAC interface.','Themes'),
525
('opacthemes','bootstrap','','Define the current theme for the OPAC interface.','Themes'),
527
('OpacTopissue','0',NULL,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server','YesNo'),
526
('OpacTopissue','0',NULL,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-4 / +1 lines)
Lines 282-291 Cataloging: Link Here
282
              choices:
282
              choices:
283
                  1: "an explanatory page ('This record is blocked')."
283
                  1: "an explanatory page ('This record is blocked')."
284
                  0: "the 404 error page ('Not found')."
284
                  0: "the 404 error page ('Not found')."
285
            - "<br />Display the following message on the redirect page for suppressed bibliographic records:"
285
            - "<br /> A custom message can be shown on the redirect page for suppressed bibliographic records by creating an <a href='/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations'>HTML customization</a> in the OpacSuppressionMessage region."
286
            - pref: OpacSuppressionMessage
287
              type: textarea
288
              class: code
289
        -
286
        -
290
            - pref: SeparateHoldings
287
            - pref: SeparateHoldings
291
              choices:
288
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 494-500 Link Here
494
            [% END %]
494
            [% END %]
495
        [% END %]
495
        [% END %]
496
    [% ELSE %]
496
    [% ELSE %]
497
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %]
497
        [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'OpacSuppressionMessage' ] %]
498
        [% FOREACH l IN available_options.sort %]
498
        [% FOREACH l IN available_options.sort %]
499
            [% IF l == location %]
499
            [% IF l == location %]
500
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
500
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-blocked.tt (-2 / +3 lines)
Lines 1-4 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE AdditionalContents %]
3
[% SET OpacSuppressionMessage = AdditionalContents.get( location => "OpacSuppressionMessage", lang => lang, library => branchcode || default_branch ) %]
2
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
3
<title>
5
<title>
4
    Record blocked &rsaquo;
6
    Record blocked &rsaquo;
Lines 33-39 Link Here
33
                    <p>You are not authorized to view this record.</p>
35
                    <p>You are not authorized to view this record.</p>
34
                    [% IF ( OpacSuppressionMessage ) %]
36
                    [% IF ( OpacSuppressionMessage ) %]
35
                        <div id="opacsuppressionmessage">
37
                        <div id="opacsuppressionmessage">
36
                            [% OpacSuppressionMessage | $raw %]
38
                            [% PROCESS koha_news_block news => OpacSuppressionMessage %]
37
                        </div>
39
                        </div>
38
                    [% END %]
40
                    [% END %]
39
                </div>
41
                </div>
40
- 

Return to bug 34894