From c5e9833f6f631da86c1f126c5ddbc6bd80c68c1b Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Date: Thu, 29 Oct 2015 09:13:26 -0300 Subject: [PATCH] Bug 15049: Hide currency but preserv alert This follow up hides currency, but the alert pops if no currency is active. To test: 1) Apply the patch 2) Unset any active currency 3) Alert must show on Acquisitons home 4) Set a currency active, no currency display on Acqui home 5) Check that currency IS displayed on /cgi-bin/koha/admin/aqbudgets.pl or /cgi-bin/koha/admin/aqbudgetperiods.pl Amended for better translation --- .../prog/en/includes/budgets-active-currency.inc | 15 ++++++++++++++- .../intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) 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 400bbb9..fbaa7e8 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,14 @@ -[% IF ( currency ) %]<p><b>Currency = [% currency %]</b></p>[% ELSE %]<div class="dialog alert"><h3>No active currency is defined</h3><p>[% IF CAN_user_parameters_parameters_remaining_permissions %]Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.[% ELSE %]Your administrator must specify an active currency.[% END %]</p></div>[% END %] +[% IF ( currency ) %] + [% IF ( not hide ) %] + <p><b>Currency = [% currency %]</b></p> + [% END %] +[% ELSE %] + <div class="dialog alert"> + <h3>No active currency is defined</h3> + [% IF CAN_user_parameters_parameters_remaining_permissions %] + <p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p> + [% ELSE %] + <p>Your administrator must specify an active currency.</p> + [% END %] + </div> +[% 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 6b521aa..ab06267 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,7 +98,7 @@ $(document).ready(function() { [% INCLUDE 'acquisitions-toolbar.inc' %] <h1>Acquisitions</h1> - [% INCLUDE 'budgets-active-currency.inc' %] + [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %] [% UNLESS ( loop_budget ) %] [% IF ( CAN_user_acquisition_period_manage ) %] <div class="dialog alert">You must <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget</a> in Administration</div> -- 1.9.1