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