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