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