Bug 11772: Show warning on About page:System information if no active currency is...
authorMarc Véron <veron@veron.ch>
Sat, 15 Feb 2014 15:19:04 +0000 (16:19 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 18 Feb 2014 20:54:23 +0000 (20:54 +0000)
This patch displays a warning on the About page when no active currency
is defined.

Test plan:
1)
Make sure that no currency is defined as active
(Home › Administration › Currencies & Exchange rates › Currencies)
2)
Go to Home › About Koha > System information
Result: No warning issued.
3)
Apply patch and reload About page
Result: Warning issued.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index 6b44ea8..ba77ca6 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -77,6 +77,8 @@ my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode();
 
 my $warnIsRootUser   = (! $loggedinuser);
 
+my $warnNoActiveCurrency = (! defined C4::Budgets->GetCurrency());
+
 $template->param(
     kohaVersion   => $kohaVersion,
     osVersion     => $osVersion,
@@ -93,6 +95,7 @@ $template->param(
     warnPrefAnonymousPatron => $warnPrefAnonymousPatron,
     errZebraConnection => $errZebraConnection,
     warnIsRootUser => $warnIsRootUser,
+    warnNoActiveCurrency => $warnNoActiveCurrency,
 );
 
 my @components = ();
index 21db9d3..7662ce3 100644 (file)
             <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 %]
+        [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnNoActiveCurrency %]
         <table>
-            <caption>Preferences</caption>
+            <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 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 Administration:Currencies & Exchange rates and mark one currency as active.</td></tr>
+            [% END %]
         </table>
         [% ELSE %]
             <p>No warnings</p>