Fix for Bug 4913 - Budget pages should show currency name instead of symbol github/bug_4913 origin/new/bug_4913
authorOwen Leonard <oleonard@myacpl.org>
Sat, 13 Nov 2010 03:53:23 +0000 (22:53 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Mon, 15 Nov 2010 02:13:55 +0000 (15:13 +1300)
This patch adds a new include file to handle the display of the active
currency name and a warning if no currency is active.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
admin/aqbudgetperiods.pl
admin/aqbudgets.pl
admin/aqplan.pl
koha-tmpl/intranet-tmpl/prog/en/includes/budgets-active-currency.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl

index 62383f1..39f3cd0 100755 (executable)
@@ -82,7 +82,9 @@ my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user(
 
 
 my $cur = GetCurrency();
-$template->param( cur => $cur->{symbol} );
+$template->param( symbol => $cur->{symbol},
+                  currency => $cur->{currency}
+               );
 my $cur_format = C4::Context->preference("CurrencyFormat");
 my $num;
 
index 34a4021..d266727 100755 (executable)
@@ -52,7 +52,9 @@ my ($template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
 );
 
 my $cur = GetCurrency();
-$template->param( cur => $cur->{symbol} );
+$template->param( symbol => $cur->{symbol},
+                  currency => $cur->{currency}
+               );
 
 my $op = $input->param('op');
 
index 8efa427..8b68d51 100755 (executable)
@@ -60,7 +60,9 @@ my $budget_period_id = $input->param('budget_period_id');
 my $period = GetBudgetPeriod($budget_period_id);
 my $count  = GetPeriodsCount();
 my $cur    = GetCurrency;
-
+$template->param( symbol => $cur->{symbol},
+                  currency => $cur->{currency}
+               );
 $template->param( period_button_only => 1 ) if $count == 0;
 
 
@@ -450,7 +452,6 @@ $template->param(
     show_actual               => $show_actual,
     show_percent              => $show_percent,
     show_mine                 => $show_mine,
-    cur                       => $cur->{symbol},
     cur_format                => $cur_format,
     CGIextChoice              => $CGIextChoice,
     CGIsepChoice              => $CGIsepChoice,
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
new file mode 100644 (file)
index 0000000..a4571f9
--- /dev/null
@@ -0,0 +1 @@
+<!-- TMPL_IF name="currency" --><p><b>Currency = <!-- TMPL_VAR NAME="currency" --></b></p><!-- TMPL_ELSE --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div><!-- /TMPL_IF -->
\ No newline at end of file
index 78c51b8..523fd13 100644 (file)
 <!--  DEFAULT  display budget periods list -->
 <!-- TMPL_IF name="else" -->
     <h2>Budgets administration</h2>
-    <!-- TMPL_IF name="cur" --><p><b>Currency = <!-- TMPL_VAR name="cur" --></b></p><!-- TMPL_ELSE --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div><!-- /TMPL_IF -->
+
+    <!-- TMPL_INCLUDE NAME="budgets-active-currency.inc" -->
+
     <table id="periodsh">
     <thead>
            <tr>
index 5e0db00..80d9156 100644 (file)
 <!-- TMPL_UNLESS name="delete_confirm" --><!-- TMPL_INCLUDE NAME="budgets-admin-toolbar.inc" --><!-- /TMPL_UNLESS -->
 <!-- TMPL_IF name="else" -->
 
-<!-- TMPL_UNLESS NAME="cur" --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div><!-- /TMPL_UNLESS -->
-
 <h1>Funds for '<!-- TMPL_VAR name="budget_period_description" -->'</h1>
+
+<!-- TMPL_INCLUDE NAME="budgets-active-currency.inc" -->
+
 <table id="budgeth">
     <thead>
         <tr>
     </tbody>
 </table>
 
-<!-- TMPL_IF name="cur" --><p><b>Currency = <!-- TMPL_VAR NAME="cur" --> <!-- TMPL_VAR NAME="cur_format" --></b></p><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="pagination_bar" --><div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div><!-- /TMPL_IF -->
 <!-- /TMPL_IF --> <!-- else -->
 
index 170c7a0..2192178 100644 (file)
@@ -139,7 +139,7 @@ YAHOO.util.Event.onAvailable("popmenu", function () {
 
     <!-- TMPL_IF NAME="budget_lines" -->
 
-    <!-- TMPL_IF name="cur" --><p><b>Currency = <!-- TMPL_VAR name="cur" --></b></p><!-- TMPL_ELSE --><div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div><!-- /TMPL_IF -->
+    <!-- TMPL_INCLUDE NAME="budgets-active-currency.inc" -->
 
     <table id="plan" width="100%">
     <thead>