Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
Jonathan Druart f41a30fe38 Bug 13071: format_date should not be called in currency.pl
The TT plugin is used in the template, it is useless and can cause
problems to format the dates before sending them to the template.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes the problem I was seeing before, didn't find any regressions.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Checked all three settings of dateformat. Looks fine to me.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-10-24 09:46:05 -03:00

235 lines
8.5 KiB
Text

[% USE KohaDates %]
[% USE ColumnsSettings %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Administration &rsaquo; Currencies &amp; Exchange rates &rsaquo;
[% IF ( add_form ) %][% IF ( searchfield ) %]Modify currency '[% searchfield %]'[% ELSE %]New currency[% END %][% END %]
[% IF ( delete_confirm ) %]Confirm deletion of currency '[% searchfield %]'[% END %]
[% IF ( delete_confirmed ) %]Currency deleted[% END %]
[% IF ( else ) %]Currencies[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script type="text/javascript">
//<![CDATA[
function check_currency(val) {
if ( val == 1.0 ) {
$("#active").removeAttr('disabled');
$("#hint").html("");
} else {
$("#active").removeAttr('checked');
$("#active").attr('disabled','disabled');
$("#hint").html(_("The active currency must have a rate of 1.0"));
}
}
$(document).ready(function() {
columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
var issuest = KohaTable("#currencies-table", {
"sDom": 'C<"clearfix">t',
"aaSorting": [],
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
],
"bPaginate": false,
}, columns_settings);
// prevents users to check active with a currency != 1
$("#rate").keyup(function() {
check_currency( $(this).val() );
});
check_currency( $("#rate").val() );
});
//]]>
</script>
</head>
<body id="admin_currency" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'currencies-admin-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; <a href="/cgi-bin/koha/admin/currency.pl">Currencies &amp; Exchange rates</a> &rsaquo; [% IF ( add_form ) %][% IF ( searchfield ) %]Modify currency '[% searchfield %]'[% ELSE %]New currency[% END %][% END %]
[% IF ( delete_confirm ) %]Confirm deletion of currency '<span class="ex">[% searchfield %]</span>'[% END %]
[% IF ( delete_confirmed ) %]Currency deleted[% END %]
[% IF ( else ) %]Currencies[% END %]
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF ( else ) %]
<div id="toolbar" class="btn-toolbar">
<a class="btn btn-small" id="newcurrency" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New currency</a>
</div>
[% END %]
[% IF ( add_form ) %]
<form action="[% script_name %]" name="Aform" method="post" class="validated">
<input type="hidden" name="op" value="save" />
<fieldset class="rows">
<legend>[% IF ( searchfield ) %]
Modify currency
[% ELSE %]
New currency
[% END %]</legend>
<ol>
<li>
[% IF ( searchfield ) %]
<span class="label">Currency: </span>
<input type="hidden" name="currency" id="currency" value="[% searchfield %]" />[% searchfield %]
[% ELSE %]
<label for="currency" class="required">Currency: </label>
<input type="text" name="currency" id="currency" size="50" maxlength="50" onblur="toUC(this);" required="required" class="required" /> <span class="required">Required</span>
[% END %]
</li>
<li>
<label for="rate" class="required">Rate: </label>
<input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% rate %]" required="required" class="required" /> <span class="required">Required</span>
</li>
<li>
<label for="symbol" class="required">Symbol: </label>
<input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% symbol %]" required="required" class="required" /> <span class="required">Required</span>
</li>
<li>
<label for="isocode">ISO code: </label>
<input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% isocode %]" />
</li>
<li>
<span class="label">Last updated: </span>[% timestamp | $KohaDates %]
</li>
<li>
<label for="active">Active: </label>
[% IF ( active ) %]
<input type="checkbox" id="active" name="active" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" id="active" name="active" value="1" />
[% END %]
<span id="hint" class="hint"></span>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit" />
<a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
</fieldset>
</form>
[% END %]
[% IF ( delete_confirm ) %]
[% IF ( totalgtzero ) %]
<div class="dialog message">
<h3>Cannot delete currency <span class="ex">'[% searchfield %]'</span></h3>
<p>This currency is used [% total %] times. Deletion not possible</p>
<form action="[% script_name %]" method="post">
<input type="submit" value="OK" class="approve" />
</form>
</div>
[% ELSE %]
<div class="dialog alert">
<h3>Confirm deletion of currency <span class="ex">'[% searchfield %]'</span></h3>
<table>
<tr><th>Currency</th>
<td>[% searchfield %]</td>
</tr>
<tr><th>Rate</th>
<td>[% rate %]</td>
</tr>
</table>
<form action="[% script_name %]" method="post">
<input type="hidden" name="op" value="delete_confirmed" />
<input type="hidden" name="searchfield" value="[% searchfield %]" />
<input type="submit" class="approve" value="Delete this Currency" />
</form>
<form action="[% script_name %]" method="post">
<input type="submit" class="deny" value="No, Do Not Delete" />
</form>
</div>
[% END %]
[% END %]
[% IF ( delete_confirmed ) %]
<div class="dialog message"><h3>Currency deleted</h3>
<form action="[% script_name %]" method="post">
<input type="submit" class="approve" value="OK" />
</form></div>
[% END %]
[% IF ( else ) %]
<h2>Currencies and exchange rates</h2>
[% IF ( loop ) %][% UNLESS ( activecurrency ) %]<div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>[% END %][% END %]
[% IF ( searchfield ) %]
You searched for [% searchfield %]</span>
[% END %]
<table id='currencies-table'>
<thead>
<tr>
<th>Currency</th>
<th>Rate</th>
<th>Symbol</th>
<th>ISO code</th>
<th class="title-string">Last updated</th>
<th>Active</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH loo IN loop %]
<tr>
<td>[% loo.currency %]</td>
<td>[% loo.rate %]</td>
<td>[% loo.symbol |html %]</td>
<td>[% loo.isocode |html %]</td>
<td><span title="[% loo.timestamp %]">[% loo.timestamp | $KohaDates %]</span></td>
<td style="color:green;">[% IF ( loo.active ) %]✓[% END %]</td>
<td>
<a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.currency %]">Edit</a>
|
<a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.currency %]">Delete</a>
</td>
</tr>
[% END %]
</tbody>
</table>
<br />
[% IF ( offsetgtzero ) %]
<a href="[% script_name %]?offset=[% prevpage %]">&lt;&lt; Previous</a>
[% END %]
[% IF ( ltcount ) %]
<a href="[% script_name %]?offset=[% nextpage %]">Next &gt;&gt;</a>
[% END %]
<div class="hint">
<p>
When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
</p>
<p>
Some examples of compatible price fields include "$9.99", "9.99 USD", "$9.99 USD", "9.99 USD (10.00 CAN)", "$9.99 USD (paperback)".
These examples assume USD is the active currency.
</p>
</div>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'admin-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]