From 9d2e268739f8fc0bd373cc6312dfdd14a713434c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Thu, 22 Oct 2015 11:44:23 +0200 Subject: [PATCH] Bug 15049: Add warning about "No active currency" to Acquisitions start page If no active currency is defined, Acquisitions does not work properly and software can occur while receiving. This patch adds the warning message about missing active currency to Home > Acquisitions To test: - Apply patch - Go to Home > Administration > Currencies & Exchange Rates > Currencies - Make sure that no active currency is set - Go to Home > Acquisitions - Verify that a warning displays: - If user has at least permission for parameters_remaining_perissions, the warning should display a link to Currencies and exchange rates (currency.pl) - If the user has no permission to edit the Currencies and exchange rates, no link is displayed. - Set an active currency - Veryfy that the warning no longer displays (Amended to remove superfluous line / mv) Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No errors Signed-off-by: JM Broust Signed-off-by: Jonathan Druart Signed-off-by: Brendan A Gallagher --- acqui/acqui-home.pl | 7 +++++++ .../prog/en/includes/budgets-active-currency.inc | 2 +- .../intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl index 58ba68e3a2..393a13152b 100755 --- a/acqui/acqui-home.pl +++ b/acqui/acqui-home.pl @@ -129,4 +129,11 @@ $template->param( suggestions_count => $suggestions_count, ); +my $cur = GetCurrency(); +if ( $cur ) { + $template->param( + currency => $cur->{currency}, + ); +} + output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc index b13fb340bd..400bbb9255 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc @@ -1 +1 @@ -[% IF ( currency ) %]

Currency = [% currency %]

[% ELSE %]

No active currency is defined

Please specify an active currency.

[% END %] \ No newline at end of file +[% IF ( currency ) %]

Currency = [% currency %]

[% ELSE %]

No active currency is defined

[% IF CAN_user_parameters_parameters_remaining_permissions %]Please specify an active currency.[% ELSE %]Your administrator must specify an active currency.[% END %]

[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt index a83fe0bcf2..6b521aa763 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -98,6 +98,7 @@ $(document).ready(function() { [% INCLUDE 'acquisitions-toolbar.inc' %]

Acquisitions

+ [% INCLUDE 'budgets-active-currency.inc' %] [% UNLESS ( loop_budget ) %] [% IF ( CAN_user_acquisition_period_manage ) %]
You must define a budget in Administration
-- 2.39.5