From 2e634b2b5e255017777066199d5bab8ce4a740fc Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 29 Jan 2010 10:50:24 -0500 Subject: [PATCH] Fix for Bug 3970, Warn user when there is no active currency - Adds warning to budget admin pages - Adds warning to currency admin page --- admin/currency.pl | 9 +++++++-- .../prog/en/modules/admin/aqbudgetperiods.tmpl | 2 +- .../prog/en/modules/admin/aqbudgets.tmpl | 8 +++++--- .../prog/en/modules/admin/aqplan.tmpl | 2 +- .../prog/en/modules/admin/currency.tmpl | 16 ++++++++++------ 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/admin/currency.pl b/admin/currency.pl index cb869e2..43e08ae 100755 --- a/admin/currency.pl +++ b/admin/currency.pl @@ -164,8 +164,10 @@ if ($op eq 'add_form') { my $results = StringSearch($searchfield); my $count = scalar(@$results); my @loop; + my $activecurrency; for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){ - warn Data::Dumper::Dumper($results->[$i]); + # warn Data::Dumper::Dumper($results->[$i]); + if($results->[$i]{'active'} == 1){ $activecurrency = 1; } push @loop, { currency => $results->[$i]{'currency'}, rate => $results->[$i]{'rate'}, @@ -174,7 +176,10 @@ if ($op eq 'add_form') { active => $results->[$i]{'active'}, }; } - $template->param(loop => \@loop); + $template->param( + loop => \@loop, + activecurrency => $activecurrency, + ); if ($offset>0) { $template->param(offsetgtzero => 1, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl index 41af729..c283dfc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl @@ -252,7 +252,7 @@

Root budgets administration

-

Currency =

+

Currency =

No active currency is defined

Please specify an active currency.

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl index de3d738..96b79a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl @@ -96,7 +96,7 @@ $(document).ready(function() { var tooltipcontent = $(".tooltipcontent"); tooltipcontent.hide(); - + $(".tooltiped td").each(function (){ contentelem = $(this).parent().children().filter(".tooltipcontent"); if(contentelem.html() != ""){ @@ -104,7 +104,7 @@ content: contentelem.html(), show: "mouseover", hide: "mouseout", - style: { + style: { name: "light", tip: "bottomLeft", border: { @@ -140,7 +140,7 @@ -
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl index 4e2702e..2823518 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl @@ -155,7 +155,7 @@ Budget planning -

Currency =

+

Currency =

No active currency is defined

Please specify an active currency.

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl index 49bf9c4..cae2b52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl @@ -1,5 +1,5 @@ -Koha › Administration › Currencies & Exchange Rates › +<title>Koha › Administration › Currencies & Exchange Rates › <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="searchfield" -->Modify Currency '<!-- TMPL_VAR NAME="searchfield" -->'<!-- TMPL_ELSE -->New Currency<!-- /TMPL_IF --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="add_validate" -->Data Recorded<!-- /TMPL_IF --> <!-- TMPL_IF NAME="delete_confirm" -->Confirm Deletion of Currency '<!-- TMPL_VAR NAME="searchfield" -->'<!-- /TMPL_IF --> @@ -69,7 +69,7 @@ <div id="bd"> <div id="yui-main"> <div class="yui-b"> - + <!-- TMPL_IF NAME="else" --> <div id="toolbar"> <ul class="toolbar"> @@ -117,7 +117,7 @@ </ol> </fieldset> - + <fieldset class="action"> <input type="submit" value="Submit" onclick="Check(this.form)" /> <input type="button" onclick="window.location.href='<!-- TMPL_VAR NAME="script_name" -->'" value="Cancel" /> @@ -177,9 +177,13 @@ <!-- TMPL_IF NAME="else" --> <h2>Currencies and Exchange Rates</h2> + +<!-- TMPL_IF NAME="loop" --><!-- TMPL_UNLESS NAME="activecurrency" --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div><!-- /TMPL_UNLESS --><!-- /TMPL_IF --> + + <!-- TMPL_IF NAME="searchfield" --> You searched for <!-- TMPL_VAR NAME="searchfield" --></span> - <!-- /TMPL_IF --> + <!-- /TMPL_IF --> <table> <tr> @@ -207,13 +211,13 @@ <!-- /TMPL_LOOP --> </table> <br> - + <!-- TMPL_IF NAME="offsetgtzero" --> <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="prevpage" -->"><< Previous</a> <!-- /TMPL_IF --> <!-- TMPL_IF NAME="ltcount" --> - <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="nextpage" -->">Next >></a> + <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="nextpage" -->">Next >></a> <!-- /TMPL_IF --> <!-- /TMPL_IF --> -- 1.6.3.3