Bug 5917 : Converted templates
[koha.git] / koha-tt / 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, State</label><input type="text" name="branchcity" id="branchcity" value="[% branchcity |html %]" /></li>
113         <li><label for="branchzip">Zip/Postal Code</label><input type="text" name="branchzip" id="branchzip" value="[% branchzip |html %]" /></li>
114         <li><label for="branchcountry">Country</label><input type="text" name="branchcountry" id="branchcountry" value="[% branchcountry |html %]" /></li>
115         <li><label for="branchphone">Phone</label><input type="text" name="branchphone" id="branchphone" value="[% branchphone |html %]" /></li>
116         <li><label for="branchfax">Fax</label><input type="text" name="branchfax" id="branchfax" value="[% branchfax |html %]" /></li>
117         <li><label for="branchemail">Email</label><input type="text" name="branchemail" id="branchemail" value="[% branchemail |html %]" /></li>
118         <li><label for="branchurl">url</label><input type="text" name="branchurl" id="branchurl" value="[% branchurl |html %]" /></li>
119         <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>
120                 <!--
121         <li><label for="branchprinter">Library Printer</label>
122             <select id="branchprinter" name="branchprinter">
123                 <option value="">None</option>
124             [% FOREACH printerloo IN printerloop %]
125                 [% IF ( printerloo.selected ) %]
126                                 <option value="[% printerloo.value %]" selected="selected">[% printerloo.branchprinter %]</option>
127                                 [% ELSE %]
128                                 <option value="[% printerloo.value %]">[% printerloo.branchprinter %]</option>
129                                 [% END %]
130                 [% END %]
131             </select></li>
132                         -->
133         <li><label for="branchnotes">Notes</label><input type="text" name="branchnotes" id="branchnotes" value="[% branchnotes |html %]" /></li>
134         </ol>
135         </fieldset>
136         <fieldset class="action"><input type="submit" value="Submit" /> <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a></fieldset>
137     </form>
138 [% END %]
139
140 [% IF ( delete_confirm ) %]
141     <form action="[% action %]" method="post">
142 <fieldset><legend>Confirm deletion of [% branchname %] ([% branchcode %])?</legend><input type="hidden" name="op" value="delete_confirmed" />
143         <input type="hidden" name="branchcode" value="[% branchcode |html %]" />
144         <input type="hidden" name="branchname" value="[% branchname |html %]">
145         <fieldset class="action"><input type="submit" value="Delete Library" /> <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a></fieldset>
146 </fieldset></form>
147 [% END %]
148
149 [% IF ( else ) %]
150     <h3>Libraries</h3>
151     [% IF ( message ) %]<div class="dialog message">
152         [% message %]</div>[% END %]
153     [% IF ( MESSAGE1 ) %]<div class="dialog message">Library not saved &mdash; code and/or name missing</div>[% END %]
154     [% IF ( MESSAGE2 ) %]<div class="dialog message">Library saved</div>[% END %]
155     [% IF ( MESSAGE3 ) %]<div class="dialog message">Library deleted</div>[% END %]
156     [% IF ( MESSAGE4 ) %]<div class="dialog message">Library category added</div>[% END %]
157     [% IF ( MESSAGE5 ) %]<div class="dialog message">Library category modified</div>[% END %]
158     [% IF ( MESSAGE6 ) %]<div class="dialog message">Library category deleted</div>[% END %]
159     [% IF ( MESSAGE7 ) %]<div class="dialog message">Library cannot be deleted because there are patrons and items using that library</div>[% END %]
160     [% IF ( MESSAGE8 ) %]<div class="dialog message">Category cannot be deleted because there are libraries using that category</div>[% END %]
161     [% IF ( MESSAGE9 ) %]<div class="dialog message">Category cannot be added, categorycode already exists</div>[% END %]
162     [% IF ( MESSAGE10 ) %]<div class="dialog message">Library cannot be deleted because there are items held by that library</div>[% END %]
163     [% IF ( MESSAGE11 ) %]<div class="dialog message">Library cannot be deleted because there are patrons registered at that library</div>[% END %]
164 [% IF ( branches ) %]
165 <span id="pagerbranchest" class="pager">
166         <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
167                 <img src="[% interface %]/prog/img/first.png" class="first"/>
168                 <img src="[% interface %]/prog/img/prev.png" class="prev"/>
169                 <input type="text" size="5" class="pagedisplay"/>
170                 <img src="[% interface %]/prog/img/next.png" class="next"/>
171                 <img src="[% interface %]/prog/img/last.png" class="last"/>
172                 , entries/page : 
173                 <select class="pagesize">
174                 <option selected="selected" value="10">10</option>
175                         <option value="20">20</option>
176                         <option value="30">30</option>
177                         <option value="40">40</option>
178                         <option value="50">50</option>
179                         <option value="100">100</option>
180                 </select>
181         </form>
182 </span>
183     <table id="branchest">
184 <thead><tr>
185                         <th>Name</th>
186             <th>Code</th>
187             <th>Address</th>
188             <th>Properties</th>
189             <th>IP</th>
190             <!-- <th>Printer</th> -->
191             <th colspan="2">&nbsp;</th>
192         </tr></thead><tbody>
193         [% FOREACH branche IN branches %]
194         [% IF ( loop.odd ) %]
195         <tr>
196         [% ELSE %]
197                 <tr class="highlight">
198         [% END %]
199                 <td>[% branche.branch_name |html %]</td>
200                 <td>[% branche.branch_code |html %]</td>
201                 <td>
202                     [% IF ( branche.address_empty_p ) %]
203                         (nothing entered)
204                     [% ELSE %]
205                         [% IF ( branche.branchaddress1 ) %]
206                             [% branche.branchaddress1 |html %][% END %]
207                         [% IF ( branche.branchaddress2 ) %]
208                             <br />[% branche.branchaddress2 |html %][% END %]
209                         [% IF ( branche.branchaddress3 ) %]
210                             <br />[% branche.branchaddress3 |html %][% END %]
211                         [% IF ( branche.branchzip ) %]
212                             <br />[% branche.branchzip |html %][% END %]
213                         [% IF ( branche.branchcity ) %]
214                             <br />[% branche.branchcity |html %][% END %]
215                         [% IF ( branche.branchcountry ) %]
216                             <br />[% branche.branchcountry |html %][% END %]
217                         [% IF ( branche.branchphone ) %]
218                             <br />Ph: [% branche.branchphone |html %][% END %]
219                         [% IF ( branche.branchfax ) %]
220                             <br />Fax: [% branche.branchfax |html %][% END %]
221                         [% IF ( branche.branchemail ) %]
222                             <br />Email: [% branche.branchemail |html %][% END %]
223                         [% IF ( branche.branchurl ) %]
224                             <br />url: [% branche.branchurl |html %][% END %]
225                         [% IF ( branche.branchnotes ) %]
226                             <br />Notes: [% branche.branchnotes |html %][% END %]
227                     [% END %]
228                 </td>
229                 <td>
230                     [% UNLESS ( branche.no_categories_p ) %]
231                         [% FOREACH category_lis IN branche.category_list %]
232                             [% category_lis.categoryname %]<br />
233                         [% END %]
234                     [% END %]
235                 </td>
236                 <td>
237                     [% branche.branchip %]
238                 </td>
239                 <!-- <td>
240                     [% branche.branchprinter %]
241                 </td> -->
242                 <td>
243                     <a href="[% branche.action %]?op=edit&amp;branchcode=[% branche.value |url %]">Edit</a>
244                 </td>
245                 <td>
246                     <a href="[% branche.action %]?branchcode=[% branche.value |url %]&amp;branchname=[% branche.branch_name |url %]&amp;op=delete">Delete</a>
247                 </td>
248             </tr>
249         [% END %]</tbody>
250     </table>
251         [% ELSE %]
252         <div class="dialog message">There are no libraries defined. <a href="/cgi-bin/koha/admin/branches.pl?op=add">Start defining libraries</a>.</div>
253         [% END %]
254     
255    [% IF ( branchcategories ) %]
256    [% FOREACH branchcategorie IN branchcategories %]
257     <h3>Group(s):  [% IF ( branchcategorie.properties ) %]Properties[% ELSE %][% IF ( branchcategorie.searchdomain ) %]Search Domain[% END %][% END %]</h3>
258         <table>
259     <tr>
260         <th>Name</th>
261         <th>Code</th>
262         <th>Description</th>
263         <th>&nbsp;</th>
264         <th>&nbsp;</th>
265     </tr>
266 [% IF ( branchcategorie.catloop ) %][% FOREACH catloo IN branchcategorie.catloop %]
267         <tr>
268         <td>[% catloo.categoryname %]</td>
269         <td>[% catloo.categorycode %]</td>
270         <td>[% catloo.codedescription %]</td>
271         <td><a href="[% catloo.action %]?op=editcategory&amp;categorycode=[% catloo.categorycode |url %]">Edit</a>
272         </td>
273         <td><a href="[% catloo.action %]?op=delete_category&amp;categorycode=[% catloo.categorycode |url %]">Delete</a>
274         </td>
275         </tr>
276     [% END %][% ELSE %]<tr><td colspan="5">No [% IF ( branchcategorie.properties ) %]Properties[% ELSIF ( branchcategorie.searchdomain ) %]Search Domain[% END %] Defined</td></tr>[% END %]
277     </table>
278     [% END %]
279     [% ELSE %]
280         <p>No Groups defined.</p>
281     [% END %] <!-- NAME="branchcategories" -->
282 [% END %]
283
284 [% IF ( editcategory ) %]
285     <h3>[% IF ( categorycode ) %]Edit Group [% categorycode %][% ELSE %]Add Group[% END %]</h3>
286     <form action="[% action %]" name="Aform" method="post">
287     <input type="hidden" name="op" value="addcategory_validate" />
288         [% IF ( categorycode ) %]
289         <input type="hidden" name="add" value="0">
290         [% ELSE %]
291         <input type="hidden" name="add" value="1">
292         [% END %]
293     <fieldset class="rows">
294         
295         <ol><li>
296                 [% IF ( categorycode ) %]
297                                 <span class="label">Category code: </span>
298                     <input type="hidden" name="categorycode" id="categorycode" value="[% categorycode |html %]" />
299                     [% categorycode %]
300                 [% ELSE %]
301                 <label for="categorycode">Category code:</label>
302                     <input type="text" name="categorycode" id="categorycode" size="11" maxlength="10" value="[% categorycode |html %]" />
303                 [% END %]
304             </li>
305         <li>
306             <label for="categoryname">Name: </label>
307             <input type="text" name="categoryname" id="categoryname" size="40" maxlength="80" value="[% categoryname |html %]" />
308         </li>
309         <li>
310             <label for="codedescription">Description: </label>
311             <input type="text" name="codedescription" id="codedescription" size="70" maxlength="80" value="[% codedescription |html %]" />
312         </li>
313                 <li>
314                 <label for="categorytype">Category Type: </label>
315             <select id="categorytype" name="categorytype">
316             [% FOREACH categorytyp IN categorytype %]
317                 [% IF ( categorytyp.selected ) %]
318                     <option value="[% categorytyp.type %]" selected="selected">
319                 [% ELSE %]
320                     <option value="[% categorytyp.type %]">
321                 [% END %] [% categorytyp.type %]</option>
322             [% END %]
323             </select>
324                 </li>
325                 </ol>
326     </fieldset>
327         <fieldset class="action"><input type="submit" value="Update" /></fieldset>
328     </form>
329 [% END %]
330
331 [% IF ( delete_category ) %]
332     [% UNLESS ( MESSAGE8 ) %]
333     <div class="dialog message"> 
334     Confirm delete:
335     <form action="[% action %]" method="post">
336         <input type="hidden" name="op" value="categorydelete_confirmed" />
337         <input type="hidden" name="categorycode" value="[% categorycode |html %]" />
338         <input type="submit" value="YES" />
339     </form>
340     <form action="[% action %]" method="post"><input type="hidden" name="op" value="">
341         <input type="submit" value="NO" />
342     </form>
343     </div>
344     [% END %]
345 [% END %]
346
347 </div>
348 </div>
349 <div class="yui-b">
350 [% INCLUDE 'admin-menu.inc' %]
351 </div>
352 </div>
353 [% INCLUDE 'intranet-bottom.inc' %]