Bug 14100: Generic solution for language overlay - Item types
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
1 [% USE AuthorisedValues %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Administration &rsaquo; Item types [% IF ( add_form ) %]&rsaquo;
4   [% IF ( itemtype ) %]
5 Modify item type '[% itemtype %]'
6   [% ELSE %]
7 Add item type
8   [% END %]
9 [% END %]
10 [% IF ( delete_confirm ) %]&rsaquo; 
11   [% IF ( total ) %]
12 Cannot delete item type '[% itemtype %]'
13   [% ELSE %]
14 Delete item type '[% itemtype %]'?
15   [% END %]
16 [% END %]
17 [% IF ( delete_confirmed ) %]&rsaquo; 
18 Data deleted
19 [% END %]
20 </title>
21 [% INCLUDE 'doc-head-close.inc' %]
22 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
23 [% INCLUDE 'greybox.inc' %]
24 [% INCLUDE 'datatables.inc' %]
25 <script type="text/javascript">
26 //<![CDATA[
27      $(document).ready(function() {
28         $('#icons').tabs();
29         $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
30             "aoColumnDefs": [
31                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
32             ],
33             "aaSorting": [[ 2, "asc" ]],
34             "iDisplayLength": 10,
35             "sPaginationType": "four_button"
36         }));
37         $( "#itemtypeentry" ).validate({
38             rules: {
39                 itemtype: { required: true },
40                 description: { required: true },
41                 rentalcharge: { number: true }
42             }
43         });
44      });
45 //]]>
46 </script>
47 <style type="text/css">
48         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
49   fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
50         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
51   fieldset.rows .ui-tabs-nav { margin-left : 10px; }
52 </style>
53 </head>
54 <body id="admin_itemtypes" class="admin">
55 [% INCLUDE 'header.inc' %]
56 [% INCLUDE 'cat-search.inc' %]
57
58 <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; [% IF ( add_form ) %]
59   [% IF ( itemtype ) %]
60 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Modify item type '[% itemtype %]'
61   [% ELSE %]
62 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Add item type
63   [% END %]
64 [% END %]
65 [% IF ( delete_confirm ) %]
66   [% IF ( total ) %]
67 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Cannot delete item type '[% itemtype %]'
68   [% ELSE %]
69 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo; Delete item type '[% itemtype %]'?
70   [% END %]
71 [% END %]
72 [% IF ( delete_confirmed ) %]
73 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item types</a> &rsaquo;Data deleted
74 [% END %]
75 [% IF ( else ) %]
76 Item types administration
77 [% END %]</div>
78
79 <div id="doc3" class="yui-t2">
80    
81    <div id="bd">
82         <div id="yui-main">
83         <div class="yui-b">
84         
85 [% IF ( else ) %]<div id="toolbar" class="btn-toolbar">
86     <a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="fa fa-plus"></i> New item type</a>
87 </div>[% END %]
88
89 [% FOREACH message IN messages %]
90   [% IF message.type == 'success' %]
91     <div class="dialog message">
92   [% ELSIF message.type == 'warning' %]
93     <div class="dialog alert">
94   [% ELSIF message.type == 'error' %]
95     <div class="dialog error" style="margin:auto;">
96   [% END %]
97   [% IF message.code == 'already_exists' %]
98     This item type already exists.
99   [% END %]
100   </div>
101 [% END %]
102
103
104 [% IF ( add_form ) %]
105   [% IF ( itemtype ) %]
106       <h3>Modify item type</h3>
107   [% ELSE %]
108       <h3>Add item type</h3>
109   [% END %]
110 <form action="[% script_name %]" name="Aform" method="post" id="itemtypeentry">
111   <input type="hidden" name="op" value="add_validate" />
112     <input type="hidden" name="checked" value="0" />
113                 
114     <fieldset class="rows">
115         <ol>
116   [% IF ( itemtype ) %]
117       <li>
118           <input type="hidden" name="is_a_modif" value="1" />
119           <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
120           [% itemtype %]
121      </li>
122   [% ELSE %]
123       <li>
124           <label for="itemtype" class="required">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
125       </li>
126   [% END %]
127       <li>
128           <label for="description" class="required">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" required="required" /> <span class="required">Required</span>
129           <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype %]" title="Translate" rel="gb_page_center[600,500]"><i class="icon-edit"></i> Translate for other languages</a>
130       </li>
131       <li>
132           <span class="label">Search category</span>
133           <select id="searchcategory" name="searchcategory">
134           <option value="">None</option>
135                 [% FOREACH cat IN searchcategory %]
136                     [% IF ( cat.selected ) %]
137                         <option value="[% cat.authorised_value %]" selected="selected">
138                             [% cat.lib %]
139                         </option>
140                     [% ELSE %]
141                         <option value="[% cat.authorised_value %]" >
142                             [% cat.lib %]
143                         </option>
144                     [% END %]
145                 [% END %]
146           </select>
147           (Options are defined as the authorized values for the ITEMTYPECAT category)
148       </li>
149      [% IF ( noItemTypeImages ) %]
150          <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
151          [% ELSE %]</ol>
152     <div id="icons" class="toptabs" style="clear:both">
153         <h5 style="margin-left:10px;">Choose an icon:</h5>
154                         <ul>
155           <li><a href="#none">None</a></li>
156                                   [% FOREACH imageset IN imagesets %]
157             [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
158                                   [% END %]
159                   [% IF ( remote_image ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
160                         </ul>
161   <div id="none"><ul>
162   <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
163   </ul>
164   <br class="clear" /></div>
165
166   [% FOREACH imageset IN imagesets %]
167   <div id="[% imageset.imagesetname %]"><ul>
168   [% FOREACH image IN imageset.images %]
169                         <li style="float: none; display: inline-block; clear : none; width: auto;">
170             <label> [% IF ( image.StaffImageUrl ) %]
171               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
172         [% ELSE %]
173         [% END %]
174     [% IF ( image.checked ) %]
175               <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
176     [% ELSE %]
177               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
178               <input type="radio" name="image" value="[% image.KohaImage %]" />
179               [% END %]
180     [% END %]
181             </label>
182                         </li>
183   [% END %]
184   </ul>
185   <br class="clear" />
186   </div>
187   [% END %]
188 <div id="remote"><ul>
189 <li> <label for="remote_image_check"> Remote image:</label>
190   [% IF ( remote_image ) %]
191             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
192   [% ELSE %]
193             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
194   [% END %]<input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> [% IF ( remote_image ) %]
195             <img src="[% remote_image %]" alt="" />
196   [% END %]</li>
197 </ul>
198   <br class="clear" />
199 </div>
200 </div>
201 [% END %]
202 <ol>
203       <li>
204           <label for="hideinopac">Hide in OPAC: </label>
205           [% IF ( hideinopac ) %]
206               <input type="checkbox" id="hideinopac" name="hideinopac" checked="checked" value="1" />
207           [% ELSE %]
208               <input type="checkbox" id="hideinopac" name="hideinopac" value="1" />
209           [% END %]
210           (if checked, items of this type will be hidden as filters in OPAC's advanced search)
211       </li>
212       <li>
213           <label for="notforloan">Not for loan: </label>   [% IF ( notforloan ) %]
214                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
215             [% ELSE %]
216                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
217             [% END %]
218           (if checked, no item of this type can be issued. If not checked, every item of this type can be issued unless notforloan is set for a specific item)
219         
220       </li>
221       <li>
222           <label for="rentalcharge">Rental charge: </label>
223                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
224          </li>
225       <li>
226           <label for="checkinmsg">Checkin message: </label>
227           <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% checkinmsg %]</textarea>
228       </li>
229       <li>
230           <label for="checkinmsgtype">Checkin message type: </label>
231           <select type="text" id="checkinmsgtype" name="checkinmsgtype">
232               [% IF ( checkinmsgtype == 'message' ) %]
233               <option value="message" selected="selected">Message</option>
234               [% ELSE %]
235                  <option value="message">Message</option>
236               [% END %]
237               [% IF ( checkinmsgtype == 'alert' ) %]
238               <option value="alert" selected="selected">Alert</option>
239               [% ELSE %]
240                   <option value="alert">Alert</option>
241               [% END %]
242           </select>
243       </li>
244       <li>
245           <label for="sip_media_type">SIP media type: </label>
246           <select id="sip_media_type" name="sip_media_type">
247               <option value=""></option>
248               [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE', sip_media_type ) %]
249                   [% IF a.selected %]
250                       <option value="[% a.authorised_value %]" selected="selected">[% a.lib %]</option>
251                   [% ELSE %]
252                       <option value="[% a.authorised_value %]">[% a.lib %]</option>
253                   [% END %]
254               [% END %]
255           </select>
256       </li>
257       <li>
258           <label for="summary">Summary: </label>
259          <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
260           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
261           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
262       </li>
263           </ol>
264     </fieldset>
265
266     <fieldset class="action">
267       <input type="submit" value="Save changes" />
268           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
269     </fieldset>
270 </form>
271 [% END %]
272
273 [% IF ( delete_confirm ) %]
274 [% IF ( total ) %]<div class="dialog message">
275 <h3>Cannot delete item type</h3>
276 <p><strong>This record is used [% total %] times</strong>. Deletion is not possible.</p>
277 [% ELSE %]<div class="dialog alert">
278 <h3>Delete item type '[% itemtype %]'?</h3>
279 [% END %]
280 <table>
281                 <tr>
282                         <th scope="row">Item type</th>
283                         <td>[% itemtype %]</td>
284                 </tr>
285
286         <tr><th scope="row">Description</th><td>[% translated_description %]</td></tr>
287         <tr><th scope="row">Loan length</th><td>[% loanlength %]</td></tr>
288 <tr><th scope="row">Rental charge</th><td>[% rentalcharge %]</td></tr></table>
289                 <form action="[% script_name %]" method="post">
290                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype %]" />[% IF ( total ) %]
291                 </form>
292                 
293                 <form action="[% script_name %]" method="post"><input type="submit" class="approve" value="OK" /></form>
294         [% ELSE %]
295                 <input type="submit" class="approve" value="Delete this Item Type" /></form> <form action="[% script_name %]" method="post"><input type="submit" class="deny" value="Do Not Delete" /></form>
296         [% END %]
297 </div>
298         
299 [% END %]
300
301 [% IF ( else ) %]
302 <h2>Item types administration</h2>
303 [% IF ( loop ) %]
304 <table id="table_item_type">
305   <thead>
306     [% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
307     <th>Code</th>
308     <th>Description</th>
309     <th>Search category</th>
310     <th>Not for loan</th>
311     <th>Hide in OPAC</th>
312     <th>Charge</th>
313     <th>Checkin message</th>
314     <th>Actions</th>
315   </thead>
316   [% FOREACH loo IN loop %]
317     <tr>
318    [% UNLESS ( noItemTypeImages ) %] <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
319     <td>
320       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">
321         [% loo.itemtype %]
322       </a>
323     </td>
324     <td>
325         [% IF loo.translated_descriptions.size %]
326             [% loo.description %] (default)<br/>
327             [% FOR description IN loo.translated_descriptions %]
328                 [% IF description.translation == loo.translated_description %]
329                     <b>[% description.translation %]</b>
330                 [% ELSE %]
331                     [% description.translation %] ([% description.lang %])
332                 [% END %]
333                 <br/>
334             [% END %]
335         [% ELSE %]
336             [% loo.description %]
337         [% END %]
338     </td>
339     <td>[% loo.searchcategory %]</td>
340     <td>[% IF ( loo.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
341     <td>[% IF ( loo.hideinopac ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
342     <td>
343     [% UNLESS ( loo.notforloan ) %]
344       [% loo.rentalcharge %]
345     [% END %]
346     </td>
347     <td>[% loo.checkinmsg | html_line_break %]</td>
348     <td>
349       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">Edit</a>
350       <a href="[% loo.script_name %]?op=delete_confirm&amp;itemtype=[% loo.itemtype |html %]">Delete</a>
351     </td>
352   </tr>
353   [% END %]
354 </table>[% ELSE %]
355 <div class="dialog message">There are no itemtypes defined</div>
356 [% END %]
357
358 <div class="pages">[% pagination_bar %]</div>
359
360 [% END %]
361
362
363
364 </div>
365 </div>
366 <div class="yui-b">
367 [% INCLUDE 'admin-menu.inc' %]
368 </div>
369 </div>
370 [% INCLUDE 'intranet-bottom.inc' %]