Bug 10452: make AllowHoldsOnDamagedItems control using damaged items to fulfill holds
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / branches.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Libraries and groups
3 [% IF ( editcategory ) %]
4     &rsaquo;[% IF ( categorycode ) %]Edit group [% categorycode %][% ELSE %]New group[% END %]
5 [% ELSIF ( delete_category ) %]
6     &rsaquo; Confirm deletion of group [% categorycode %]
7 [% ELSIF ( add ) %]
8     &rsaquo;[% IF ( heading_branches_add_branch_p ) %]New library[% ELSE %]Modify library [% branchcode %][% END %]
9 [% ELSIF ( delete_confirm ) %]
10     &rsaquo; Confirm deletion of library '[% branchcode %]'
11 [% END %]
12 </title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
15 [% INCLUDE 'datatables.inc' %]
16 <script type="text/javascript" src="[% interface %]/lib/tiny_mce/tiny_mce.js"></script>
17 <script type="text/javascript">
18 //<![CDATA[
19     $(document).ready(function() {
20         $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, {
21             "aoColumnDefs": [
22                 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
23             ],
24             "iDisplayLength": 10,
25             "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
26             "sPaginationType": "four_button"
27         }));
28     });
29 tinyMCE.init({
30     mode : "textareas",
31     theme : "advanced",
32     content_css : "[% themelang %]/css/tinymce.css",
33     plugins : "table,save,advhr,advlink,contextmenu",
34     theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,",
35     theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
36     // theme_advanced_buttons3 : "",
37     theme_advanced_toolbar_location : "top",
38     theme_advanced_toolbar_align : "left",
39     theme_advanced_path_location : "bottom",
40     theme_advanced_resizing : true,
41     apply_source_formatting : true
42 });
43 //]]>
44 </script>
45 </head>
46 <body id="admin_branches" class="admin">
47 [% INCLUDE 'header.inc' %]
48 [% INCLUDE 'cat-search.inc' %]
49
50 <div id="breadcrumbs">
51     <a href="/cgi-bin/koha/mainpage.pl">Home</a>
52 &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
53 &rsaquo; <a href="/cgi-bin/koha/admin/branches.pl">Libraries and groups</a>
54 [% IF ( editcategory ) %]
55 &rsaquo; [% IF ( categorycode ) %]Edit group [% categorycode %][% ELSE %]New group[% END %]
56 [% ELSIF ( delete_category ) %]
57 &rsaquo; Confirm deletion of group [% categorycode %]
58 [% ELSIF ( add ) %]
59 &rsaquo; [% IF ( heading_branches_add_branch_p ) %]New library[% ELSE %]Modify library [% branchcode %][% END %]
60 [% ELSIF ( delete_confirm ) %]
61 &rsaquo; Confirm deletion of library '[% branchcode %]'
62 [% END %]
63 </div>
64
65 <div id="doc3" class="yui-t2">
66    
67    <div id="bd">
68         <div id="yui-main">
69         <div class="yui-b">
70         [% IF ( else ) %]
71     <div id="toolbar" class="btn-toolbar">
72         <a class="btn btn-small" id="newbranch" href="/cgi-bin/koha/admin/branches.pl?op=add"><i class="icon-plus"></i> New library</a>
73         <a class="btn btn-small" id="newcategory" href="/cgi-bin/koha/admin/branches.pl?op=editcategory"><i class="icon-plus"></i> New group</a>
74     </div>
75 [% END %]
76
77 [% IF ( add ) %]
78     [% IF ( ERROR1 ) %]<div class="dialog message">Library with that code already exists &mdash; Please enter a unique code</div>[% END %]
79   <h3>[% IF ( heading_branches_add_branch_p ) %]New library[% ELSE %]Modify library[% END %]</h3>
80     <form action="[% action %]" id="Aform" name="Aform" class="validated" method="post">
81         <fieldset class="rows">
82         <input type="hidden" name="op" value="add_validate" />
83         [% IF ( heading_branches_add_branch_p ) %]
84             <input type="hidden" name="add" value="1" />
85         [% ELSE %]
86             <input type="hidden" name="add" value="0" />
87         [% END %]
88         <ol><li>
89             [% IF ( heading_branches_add_branch_p ) %]
90             <label for="branchcode" class="required">Library code: </label>
91                 <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% branchcode |html %]" class="required" required="required" /> <span class="required">Required</span>
92             [% ELSE %]
93             <span class="label">Library code: </span>
94                 <input type="hidden" name="branchcode" value="[% branchcode |html %]" />
95                 [% branchcode %]
96             [% END %]
97         </li>
98         <li>
99             <label for="branchname" class="required">Name: </label>
100             <input type="text" name="branchname" id="branchname" size="80" value="[% branch_name |html %]" class="required" required="required" /> <span class="required">Required</span>
101         </li>
102         </ol>
103         </fieldset>
104         [% IF ( categoryloop ) %]<fieldset class="rows"><legend>Group(s):</legend>
105         <ol>
106                 [% FOREACH categoryloo IN categoryloop %]
107             <li><label for="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]: </label>
108                 [% IF categoryloo.selected %]
109                     <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" checked="checked" />
110                 [% ELSE %]
111                     <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" />
112                 [% END %]
113                 <span class="hint">[% categoryloo.codedescription %]</span>
114             </li>
115         [% END %]
116                 </ol>
117 </fieldset>[% END %]
118         <fieldset class="rows">
119         <ol>
120         <li><label for="branchaddress1">Address line 1: </label><input type="text" name="branchaddress1" id="branchaddress1" size="60" value="[% branchaddress1 |html %]" /></li>
121         <li><label for="branchaddress2">Address line 2: </label><input type="text" name="branchaddress2" id="branchaddress2" size="60" value="[% branchaddress2 |html %]" /></li>
122         <li><label for="branchaddress3">Address line 3: </label><input type="text" name="branchaddress3" id="branchaddress3" size="60" value="[% branchaddress3 |html %]" /></li>
123         <li><label for="branchcity">City: </label><input type="text" name="branchcity" id="branchcity" size="60" value="[% branchcity |html %]" /></li>
124         <li><label for="branchstate">State: </label><input type="text" name="branchstate" id="branchstate" size="60" value="[% branchstate |html %]" /></li>
125         <li><label for="branchzip">Zip/Postal code: </label><input type="text" name="branchzip" id="branchzip"  size="25" maxlength="25" value="[% branchzip |html %]" /></li>
126         <li><label for="branchcountry">Country: </label><input type="text" name="branchcountry" id="branchcountry" size="60" value="[% branchcountry |html %]" /></li>
127         <li><label for="branchphone">Phone: </label><input type="text" name="branchphone" id="branchphone" size="60" value="[% branchphone |html %]" /></li>
128         <li><label for="branchfax">Fax: </label><input type="text" name="branchfax" id="branchfax" size="60" value="[% branchfax |html %]" /></li>
129         <li><label for="branchemail">Email: </label><input type="text" name="branchemail" id="branchemail" class="email"  size="80" value="[% branchemail |html %]" /></li>
130         <li><label for="branchurl">URL: </label><input type="text" name="branchurl" id="branchurl"  size="80" value="[% branchurl |html %]" class="url" /></li>
131         <li><label for="opac_info">OPAC info: </label><textarea name="opac_info" id="opac_info">[% opac_info |html %]</textarea></li>
132         <li><label for="branchip">IP: </label><input type="text" name="branchip" id="branchip"  size="15" maxlength="15" value="[% branchip |html %]" /> <span class="hint">Can be entered as a single IP, or a subnet such as 192.168.1.*</span></li>
133                 <!--
134         <li><label for="branchprinter">Library Printer: </label>
135             <select id="branchprinter" name="branchprinter">
136                 <option value="">None</option>
137             [% FOREACH printerloo IN printerloop %]
138                 [% IF ( printerloo.selected ) %]
139                                 <option value="[% printerloo.value %]" selected="selected">[% printerloo.branchprinter %]</option>
140                                 [% ELSE %]
141                                 <option value="[% printerloo.value %]">[% printerloo.branchprinter %]</option>
142                                 [% END %]
143                 [% END %]
144             </select></li>
145                         -->
146         <li><label for="branchnotes">Notes: </label><input type="text" name="branchnotes" id="branchnotes" size="80" value="[% branchnotes |html %]" /></li>
147         </ol>
148         </fieldset>
149         <fieldset class="action"><input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a></fieldset>
150     </form>
151 [% END %]
152
153 [% IF ( delete_confirm ) %]
154     <form action="[% action %]" method="post">
155 <fieldset><legend>Confirm deletion of [% branchname %] ([% branchcode %])?</legend><input type="hidden" name="op" value="delete_confirmed" />
156         <input type="hidden" name="branchcode" value="[% branchcode |html %]" />
157         <input type="hidden" name="branchname" value="[% branchname |html %]">
158         <fieldset class="action"><input type="submit" value="Delete Library" /> <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a></fieldset>
159 </fieldset></form>
160 [% END %]
161
162 [% IF ( else ) %]
163     <h3>Libraries</h3>
164     [% IF ( message ) %]<div class="dialog message">
165         [% message %]</div>[% END %]
166     [% IF ( MESSAGE1 ) %]<div class="dialog message">Library not saved &mdash; code and/or name missing</div>[% END %]
167     [% IF ( MESSAGE2 ) %]<div class="dialog message">Library saved</div>[% END %]
168     [% IF ( MESSAGE3 ) %]<div class="dialog message">Library deleted</div>[% END %]
169     [% IF ( MESSAGE4 ) %]<div class="dialog message">Library category added</div>[% END %]
170     [% IF ( MESSAGE5 ) %]<div class="dialog message">Library category modified</div>[% END %]
171     [% IF ( MESSAGE6 ) %]<div class="dialog message">Library category deleted</div>[% END %]
172     [% IF ( MESSAGE7 ) %]<div class="dialog message">Library cannot be deleted because there are patrons and items using that library</div>[% END %]
173     [% IF ( MESSAGE8 ) %]<div class="dialog message">Category cannot be deleted because there are libraries using that category</div>[% END %]
174     [% IF ( MESSAGE9 ) %]<div class="dialog message">Category cannot be added, categorycode already exists</div>[% END %]
175     [% IF ( MESSAGE10 ) %]<div class="dialog message">Library cannot be deleted because there are items held by that library</div>[% END %]
176     [% IF ( MESSAGE11 ) %]<div class="dialog message">Library cannot be deleted because there are patrons registered at that library</div>[% END %]
177 [% IF ( branches ) %]
178     <table id="branchest">
179 <thead><tr>
180                         <th>Name</th>
181             <th>Code</th>
182             <th>Address</th>
183             <th>Properties</th>
184             <th>IP</th>
185             <!-- <th>Printer</th> -->
186             <th>&nbsp;</th>
187             <th>&nbsp;</th>
188         </tr></thead><tbody>
189         [% FOREACH branche IN branches %]
190         [% IF ( loop.odd ) %]
191         <tr>
192         [% ELSE %]
193                 <tr class="highlight">
194         [% END %]
195                 <td>[% branche.branch_name |html %]</td>
196                 <td>[% branche.branch_code |html %]</td>
197                 <td>
198                     [% IF ( branche.address_empty_p ) %]
199                         (nothing entered)
200                     [% ELSE %]
201                         [% IF ( branche.branchaddress1 ) %]
202                             [% branche.branchaddress1 |html %][% END %]
203                         [% IF ( branche.branchaddress2 ) %]
204                             <br />[% branche.branchaddress2 |html %][% END %]
205                         [% IF ( branche.branchaddress3 ) %]
206                             <br />[% branche.branchaddress3 |html %][% END %]
207                         [% IF ( branche.branchcity ) %]
208                             <br />[% branche.branchcity |html %][% END %][% IF ( branche.branchstate ) %],
209                             [% branche.branchstate |html %][% END %]
210                         [% IF ( branche.branchzip ) %]
211                             [% branche.branchzip |html %][% END %]
212                         [% IF ( branche.branchcountry ) %]
213                             <br />[% branche.branchcountry |html %][% END %]
214                         [% IF ( branche.branchphone ) %]
215                             <br />Ph: [% branche.branchphone |html %][% END %]
216                         [% IF ( branche.branchfax ) %]
217                             <br />Fax: [% branche.branchfax |html %][% END %]
218                         [% IF ( branche.branchemail ) %]
219                             <br /><a href="mailto:[% branche.branchemail %]">[% branche.branchemail |html %]</a>[% END %]
220                         [% IF ( branche.branchurl ) %]
221                             <br /><a href="[% branche.branchurl %]">[% branche.branchurl |html %]</a>[% END %]
222                         [% IF ( branche.opac_info ) %]
223                             <br />OPAC Info: <div>[% branche.opac_info %]</div>[% END %]
224                         [% IF ( branche.branchnotes ) %]
225                             <br />Notes: [% branche.branchnotes |html %][% END %]
226                     [% END %]
227                 </td>
228                 <td>
229                     [% UNLESS ( branche.no_categories_p ) %]
230                         [% FOREACH category_lis IN branche.category_list %]
231                             [% category_lis.categoryname %]<br />
232                         [% END %]
233                     [% END %]
234                 </td>
235                 <td>
236                     [% branche.branchip %]
237                 </td>
238                 <!-- <td>
239                     [% branche.branchprinter %]
240                 </td> -->
241                 <td>
242                     <a href="[% branche.action %]?op=edit&amp;branchcode=[% branche.value |url %]">Edit</a>
243                 </td>
244                 <td>
245                     <a href="[% branche.action %]?branchcode=[% branche.value |url %]&amp;branchname=[% branche.branch_name |url %]&amp;op=delete">Delete</a>
246                 </td>
247             </tr>
248         [% END %]</tbody>
249     </table>
250         [% ELSE %]
251         <div class="dialog message">There are no libraries defined. <a href="/cgi-bin/koha/admin/branches.pl?op=add">Start defining libraries</a>.</div>
252         [% END %]
253     
254    [% IF ( branchcategories ) %]
255    [% FOREACH branchcategorie IN branchcategories %]
256     <h3>Group(s):  [% IF ( branchcategorie.properties ) %]Properties[% ELSE %][% IF ( branchcategorie.searchdomain ) %]Search domain[% END %][% END %]</h3>
257     [% IF ( branchcategorie.catloop ) %]
258       <table>
259         <thead>
260           <tr>
261             <th>Name</th>
262             <th>Code</th>
263             <th>Description</th>
264             <th>&nbsp;</th>
265             <th>&nbsp;</th>
266           </tr>
267         </thead>
268         <tbody>
269           [% FOREACH catloo IN branchcategorie.catloop %]
270             <tr>
271               <td>[% catloo.categoryname %]</td>
272               <td>[% catloo.categorycode %]</td>
273               <td>[% catloo.codedescription %]</td>
274               <td>
275                 <a href="[% catloo.action %]?op=editcategory&amp;categorycode=[% catloo.categorycode |url %]">Edit</a>
276               </td>
277               <td>
278                 <a href="[% catloo.action %]?op=delete_category&amp;categorycode=[% catloo.categorycode |url %]">Delete</a>
279               </td>
280             </tr>
281           [% END %]
282         </tbody>
283       </table>
284     [% ELSE %]
285       No [% IF ( branchcategorie.properties ) %]properties[% ELSIF ( branchcategorie.searchdomain ) %]search domain[% END %] defined. <a href="/cgi-bin/koha/admin/branches.pl?op=editcategory">Add a new group</a>.
286     [% END %]
287   [% END %]
288   [% ELSE %]
289     <p>No groups defined.</p>
290   [% END %] <!-- NAME="branchcategories" -->
291 [% END %]
292
293 [% IF ( editcategory ) %]
294     <h3>[% IF ( categorycode ) %]Edit group [% categorycode %][% ELSE %]Add group[% END %]</h3>
295     <form action="[% action %]" name="Aform" method="post">
296     <input type="hidden" name="op" value="addcategory_validate" />
297         [% IF ( categorycode ) %]
298         <input type="hidden" name="add" value="0">
299         [% ELSE %]
300         <input type="hidden" name="add" value="1">
301         [% END %]
302     <fieldset class="rows">
303         
304         <ol><li>
305                 [% IF ( categorycode ) %]
306                                 <span class="label">Category code: </span>
307                     <input type="hidden" name="categorycode" id="categorycode" value="[% categorycode |html %]" />
308                     [% categorycode %]
309                 [% ELSE %]
310                 <label for="categorycode">Category code:</label>
311                     <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" value="[% categorycode |html %]" />
312                 [% END %]
313             </li>
314         <li>
315             <label for="categoryname">Name: </label>
316             <input type="text" name="categoryname" id="categoryname" size="32" maxlength="32" value="[% categoryname |html %]" />
317         </li>
318         <li>
319             <label for="codedescription">Description: </label>
320             <input type="text" name="codedescription" id="codedescription" size="70" value="[% codedescription |html %]" />
321         </li>
322                 <li>
323         <label for="categorytype">Category type: </label>
324             <select id="categorytype" name="categorytype">
325             [% FOREACH categorytyp IN categorytype %]
326                 [% IF ( categorytyp.selected ) %]
327                     <option value="[% categorytyp.type %]" selected="selected">
328                 [% ELSE %]
329                     <option value="[% categorytyp.type %]">
330                 [% END %] [% categorytyp.type %]</option>
331             [% END %]
332             </select>
333                 </li>
334         <li>
335             <label for="show_in_pulldown">Show in search pulldown: </label>
336             [% IF ( show_in_pulldown ) %]
337                 <input type="checkbox" name="show_in_pulldown" id="show_in_pulldown" checked="checked"/>
338             [% ELSE %]
339                 <input type="checkbox" name="show_in_pulldown" id="show_in_pulldown" />
340             [% END %]
341         </li>
342                 </ol>
343     </fieldset>
344         <fieldset class="action"><input type="submit" value="Update" /></fieldset>
345     </form>
346 [% END %]
347
348 [% IF ( delete_category ) %]
349     [% UNLESS ( MESSAGE8 ) %]
350     <div class="dialog message"> 
351     Confirm delete:
352     <form action="[% action %]" method="post">
353         <input type="hidden" name="op" value="categorydelete_confirmed" />
354         <input type="hidden" name="categorycode" value="[% categorycode |html %]" />
355         <input type="submit" value="YES" />
356     </form>
357     <form action="[% action %]" method="post"><input type="hidden" name="op" value="">
358         <input type="submit" value="NO" />
359     </form>
360     </div>
361     [% END %]
362 [% END %]
363
364 </div>
365 </div>
366 <div class="yui-b">
367 [% INCLUDE 'admin-menu.inc' %]
368 </div>
369 </div>
370 [% INCLUDE 'intranet-bottom.inc' %]