Bugzilla – Attachment 180627 Details for
Bug 34556
Add a template 'Accessibility statement' page to the default data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34556: Add an Accessibility Statement Page
Bug-34556-Add-an-Accessibility-Statement-Page.patch (text/plain), 11.31 KB, created by
Nina Martinez
on 2025-04-04 11:38:55 UTC
(
hide
)
Description:
Bug 34556: Add an Accessibility Statement Page
Filename:
MIME Type:
Creator:
Nina Martinez
Created:
2025-04-04 11:38:55 UTC
Size:
11.31 KB
patch
obsolete
>From a6fe75c487e9bad6d0e45004693dbafd12b780e7 Mon Sep 17 00:00:00 2001 >From: nina martinez <nina.martinez@biblibre.com> >Date: Wed, 26 Mar 2025 11:58:10 +0100 >Subject: [PATCH] Bug 34556: Add an Accessibility Statement Page > >This patch adds an Accessibility Statement page. To include this page, we propose adding a link in the Koha footer and using the HTML customization tools. This link will appear when you add content in the new HTML customization location: 'OpacAccessibility'. > >The page title and the link will use the title written in the HTML customizations or 'Accessibility' if none is provided. If there are multiple HTML customizations added for the location 'OpacAccessibility', the first one added will be used for the title by default. If you want a different title than the first one created, you must specify the "Appear in position" field in each 'OpacAccessibility' location and set it to '1' for the one you want to use for the title and link. > >If you add more than one content entry for this location, they will appear in succession on the page, similar to the title, with the first created or last edited appearing first by default. You can change this order by numbering the positions ("Appear in position" field). > >Test Plan: > >1. Apply the patch. >2. Open the staff interface. >3. Click on 'Tools.' >4. Click on 'HTML Customizations.' >5. Click on 'New entry.' >6. Choose the location 'OpacAccessibility' and 'All libraries'. >7. Add a title (if desired), content and a publication date. >8. Open the OPAC interface. >9. Click on the link in the footer (the name should match the title you provided or 'Accessibility'). >10. Verify that the content you added in the HTML customizations appears. >11. Go back to the Staff interface >12. Add another content entry for the same location (with a title and content) but choose a specific library. >13. Set the "Appear in position" to 1 for the new entry. >14. Edit the first entry to set its position to 2. >15. Return to the OPAC interface logged in to a specific library Patron (same library you choose for the second entry) and verify that the link title matches the second title you wrote. >16. Verify that both content appear on the Accessibility page. >17. Go back to the staff interface and add content to the location : 'OpacNav' >18. Edit the second entry to set an expiration date for yesterday. >19. Return to the Opac and check that on the Accessibility page, the OpacNav content appears like the other pages on the left and the content of the second entry doesn't appear. >20. Return to the staff interface and delete all the HTML customizations for the 'OpacAccessibility' location. >21. Return to the OPAC interface. >22. Check that there is no link in the footer. > >Signed-off-by: PhilipOrr <philip.orr@lmscloud.de> >--- > .../en/includes/html-customization-help.inc | 2 + > .../en/modules/tools/additional-contents.tt | 2 +- > .../bootstrap/en/includes/opac-bottom.inc | 10 ++++ > .../en/modules/opac-accessibility.tt | 60 +++++++++++++++++++ > opac/opac-accessibility.pl | 38 ++++++++++++ > 5 files changed, 111 insertions(+), 1 deletion(-) > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-accessibility.tt > create mode 100755 opac/opac-accessibility.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >index bc0bfabe7c..a0aeb29e6a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc >@@ -16,6 +16,8 @@ > > <div id="IntranetmainUserblock_notes" class="hint customization_note"> Include this content in its own section on the main page of the staff interface </div> > >+<div id="OpacAccessibility" class="hint customization_note"> Show this content in the Accessibility page in the OPAC. </div> >+ > <div id="opaccredits_notes" class="hint customization_note"> Include this content in the footer of all pages in the OPAC. </div> > > <div id="OpacCustomSearch_notes" class="hint customization_note"> Replace the search box at the top of OPAC pages with this content. </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index 75e1a5215b..32d7b2c7eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -532,7 +532,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %] >+ [% SET opac_available_options = ['OpacAccessibility' ,'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %] > <optgroup label="OPAC"> > [% FOREACH l IN opac_available_options.sort %] > [% IF l == location %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 76b0e7f4ca..5f4568f51f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -4,6 +4,7 @@ > [% USE AdditionalContents %] > [%- USE KohaPlugins -%] > [% USE Asset %] >+[% SET OpacAccessibility = AdditionalContents.get( location => "OpacAccessibility", lang => lang, library => logged_in_user.branchcode || default_branch ) %] > [% SET opaccredits = AdditionalContents.get( location => "opaccredits", lang => lang, library => logged_in_user.branchcode || default_branch ) %] > [% PROCESS 'html_helpers.inc' %] > [% IF Koha.Preference( 'CookieConsent' ) %] >@@ -47,6 +48,15 @@ > </a> > [% END %] > </div> >+ >+ [% IF ( OpacAccessibility ) %] >+ <div class="navbar-nav flex-grow-1"> >+ <a id="accessibility_page" class="nav-link" href="/cgi-bin/koha/opac-accessibility.pl"> >+ [% IF OpacAccessibility.content.single.title %][% OpacAccessibility.content.single.title | html %][% ELSE %]Accessibility[% END %] >+ </a> >+ </div> >+ [% END %] >+ > [% IF OpacKohaUrl %] > <div class="navbar-nav"> > <a id="koha_url" class="nav-link koha_url" href="http://koha-community.org"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-accessibility.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-accessibility.tt >new file mode 100644 >index 0000000000..0b4904d5fe >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-accessibility.tt >@@ -0,0 +1,60 @@ >+[% USE raw %] >+[% USE Koha %] >+[% USE AdditionalContents %] >+[% SET OpacAccessibility = AdditionalContents.get( location => "OpacAccessibility", lang => lang, library => logged_in_user.branchcode || default_branch , blocktitle => 0) %] >+[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >+[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] >+[% INCLUDE 'doc-head-open.inc' %] >+ >+<title> >+ [% IF OpacAccessibility.content.single.title %] >+ [% OpacAccessibility.content.single.title | html %] >+ [% ELSE %] >+ Accessibility >+ [% END %] >+</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% BLOCK cssinclude %] >+[% END %] >+</head> >+[% INCLUDE 'bodytag.inc' bodyid='opac-accessibility' %] >+[% INCLUDE 'masthead.inc' %] >+ >+<main class="main"> >+ [% WRAPPER breadcrumbs %] >+ [% WRAPPER breadcrumb_item bc_active= 1 %] >+ <span> >+ [% IF OpacAccessibility.content.single.title %] >+ [% OpacAccessibility.content.single.title | html %] >+ [% ELSE %] >+ Accessibility >+ [% END %] >+ </span> >+ [% END %] >+ [% END #/ WRAPPER breadcrumbs %] >+ >+ <div class="container-fluid"> >+ <div class="row"> >+ [% SET div_class = 'col-10 order-first order-md-first order-lg-2' %] >+ [% IF ( OpacNav || OpacNavBottom ) %] >+ <div class="col-lg-2"> >+ <div id="navigation"> [% INCLUDE 'navigation.inc' %] </div> >+ </div> >+ [% ELSE %] >+ [% SET div_class = 'col order-first order-md-first order-lg-2' %] >+ [% END %] >+ <div class="[% div_class | html %]"> >+ [% IF ( OpacAccessibility ) %] >+ [% PROCESS koha_news_block news => OpacAccessibility %] >+ [% END %] >+ </div> >+ <!-- /.row --> >+ </div> >+ <!-- /.container-fluid --> >+ </div> >+ <!-- /.main --> >+</main> >+ >+[% INCLUDE 'opac-bottom.inc' %] >+[% BLOCK jsinclude %] >+[% END %] >diff --git a/opac/opac-accessibility.pl b/opac/opac-accessibility.pl >new file mode 100755 >index 0000000000..0a14365be1 >--- /dev/null >+++ b/opac/opac-accessibility.pl >@@ -0,0 +1,38 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Parts Copyright (C) 2013 Mark Tompsett >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+use C4::Auth qw( get_template_and_user ); >+use C4::Output qw( output_html_with_http_headers ); >+ >+my $input = CGI->new; >+ >+my ( $template, $cookie ) = get_template_and_user( >+ { >+ template_name => "opac-accessibility.tt", >+ type => "opac", >+ query => $input, >+ authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), >+ } >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >+ >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34556
:
180474
|
180492
| 180627