5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Administration › Library groups</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
11 <body id="admin_library_groups" class="admin">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
15 <div id="breadcrumbs">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
17 › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
18 › <a href="/cgi-bin/koha/admin/library_groups.pl">Library groups</a>
21 [% FOR m IN messages %]
22 <div class="dialog [% m.type | html %]">
24 [% CASE 'error_on_insert' %]
25 An error occurred when adding this library. The library id might already exist in this group.
33 <div class="dialog message group-added">
34 [% IF added.branchcode %]
35 [% added.library.branchname | $KohaSpan class = 'name' | $raw %] added to group.
37 Group [% added.title | $KohaSpan class = 'name' | $raw %] created.
41 <div class="dialog message group-deleted">
42 [% IF deleted.title %]
43 Group [% deleted.title | $KohaSpan class = 'name' | $raw %] has been deleted.
45 [% deleted.library | $KohaSpan class = 'name' | $raw %] has been removed from group.
48 [% ELSIF error_duplicate_title %]
49 <div class="dialog alert error-duplicate-group-title">
50 A group with the title [% error_duplicate_title | $KohaSpan class = 'name' | $raw %] already exists.
54 <div class="main container-fluid">
56 <div class="col-sm-10 col-sm-push-2">
59 <div id="toolbar" class="btn-toolbar">
60 <div class="btn-group">
61 <a id="add-group-root" class="btn btn-default add-group" href="#">
62 <i class="fa fa-plus"></i> Add group
67 <h2>Library groups</h2>
69 [% FOREACH root_group IN root_groups %]
70 <table class="library-groups">
74 <th>Features enabled</th>
77 [% PROCESS tree group=root_group %]
82 </div> <!-- /.col-sm-10.col-sm-push-2 -->
84 <div class="col-sm-2 col-sm-pull-10">
86 [% INCLUDE 'admin-menu.inc' %]
88 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
91 <div id="add-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="add-group-modal-label" aria-hidden="true">
92 <form id="add-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal">
93 <div class="modal-dialog">
94 <div class="modal-content">
95 <div class="modal-header">
96 <h3 id="add-group-modal-label">Add group</h3>
98 <div class="modal-body">
99 <fieldset class="rows">
100 <input type="hidden" id="add-group-modal-parent-id" name="parent_id" value="" />
101 <input type="hidden" id="add-group-modal-action" name="action" value="add">
104 <label for="add-group-modal-title">Title: </label>
105 <input type="text" size="40" maxlength="100" name="title" id="add-group-modal-title" required="required" />
106 <span class="required">Required</span>
107 <div class="hint">Displayed in the library group search dropdowns.</div>
110 <label for="add-group-modal-description">Description: </label>
111 <input type="text" size="40" name="description" id="add-group-modal-description" />
115 <div id="root-group-features-add">
117 <div class="checkbox">
120 <input type="checkbox" name="ft_hide_patron_info" id="add-group-modal-ft_hide_patron_info" value="1" />
121 Limit patron data access by group
126 <input type="checkbox" name="ft_search_groups_opac" id="add-group-modal-ft_search_groups_opac" value="1" />
127 Use for OPAC search groups
132 <input type="checkbox" name="ft_search_groups_staff" id="add-group-modal-ft_search_groups_staff" value="1" />
133 Use for staff search groups
138 <input type="checkbox" name="ft_local_hold_group" id="add-group-modal-ft_local_hold_group" value="1" />
145 <div class="modal-footer">
146 <button type="submit" class="btn btn-default">Save</button>
147 <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
154 <div id="edit-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="edit-group-modal-label" aria-hidden="true">
155 <form id="edit-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal">
156 <div class="modal-dialog">
157 <div class="modal-content">
158 <div class="modal-header">
159 <h3 id="edit-group-modal-label">Edit group</h3>
161 <div class="modal-body">
162 <input type="hidden" id="edit-group-modal-id" name="id" value="" />
163 <input type="hidden" id="edit-group-modal-action" name="action" value="edit" />
164 <fieldset class="rows">
167 <label for="edit-group-modal-title">Title: </label>
168 <input type="text" size="40" maxlength="100" id="edit-group-modal-title" name="title" value="" required="required" />
169 <span class="required">Required</span>
170 <div class="hint">Displayed in the library group search dropdowns.</div>
174 <label for="edit-group-modal-description">Description: </label>
175 <input type="text" size="40" id="edit-group-modal-description" name="description" value="" />
179 <div id="root-group-features-edit">
181 <div class="checkbox">
184 <input type="checkbox" id="edit-group-modal-ft_hide_patron_info" name="ft_hide_patron_info" value="1" />
185 Limit patron data access by group
190 <input type="checkbox" id="edit-group-modal-ft_search_groups_opac" name="ft_search_groups_opac" value="1" />
191 Use for OPAC search groups
196 <input type="checkbox" id="edit-group-modal-ft_search_groups_staff" name="ft_search_groups_staff" value="1" />
197 Use for staff search groups
202 <input type="checkbox" id="edit-group-modal-ft_local_hold_group" name="ft_local_hold_group" value="1" />
209 <div class="modal-footer">
210 <button type="submit" class="btn btn-default">Update</button>
211 <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
218 <div id="delete-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="delete-group-modal-label" aria-hidden="true">
219 <form action="/cgi-bin/koha/admin/library_groups.pl">
220 <div class="modal-dialog">
221 <div class="modal-content">
222 <input id="delete-group-modal-action" type="hidden" name="action" value="delete" />
223 <input id="delete-group-modal-id" type="hidden" name="id" value="" />
224 <div class="modal-header">
225 <h3 id="delete-group-modal-label">Delete group</h3>
227 <div class="modal-body">
228 Are you sure you want to delete <span id="delete-group-modal-title" class="name"></span>?
230 <div class="modal-footer">
231 <button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Delete</button>
232 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
239 <div id="remove-library-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="remove-library-modal-label" aria-hidden="true">
240 <form action="/cgi-bin/koha/admin/library_groups.pl">
241 <div class="modal-dialog">
242 <div class="modal-content">
243 <input id="remove-library-modal-action" type="hidden" name="action" value="delete" />
244 <input id="remove-library-modal-id" type="hidden" name="id" value="" />
245 <div class="modal-header">
246 <h3 id="remove-library-modal-label">Remove library from group</h3>
248 <div class="modal-body">
249 Are you sure you want to remove <span id="remove-library-modal-library" class="name"></span> from <span id="remove-library-modal-group" class="name"></span>?
251 <div class="modal-footer">
252 <button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Remove</button>
253 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
260 [% MACRO jsinclude BLOCK %]
261 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
263 $(document).ready(function() {
264 $('.library-groups').treetable({
266 initialState: 'expanded',
267 clickableNodeNames: true,
270 $('.add-group').on('click', function(e) {
272 var id = $(this).data('groupId');
276 $('.edit-group').on('click', function(e) {
278 var id = $(this).data('groupId');
279 var parent_id = $(this).data('groupParentId');
280 var title = $(this).data('groupTitle');
281 var description = $(this).data('groupDescription');
282 var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info');
283 var ft_search_groups_opac = $(this).data('groupFt_search_groups_opac');
284 var ft_search_groups_staff = $(this).data('groupFt_search_groups_staff');
285 var ft_local_hold_group = $(this).data('groupFt_local_hold_group');
286 edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group );
289 $('.delete-group').on('click', function(e) {
291 var id = $(this).data('groupId');
292 var title = $(this).data('groupTitle');
293 delete_group( id, title );
296 $('.remove-library').on('click', function(e) {
298 var id = $(this).data('groupId');
299 var library = $(this).data('groupLibrary');
300 var parent_title = $(this).data('groupParentTitle');
301 remove_library( id, library, parent_title );
303 $('#add-group-modal').on('shown.bs.modal', function() {
304 $('#add-group-modal-title').focus();
306 $('#edit-group-modal').on('shown.bs.modal', function() {
307 $('#edit-group-modal-title').focus();
311 function add_group( parent_id ) {
312 $('#add-group-modal-parent-id').val( parent_id );
314 $('#add-group-modal-description').val("");
315 $('#add-group-modal-title').val("");
318 $('#add-group-modal-ft_hide_patron_info').prop('checked', false);
319 $('#add-group-modal-ft_search_groups_opac').prop('checked', false);
320 $('#add-group-modal-ft_search_groups_staff').prop('checked', false);
321 $('#add-group-modal-ft_local_hold_group').prop('checked', false);
323 $('#root-group-features-add').hide();
325 $('#root-group-features-add').show();
327 $('#add-group-modal').modal('show');
331 function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group ) {
332 $('#edit-group-modal-id').val( id );
333 $('#edit-group-modal-title').val( title );
334 $('#edit-group-modal-description').val( description );
337 $('#edit-group-modal-ft_hide_patron_info').prop('checked', false);
338 $('#edit-group-modal-ft_search_groups_opac').prop('checked', false);
339 $('#edit-group-modal-ft_search_groups_staff').prop('checked', false);
340 $('#edit-group-modal-ft_local_hold_group').prop('checked', false);
341 $('#root-group-features-edit').hide();
343 $('#edit-group-modal-ft_hide_patron_info').prop('checked', ft_hide_patron_info ? true : false );
344 $('#edit-group-modal-ft_search_groups_opac').prop('checked', ft_search_groups_opac ? true : false );
345 $('#edit-group-modal-ft_search_groups_staff').prop('checked', ft_search_groups_staff ? true : false );
346 $('#edit-group-modal-ft_local_hold_group').prop('checked', ft_local_hold_group ? true : false );
347 $('#root-group-features-edit').show();
350 $('#edit-group-modal').modal('show');
353 function delete_group( id, title ) {
354 $('#delete-group-modal-title').html(title);
355 $('#delete-group-modal-id').val( id );
356 $('#delete-group-modal').modal('show');
359 function remove_library( id, library, parent_title ) {
360 $('#remove-library-modal-library').html( library );
361 $('#remove-library-modal-group').html(parent_title);
362 $('#remove-library-modal-id').val( id );
363 $('#remove-library-modal').modal('show');
369 [% INCLUDE 'intranet-bottom.inc' %]
372 <tr data-tt-id="[% group.id | html %]" data-tt-parent-id="[% group.parent_id | html %]">
374 [% IF group.branchcode %]
375 [% group.branchcode | html %]
377 [% group.title | html %]
381 [% IF group.branchcode %]
382 [% group.library.branchname | html %]
384 [% group.description | html %]
388 [% UNLESS group.branchcode %]
390 [% IF group.ft_hide_patron_info %]
391 <li>Hide patron's info for librarians outside of this group.</li>
393 [% IF group.ft_search_groups_opac %]
394 <li>Use for OPAC search groups</li>
396 [% IF group.ft_search_groups_staff %]
397 <li>Use for staff search groups</li>
399 [% IF group.ft_local_hold_group %]
400 <li>Is local hold group</li>
406 [% IF group.branchcode %]
407 <button class="btn btn-default btn-xs remove-library" data-group-id="[% group.id | html %]" data-group-library="[% group.library.branchname | html %]" data-group-parent-title="[% group.parent.title | html %]" ><i class="fa fa-trash"></i> Remove from group</button>
409 <div class="btn-group">
410 <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> Actions <span class="caret"></span></button>
411 <ul class="dropdown-menu">
413 <a id="add-group-[% group.id | html %]" href="#" class="add-group" data-group-id="[% group.id | html %]">
414 <i class="fa fa-plus"></i> Add sub-group
419 <a class="edit-group" id="edit-group-[% group.id | html %]" href="#" data-group-id="[% group.id | html %]" data-group-parent-id="[% group.parent_id | html %]" data-group-title="[% group.title | html %]" data-group-description="[% group.description | html %]" data-group-ft_hide_patron_info="[% group.ft_hide_patron_info | html %]" data-group-ft_search_groups_opac="[% group.ft_search_groups_opac | html %]" data-group-ft_search_groups_staff="[% group.ft_search_groups_staff | html %]" data-group-ft_local_hold_group="[% group.ft_local_hold_group | html %]" >
420 <i class="fa fa-pencil"></i> Edit
425 <a class="delete-group" id="delete-group-[% group.id | html %]" href="#" data-group-id="[% group.id | html %]" data-group-title="[% group.title | html %]">
426 <i class="fa fa-trash"></i> Delete
432 <div class="btn-group">
433 <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> Add library <span class="caret"></span></button>
434 <ul class="dropdown-menu">
435 [% FOREACH library IN group.libraries_not_direct_children %]
437 <a class="add-library" id="add-library[% library.id | html %]-[% group.id | html %]" href="/cgi-bin/koha/admin/library_groups.pl?action=add&parent_id=[% group.id | html %]&branchcode=[% library.id | html %]">
438 [% library.branchname | html %]
448 [% FOREACH g IN group.children %]
449 [% PROCESS tree group=g %]