[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Administration › Currencies & Exchange rates ›
[% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency %]'[% ELSE %]New currency[% END %][% END %]
-[% IF op == 'delete_' %]Confirm deletion of currency '[% searchfield %]'[% END %]
+[% IF op == 'delete_confirm' %]Confirm deletion of currency '[% currency.currency %]'[% END %]
[% IF op == 'list' %]Currencies[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script type="text/javascript">
function check_currency(val) {
if ( val == 1.0 ) {
- $("#active").removeAttr('disabled');
+ $("#active").prop('disabled', false);
$("#hint").html("");
} else {
- $("#active").removeAttr('checked');
- $("#active").attr('disabled','disabled');
+ $("#active").prop('checked', false);
+ $("#active").prop('disabled', true);
$("#hint").html(_("The active currency must have a rate of 1.0"));
}
}
check_currency( $(this).val() );
});
check_currency( $("#rate").val() );
+ $("#currency_code").on("blur",function(){
+ toUC(this);
+ });
});
//]]>
</script>
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/currency.pl">Currencies & Exchange rates</a> › [% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency %]'[% ELSE %]New currency[% END %][% END %]
-[% IF op == 'delete_confirm' %]Confirm deletion of currency '<span class="ex">[% searchfield %]</span>'
+[% IF op == 'delete_confirm' %]Confirm deletion of currency '[% '<span class="ex">' _ currency.currency _ '</span>' %]'
[% ELSIF op == 'list' %]Currencies
[% END %]
</div>
</div>
[% END %]
+[% FOR m IN messages %]
+ <div class="dialog [% m.type %]">
+ [% SWITCH m.code %]
+ [% CASE 'error_on_update' %]
+ An error occurred when updating this currency. Perhaps it already exists.
+ [% CASE 'error_on_insert' %]
+ An error occurred when adding this currency. The currency code might already exist.
+ [% CASE 'error_on_delete' %]
+ An error occurred when deleting this currency. Check the logs.
+ [% CASE 'success_on_update' %]
+ Currency updated successfully.
+ [% CASE 'success_on_insert' %]
+ Currency added successfully.
+ [% CASE 'success_on_delete' %]
+ Currency deleted successfully.
+ [% CASE %]
+ [% m.code %]
+ [% END %]
+ </div>
+[% END %]
+
+
+
[% IF op == 'add_form' %]
<form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
<input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %]
[% ELSE %]
<label for="currency_code" class="required">Currency: </label>
- <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" onblur="toUC(this);" required="required" class="required" /> <span class="required">Required</span>
+ <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
[% END %]
</li>
<li>
[% END %]
[% IF op =='delete_confirm' %]
- [% IF nb_of_orders %]
+ [% IF nb_of_orders or nb_of_vendors %]
<div class="dialog alert">
- <h3>Cannot delete currency <span class="ex">'[% currency.currency %]'</span></h3>
- <p>This currency is used by [% nb_of_orders %] orders. Deletion not possible</p>
+ <h3>Cannot delete currency '[% '<span class="ex">' _ currency.currency _ '</span>' %]'</h3>
+ <p>
+ [% IF nb_of_orders %]
+ This currency is used by [% nb_of_orders %] orders.
+ [% ELSIF nb_of_vendors %]
+ This currency is used by [% nb_of_vendors %] vendors.
+ [% END %]
+ Deletion not possible
+ </p>
<form action="/cgi-bin/koha/admin/currency.pl" method="post">
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>
[% ELSE %]
<div class="dialog alert">
- <h3>Confirm deletion of currency <span class="ex">'[% currency.currency %]'</span></h3>
+ <h3>Confirm deletion of currency '[% '<span class="ex">' _ currency.currency _ '</span>' %]'</h3>
<table>
<tr><th>Currency</th>
<td>[% currency.currency %]</td>
<td><span title="[% currency.timestamp %]">[% currency.timestamp | $KohaDates %]</span></td>
<td style="color:green;">[% IF currency.active %]✓[% END %]</td>
<td>[% IF currency.archived %]Yes[% END %]</td>
- <td>
+ <td class="actions">
<a class="btn btn-mini" href="/cgi-bin/koha/admin/currency.pl?op=add_form&currency_code=[% currency.currency %]"><i class="fa fa-pencil"></i> Edit</a>
<a class="btn btn-mini" href="/cgi-bin/koha/admin/currency.pl?op=delete_confirm&currency_code=[% currency.currency %]"><i class="fa fa-trash"></i> Delete</a>
</td>