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