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

(-)a/Koha/AdditionalContents.pm (-1 / +1 lines)
Lines 170-176 sub get_html_customizations_options { Link Here
170
            'OpacMaintenanceNotice',         'OPACResultsSidebar',   'OpacSuppressionMessage', 'SCOMainUserBlock',
170
            'OpacMaintenanceNotice',         'OPACResultsSidebar',   'OpacSuppressionMessage', 'SCOMainUserBlock',
171
            'SelfCheckInMainUserBlock',      'SelfCheckHelpMessage', 'CatalogConcernHelp',     'CatalogConcernTemplate',
171
            'SelfCheckInMainUserBlock',      'SelfCheckHelpMessage', 'CatalogConcernHelp',     'CatalogConcernTemplate',
172
            'CookieConsentBar',              'CookieConsentPopup',   'PatronSelfRegistrationAdditionalInstructions',
172
            'CookieConsentBar',              'CookieConsentPopup',   'PatronSelfRegistrationAdditionalInstructions',
173
            'ILLModuleCopyrightClearance'
173
            'ILLModuleCopyrightClearance',   'OpacHiddenRecordMessage'
174
        ];
174
        ];
175
    }
175
    }
176
176
(-)a/installer/data/mysql/atomicupdate/bug_27734.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
        ('OpacHiddenRecordRedirect','0','Redirect the opac detail page for records hidden by OpacHiddenItems to an explanatory page (otherwise redirect to 404 error page)','','YesNo')
6
    });
7
8
    NewVersion( $DBversion, 27734, "Add OpacHiddenRecordRedirect preference");
9
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 514-519 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
514
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See https://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'),
514
('OpacHiddenItems','','','This syspref allows to define custom rules for hiding specific items at the OPAC. See https://wiki.koha-community.org/wiki/OpacHiddenItems for more information.','Textarea'),
515
('OpacHiddenItemsExceptions','',NULL,'List of borrower categories, separated by comma, that can see items otherwise hidden by OpacHiddenItems','Textarea'),
515
('OpacHiddenItemsExceptions','',NULL,'List of borrower categories, separated by comma, that can see items otherwise hidden by OpacHiddenItems','Textarea'),
516
('OpacHiddenItemsHidesRecord','1','','Hide biblio record when all its items are hidden because of OpacHiddenItems','YesNo'),
516
('OpacHiddenItemsHidesRecord','1','','Hide biblio record when all its items are hidden because of OpacHiddenItems','YesNo'),
517
('OpacHiddenRecordRedirect','0','Redirect the opac detail page for records hidden by OpacHiddenItems to an explanatory page (otherwise redirect to 404 error page)','','YesNo'),
517
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
518
('OpacHighlightedWords','1','','If Set, then queried words are higlighted in OPAC','YesNo'),
518
('OPACHoldingsDefaultSortField','first_column','first_column|homebranch|holdingbranch','Default sort field for the holdings table at the OPAC','choice'),
519
('OPACHoldingsDefaultSortField','first_column','first_column|homebranch|holdingbranch','Default sort field for the holdings table at the OPAC','choice'),
519
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
520
('OpacHoldNotes','0','','Show hold notes on OPAC','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc (+4 lines)
Lines 26-31 Link Here
26
26
27
<div id="OpacLibraryInfo_notes" class="hint customization_note"> Include this content on the library information page in the OPAC. </div>
27
<div id="OpacLibraryInfo_notes" class="hint customization_note"> Include this content on the library information page in the OPAC. </div>
28
28
29
<div id="OpacHiddenRecordMessage_notes" class="hint customization_note">
30
    Display the following message on the redirect page for hidden bibliographic records. Depends on the system preferences OpacHiddenItems and OpacHiddenRecordRedirect.
31
</div>
32
29
<div id="OpacLoginInstructions_notes" class="hint customization_note"> Show this content on the OPAC login form when a patron is not logged in. </div>
33
<div id="OpacLoginInstructions_notes" class="hint customization_note"> Show this content on the OPAC login form when a patron is not logged in. </div>
30
34
31
<div id="OpacMaintenanceNotice_notes" class="hint customization_note"> Show this content on the OPAC when the OpacMaintenance system preference is enabled. </div>
35
<div id="OpacMaintenanceNotice_notes" class="hint customization_note"> Show this content on the OPAC when the OpacMaintenance system preference is enabled. </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 681-686 OPAC: Link Here
681
                  0: "Don't hide"
681
                  0: "Don't hide"
682
                  1: Hide
682
                  1: Hide
683
            - "the bibliographic record when all its items are hidden by <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems'>OpacHiddenItems</a>."
683
            - "the bibliographic record when all its items are hidden by <a href='/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems'>OpacHiddenItems</a>."
684
            - <br />Redirect the opac detail page for hidden records to
685
            - pref: OpacHiddenRecordRedirect
686
              choices:
687
                  1: "an explanatory page ('This record is blocked')."
688
                  0: "the 404 error page ('Not found')."
689
            - "<br />Display a message on the redirect page for suppressed bibliographic records with HTML customization <strong>OpacHiddenRecordMessage</strong>."
684
        -
690
        -
685
            - pref: OpacAllowPublicListCreation
691
            - pref: OpacAllowPublicListCreation
686
              default: 1
692
              default: 1
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-blocked.tt (-2 / +9 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE AdditionalContents %]
2
[% USE AdditionalContents %]
3
[% SET OpacSuppressionMessage = AdditionalContents.get( location => "OpacSuppressionMessage", lang => lang, library => branchcode || default_branch ) %]
3
[% SET OpacSuppressionMessage = AdditionalContents.get( location => "OpacSuppressionMessage", lang => lang, library => branchcode || default_branch ) %]
4
[% SET OpacHiddenRecordMessage = AdditionalContents.get( location => "OpacHiddenRecordMessage", lang => lang, library => branchcode || default_branch ) %]
4
[% PROCESS 'i18n.inc' %]
5
[% PROCESS 'i18n.inc' %]
5
[% PROCESS 'html_helpers.inc' %]
6
[% PROCESS 'html_helpers.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
[% INCLUDE 'doc-head-open.inc' %]
Lines 29-36 Link Here
29
                <div id="opac-blocked-message" class="maincontent">
30
                <div id="opac-blocked-message" class="maincontent">
30
                    <h1>Record blocked</h1>
31
                    <h1>Record blocked</h1>
31
                    <p>You are not authorized to view this record.</p>
32
                    <p>You are not authorized to view this record.</p>
32
                    [% IF ( OpacSuppressionMessage ) %]
33
                    [% IF ( OpacSuppressionMessage ) || ( hidden ) %]
33
                        <div id="opacsuppressionmessage"> [% PROCESS koha_news_block news => OpacSuppressionMessage %] </div>
34
                        <div id="opacsuppressionmessage">
35
                            [% IF hidden %]
36
                                [% PROCESS koha_news_block news => OpacHiddenRecordMessage %]
37
                            [% ELSE %]
38
                                [% PROCESS koha_news_block news => OpacSuppressionMessage %]
39
                            [% END %]
40
                        </div>
34
                    [% END %]
41
                    [% END %]
35
                </div>
42
                </div>
36
            </div>
43
            </div>
(-)a/opac/opac-blocked.pl (-1 / +4 lines)
Lines 33-36 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
33
    }
33
    }
34
);
34
);
35
35
36
if ( $query->param('hidden') ) {
37
    $template->param( hidden => 1 );
38
}
39
36
output_with_http_headers $query, $cookie, $template->output, 'html';
40
output_with_http_headers $query, $cookie, $template->output, 'html';
37
- 

Return to bug 27734