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