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