Bugzilla – Attachment 96772 Details for
Bug 24327
Anonymous suggestions should not be allowed if AnonymousPatron misconfigured
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24327: Add warning to the about page is AnonSugggestions but AnonymousPatron
Bug-24327-Add-warning-to-the-about-page-is-AnonSug.patch (text/plain), 8.38 KB, created by
Katrin Fischer
on 2020-01-02 22:01:14 UTC
(
hide
)
Description:
Bug 24327: Add warning to the about page is AnonSugggestions but AnonymousPatron
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-01-02 22:01:14 UTC
Size:
8.38 KB
patch
obsolete
>From dc5961920929846a1e512f27e7a0a455ccdb8cd4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 2 Jan 2020 11:26:49 +0100 >Subject: [PATCH] Bug 24327: Add warning to the about page is AnonSugggestions > but AnonymousPatron > >This patch adds a warning to the about page if AnonSuggestions is set >but AnonymousPatron. > >Test plan: >Turn on AnonSuggestions and set AnonymousPatron to 0 >=> You see a warning on the about page >Turn on AnonSuggestions and set AnonymousPatron to an invalid value >=> You see a warning on the about page >Turn off AnonSuggestions >=> No warning >Turn on AnonSuggestions and set AnonymousPatron to a valid value >=> No warning > >Signed-off-by: hc <hc@interleaf.ie> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > about.pl | 22 ++++++++++++++++------ > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 14 ++++++++++---- > 2 files changed, 26 insertions(+), 10 deletions(-) > >diff --git a/about.pl b/about.pl >index dc6380099b..18293b5db4 100755 >--- a/about.pl >+++ b/about.pl >@@ -159,13 +159,21 @@ my $warnPrefBiblioAddsAuthorities = ( $prefAutoCreateAuthorities && ( !$prefBibl > my $prefEasyAnalyticalRecords = C4::Context->preference('EasyAnalyticalRecords'); > my $prefUseControlNumber = C4::Context->preference('UseControlNumber'); > my $warnPrefEasyAnalyticalRecords = ( $prefEasyAnalyticalRecords && $prefUseControlNumber ); >-my $warnPrefAnonymousPatron = ( >+ >+my $AnonymousPatron = C4::Context->preference('AnonymousPatron'); >+my $warnPrefAnonymousPatronOPACPrivacy = ( > C4::Context->preference('OPACPrivacy') >- and not C4::Context->preference('AnonymousPatron') >+ and not $AnonymousPatron >+); >+my $warnPrefAnonymousPatronAnonSuggestions = ( >+ C4::Context->preference('AnonSuggestions') >+ and not $AnonymousPatron > ); > >-my $anonymous_patron = Koha::Patrons->find( C4::Context->preference('AnonymousPatron') ); >-my $warnPrefAnonymousPatron_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count ); >+my $anonymous_patron = Koha::Patrons->find( $AnonymousPatron ); >+my $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist = ( $AnonymousPatron && C4::Context->preference('AnonSuggestions') && not $anonymous_patron ); >+ >+my $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist = ( not $anonymous_patron and Koha::Patrons->search({ privacy => 2 })->count ); > > my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode(); > >@@ -520,8 +528,10 @@ $template->param( > prefAutoCreateAuthorities => $prefAutoCreateAuthorities, > warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities, > warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords, >- warnPrefAnonymousPatron => $warnPrefAnonymousPatron, >- warnPrefAnonymousPatron_PatronDoesNotExist => $warnPrefAnonymousPatron_PatronDoesNotExist, >+ warnPrefAnonymousPatronOPACPrivacy => $warnPrefAnonymousPatronOPACPrivacy, >+ warnPrefAnonymousPatronAnonSuggestions => $warnPrefAnonymousPatronAnonSuggestions, >+ warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist => $warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist, >+ warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist => $warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist, > errZebraConnection => $errZebraConnection, > warnIsRootUser => $warnIsRootUser, > warnNoActiveCurrency => $warnNoActiveCurrency, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 11423f2f6b..c612e90b51 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 || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps || bad_yaml_prefs || warnRelationships %] > [% 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> >@@ -246,7 +246,7 @@ > [% END %] > [% END %] > >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatronOPACPrivacy || warnPrefAnonymousPatronAnonSuggestions || warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist || warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps || bad_yaml_prefs || warnIssuingRules %] > <h2>Warnings regarding the system configuration</h2> > <table> > <caption>Preferences and parameters</caption> >@@ -256,12 +256,18 @@ > [% IF (warnPrefEasyAnalyticalRecords) %] > <tr><th scope="row"><b>Warning</b> </th><td>System preference 'EasyAnalyticalRecords' set, but UseControlNumber preference is set to 'Use'. Set it to 'Don't use' or else the 'Show analytics' links in the staff client and the OPAC will be broken.</td></tr> > [% END %] >- [% IF warnPrefAnonymousPatron %] >+ [% IF warnPrefAnonymousPatronOPACPrivacy %] > <tr><th scope="row"><b>Warning</b> </th><td>System preference 'OPACPrivacy' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly.</td></tr> > [% END %] >- [% IF warnPrefAnonymousPatron_PatronDoesNotExist %] >+ [% IF warnPrefAnonymousPatronAnonSuggestions %] >+ <tr><th scope="row"><b>Warning</b> </th><td>System preference 'AnonSuggestions' set, but AnonymousPatron preference is set to '0'. Set it to a valid borrower number if you want that this feature works correctly.</td></tr> >+ [% END %] >+ [% IF warnPrefAnonymousPatronOPACPrivacy_PatronDoesNotExist %] > <tr><th scope="row"><b>Warning</b> </th><td>Some patrons have requested a privacy on returning item but the AnonymousPatron pref is not set correctly. Set it to a valid borrower number if you want that this feature works correctly.</td></tr> > [% END %] >+ [% IF warnPrefAnonymousPatronAnonSuggestions_PatronDoesNotExist %] >+ <tr><th scope="row"><b>Warning</b> </th><td>System preference 'AnonSuggestions' set, but AnonymousPatron preference is not set correctly. Set it to a valid borrower number if you want that this feature works correctly.</td></tr> >+ [% END %] > [% IF warnNoActiveCurrency %] > <tr><th scope="row"><b>Warning</b> </th><td>No active currency is defined. Please go to <a href="/cgi-bin/koha/admin/currency.pl">Administration > Currencies and exchange rates</a> and mark one currency as active.</td></tr> > [% END %] >-- >2.11.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 24327
:
96730
|
96731
|
96746
|
96747
| 96772 |
96773