Bugzilla – Attachment 107437 Details for
Bug 25826
Hiding biblionumber in the frameworks breaks links in result list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25826: Add a warning to the about page
Bug-25826-Add-a-warning-to-the-about-page.patch (text/plain), 6.66 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-07-27 15:26:10 UTC
(
hide
)
Description:
Bug 25826: Add a warning to the about page
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-07-27 15:26:10 UTC
Size:
6.66 KB
patch
obsolete
>From 9f0becb4e96255ee53ce40eb928c2bfb6bf2e1f9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 22 Jul 2020 16:43:38 +0200 >Subject: [PATCH] Bug 25826: Add a warning to the about page > >This patch adds a warning to the about page if the biblionumber field is >hidden at the OPAC or staff interface. > >Test plan: >Hide the biblionumber to some framework >Confirm that there is a warning on the about page > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > about.pl | 28 +++++++++++++++++++ > .../intranet-tmpl/prog/en/modules/about.tt | 16 +++++++++-- > 2 files changed, 42 insertions(+), 2 deletions(-) > >diff --git a/about.pl b/about.pl >index b44e5313bd..029bd94833 100755 >--- a/about.pl >+++ b/about.pl >@@ -43,6 +43,7 @@ use C4::Installer::PerlModules; > use Koha; > use Koha::DateUtils qw(dt_from_string output_pref); > use Koha::Acquisition::Currencies; >+use Koha::BiblioFrameworks; > use Koha::Patron::Categories; > use Koha::Patrons; > use Koha::Caches; >@@ -50,6 +51,7 @@ use Koha::Config::SysPrefs; > use Koha::Illrequest::Config; > use Koha::SearchEngine::Elasticsearch; > use Koha::Logger; >+use Koha::Filter::MARC::ViewPolicy; > > use C4::Members::Statistics; > >@@ -525,6 +527,32 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; > and not C4::Context->config('bcrypt_settings'); > } > >+{ >+ my @frameworkcodes = Koha::BiblioFrameworks->search->get_column('frameworkcode'); >+ my @hidden_biblionumbers; >+ push @frameworkcodes, ""; # it's not in the biblio_frameworks table! >+ for my $frameworkcode ( @frameworkcodes ) { >+ my $shouldhidemarc_opac = Koha::Filter::MARC::ViewPolicy->should_hide_marc( >+ { >+ frameworkcode => $frameworkcode, >+ interface => "opac" >+ } >+ ); >+ push @hidden_biblionumbers, { frameworkcode => $frameworkcode, interface => 'opac' } >+ if $shouldhidemarc_opac->{biblionumber}; >+ >+ my $shouldhidemarc_intranet = Koha::Filter::MARC::ViewPolicy->should_hide_marc( >+ { >+ frameworkcode => $frameworkcode, >+ interface => "intranet" >+ } >+ ); >+ push @hidden_biblionumbers, { frameworkcode => $frameworkcode, interface => 'intranet' } >+ if $shouldhidemarc_intranet->{biblionumber}; >+ } >+ $template->param( warnHiddenBiblionumbers => \@hidden_biblionumbers ); >+} >+ > my %versions = C4::Context::get_versions(); > > $template->param( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 70ed9b183f..e4402d30b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -184,7 +184,7 @@ > </div> > > <div id="sysinfo"> >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships || log4perl_errors || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %] > [% IF (warnIsRootUser) %] > <h2>Warning regarding current user</h2> > <p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p> >@@ -259,7 +259,7 @@ > [% END %] > [% END %] > >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules || config_bcrypt_settings_no_set || warnHiddenBiblionumbers.size %] > <h2>Warnings regarding the system configuration</h2> > <table> > <caption>Preferences and parameters</caption> >@@ -340,6 +340,18 @@ > System preference 'Pseudonymization' is set, but there is not 'bcrypt_settings' entry defined in the $KOHA_CONF file. > </td></tr> > [% END %] >+ [% IF config_bcrypt_settings_no_set %] >+ <tr><th scope="row"><b>Warning</b> </th><td> >+ System preference 'Pseudonymization' is set, but there is not 'bcrypt_settings' entry defined in the $KOHA_CONF file. >+ </td></tr> >+ [% END %] >+ [% IF warnHiddenBiblionumbers.size %] >+ <tr><th scope="row"><b>Warning</b> </th><td> >+ [% FOR w IN warnHiddenBiblionumbers %] >+ Biblio framework "[% w.frameworkcode %]" has the biblionumber field hidden at the interface [% w.interface %]<br/> >+ [% END %] >+ </td></tr> >+ [% END %] > </table> > [% END %] > >-- >2.27.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 25826
:
107179
|
107437
|
107438
|
107885
|
107886
|
107887
|
107982
|
114868
|
114869
|
114870
|
114871