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 (+38 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
            $dbh->do(
20
                "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'OpacSuppressionMessage', 'OpacSuppressionMessage', NULL, CAST(NOW() AS date) )"
21
            );
22
23
            my ($insert_id) = $dbh->selectrow_array(
24
                "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'OpacSuppressionMessage' AND location = 'OpacSuppressionMessage' LIMIT 1",
25
                {}
26
            );
27
28
            $dbh->do(
29
                "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'OpacSuppressionMessage default', ?, 'default' )",
30
                undef, $insert_id, $opacsuppressionmessage
31
            );
32
33
            # Remove old system preference
34
            $dbh->do("DELETE FROM systempreferences WHERE variable='OpacSuppressionMessage'");
35
            say $out "Bug 34894 update done";
36
        }
37
    }
38
    }
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 523-529 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
523
('OPACSuggestionUnwantedFields',NULL,'','Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'),
523
('OPACSuggestionUnwantedFields',NULL,'','Define the hidden fields for a patron purchase suggestions made via OPAC.','multiple'),
524
('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'),
524
('OpacSuppression','0','','Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details','YesNo'),
525
('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'),
525
('OpacSuppressionByIPRange','','','Restrict the suppression to IP adresses outside of the IP range','free'),
526
('OpacSuppressionMessage','','Display this message on the redirect page for suppressed biblios','70|10','Textarea'),
527
('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo'),
526
('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo'),
528
('opacthemes','bootstrap','','Define the current theme for the OPAC interface.','Themes'),
527
('opacthemes','bootstrap','','Define the current theme for the OPAC interface.','Themes'),
529
('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'),
528
('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 524-530 Link Here
524
            [% END %]
524
            [% END %]
525
        [% END %]
525
        [% END %]
526
    [% ELSE %]
526
    [% ELSE %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %]
527
        [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %]
528
        <optgroup label="OPAC">
528
        <optgroup label="OPAC">
529
            [% FOREACH l IN opac_available_options.sort %]
529
            [% FOREACH l IN opac_available_options.sort %]
530
                [% IF l == location %]
530
                [% IF l == location %]
(-)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 28-34 Link Here
28
                    <p>You are not authorized to view this record.</p>
30
                    <p>You are not authorized to view this record.</p>
29
                    [% IF ( OpacSuppressionMessage ) %]
31
                    [% IF ( OpacSuppressionMessage ) %]
30
                        <div id="opacsuppressionmessage">
32
                        <div id="opacsuppressionmessage">
31
                            [% OpacSuppressionMessage | $raw %]
33
                            [% PROCESS koha_news_block news => OpacSuppressionMessage %]
32
                        </div>
34
                        </div>
33
                    [% END %]
35
                    [% END %]
34
                </div>
36
                </div>
35
- 

Return to bug 34894