Merge remote branch 'kc/new/for-3.4/enh_bulkmarcimport' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / currency.tmpl
index 73cefe1..a95967d 100644 (file)
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Koha &rsaquo; Administration &rsaquo; Currencies &amp; Exchange Rates &rsaquo; 
+<title>Koha &rsaquo; Administration &rsaquo; Currencies &amp; Exchange Rates &rsaquo;
 <!-- 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 -->
 <!-- TMPL_IF NAME="delete_confirmed" -->Currency Deleted<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="else" -->Currencies<!-- /TMPL_IF --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-<style type="text/css">
-       .highlight { background-color: #ffffcc;}
-</style>
-<!-- TMPL_IF NAME="add_form" -->
 <script type="text/javascript">
 //<![CDATA[
-        //
-        function isNotNull(f,noalert) {
-                if (f.value.length ==0) {
-   return false;
-                }
-                return true;
-        }
-        //
-        function toUC(f) {
-                var x=f.value.toUpperCase();
-                f.value=x;
-                return true;
-        }
-        //
-        function isNum(v,maybenull) {
-        var n = new Number(v.value);
-        if (isNaN(n)) {
-                return false;
-                }
-        if (maybenull=="0" && v.value=="") {
-                return false;
-        }
+    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";
         }
-        //
-        function isDate(f) {
-                var t = Date.parse(f.value);
-                if (isNaN(t)) {
-                        return false;
-                }
+        if (f.symbol.value.length==0) {
+            _alertString += _("- Symbol missing") + "\n";
         }
-        //
-        function Check(f) {
-                var ok=1;
-                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 (_alertString.length==0) {
-                        document.Aform.submit();
-                } else {
-                        alertString2 = "Form not submitted because of the following problem(s)\\n";
-                        alertString2 += "------------------------------------------------------------------------------------\\n\\n";
-                        alertString2 += _alertString;
-                        alert(alertString2);
-                }
+        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);
         }
-        //]]>
+    }
+
+    $(document).ready(function() {
+        new YAHOO.widget.Button("newcurrency");
+
+        // prevents users to check active with a currency != 1
+        $("#rate").keyup(function() {
+            if ( $(this).val() == 1.0 ) {
+                $("#active").removeAttr('disabled');
+            } else {
+                $("#active").removeAttr('checked');
+                $("#active").attr('disabled','disabled');
+            }
+        });
+    });
+//]]>
 </script>
-               <!-- /TMPL_IF -->
 </head>
 <body>
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="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; <!-- 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 '<span class="ex"><!-- TMPL_VAR NAME="searchfield" --></span>'<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="delete_confirmed" -->Currency Deleted<!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="else" -->Currencies<!-- /TMPL_IF --></div>
+<!-- TMPL_IF NAME="else" -->Currencies<!-- /TMPL_IF -->
+</div>
 
 <div id="doc3" class="yui-t2">
-   
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
-       
+
+<div id="bd">
+    <div id="yui-main">
+    <div class="yui-b">
+
 <!-- TMPL_IF NAME="else" -->
 <div id="toolbar">
-       <script type="text/javascript">
-       //<![CDATA[
-       // prepare DOM for YUI Toolbar
-        $(document).ready(function() {
-           yuiToolbar();
-        });
-       // YUI Toolbar Functions
-       function yuiToolbar() {
-           new YAHOO.widget.Button("newcurrency");
-       }       //]]>
-       </script>
-       <ul class="toolbar">
-       <li><a id="newcurrency" href="/cgi-bin/koha/admin/currency.pl?op=add_form">New Currency</a></li>
+    <ul class="toolbar">
+    <li><a id="newcurrency" href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form">New Currency</a></li>
 </ul></div>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="add_form" -->
 
 <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
-<input type="hidden" name="op" value="add_validate" />
-
-       <fieldset class="rows">
-       <legend><!-- TMPL_IF NAME="searchfield" -->
-               Modify currency
-       <!-- TMPL_ELSE -->
-               New currency
-       <!-- /TMPL_IF --></legend>
-       <ol>
-               <li>
-       <!-- TMPL_IF NAME="searchfield" -->
-                       <span class="label">Currency: </span>
-                       <input type="hidden" name="currency" id="currency" value="<!-- TMPL_VAR NAME="searchfield" -->" /><!-- TMPL_VAR NAME="searchfield" -->
-       <!-- TMPL_ELSE -->
-                       <label for="currency">Currency: </label>
-                       <input type="text" name="currency" id="currency" size="50" maxlength="50" onblur="toUC(this);" />
-       <!-- /TMPL_IF -->
-               </li>
+    <input type="hidden" name="op" value="save" />
+    <fieldset class="rows">
+    <legend><!-- TMPL_IF NAME="searchfield" -->
+        Modify currency
+    <!-- TMPL_ELSE -->
+        New currency
+    <!-- /TMPL_IF --></legend>
+    <ol>
         <li>
-                       <label for="rate">Rate: </label>
-                       <input type="text" name="rate" id="rate" size="10" maxlength="10" value="<!-- TMPL_VAR NAME="rate" -->" />
-               </li>
+    <!-- TMPL_IF NAME="searchfield" -->
+            <span class="label">Currency: </span>
+            <input type="hidden" name="currency" id="currency" value="<!-- TMPL_VAR NAME="searchfield" -->" /><!-- TMPL_VAR NAME="searchfield" -->
+    <!-- TMPL_ELSE -->
+            <label for="currency">Currency: </label>
+            <input type="text" name="currency" id="currency" size="50" maxlength="50" onblur="toUC(this);" />
+    <!-- /TMPL_IF -->
+        </li>
         <li>
-                       <label for="symbol">Symbol: </label>
-                       <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="<!-- TMPL_VAR NAME="symbol" -->" />
-               </li>
+            <label for="rate">Rate: </label>
+            <input type="text" name="rate" id="rate" size="10" maxlength="10" value="<!-- TMPL_VAR NAME="rate" -->" />
+        </li>
         <li>
-                       <label for="currency">Last Updated: </label><!-- TMPL_VAR NAME="timestamp" -->
-               </li>
-               </ol>
+            <label for="symbol">Symbol: </label>
+            <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="<!-- TMPL_VAR NAME="symbol" -->" />
+        </li>
+
+        <li>
+            <span class="label">Last Updated: </span><!-- TMPL_VAR NAME="timestamp" -->
+        </li>
+        <li>
+            <label for="active">Active: </label>
+            <!-- TMPL_IF NAME="active" -->
+            <input type="checkbox" id="active" name="active" value="1" checked="checked" />
+            <!-- TMPL_ELSE -->
+            <input type="checkbox" id="active" name="active" value="1" />
+            <!-- /TMPL_IF -->
+        </li>
+
+        </ol>
         </fieldset>
-               
-               <fieldset class="action"><input type="submit" value="Submit" onclick="Check(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/currency.pl">Cancel</a> </fieldset>
-        </form>
 
-<!-- /TMPL_IF -->
+    <fieldset class="action">
+        <input type="submit" value="Submit" onclick="Check(this.form)" />
+        <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
+    </fieldset>
+    </form>
 
-<!-- TMPL_IF NAME="add_validate" -->
-<h3>Data Recorded</h3>
-<form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="OK" />
-        </form>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="delete_confirm" -->
-               <!-- TMPL_IF NAME="totalgtzero" -->
-<div class="dialog message">           <h3>Cannot Delete Currencey <span class="ex">'<!-- TMPL_VAR NAME="searchfield" -->'</span></h3>
-                                               <p>This currency is used <!-- TMPL_VAR NAME="total" --> times. Deletion not possible</span>
-                               <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
-                                       <input type="submit" value="OK" class="approve" />
-                               </form></div>
-               <!-- TMPL_ELSE -->
-<div class="dialog alert">             <h3>Confirm Deletion of Currency <span class="ex">'<!-- TMPL_VAR NAME="searchfield" -->'</span></h3>
-<table>
-               <tr>
-                       <th>Currency</th>
-                       <td><!-- TMPL_VAR NAME="searchfield" --></td>
-               </tr>
-               <tr>
-                       <th>Rate</th>
-                       <td><!-- TMPL_VAR NAME="rate" --></td>
-               </tr>
-               </table>
-
-
-       <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
-                       <input type="hidden" name="op" value="delete_confirmed" />
-                       <input type="hidden" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" />
-                               <input type="submit" class="approve" value="Delete this Currency" />
-                               </form>
-                               <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
-                                       <input type="submit" class="deny" value="No, Do Not Delete" />
-                               </form></div>
-               <!-- /TMPL_IF -->
+    <!-- TMPL_IF NAME="totalgtzero" -->
+    <div class="dialog message">
+        <h3>Cannot Delete Currency <span class="ex">'<!-- TMPL_VAR NAME="searchfield" -->'</span></h3>
+        <p>This currency is used <!-- TMPL_VAR NAME="total" --> times. Deletion not possible</p>
+        <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
+            <input type="submit" value="OK" class="approve" />
+        </form>
+    </div>
+    <!-- TMPL_ELSE -->
+    <div class="dialog alert">
+        <h3>Confirm Deletion of Currency <span class="ex">'<!-- TMPL_VAR NAME="searchfield" -->'</span></h3>
+        <table>
+            <tr><th>Currency</th>
+                <td><!-- TMPL_VAR NAME="searchfield" --></td>
+            </tr>
+            <tr><th>Rate</th>
+                <td><!-- TMPL_VAR NAME="rate" --></td>
+            </tr>
+        </table>
+        <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
+            <input type="hidden" name="op" value="delete_confirmed" />
+            <input type="hidden" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" />
+            <input type="submit" class="approve" value="Delete this Currency" />
+        </form>
+        <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
+            <input type="submit" class="deny" value="No, Do Not Delete" />
+        </form>
+    </div>
+    <!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="delete_confirmed" -->
-<h3>Currency Deleted</h3>
+<div class="dialog message"><h3>Currency Deleted</h3>
 <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post">
-               <input type="submit" value="OK" />
-       </form>
+    <input type="submit" class="approve" value="OK" />
+</form></div>
 <!-- /TMPL_IF -->
 
 <!-- TMPL_IF NAME="else" -->
 
 <h2>Currencies and Exchange Rates</h2>
-       <!-- TMPL_IF NAME="searchfield" -->
-               You searched for <!-- TMPL_VAR NAME="searchfield" --></span>
-       <!-- /TMPL_IF -->       
-
-       <table>
-               <tr>
-                       <th>Currency</th>
-                       <th>Rate</th>
-                       <th>Symbol</th>
-                       <th>Last Updated</th>
-                       <th colspan="2">&nbsp;</th>
-               </tr>
-               <!-- TMPL_LOOP NAME="loop" -->
-               <!-- TMPL_IF NAME="toggle" -->
-               <tr class="highlight"><td class="highlight">
-               <!-- TMPL_ELSE -->
-               <tr><td>
-               <!-- /TMPL_IF -->
-                           <!-- TMPL_VAR NAME="currency" --></td>
-                       <td><!-- TMPL_VAR NAME="rate" --></td>
-                       <td><!-- TMPL_VAR NAME="symbol" --></td>
-                       <td><!-- TMPL_VAR NAME="timestamp" --></td>
-                       <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="currency" -->">Edit</a></td>
+
+<!-- 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 -->
+
+    <table>
+        <tr>
+            <th>Currency</th>
+            <th>Rate</th>
+            <th>Symbol</th>
+            <th>Last Updated</th>
+            <th>Active</th>
+            <th colspan="2">Actions&nbsp;</th>
+        </tr>
+        <!-- TMPL_LOOP NAME="loop" -->
+        <!-- TMPL_UNLESS NAME="__odd__" -->
+        <tr class="highlight">
+        <!-- TMPL_ELSE -->
+        <tr>
+        <!-- /TMPL_UNLESS -->
+            <td><!-- TMPL_VAR NAME="currency" --></td>
+            <td><!-- TMPL_VAR NAME="rate" --></td>
+            <td><!-- TMPL_VAR NAME="symbol" ESCAPE="HTML" --></td>
+            <td><!-- TMPL_VAR NAME="timestamp" --></td>
+            <td style="color:green;"><!-- TMPL_IF NAME="active" -->✓<!-- /TMPL_IF --></td>
+            <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="currency" -->">Edit</a></td>
             <td><a href="<!-- TMPL_VAR NAME="script_name" -->?op=delete_confirm&amp;searchfield=<!-- TMPL_VAR NAME="currency" -->">Delete</a></td>
-               </tr>
-               <!-- /TMPL_LOOP -->
-       </table>
-       
-       <!-- TMPL_IF NAME="offsetgtzero" -->
-               <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="prevpage" -->">&lt;&lt; Previous</a>
-       <!-- /TMPL_IF -->
-
-       <!-- TMPL_IF NAME="ltcount" -->
-               <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="nextpage" -->">Next &gt;&gt;</a>       
-       <!-- /TMPL_IF -->
+        </tr>
+        <!-- /TMPL_LOOP -->
+    </table>
+<br />
+
+    <!-- TMPL_IF NAME="offsetgtzero" -->
+        <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="prevpage" -->">&lt;&lt; Previous</a>
+    <!-- /TMPL_IF -->
+
+    <!-- TMPL_IF NAME="ltcount" -->
+        <a href="<!-- TMPL_VAR NAME="script_name" -->?offset=<!-- TMPL_VAR NAME="nextpage" -->">Next &gt;&gt;</a>
+    <!-- /TMPL_IF -->
 
 <!-- /TMPL_IF -->