From 6e9948e328c2c6234077d2788062a53887d44961 Mon Sep 17 00:00:00 2001 From: Jonathan Druart <jonathan.druart@biblibre.com> Date: Fri, 24 Jan 2014 12:33:15 +0100 Subject: [PATCH] Bug 11596: Fix ergonomic issue If you had a warning on preference, the warning on the config file did not appear. To reproduce, without this patch: - switch on OPACPrivacy and set AnonymousPatron to 0. - comment at least 1 zebra_*_index_mode in your config file. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> --- about.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 59 +++++++++++++----------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/about.pl b/about.pl index e23e945..c91dd0b 100755 --- a/about.pl +++ b/about.pl @@ -107,7 +107,7 @@ $template->param( warnPrefAnonymousPatron => $warnPrefAnonymousPatron, errZebraConnection => $errZebraConnection, warnIsRootUser => $warnIsRootUser, - xml_config_warnings => \@xml_config_warnings + xml_config_warnings => \@xml_config_warnings ); my @components = (); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index 847047b..2129425 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -98,38 +98,41 @@ </div> <div id="sysinfo"> - [% IF (warnIsRootUser) %] + [% IF warnIsRootUser || warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || xml_config_warnings.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> <p>Please log in instead with a regular staff account. To create a staff account, create a library, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p> - [% END %] - <h2>Warnings regarding the system configuration</h2> - [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron %] - <table> - <caption>Preferences</caption> - [% IF (warnPrefBiblioAddsAuthorities) %] - <tr><th scope="row"><b>Warning</b> </th><td>System preference 'AutoCreateAuthorities' set, but needs 'BiblioAddsAuthorities' set as well.</td></tr> - [% END %] - [% 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 %] - <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 %] - </table> - [% ELSIF xml_config_warnings.size %] - <table> - <caption>XML configuration file</caption> - [% FOREACH config_entry IN xml_config_warnings %] - [% IF config_entry.error == 'zebra_bib_index_mode_warn' %] - <tr><th scope="row"><b>Warning</b> </th><td>The <zebra_bib_index_mode> entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>grs1</strong> but this could change in the future.</td></tr> - [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %] - <tr><th scope="row"><b>Warning</b> </th><td>The <zebra_auth_index_mode> entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>dom</strong> but this could change in the future.</td></tr> - [% END %] - [% END %] - </table> + [% END %] + [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron %] + <h2>Warnings regarding the system configuration</h2> + <table> + <caption>Preferences</caption> + [% IF (warnPrefBiblioAddsAuthorities) %] + <tr><th scope="row"><b>Warning</b> </th><td>System preference 'AutoCreateAuthorities' set, but needs 'BiblioAddsAuthorities' set as well.</td></tr> + [% END %] + [% 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 %] + <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 %] + </table> + [% END %] + [% IF xml_config_warnings.size %] + <table> + <caption>XML configuration file</caption> + [% FOREACH config_entry IN xml_config_warnings %] + [% IF config_entry.error == 'zebra_bib_index_mode_warn' %] + <tr><th scope="row"><b>Warning</b> </th><td>The <zebra_bib_index_mode> entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>grs1</strong> but this could change in the future.</td></tr> + [% ELSIF config_entry.error == 'zebra_auth_index_mode_warn' %] + <tr><th scope="row"><b>Warning</b> </th><td>The <zebra_auth_index_mode> entry is missing in your configuration file. It should be set to <strong>dom</strong> or <strong>grs1</strong>. It will default to <strong>dom</strong> but this could change in the future.</td></tr> + [% END %] + [% END %] + </table> + [% END %] [% ELSE %] - <p>No warnings</p> + <p>All looks good.</p> [% END %] </div> -- 1.8.3.2