Bug 9593: improve parsing of prices from staged files
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / currency.tt
index 4834ff3..fd40142 100644 (file)
@@ -7,32 +7,6 @@
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript">
 //<![CDATA[
-    function toUC(f) {
-        var x=f.value.toUpperCase();
-        f.value=x;
-        return true;
-    }
-    function Check(f) {
-        var _alertString="";
-        var alertString2;
-        if (f.currency.value.length==0) {
-            _alertString += _("- Currency name missing") + "\n";
-        }
-        if (f.rate.value.length==0) {
-            _alertString += _("- Rate missing") + "\n";
-        }
-        if (f.symbol.value.length==0) {
-            _alertString += _("- Symbol missing") + "\n";
-        }
-        if (_alertString.length==0) {
-            document.Aform.submit();
-        } else {
-            alertString2 = _("Form not submitted because of the following problem(s)") + "\n";
-            alertString2 += "------------------------------------------------------------------------------------\n";
-            alertString2 += _alertString;
-            alert(alertString2);
-        }
-    }
 
     function check_currency(val) {
         if ( val == 1.0 ) {
@@ -46,8 +20,6 @@
     }
 
     $(document).ready(function() {
-        new YAHOO.widget.Button("newcurrency");
-
         // prevents users to check active with a currency != 1
         $("#rate").keyup(function() {
             check_currency( $(this).val() );
 <div id="bd">
     <div id="yui-main">
     <div class="yui-b">
-
+<div class="message dialog"><p style="text-align:justify" >The active currency priority will be picked during the importation process from a staged file whenever the price data is provided under different currencies.<br/>
+The symbol may be the pure currency sign or a string in which it's included ( like '$US' ).</p></div>
 [% IF ( else ) %]
-<div id="toolbar">
-    <ul class="toolbar">
-    <li><a id="newcurrency" href="[% script_name %]?op=add_form">New currency</a></li>
-</ul></div>
+<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">
+<form action="[% script_name %]" name="Aform" method="post" class="validated">
     <input type="hidden" name="op" value="save" />
     <fieldset class="rows">
     <legend>[% IF ( searchfield ) %]
             <span class="label">Currency: </span>
             <input type="hidden" name="currency" id="currency" value="[% searchfield %]" />[% searchfield %]
     [% ELSE %]
-            <label for="currency">Currency: </label>
-            <input type="text" name="currency" id="currency" size="50" maxlength="50" onblur="toUC(this);" />
+            <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">Rate: </label>
-            <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% rate %]" />
+            <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">Symbol: </label>
-            <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% symbol %]" />
+            <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" class="required">Iso code: </label>
+            <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% isocode %]" required="required"  class="required" /> <span class="required">Required</span>
         </li>
-
         <li>
             <span class="label">Last updated: </span>[% timestamp %]
         </li>
         </fieldset>
 
     <fieldset class="action">
-        <input type="submit" value="Submit" onclick="Check(this.form); return false;" />
+        <input type="submit" value="Submit" />
         <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
     </fieldset>
     </form>
             <th>Currency</th>
             <th>Rate</th>
             <th>Symbol</th>
+            <th>Iso code</th>
             <th>Last updated</th>
             <th>Active</th>
             <th colspan="2">Actions&nbsp;</th>
             <td>[% loo.currency %]</td>
             <td>[% loo.rate %]</td>
             <td>[% loo.symbol |html %]</td>
+            <td>[% loo.isocode |html %]</td>
             <td>[% loo.timestamp %]</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></td>