Bug 6739: (follow-up) yet more fixes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / currency.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Currencies &amp; Exchange rates &rsaquo;
3 [% IF ( add_form ) %][% IF ( searchfield ) %]Modify currency '[% searchfield %]'[% ELSE %]New currency[% END %][% END %]
4 [% IF ( delete_confirm ) %]Confirm deletion of currency '[% searchfield %]'[% END %]
5 [% IF ( delete_confirmed ) %]Currency deleted[% END %]
6 [% IF ( else ) %]Currencies[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <script type="text/javascript">
9 //<![CDATA[
10
11     function check_currency(val) {
12         if ( val == 1.0 ) {
13             $("#active").removeAttr('disabled');
14             $("#hint").html("");
15         } else {
16             $("#active").removeAttr('checked');
17             $("#active").attr('disabled','disabled');
18             $("#hint").html(_("The active currency must have a rate of 1.0"));
19         }
20     }
21
22     $(document).ready(function() {
23         // prevents users to check active with a currency != 1
24         $("#rate").keyup(function() {
25             check_currency( $(this).val() );
26         });
27         check_currency( $("#rate").val() );
28     });
29 //]]>
30 </script>
31 </head>
32 <body id="admin_currency" class="admin">
33 [% INCLUDE 'header.inc' %]
34 [% INCLUDE 'currencies-admin-search.inc' %]
35
36
37
38 <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 %]
39 [% IF ( delete_confirm ) %]Confirm deletion of currency '<span class="ex">[% searchfield %]</span>'[% END %]
40 [% IF ( delete_confirmed ) %]Currency deleted[% END %]
41 [% IF ( else ) %]Currencies[% END %]
42 </div>
43
44 <div id="doc3" class="yui-t2">
45
46 <div id="bd">
47     <div id="yui-main">
48     <div class="yui-b">
49 [% IF ( else ) %]
50 <div id="toolbar" class="btn-toolbar">
51     <a class="btn btn-small" id="newcurrency" href="[% script_name %]?op=add_form"><i class="icon-plus"></i> New currency</a>
52 </div>
53 [% END %]
54
55 [% IF ( add_form ) %]
56
57 <form action="[% script_name %]" name="Aform" method="post" class="validated">
58     <input type="hidden" name="op" value="save" />
59     <fieldset class="rows">
60     <legend>[% IF ( searchfield ) %]
61         Modify currency
62     [% ELSE %]
63         New currency
64     [% END %]</legend>
65     <ol>
66         <li>
67     [% IF ( searchfield ) %]
68             <span class="label">Currency: </span>
69             <input type="hidden" name="currency" id="currency" value="[% searchfield %]" />[% searchfield %]
70     [% ELSE %]
71             <label for="currency" class="required">Currency: </label>
72             <input type="text" name="currency" id="currency" size="50" maxlength="50" onblur="toUC(this);" required="required" class="required" /> <span class="required">Required</span>
73     [% END %]
74         </li>
75         <li>
76             <label for="rate" class="required">Rate: </label>
77             <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% rate %]" required="required" class="required" /> <span class="required">Required</span>
78         </li>
79         <li>
80             <label for="symbol" class="required">Symbol: </label>
81             <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% symbol %]" required="required" class="required" /> <span class="required">Required</span>
82         </li>
83         <li>
84             <label for="isocode">ISO code: </label>
85             <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% isocode %]" />
86         </li>
87         <li>
88             <span class="label">Last updated: </span>[% timestamp %]
89         </li>
90         <li>
91             <label for="active">Active: </label>
92             [% IF ( active ) %]
93             <input type="checkbox" id="active" name="active" value="1" checked="checked" />
94             [% ELSE %]
95             <input type="checkbox" id="active" name="active" value="1" />
96             [% END %]
97             <span id="hint" class="hint"></span>
98         </li>
99
100         </ol>
101         </fieldset>
102
103     <fieldset class="action">
104         <input type="submit" value="Submit" />
105         <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
106     </fieldset>
107     </form>
108
109 [% END %]
110
111 [% IF ( delete_confirm ) %]
112     [% IF ( totalgtzero ) %]
113     <div class="dialog message">
114         <h3>Cannot delete currency <span class="ex">'[% searchfield %]'</span></h3>
115         <p>This currency is used [% total %] times. Deletion not possible</p>
116         <form action="[% script_name %]" method="post">
117             <input type="submit" value="OK" class="approve" />
118         </form>
119     </div>
120     [% ELSE %]
121     <div class="dialog alert">
122         <h3>Confirm deletion of currency <span class="ex">'[% searchfield %]'</span></h3>
123         <table>
124             <tr><th>Currency</th>
125                 <td>[% searchfield %]</td>
126             </tr>
127             <tr><th>Rate</th>
128                 <td>[% rate %]</td>
129             </tr>
130         </table>
131         <form action="[% script_name %]" method="post">
132             <input type="hidden" name="op" value="delete_confirmed" />
133             <input type="hidden" name="searchfield" value="[% searchfield %]" />
134             <input type="submit" class="approve" value="Delete this Currency" />
135         </form>
136         <form action="[% script_name %]" method="post">
137             <input type="submit" class="deny" value="No, Do Not Delete" />
138         </form>
139     </div>
140     [% END %]
141 [% END %]
142
143 [% IF ( delete_confirmed ) %]
144 <div class="dialog message"><h3>Currency deleted</h3>
145 <form action="[% script_name %]" method="post">
146     <input type="submit" class="approve" value="OK" />
147 </form></div>
148 [% END %]
149
150 [% IF ( else ) %]
151
152 <h2>Currencies and exchange rates</h2>
153
154 [% 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 %]
155
156
157     [% IF ( searchfield ) %]
158         You searched for [% searchfield %]</span>
159     [% END %]
160
161     <table>
162         <tr>
163             <th>Currency</th>
164             <th>Rate</th>
165             <th>Symbol</th>
166             <th>ISO code</th>
167             <th>Last updated</th>
168             <th>Active</th>
169             <th colspan="2">Actions&nbsp;</th>
170         </tr>
171         [% FOREACH loo IN loop %]
172         [% UNLESS ( loop.odd ) %]
173         <tr class="highlight">
174         [% ELSE %]
175         <tr>
176         [% END %]
177             <td>[% loo.currency %]</td>
178             <td>[% loo.rate %]</td>
179             <td>[% loo.symbol |html %]</td>
180             <td>[% loo.isocode |html %]</td>
181             <td>[% loo.timestamp %]</td>
182             <td style="color:green;">[% IF ( loo.active ) %]✓[% END %]</td>
183             <td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.currency %]">Edit</a></td>
184             <td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.currency %]">Delete</a></td>
185         </tr>
186         [% END %]
187     </table>
188 <br />
189
190     [% IF ( offsetgtzero ) %]
191         <a href="[% script_name %]?offset=[% prevpage %]">&lt;&lt; Previous</a>
192     [% END %]
193
194     [% IF ( ltcount ) %]
195         <a href="[% script_name %]?offset=[% nextpage %]">Next &gt;&gt;</a>
196     [% END %]
197
198     <div class="hint">
199         <p>
200             When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
201         </p>
202         <p>
203             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)".
204             These examples assume USD is the active currency.
205         </p>
206     </div>
207
208 [% END %]
209
210 </div>
211 </div>
212 <div class="yui-b">
213 [% INCLUDE 'admin-menu.inc' %]
214 </div>
215 </div>
216 [% INCLUDE 'intranet-bottom.inc' %]