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