Bug 9043: Add the multiple select jquery plugin
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
1 [% USE EncodeUTF8 %]
2 [% USE AuthorisedValues %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha &rsaquo; Administration &rsaquo; Item types [% IF ( add_form ) %]&rsaquo;
5   [% IF ( itemtype ) %]
6 Modify item type '[% itemtype %]'
7   [% ELSE %]
8 Add item type
9   [% END %]
10 [% END %]
11 [% IF ( delete_confirm ) %]&rsaquo; 
12   [% IF ( total ) %]
13 Cannot delete item type '[% itemtype %]'
14   [% ELSE %]
15 Delete item type '[% itemtype %]'?
16   [% END %]
17 [% END %]
18 [% IF ( delete_confirmed ) %]&rsaquo; 
19 Data deleted
20 [% END %]
21 </title>
22 [% INCLUDE 'doc-head-close.inc' %]
23 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
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         }));
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 [% IF ( add_form ) %]
89   [% IF ( itemtype ) %]
90       <h3>Modify item type</h3>
91   [% ELSE %]
92       <h3>Add item type</h3>
93   [% END %]
94 <form action="[% script_name %]" name="Aform" method="post" id="itemtypeentry">
95   <input type="hidden" name="op" value="add_validate" />
96     <input type="hidden" name="checked" value="0" />
97                 
98     <fieldset class="rows">
99         <ol>
100   [% IF ( itemtype ) %]
101       <li>
102           <span class="label">Item type: </span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
103           [% itemtype %]
104      </li>
105   [% ELSE %]
106       <li>
107           <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>
108       </li>
109   [% END %]
110       <li>
111           <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>
112      [% IF ( noItemTypeImages ) %]
113          <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>
114          [% ELSE %]</ol>
115     <div id="icons" class="toptabs" style="clear:both">
116         <h5 style="margin-left:10px;">Choose an icon:</h5>
117                         <ul>
118           <li><a href="#none">None</a></li>
119                                   [% FOREACH imageset IN imagesets %]
120             [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
121                                   [% END %]
122                   [% IF ( remote_image ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
123                         </ul>
124   <div id="none"><ul>
125   <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
126   </ul>
127   <br class="clear" /></div>
128
129   [% FOREACH imageset IN imagesets %]
130   <div id="[% imageset.imagesetname %]"><ul>
131   [% FOREACH image IN imageset.images %]
132                         <li style="float: none; display: inline-block; clear : none; width: auto;">
133             <label> [% IF ( image.StaffImageUrl ) %]
134               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
135         [% ELSE %]
136         [% END %]
137     [% IF ( image.checked ) %]
138               <input type="radio" name="image" value="[% image.KohaImage %]" checked="checked" />
139     [% ELSE %]
140               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
141               <input type="radio" name="image" value="[% image.KohaImage %]" />
142               [% END %]
143     [% END %]
144             </label>
145                         </li>
146   [% END %]
147   </ul>
148   <br class="clear" />
149   </div>
150   [% END %]
151 <div id="remote"><ul>
152 <li> <label for="remote_image_check"> Remote image:</label>
153   [% IF ( remote_image ) %]
154             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
155   [% ELSE %]
156             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
157   [% END %]<input type="text" name="remoteImage" size="48" maxlength="200" value="[% remote_image %]" onmousedown="document.getElementById('remote_image_check').checked = true;" /> [% IF ( remote_image ) %]
158             <img src="[% remote_image %]" alt="" />
159   [% END %]</li>
160 </ul>
161   <br class="clear" />
162 </div>
163 </div>
164 [% END %]
165 <ol>
166       <li>
167           <label for="notforloan">Not for loan: </label>   [% IF ( notforloan ) %]
168                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
169             [% ELSE %]
170                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
171             [% END %]
172           (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)
173         
174       </li>
175       <li>
176           <label for="rentalcharge">Rental charge: </label>
177                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
178          </li>
179       <li>
180           <label for="checkinmsg">Checkin message: </label>
181           <textarea id="checkinmsg" name="checkinmsg" cols="55" rows="5">[% checkinmsg %]</textarea>
182       </li>
183       <li>
184           <label for="checkinmsgtype">Checkin message type: </label>
185           <select type="text" id="checkinmsgtype" name="checkinmsgtype">
186               [% IF ( checkinmsgtype == 'message' ) %]
187               <option value="message" selected="selected">Message</option>
188               [% ELSE %]
189                  <option value="message">Message</option>
190               [% END %]
191               [% IF ( checkinmsgtype == 'alert' ) %]
192               <option value="alert" selected="selected">Alert</option>
193               [% ELSE %]
194                   <option value="alert">Alert</option>
195               [% END %]
196           </select>
197       </li>
198       <li>
199           <label for="sip_media_type">SIP media type: </label>
200           <select id="sip_media_type" name="sip_media_type">
201               <option value=""></option>
202               [% FOREACH a IN AuthorisedValues.Get('SIP_MEDIA_TYPE', sip_media_type ) %]
203                   [% IF a.selected %]
204                       <option value="[% a.authorised_value %]" selected="selected">[% a.lib | $EncodeUTF8 %]</option>
205                   [% ELSE %]
206                       <option value="[% a.authorised_value %]">[% a.lib | $EncodeUTF8  %]</option>
207                   [% END %]
208               [% END %]
209           </select>
210       </li>
211       <li>
212           <label for="summary">Summary: </label>
213          <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
214           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
215           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
216       </li>
217           </ol>
218     </fieldset>
219
220     <fieldset class="action">
221       <input type="submit" value="Save changes" />
222           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
223     </fieldset>
224 </form>
225 [% END %]
226
227 [% IF ( delete_confirm ) %]
228 [% IF ( total ) %]<div class="dialog message">
229 <h3>Cannot delete item type</h3>
230 <p><strong>This record is used [% total %] times</strong>. Deletion is not possible.</p>
231 [% ELSE %]<div class="dialog alert">
232 <h3>Delete item type '[% itemtype %]'?</h3>
233 [% END %]
234 <table>
235                 <tr>
236                         <th scope="row">Item type</th>
237                         <td>[% itemtype %]</td>
238                 </tr>
239
240         <tr><th scope="row">Description</th><td>[% description %]</td></tr>
241         <tr><th scope="row">Loan length</th><td>[% loanlength %]</td></tr>
242 <tr><th scope="row">Rental charge</th><td>[% rentalcharge %]</td></tr></table>
243                 <form action="[% script_name %]" method="post">
244                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="[% itemtype %]" />[% IF ( total ) %]
245                 </form>
246                 
247                 <form action="[% script_name %]" method="post"><input type="submit" class="approve" value="OK" /></form>
248         [% ELSE %]
249                 <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>
250         [% END %]
251 </div>
252         
253 [% END %]
254
255 [% IF ( else ) %]
256 <h2>Item types administration</h2>
257 [% IF ( loop ) %]
258 <table id="table_item_type">
259   <thead>
260     [% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
261     <th>Code</th>
262     <th>Description</th>
263     <th>Not for loan</th>
264     <th>Charge</th>
265     <th>Checkin message</th>
266     <th>Actions</th>
267   </thead>
268   [% FOREACH loo IN loop %]
269     <tr>
270    [% UNLESS ( noItemTypeImages ) %] <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt="" />[% ELSE %]&nbsp;[% END %]</td>[% END %]
271     <td>
272       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">
273         [% loo.itemtype %]
274       </a>
275     </td>
276     <td>[% loo.description %]</td>
277     <td>[% IF ( loo.notforloan ) %]Yes[% ELSE %]&nbsp;[% END %]</td>
278     <td>
279     [% UNLESS ( loo.notforloan ) %]
280       [% loo.rentalcharge %]
281     [% END %]
282     </td>
283     <td>[% loo.checkinmsg | html_line_break %]</td>
284     <td>
285       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">Edit</a>
286       <a href="[% loo.script_name %]?op=delete_confirm&amp;itemtype=[% loo.itemtype |html %]">Delete</a>
287     </td>
288   </tr>
289   [% END %]
290 </table>[% ELSE %]
291 <div class="dialog message">There are no itemtypes defined</div>
292 [% END %]
293
294 <div class="pages">[% pagination_bar %]</div>
295
296 [% END %]
297
298
299
300 </div>
301 </div>
302 <div class="yui-b">
303 [% INCLUDE 'admin-menu.inc' %]
304 </div>
305 </div>
306 [% INCLUDE 'intranet-bottom.inc' %]