4 [% USE ColumnsSettings %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Administration › Libraries
7 [% IF op == 'add_form' %]
8 ›[% IF library %]Modify library[% ELSE %]New library [% library.branchcode | html %][% END %]
9 [% ELSIF op == 'delete_confirm' %]
10 › Confirm deletion of library '[% library.branchcode | html %]'
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% Asset.css("css/datatables.css") | $raw %]
17 <body id="admin_branches" class="admin">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'prefs-admin-search.inc' %]
21 <div id="breadcrumbs">
22 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
24 › <a href="/cgi-bin/koha/admin/branches.pl">Libraries</a>
25 [% IF op == 'add_form' %]
26 › [% IF library %]Modify library[% ELSE %]New library [% library.branchcode | html %][% END %]
27 [% ELSIF op == 'delete_confirm' %]
28 › Confirm deletion of library '[% library.branchcode | html %]'
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 [% FOREACH m IN messages %]
38 <div class="dialog [% m.type | html %]">
40 [% CASE 'error_on_update' %]
41 An error occurred when updating this library. Perhaps it already exists.
42 [% CASE 'error_on_insert' %]
43 An error occurred when adding this library. The branchcode might already exist.
44 [% CASE 'error_on_delete' %]
45 An error occurred when deleting this library. Check the logs.
46 [% CASE 'success_on_update' %]
47 Library updated successfully.
48 [% CASE 'success_on_insert' %]
49 Library added successfully.
50 [% CASE 'success_on_delete' %]
51 Library deleted successfully.
52 [% CASE 'cannot_delete_library' %]
53 This library cannot be deleted. Patrons or items are still using it
54 [% IF m.data.patrons_count and m.data.items_count %]
55 ([% m.data.patrons_count | html %] patrons and [% m.data.items_count | html %] items).
56 [% ELSIF m.data.patrons_count %]
57 ([% m.data.patrons_count | html %] patrons).
58 [% ELSIF m.data.items_count %]
59 ([% m.data.items_count | html %] items).
61 [% CASE 'error_on_update_category' %]
62 An error occurred when updating this library category. Perhaps it already exists.
63 [% CASE 'error_on_insert_category' %]
64 An error occurred when adding this library category. The categorycode might already exist.
65 [% CASE 'error_on_delete_category' %]
66 An error occurred when deleting this library category. Check the logs.
67 [% CASE 'success_on_update_category' %]
68 Library category updated successfully.
69 [% CASE 'success_on_insert_category' %]
70 Library category added successfully.
71 [% CASE 'success_on_delete_category' %]
72 Library category deleted successfully.
73 [% CASE 'cannot_delete_category' %]
74 This library category cannot be deleted. [% m.data.libraries_count | html %] libraries are still using it.
82 <div id="toolbar" class="btn-toolbar">
83 <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>
87 [% IF op == 'add_form' %]
88 <h3>[% IF library %]Modify library[% ELSE %]New library[% END %]</h3>
89 <form action="/cgi-bin/koha/admin/branches.pl" id="Aform" name="Aform" class="validated" method="post">
90 <fieldset class="rows">
91 <input type="hidden" name="op" value="add_validate" />
93 <input type="hidden" name="is_a_modif" value="1" />
98 <span class="label">Library code: </span>
99 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
100 [% library.branchcode | html %]
102 <label for="branchcode" class="required">Library code: </label>
103 <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode | html %]" class="required" required="required" />
104 <span class="required">Required</span>
108 <label for="branchname" class="required">Name: </label>
109 <input type="text" name="branchname" id="branchname" size="80" value="[% library.branchname | html %]" class="required" required="required" />
110 <span class="required">Required</span>
115 <fieldset class="rows"><legend>Group(s):</legend>
117 [% FOREACH category IN categories %]
119 <label for="[% category.categorycode | html %]">[% category.categoryname | html %]: </label>
120 [% IF category and selected_categorycodes.grep(category.categorycode).size %]
121 <input type="checkbox" id="[% category.categorycode | html %]" name="selected_categorycode_[% category.categorycode | html %]" checked="checked" />
123 <input type="checkbox" id="[% category.categorycode | html %]" name="selected_categorycode_[% category.categorycode | html %]" />
125 <span class="hint">[% category.codedescription | html %]</span>
131 <fieldset class="rows">
133 <li><label for="branchaddress1">Address line 1: </label><input type="text" name="branchaddress1" id="branchaddress1" size="60" value="[% library.branchaddress1 | html %]" /></li>
134 <li><label for="branchaddress2">Address line 2: </label><input type="text" name="branchaddress2" id="branchaddress2" size="60" value="[% library.branchaddress2 | html %]" /></li>
135 <li><label for="branchaddress3">Address line 3: </label><input type="text" name="branchaddress3" id="branchaddress3" size="60" value="[% library.branchaddress3 | html %]" /></li>
136 <li><label for="branchcity">City: </label><input type="text" name="branchcity" id="branchcity" size="60" value="[% library.branchcity | html %]" /></li>
137 <li><label for="branchstate">State: </label><input type="text" name="branchstate" id="branchstate" size="60" value="[% library.branchstate | html %]" /></li>
138 <li><label for="branchzip">ZIP/Postal code: </label><input type="text" name="branchzip" id="branchzip" size="25" maxlength="25" value="[% library.branchzip | html %]" /></li>
139 <li><label for="branchcountry">Country: </label><input type="text" name="branchcountry" id="branchcountry" size="60" value="[% library.branchcountry | html %]" /></li>
140 <li><label for="branchphone">Phone: </label><input type="text" name="branchphone" id="branchphone" size="60" value="[% library.branchphone | html %]" /></li>
141 <li><label for="branchfax">Fax: </label><input type="text" name="branchfax" id="branchfax" size="60" value="[% library.branchfax | html %]" /></li>
142 <li><label for="branchemail">Email: </label><input type="text" name="branchemail" id="branchemail" class="email" size="80" value="[% library.branchemail | html %]" /></li>
143 <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>
144 <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>
145 <li><label for="branchurl">URL: </label><input type="text" name="branchurl" id="branchurl" size="80" value="[% library.branchurl | html %]" class="url" /></li>
146 <li><label for="opac_info">OPAC info: </label><textarea name="opac_info" id="opac_info">[% library.opac_info | $raw %]</textarea></li>
147 <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>
148 <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>
149 <li><label for="branchnotes">Notes: </label><input type="text" name="branchnotes" id="branchnotes" size="80" value="[% library.branchnotes | html %]" /></li>
150 <li><label for="pickup_location">Pickup location: </label>
151 <select name="pickup_location" id="pickup_location">
152 [% IF !library || library.pickup_location == 1 %]
153 <option value="1" selected="selected">Yes</option>
154 <option value="0">No</option>
156 <option value="1">Yes</option>
157 <option value="0" selected="selected">No</option>
163 <fieldset class="action">
164 <input type="submit" value="Submit" />
165 <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a>
170 [% IF op == 'delete_confirm' and not ( items_count or patrons_count )%]
171 <div class="dialog alert">
172 <form action="/cgi-bin/koha/admin/branches.pl" method="post">
173 <h3>Are you sure you want to delete [% library.branchname | html %] ([% library.branchcode | html %])?</h3>
174 <input type="hidden" name="op" value="delete_confirmed" />
175 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
176 <input type="hidden" name="branchname" value="[% library.branchname | html %]">
177 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
179 <form action="/cgi-bin/koha/admin/branches.pl" method="get">
180 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
185 [% IF op == 'list' %]
187 [% IF libraries.count %]
188 <table id="libraries">
194 <th>MARC organization code</th>
196 <th>Pickup location</th>
201 [% FOREACH library IN libraries %]
203 <td>[% library.branchname | html %]</td>
204 <td>[% library.branchcode | html %]</td>
206 [% IF library.branchaddress1 %]
207 [% library.branchaddress1 | html %][% END %]
208 [% IF library.branchaddress2 %]
209 <br />[% library.branchaddress2 | html %][% END %]
210 [% IF library.branchaddress3 %]
211 <br />[% library.branchaddress3 | html %][% END %]
212 [% IF library.branchcity %]
213 <br />[% library.branchcity | html %][% END %][% IF ( library.branchstate ) %],
214 [% library.branchstate | html %][% END %]
215 [% IF library.branchzip %]
216 [% library.branchzip | html %][% END %]
217 [% IF library.branchcountry %]
218 <br />[% library.branchcountry | html %][% END %]
219 [% IF library.branchphone %]
220 <br />Ph: [% library.branchphone | html %][% END %]
221 [% IF library.branchfax %]
222 <br />Fax: [% library.branchfax | html %][% END %]
223 [% IF library.branchemail %]
224 <br /><a href="mailto:[% library.branchemail | uri %]">[% library.branchemail | html %]</a>[% END %]
225 [% IF library.branchurl %]
226 <br /><a href="[% library.branchurl | url %]">[% library.branchurl | html %]</a>[% END %]
227 [% IF library.opac_info %]
228 <br />OPAC Info: <div>[% library.opac_info | $raw %]</div>[% END %]
229 [% IF library.branchnotes %]
230 <br />Notes: [% library.branchnotes | html %][% END %]
232 <td>[% library.marcorgcode | html %]</td>
233 <td>[% library.branchip | html %]</td>
234 <td>[% IF library.pickup_location %]Yes[% ELSE %]No[% END %]</td>
236 <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>
237 <form action="/cgi-bin/koha/admin/branches.pl" method="post">
238 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
239 <input type="hidden" name="op" value="delete_confirm" />
240 <button type="submit" id="delete_library_[% library.branchcode | html %]" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</button>
248 <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>
253 </div> <!-- /.col-sm-10.col-sm-push-2 -->
255 <div class="col-sm-2 col-sm-pull-10">
257 [% INCLUDE 'admin-menu.inc' %]
259 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
260 </div> <!-- /.row -->
262 [% MACRO jsinclude BLOCK %]
263 [% Asset.js("js/admin-menu.js") | $raw %]
264 [% INCLUDE 'datatables.inc' %]
265 [% INCLUDE 'columns_settings.inc' %]
266 [% Asset.js("lib/tiny_mce/tiny_mce.js") | $raw %]
268 var columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'libraries', 'libraries', 'json' ) | $raw %];
269 $(document).ready(function() {
270 KohaTable("libraries", {
272 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
274 "sPaginationType": "four_button",
275 "exportColumns": [0,1,2,3,4,5]
276 }, columns_settings);
279 $("#Aform").on("submit", function( event ) {
280 if ( $("#branchcode").val().match(/\s/) ) {
281 event.preventDefault();
282 alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code"));
290 tinyMCE.baseURL = "[% interface | html %]/lib/tiny_mce";
294 content_css : "[% interface | html %]/[% theme | html %]/css/tinymce.css",
295 plugins : "table,save,advhr,advlink,contextmenu",
296 theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,",
297 theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
298 // theme_advanced_buttons3 : "",
299 theme_advanced_toolbar_location : "top",
300 theme_advanced_toolbar_align : "left",
301 theme_advanced_path_location : "bottom",
302 theme_advanced_resizing : true,
303 apply_source_formatting : true
308 [% INCLUDE 'intranet-bottom.inc' %]