Merge remote branch 'kc/new/signoffs' into kcmaster
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Item Types <!-- TMPL_IF name="add_form" -->&rsaquo; 
3   <!-- TMPL_IF name="itemtype" -->
4 Modify Item Type '<!-- TMPL_VAR name="itemtype" -->'
5   <!-- TMPL_ELSE -->
6 Add Item Type
7   <!-- /TMPL_IF -->
8 <!-- /TMPL_IF -->
9 <!-- TMPL_IF name="delete_confirm" -->&rsaquo; 
10   <!-- TMPL_IF name="total" -->
11 Cannot Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'
12   <!-- TMPL_ELSE -->
13 Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?
14   <!-- /TMPL_IF -->
15 <!-- /TMPL_IF -->
16 <!-- TMPL_IF name="delete_confirmed" -->&rsaquo; 
17 Data Deleted
18 <!-- /TMPL_IF -->
19 </title>
20 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" --><script type="text/javascript">
21 //<![CDATA[
22
23 function isNotNull(f,noalert) {
24         if (f.value.length ==0) {
25                 return false;
26         }
27         return true;
28 }
29
30 function toUC(f) {
31         var x=f.value.toUpperCase();
32         f.value=x;
33         return true;
34 }
35
36 function isNum(v,maybenull) {
37 var n = new Number(v.value);
38 if (isNaN(n)) {
39         return false;
40         }
41 if (maybenull==0 && v.value=='') {
42         return false;
43 }
44 return true;
45 }
46
47 function isDate(f) {
48         var t = Date.parse(f.value);
49         if (isNaN(t)) {
50                 return false;
51         }
52 }
53
54 function Check(f) {
55         var ok=1;
56         var _alertString="";
57         var alertString2;
58         if (f.itemtype.value.length==0) {
59                 _alertString += "\n- " + _("Itemtype missing");
60         }
61         if (!(isNotNull(window.document.Aform.description,1))) {
62                 _alertString += "\n- " + _("Description missing");
63         }
64         if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
65                 _alertString += "\n- " + _("Rental charge is not a number");
66         }
67         if (_alertString.length==0) {
68                 document.Aform.submit();
69         } else {
70                 alertString2  = _("Form not submitted because of the following problem(s)");
71                 alertString2 += "\n------------------------------------------------------------------------------------\n";
72                 alertString2 += _alertString;
73                 alert(alertString2);
74         }
75 }
76      $(document).ready(function() {
77         $('#icons > ul').tabs();
78      });
79 //]]>
80 </script>
81 <style type="text/css">
82         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
83         fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : transparent; }
84         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
85 </style>
86 </head>
87 <body>
88 <!-- TMPL_INCLUDE NAME="header.inc" -->
89 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
90
91 <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; <!-- TMPL_IF name="add_form" -->
92   <!-- TMPL_IF name="itemtype" -->
93 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Modify Item Type '<!-- TMPL_VAR name="itemtype" -->'
94   <!-- TMPL_ELSE -->
95 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Add Item Type
96   <!-- /TMPL_IF -->
97 <!-- /TMPL_IF -->
98 <!-- TMPL_IF name="delete_confirm" -->
99   <!-- TMPL_IF name="total" -->
100 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Cannot Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'
101   <!-- TMPL_ELSE -->
102 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?
103   <!-- /TMPL_IF -->
104 <!-- /TMPL_IF -->
105 <!-- TMPL_IF name="delete_confirmed" -->
106 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo;Data Deleted
107 <!-- /TMPL_IF -->
108 <!-- TMPL_IF name="else" -->
109 Item Types Administration
110 <!-- /TMPL_IF --></div>
111
112 <div id="doc3" class="yui-t2">
113    
114    <div id="bd">
115         <div id="yui-main">
116         <div class="yui-b">
117         
118 <!-- TMPL_IF NAME="else" --><div id="toolbar">
119         <script type="text/javascript">
120         //<![CDATA[
121
122         // prepare DOM for YUI Toolbar
123
124          $(document).ready(function() {
125             yuiToolbar();
126          });
127
128         // YUI Toolbar Functions
129
130         function yuiToolbar() {
131             new YAHOO.widget.Button("newitemtype");
132         }
133
134         //]]>
135         </script>
136         <ul class="toolbar">
137         <li><a id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form">New Item Type</a></li>
138 </ul></div><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF -->
139
140 <!-- TMPL_IF name="add_form" -->
141   <!-- TMPL_IF name="itemtype" -->
142       <h3>Modify Item Type</h3>
143   <!-- TMPL_ELSE -->
144       <h3>Add Item Type</h3>
145   <!-- /TMPL_IF -->
146 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
147   <input type="hidden" name="op" value="add_validate" />
148     <input type="hidden" name="checked" value="0" />
149                 
150     <fieldset class="rows">
151         <ol>
152   <!-- TMPL_IF name="itemtype" -->
153       <li>
154           <span class="label">Item type</span> <input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" />
155           <!-- TMPL_VAR name="itemtype" -->
156      </li>
157   <!-- TMPL_ELSE -->
158       <li>
159           <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
160       </li>
161   <!-- /TMPL_IF -->
162       <li>
163           <label for="description">Description</label><input type="text" id="description" name="description" size="48" maxlength="80" value="<!-- TMPL_VAR name="description" escape="HTML" -->" />      </li>
164      <!-- TMPL_IF NAME="noItemTypeImages" -->
165          <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&searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
166          <!-- TMPL_ELSE --></ol>
167                 <div id="icons" class="toptabs">
168                 <h5 style="margin-left:10px;">Choose an Icon:</h5>
169                         <ul>
170                                         <li><a href="/cgi-bin/koha/admin/itemtypes.pl#none">None</a></li>
171                                   <!-- TMPL_LOOP NAME="imagesets" -->
172             <!-- TMPL_IF NAME="imagesetactive" --><li class="ui-tabs-selected"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/itemtypes.pl#<!-- TMPL_VAR NAME="imagesetname" -->"><!-- TMPL_VAR name="imagesetname" --></a></li>
173                                   <!-- /TMPL_LOOP -->
174                                   <!-- TMPL_IF NAME="remote_image" --><li class="ui-tabs-selected"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/admin/itemtypes.pl#remote">Remote Image</a></li>
175                         </ul>
176                 </div>
177   <div id="none"><ul>
178   <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
179   </ul>
180   <br class="clear" /></div>
181         
182   <!-- TMPL_LOOP NAME="imagesets" -->
183   <div id="<!-- TMPL_VAR NAME="imagesetname" -->"><ul>
184   <!-- TMPL_LOOP NAME="images" -->
185                         <li style="float: none; display: inline; clear : none; width: auto;">
186             <label> <!-- TMPL_IF NAME="StaffImageUrl" -->
187               <img src="<!-- TMPL_VAR name="StaffImageUrl" -->" alt="<!-- TMPL_VAR name="StaffImageUrl" -->" title="<!-- TMPL_VAR name="StaffImageUrl" -->" />
188         <!-- TMPL_ELSE -->
189         <!-- /TMPL_IF -->
190     <!-- TMPL_IF name="checked" -->
191               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" checked="checked" />
192     <!-- TMPL_ELSE -->
193               <!-- TMPL_IF NAME="KohaImage" --> <!-- to delete the radio button if there is no image after -->
194               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" />
195               <!-- /TMPL_IF -->
196     <!-- /TMPL_IF -->
197             </label>
198                         </li>
199   <!-- /TMPL_LOOP -->
200   </ul>
201   <br class="clear" />
202   </div>
203   <!-- /TMPL_LOOP -->
204 <div id="remote"><ul>
205 <li> <label for="remote_image_check"> Remote image:</label>
206   <!-- TMPL_IF name="remote_image" -->
207             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
208   <!-- TMPL_ELSE -->
209             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
210   <!-- /TMPL_IF --><input type="text" name="remoteImage" size="48" maxlength="200" value="<!-- TMPL_VAR name="remote_image" -->" onmousedown="document.getElementById('remote_image_check').checked = true;" /> <!-- TMPL_IF name="remote_image" -->
211             <img src="<!-- TMPL_VAR name="remote_image" -->" alt="" />
212   <!-- /TMPL_IF --></li>
213 </ul>
214   <br class="clear" />
215 </div>
216 <!-- /TMPL_IF -->
217 <ol>
218       <li>
219           <label for="notforloan">Not for loan</label>   <!-- TMPL_IF name="notforloan" -->
220                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
221             <!-- TMPL_ELSE -->
222                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
223             <!-- /TMPL_IF -->
224           (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)
225         
226       </li>
227       <li>
228           <label for="rentalcharge">Rental charge: </label>
229                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="<!-- TMPL_VAR name="rentalcharge" -->" />
230          </li>
231       <li>
232           <label for="summary">Summary: </label>
233          <textarea id="summary" name="summary" cols="55" rows="5"><!-- TMPL_VAR NAME="summary" --></textarea>
234           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
235           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
236       </li>
237           </ol>
238     </fieldset>
239
240     <fieldset class="action">
241       <input type="button" value="Save Changes" onclick="Check(this.form)" />
242           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
243     </fieldset>
244 </form>
245 <!-- /TMPL_IF -->
246
247 <!-- TMPL_IF name="delete_confirm" -->
248 <!-- TMPL_IF name="total" --><div class="dialog message">
249 <h3>Cannot Delete Item Type</h3>
250 <p><strong>This record is used <!-- TMPL_VAR name="total" --> times</strong>. Deletion is not possible.</p>
251 <!-- TMPL_ELSE --><div class="dialog alert">
252 <h3>Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?</h3>
253 <!-- /TMPL_IF -->
254 <table>
255                 <tr>
256                         <th scope="row">Item type</th>
257                         <td><!-- TMPL_VAR name="itemtype" --></td>
258                 </tr>
259
260         <tr><th scope="row">Description</th><td><!-- TMPL_VAR name="description" --></td></tr>
261         <tr><th scope="row">Loan length</th><td><!-- TMPL_VAR name="loanlength" --></td></tr>
262 <tr><th scope="row">Rental charge</th><td><!-- TMPL_VAR name="rentalcharge" --></td></tr></table>
263                 <form action="<!-- TMPL_VAR name="script_name" -->" method="post">
264                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" /><!-- TMPL_IF name="total" -->
265                 </form>
266                 
267                 <form action="<!-- TMPL_VAR name="script_name" -->" method="post"><input type="submit" class="approve" value="OK" /></form>
268         <!-- TMPL_ELSE -->
269                 <input type="submit" class="approve" value="Delete this Item Type" /></form> <form action="<!-- TMPL_VAR name="script_name" -->" method="post"><input type="submit" class="deny" value="Do Not Delete" /></form>
270         <!-- /TMPL_IF -->
271 </div>
272         
273 <!-- /TMPL_IF -->
274
275 <!-- TMPL_IF name="else" -->
276 <h2>Item Types Administration</h2>
277 <table>
278   <tr>
279     <!-- TMPL_UNLESS NAME="noItemTypeImages" --><th>Image</th><!-- /TMPL_UNLESS -->
280     <th>Code</th>
281     <th>Description</th>
282     <th>Not for loan</th>
283     <th>Charge</th>
284     <th>Actions</th>
285   </tr>
286   <!-- TMPL_LOOP name="loop" -->
287     <!-- TMPL_UNLESS name="__odd__" -->
288   <tr class="highlight">
289     <!-- TMPL_ELSE -->
290   <tr>
291     <!-- /TMPL_IF -->
292    <!-- TMPL_UNLESS NAME="noItemTypeImages" --> <td><img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /></td><!-- /TMPL_UNLESS -->
293     <td>
294       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">
295         <!-- TMPL_VAR name="itemtype" -->
296       </a>
297     </td>
298     <td><!-- TMPL_VAR name="description" --></td>
299     <td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
300     <td>
301     <!-- TMPL_UNLESS name="notforloan" -->
302       <!-- TMPL_VAR NAME="rentalcharge" -->
303     <!-- /TMPL_UNLESS -->
304     </td>
305     <td>
306       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Edit</a>
307       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Delete</a>
308     </td>
309   </tr>
310   <!-- /TMPL_LOOP -->
311 </table>
312
313 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
314
315 <!-- /TMPL_IF -->
316
317
318
319 </div>
320 </div>
321 <div class="yui-b">
322 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
323 </div>
324 </div>
325 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->