Bug 11772: Show warning on About page:System information if no active currency is defined

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>
This commit is contained in:
Marc Véron 2014-02-15 16:19:04 +01:00 committed by Galen Charlton
parent 1aeb1d7e0b
commit 9e01b7c1d6
2 changed files with 8 additions and 2 deletions

View file

@ -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 = ();

View file

@ -104,9 +104,9 @@
<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 %]
@ -116,6 +116,9 @@
[% 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>