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