4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › Libraries
6 [% IF op == 'add_form' %]
7 ›[% IF library %]Modify library[% ELSE %]New library [% library.branchcode | html %][% END %]
8 [% ELSIF op == 'delete_confirm' %]
9 › Confirm deletion of library '[% library.branchcode | html %]'
12 [% INCLUDE 'doc-head-close.inc' %]
13 [% Asset.css("css/datatables.css") | $raw %]
16 <body id="admin_branches" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'prefs-admin-search.inc' %]
20 <div id="breadcrumbs">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
23 › <a href="/cgi-bin/koha/admin/branches.pl">Libraries</a>
24 [% IF op == 'add_form' %]
25 › [% IF library %]Modify library[% ELSE %]New library [% library.branchcode | html %][% END %]
26 [% ELSIF op == 'delete_confirm' %]
27 › Confirm deletion of library '[% library.branchcode | html %]'
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
36 [% FOREACH m IN messages %]
37 <div class="dialog [% m.type | html %]">
39 [% CASE 'error_on_update' %]
40 An error occurred when updating this library. Perhaps it already exists.
41 [% CASE 'error_on_insert' %]
42 An error occurred when adding this library. The branchcode might already exist.
43 [% CASE 'error_on_delete' %]
44 An error occurred when deleting this library. Check the logs.
45 [% CASE 'success_on_update' %]
46 Library updated successfully.
47 [% CASE 'success_on_insert' %]
48 Library added successfully.
49 [% CASE 'success_on_delete' %]
50 Library deleted successfully.
51 [% CASE 'cannot_delete_library' %]
52 This library cannot be deleted. Patrons or items are still using it
53 [% IF m.data.patrons_count and m.data.items_count %]
54 ([% m.data.patrons_count | html %] patrons and [% m.data.items_count | html %] items).
55 [% ELSIF m.data.patrons_count %]
56 ([% m.data.patrons_count | html %] patrons).
57 [% ELSIF m.data.items_count %]
58 ([% m.data.items_count | html %] items).
60 [% CASE 'error_on_update_category' %]
61 An error occurred when updating this library category. Perhaps it already exists.
62 [% CASE 'error_on_insert_category' %]
63 An error occurred when adding this library category. The categorycode might already exist.
64 [% CASE 'error_on_delete_category' %]
65 An error occurred when deleting this library category. Check the logs.
66 [% CASE 'success_on_update_category' %]
67 Library category updated successfully.
68 [% CASE 'success_on_insert_category' %]
69 Library category added successfully.
70 [% CASE 'success_on_delete_category' %]
71 Library category deleted successfully.
72 [% CASE 'cannot_delete_category' %]
73 This library category cannot be deleted. [% m.data.libraries_count | html %] libraries are still using it.
81 <div id="toolbar" class="btn-toolbar">
82 <a class="btn btn-default btn-sm" id="newbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form"><i class="fa fa-plus"></i> New library</a>
86 [% IF op == 'add_form' %]
87 <h3>[% IF library %]Modify library[% ELSE %]New library[% END %]</h3>
88 <form action="/cgi-bin/koha/admin/branches.pl" id="Aform" name="Aform" class="validated" method="post">
89 <fieldset class="rows">
90 <input type="hidden" name="op" value="add_validate" />
92 <input type="hidden" name="is_a_modif" value="1" />
97 <span class="label">Library code: </span>
98 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
99 [% library.branchcode | html %]
101 <label for="branchcode" class="required">Library code: </label>
102 <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode | html %]" class="required" required="required" />
103 <span class="required">Required</span>
107 <label for="branchname" class="required">Name: </label>
108 <input type="text" name="branchname" id="branchname" size="80" value="[% library.branchname | html %]" class="required" required="required" />
109 <span class="required">Required</span>
114 <fieldset class="rows"><legend>Group(s):</legend>
116 [% FOREACH category IN categories %]
118 <label for="[% category.categorycode | html %]">[% category.categoryname | html %]: </label>
119 [% IF category and selected_categorycodes.grep(category.categorycode).size %]
120 <input type="checkbox" id="[% category.categorycode | html %]" name="selected_categorycode_[% category.categorycode | html %]" checked="checked" />
122 <input type="checkbox" id="[% category.categorycode | html %]" name="selected_categorycode_[% category.categorycode | html %]" />
124 <span class="hint">[% category.codedescription | html %]</span>
130 <fieldset class="rows">
132 <li><label for="branchaddress1">Address line 1: </label><input type="text" name="branchaddress1" id="branchaddress1" size="60" value="[% library.branchaddress1 | html %]" /></li>
133 <li><label for="branchaddress2">Address line 2: </label><input type="text" name="branchaddress2" id="branchaddress2" size="60" value="[% library.branchaddress2 | html %]" /></li>
134 <li><label for="branchaddress3">Address line 3: </label><input type="text" name="branchaddress3" id="branchaddress3" size="60" value="[% library.branchaddress3 | html %]" /></li>
135 <li><label for="branchcity">City: </label><input type="text" name="branchcity" id="branchcity" size="60" value="[% library.branchcity | html %]" /></li>
136 <li><label for="branchstate">State: </label><input type="text" name="branchstate" id="branchstate" size="60" value="[% library.branchstate | html %]" /></li>
137 <li><label for="branchzip">ZIP/Postal code: </label><input type="text" name="branchzip" id="branchzip" size="25" maxlength="25" value="[% library.branchzip | html %]" /></li>
138 <li><label for="branchcountry">Country: </label><input type="text" name="branchcountry" id="branchcountry" size="60" value="[% library.branchcountry | html %]" /></li>
139 <li><label for="branchphone">Phone: </label><input type="text" name="branchphone" id="branchphone" size="60" value="[% library.branchphone | html %]" /></li>
140 <li><label for="branchfax">Fax: </label><input type="text" name="branchfax" id="branchfax" size="60" value="[% library.branchfax | html %]" /></li>
141 <li><label for="branchemail">Email: </label><input type="text" name="branchemail" id="branchemail" class="email" size="80" value="[% library.branchemail | html %]" /></li>
142 <li><label for="branchreplyto">Reply-To: </label> <input type="text" name="branchreplyto" id="branchreplyto" class="email" size="80" value="[% library.branchreplyto | html %]" /><br /><span class="hint">Default: ReplyToDefault system preference</span></li>
143 <li><label for="branchreturnpath">Return-Path: </label> <input type="text" name="branchreturnpath" id="branchreturnpath" class="email" size="80" value="[% library.branchreturnpath | html %]" /><br /><span class="hint">Default: ReturnpathDefault system preference</span></li>
144 <li><label for="branchurl">URL: </label><input type="text" name="branchurl" id="branchurl" size="80" value="[% library.branchurl | html %]" class="url" /></li>
145 <li><label for="opac_info">OPAC info: </label><textarea name="opac_info" id="opac_info">[% library.opac_info | $raw %]</textarea></li>
146 <li><label for="branchip">IP: </label><input type="text" name="branchip" id="branchip" size="15" maxlength="15" value="[% library.branchip | html %]" /> <span class="hint">Can be entered as a single IP, or a subnet such as 192.168.1.*</span></li>
147 <li><label for="marcorgccode">MARC organization code</label> <input type="text" name="marcorgcode" id="marcorgcode" size="16" value="[% library.marcorgcode | html %]" /> <span class="hint">If not filled in defaults to system preference MARCOrgCode. You can obtain your code from <a href="http://www.loc.gov/marc/organizations/orgshome.html" target="_blank">Library of Congress</a>.</span>
148 <li><label for="branchnotes">Notes: </label><input type="text" name="branchnotes" id="branchnotes" size="80" value="[% library.branchnotes | html %]" /></li>
149 <li><label for="pickup_location">Pickup location: </label>
150 <select name="pickup_location" id="pickup_location">
151 [% IF !library || library.pickup_location == 1 %]
152 <option value="1" selected="selected">Yes</option>
153 <option value="0">No</option>
155 <option value="1">Yes</option>
156 <option value="0" selected="selected">No</option>
162 <fieldset class="action">
163 <input type="submit" value="Submit" />
164 <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a>
169 [% IF op == 'delete_confirm' and not ( items_count or patrons_count )%]
170 <div class="dialog alert">
171 <form action="/cgi-bin/koha/admin/branches.pl" method="post">
172 <h3>Are you sure you want to delete [% library.branchname | html %] ([% library.branchcode | html %])?</h3>
173 <input type="hidden" name="op" value="delete_confirmed" />
174 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
175 <input type="hidden" name="branchname" value="[% library.branchname | html %]">
176 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
178 <form action="/cgi-bin/koha/admin/branches.pl" method="get">
179 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
184 [% IF op == 'list' %]
186 [% IF libraries.count %]
187 <table id="branchest">
193 <th>MARC organization code</th>
195 <th>Pickup location</th>
200 [% FOREACH library IN libraries %]
202 <td>[% library.branchname | html %]</td>
203 <td>[% library.branchcode | html %]</td>
205 [% IF library.branchaddress1 %]
206 [% library.branchaddress1 | html %][% END %]
207 [% IF library.branchaddress2 %]
208 <br />[% library.branchaddress2 | html %][% END %]
209 [% IF library.branchaddress3 %]
210 <br />[% library.branchaddress3 | html %][% END %]
211 [% IF library.branchcity %]
212 <br />[% library.branchcity | html %][% END %][% IF ( library.branchstate ) %],
213 [% library.branchstate | html %][% END %]
214 [% IF library.branchzip %]
215 [% library.branchzip | html %][% END %]
216 [% IF library.branchcountry %]
217 <br />[% library.branchcountry | html %][% END %]
218 [% IF library.branchphone %]
219 <br />Ph: [% library.branchphone | html %][% END %]
220 [% IF library.branchfax %]
221 <br />Fax: [% library.branchfax | html %][% END %]
222 [% IF library.branchemail %]
223 <br /><a href="mailto:[% library.branchemail | uri %]">[% library.branchemail | html %]</a>[% END %]
224 [% IF library.branchurl %]
225 <br /><a href="[% library.branchurl | url %]">[% library.branchurl | html %]</a>[% END %]
226 [% IF library.opac_info %]
227 <br />OPAC Info: <div>[% library.opac_info | $raw %]</div>[% END %]
228 [% IF library.branchnotes %]
229 <br />Notes: [% library.branchnotes | html %][% END %]
231 <td>[% library.marcorgcode | html %]</td>
232 <td>[% library.branchip | html %]</td>
233 <td>[% IF library.pickup_location %]Yes[% ELSE %]No[% END %]</td>
235 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=[% library.branchcode |uri %]"><i class="fa fa-pencil"></i> Edit</a>
236 <form action="/cgi-bin/koha/admin/branches.pl" method="post">
237 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
238 <input type="hidden" name="op" value="delete_confirm" />
239 <button type="submit" id="delete_library_[% library.branchcode | html %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>
247 <div class="dialog message">There are no libraries defined. <a href="/cgi-bin/koha/admin/branches.pl?op=add_form">Start defining libraries</a>.</div>
252 </div> <!-- /.col-sm-10.col-sm-push-2 -->
254 <div class="col-sm-2 col-sm-pull-10">
256 [% INCLUDE 'admin-menu.inc' %]
258 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
259 </div> <!-- /.row -->
261 [% MACRO jsinclude BLOCK %]
262 [% Asset.js("js/admin-menu.js") | $raw %]
263 [% INCLUDE 'datatables.inc' %]
264 [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
266 $(document).ready(function() {
267 $("#branchest").dataTable($.extend(true, {}, dataTablesDefaults, {
269 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
271 "iDisplayLength": 10,
272 "sPaginationType": "four_button"
276 $("#Aform").on("submit", function( event ) {
277 if ( $("#branchcode").val().match(/\s/) ) {
278 event.preventDefault();
279 alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code"));
287 tinyMCE.baseURL = "[% interface | html %]/lib/tiny_mce";
291 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
292 plugins : "table,save,advhr,advlink,contextmenu",
293 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,",
294 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
295 // theme_advanced_buttons3 : "",
296 theme_advanced_toolbar_location : "top",
297 theme_advanced_toolbar_align : "left",
298 theme_advanced_path_location : "bottom",
299 theme_advanced_resizing : true,
300 apply_source_formatting : true
305 [% INCLUDE 'intranet-bottom.inc' %]