Bug 12745: (QA followup) remove misleading 'No warnings' message
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 15 Aug 2014 15:45:10 +0000 (12:45 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 15 Aug 2014 17:39:31 +0000 (14:39 -0300)
Current code displays "No warnings" even if there are actually warnings
printed.

It is not related to the bug itself, but as it was pointed out by the QAM,
I attach a followup to solve that.

Regards
To+

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index 23b3bb0..6cf42ab 100644 (file)
         </div>
 
         <div id="sysinfo">
+    [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron ||
+          warnNoActiveCurrency || QueryParserError || warnIsRootUser || 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 ||
               warnNoActiveCurrency || QueryParserError %]
-        <table>
-            <caption>Preferences and parameters</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 %]
-            [% 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 &gt; Currencies and exchange rates</a> and mark one currency as active.</td></tr>
-            [% END %]
-            [% IF QueryParserError %]
-                <tr><th scope="row"><b>Warning</b> </th><td>
-                    You have set UseQueryParser but there was a problem inititializing QueryParser.
-                [% IF QueryParserError.fallback %]
-                    The 'queryparser_config' entry is missing in your configuration file.
-                    <strong>[% QueryParserError.file %]</strong> was used instead without success.
-                [% ELSE %]
-                    The following configuration file was used without success: <strong>[% QueryParserError.file %]</strong>.
+            <h2>Warnings regarding the system configuration</h2>
+            <table>
+                <caption>Preferences and parameters</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 %]
-                    </td>
-                </tr>
-            [% END %]
-
-        </table>
+                [% 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 %]
+                [% 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 &gt; Currencies and exchange rates</a> and mark one currency as active.</td></tr>
+                [% END %]
+                [% IF QueryParserError %]
+                    <tr><th scope="row"><b>Warning</b> </th><td>
+                        You have set UseQueryParser but there was a problem inititializing QueryParser.
+                    [% IF QueryParserError.fallback %]
+                        The 'queryparser_config' entry is missing in your configuration file.
+                        <strong>[% QueryParserError.file %]</strong> was used instead without success.
+                    [% ELSE %]
+                        The following configuration file was used without success: <strong>[% QueryParserError.file %]</strong>.
+                    [% END %]
+                        </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 &lt;zebra_bib_index_mode&gt; 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 &lt;zebra_auth_index_mode&gt; 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>
-            [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
-            <tr>
-                <th scope="row"><b>Warning</b></th>
-                <td>You have set UseQueryParser but the 'queryparser_config' entry is missing in your configuration
-                    file. <strong>[% config_entry.file %]</strong> is used as a fallback.
-                </td>
-            </tr>
+            <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 &lt;zebra_bib_index_mode&gt; 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 &lt;zebra_auth_index_mode&gt; 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>
+                [% ELSIF config_entry.error == 'queryparser_entry_missing' %]
+                <tr>
+                    <th scope="row"><b>Warning</b></th>
+                    <td>You have set UseQueryParser but the 'queryparser_config' entry is missing in your configuration
+                        file. <strong>[% config_entry.file %]</strong> is used as a fallback.
+                    </td>
+                </tr>
+                [% END %]
             [% END %]
+            </table>
         [% END %]
-        </table>
-        [% ELSE %]
-            <p>No warnings</p>
-        [% END %]
+    [% ELSE %]
+        <p>No warnings.</p>
+    [% END %]
         </div>
 
         <div id="team">