Standardizing format for error/message dialogs. <div class="dialog alert"> for high...
[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 //]]>
77 </script>
78 </head>
79 <body>
80 <!-- TMPL_INCLUDE NAME="header.inc" -->
81 <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
82
83 <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" -->
84   <!-- TMPL_IF name="itemtype" -->
85 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Modify Item Type '<!-- TMPL_VAR name="itemtype" -->'
86   <!-- TMPL_ELSE -->
87 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Add Item Type
88   <!-- /TMPL_IF -->
89 <!-- /TMPL_IF -->
90 <!-- TMPL_IF name="delete_confirm" -->
91   <!-- TMPL_IF name="total" -->
92 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Cannot Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'
93   <!-- TMPL_ELSE -->
94 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo; Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?
95   <!-- /TMPL_IF -->
96 <!-- /TMPL_IF -->
97 <!-- TMPL_IF name="delete_confirmed" -->
98 <a href="/cgi-bin/koha/admin/itemtypes.pl">Item Types</a> &rsaquo;Data Deleted
99 <!-- /TMPL_IF -->
100 <!-- TMPL_IF name="else" -->
101 Item Types Administration
102 <!-- /TMPL_IF --></div>
103
104 <div id="doc3" class="yui-t2">
105    
106    <div id="bd">
107         <div id="yui-main">
108         <div class="yui-b">
109         
110 <!-- TMPL_IF NAME="else" --><div id="toolbar">
111         <script type="text/javascript">
112         //<![CDATA[
113
114         // prepare DOM for YUI Toolbar
115
116          $(document).ready(function() {
117             yuiToolbar();
118          });
119
120         // YUI Toolbar Functions
121
122         function yuiToolbar() {
123             new YAHOO.widget.Button("newitemtype");
124         }
125
126         //]]>
127         </script>
128         <ul class="toolbar">
129         <li><a id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form">New Item Type</a></li>
130 </ul></div><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF -->
131
132 <!-- TMPL_IF name="add_form" -->
133   <!-- TMPL_IF name="itemtype" -->
134       <h3>Modify Item Type</h3>
135   <!-- TMPL_ELSE -->
136       <h3>Add Item Type</h3>
137   <!-- /TMPL_IF -->
138 <form action="<!-- TMPL_VAR name="script_name" -->" name="Aform" method="post">
139   <input type="hidden" name="op" value="add_validate" />
140     <input type="hidden" name="checked" value="0" />
141                 
142     <fieldset class="rows">
143         <ol>
144   <!-- TMPL_IF name="itemtype" -->
145       <li>
146           <span class="label">Item type</span> <input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" />
147           <!-- TMPL_VAR name="itemtype" -->
148      </li>
149   <!-- TMPL_ELSE -->
150       <li>
151           <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
152       </li>
153   <!-- /TMPL_IF -->
154       <li>
155           <label for="description">Description</label><input type="text" id="description" name="description" size="48" maxlength="80" value="<!-- TMPL_VAR name="description" escape="HTML" -->" />      </li>
156       <li><fieldset>
157           <legend>Image: </legend>
158         
159           <ol>
160   <!-- TMPL_LOOP NAME="IMAGESLOOP" -->
161                         <li style="float: none; display: inline; clear : none; width: auto;">
162             <label> <!-- TMPL_IF NAME="KohaImageSrc" -->
163               <img src="<!-- TMPL_VAR name="KohaImageSrc" -->" alt="<!-- TMPL_VAR name="KohaImageSrc" -->" title="<!-- TMPL_VAR name="KohaImageSrc" -->" />
164         <!-- TMPL_ELSE -->
165         <!-- /TMPL_IF -->
166     <!-- TMPL_IF name="checked" -->
167               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" checked="checked" />
168     <!-- TMPL_ELSE -->
169               <!-- TMPL_IF NAME="KohaImage" --> <!-- to delete the radio button if there is no image after -->
170               <input type="radio" name="image" value="<!-- TMPL_VAR name="KohaImage" -->" />
171               <!-- /TMPL_IF -->
172     <!-- /TMPL_IF -->
173             </label>
174                         </li>
175   <!-- /TMPL_LOOP -->
176         <li>
177             <label for="remote_image_check"> Remote image:</label>
178   <!-- TMPL_IF name="remote_image" -->
179             <input type="radio" id="remote_image_check" name="image" value="remoteImage" checked="checked" />
180   <!-- TMPL_ELSE -->
181             <input type="radio" id="remote_image_check" name="image" value="remoteImage" />
182   <!-- /TMPL_IF -->
183            
184             <input type="text" name="remoteImage" size="48" maxlength="200" value="<!-- TMPL_VAR name="remote_image" -->" onmousedown="document.getElementById('remote_image_check').checked = true;" />
185
186   <!-- TMPL_IF name="remote_image" -->
187             <img src="<!-- TMPL_VAR name="remote_image" -->" alt="" />
188   <!-- /TMPL_IF -->
189           </li>
190           <li>
191             <label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" />
192           </li>
193         
194           </ol>
195                   </fieldset>
196       </li>
197       <li>
198           <label for="notforloan">Not for loan</label>   <!-- TMPL_IF name="notforloan" -->
199                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
200             <!-- TMPL_ELSE -->
201                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
202             <!-- /TMPL_IF -->
203           (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)
204         
205       </li>
206       <li>
207           <label for="renewalsallowed">Renewals: </label>
208                   <input type="text" id="renewalsallowed" name="renewalsallowed" size="3" maxlength="3" value="<!-- TMPL_VAR NAME="renewalsallowed" -->" />
209         </li>
210       <li>
211           <label for="rentalcharge">Rental charge: </label>
212                   <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="<!-- TMPL_VAR name="rentalcharge" -->" />
213          </li>
214       <li>
215           <label for="summary">Summary: </label>
216          <textarea id="summary" name="summary" cols="55" rows="5"><!-- TMPL_VAR NAME="summary" --></textarea>
217           <p>Enter a summary that will overwrite the default one in search results lists. Example, for a website itemtype : </p>
218           <p><b>&lt;a href="[856u]"&gt;open site&lt;/a&gt;</b> will show the link just below the title</p>
219       </li>
220           </ol>
221     </fieldset>
222
223     <fieldset class="action">
224       <input type="button" value="Save Changes" onclick="Check(this.form)" />
225           <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
226     </fieldset>
227 </form>
228 <!-- /TMPL_IF -->
229
230 <!-- TMPL_IF name="delete_confirm" -->
231 <!-- TMPL_IF name="total" --><div class="dialog message">
232 <h3>Cannot Delete Item Type</h3>
233 <p><strong>This record is used <!-- TMPL_VAR name="total" --> times</strong>. Deletion is not possible.</p>
234 <!-- TMPL_ELSE --><div class="dialog alert">
235 <h3>Delete Item Type '<!-- TMPL_VAR name="itemtype" -->'?</h3>
236 <!-- /TMPL_IF -->
237 <table>
238                 <tr>
239                         <th scope="row">Item type</th>
240                         <td><!-- TMPL_VAR name="itemtype" --></td>
241                 </tr>
242
243         <tr><th scope="row">Description</th><td><!-- TMPL_VAR name="description" --></td></tr>
244         <tr><th scope="row">Loan length</th><td><!-- TMPL_VAR name="loanlength" --></td></tr>
245         <tr><th scope="row">Renewals</th><td><!-- TMPL_IF name="renewalsallowed" -->Allowed<!-- TMPL_ELSE -->Not allowed<!-- /TMPL_IF --></td></tr>
246 <tr><th scope="row">Rental charge</th><td><!-- TMPL_VAR name="rentalcharge" --></td></tr></table>
247                 <form action="<!-- TMPL_VAR name="script_name" -->" method="post">
248                 <input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="itemtype" value="<!-- TMPL_VAR name="itemtype" -->" /><!-- TMPL_IF name="total" -->
249                 </form>
250                 
251                 <form action="<!-- TMPL_VAR name="script_name" -->" method="post"><input type="submit" class="approve" value="OK" /></form>
252         <!-- TMPL_ELSE -->
253                 <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>
254         <!-- /TMPL_IF -->
255 </div>
256         
257 <!-- /TMPL_IF -->
258
259 <!-- TMPL_IF name="else" -->
260 <h2>Item Types Administration</h2>
261 <table>
262   <tr>
263     <th>Image</th>
264     <th>Code</th>
265     <th>Description</th>
266     <th>Not for loan</th>
267     <th>Renewable</th>
268     <th>Charge</th>
269     <th>Actions</th>
270   </tr>
271   <!-- TMPL_LOOP name="loop" -->
272     <!-- TMPL_IF NAME="toggle" -->
273   <tr>
274     <!-- TMPL_ELSE -->
275   <tr class="highlight">
276     <!-- /TMPL_IF -->
277     <td><img src="<!-- TMPL_VAR name="imageurl" -->" alt="" /></td>
278     <td>
279       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">
280         <!-- TMPL_VAR name="itemtype" -->
281       </a>
282     </td>
283     <td><!-- TMPL_VAR name="description" --></td>
284     <td><!-- TMPL_IF NAME="notforloan" -->Yes<!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td>
285     <td>
286     <!-- TMPL_IF NAME="renewalsallowed" -->
287       <!-- TMPL_VAR name="renewalsallowed" --> times
288     <!-- TMPL_ELSE -->
289       No
290     <!-- /TMPL_IF -->
291     </td>
292     <td>
293     <!-- TMPL_UNLESS name="notforloan" -->
294       <!-- TMPL_VAR NAME="rentalcharge" -->
295     <!-- /TMPL_UNLESS -->
296     </td>
297     <td>
298       <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Edit</a>
299       <a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;itemtype=<!-- TMPL_VAR name="itemtype" escape="HTML" -->">Delete</a>
300     </td>
301   </tr>
302   <!-- /TMPL_LOOP -->
303 </table>
304
305 <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
306
307 <!-- /TMPL_IF -->
308
309
310
311 </div>
312 </div>
313 <div class="yui-b">
314 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
315 </div>
316 </div>
317 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->