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