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>
109 <label for="add-group-modal-description">Description: </label>
110 <input type="text" size="40" name="description" id="add-group-modal-description" />
114 <div id="root-group-features-add">
116 <div class="checkbox">
119 <input type="checkbox" name="ft_hide_patron_info" id="add-group-modal-ft_hide_patron_info" value="1" />
120 Limit patron data access by group
125 <input type="checkbox" name="ft_search_groups_opac" id="add-group-modal-ft_search_groups_opac" value="1" />
126 Use for OPAC search groups
131 <input type="checkbox" name="ft_search_groups_staff" id="add-group-modal-ft_search_groups_staff" value="1" />
132 Use for staff search groups
137 <input type="checkbox" name="ft_local_hold_group" id="add-group-modal-ft_local_hold_group" value="1" />
144 <div class="modal-footer">
145 <button type="submit" class="btn btn-default">Save</button>
146 <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
153 <div id="edit-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="edit-group-modal-label" aria-hidden="true">
154 <form id="edit-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal">
155 <div class="modal-dialog">
156 <div class="modal-content">
157 <div class="modal-header">
158 <h3 id="edit-group-modal-label">Edit group</h3>
160 <div class="modal-body">
161 <input type="hidden" id="edit-group-modal-id" name="id" value="" />
162 <input type="hidden" id="edit-group-modal-action" name="action" value="edit" />
163 <fieldset class="rows">
166 <label for="edit-group-modal-title">Title: </label>
167 <input type="text" size="40" maxlength="100" id="edit-group-modal-title" name="title" value="" required="required" />
168 <span class="required">Required</span>
172 <label for="edit-group-modal-description">Description: </label>
173 <input type="text" size="40" id="edit-group-modal-description" name="description" value="" />
177 <div id="root-group-features-edit">
179 <div class="checkbox">
182 <input type="checkbox" id="edit-group-modal-ft_hide_patron_info" name="ft_hide_patron_info" value="1" />
183 Limit patron data access by group
188 <input type="checkbox" id="edit-group-modal-ft_search_groups_opac" name="ft_search_groups_opac" value="1" />
189 Use for OPAC search groups
194 <input type="checkbox" id="edit-group-modal-ft_search_groups_staff" name="ft_search_groups_staff" value="1" />
195 Use for staff search groups
200 <input type="checkbox" id="edit-group-modal-ft_local_hold_group" name="ft_local_hold_group" value="1" />
207 <div class="modal-footer">
208 <button type="submit" class="btn btn-default">Update</button>
209 <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
216 <div id="delete-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="delete-group-modal-label" aria-hidden="true">
217 <form action="/cgi-bin/koha/admin/library_groups.pl">
218 <div class="modal-dialog">
219 <div class="modal-content">
220 <input id="delete-group-modal-action" type="hidden" name="action" value="delete" />
221 <input id="delete-group-modal-id" type="hidden" name="id" value="" />
222 <div class="modal-header">
223 <h3 id="delete-group-modal-label">Delete group</h3>
225 <div class="modal-body">
226 Are you sure you want to delete <span id="delete-group-modal-title" class="name"></span>?
228 <div class="modal-footer">
229 <button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Delete</button>
230 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
237 <div id="remove-library-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="remove-library-modal-label" aria-hidden="true">
238 <form action="/cgi-bin/koha/admin/library_groups.pl">
239 <div class="modal-dialog">
240 <div class="modal-content">
241 <input id="remove-library-modal-action" type="hidden" name="action" value="delete" />
242 <input id="remove-library-modal-id" type="hidden" name="id" value="" />
243 <div class="modal-header">
244 <h3 id="remove-library-modal-label">Remove library from group</h3>
246 <div class="modal-body">
247 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>?
249 <div class="modal-footer">
250 <button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Remove</button>
251 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
258 [% MACRO jsinclude BLOCK %]
259 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
261 $(document).ready(function() {
262 $('.library-groups').treetable({
264 initialState: 'expanded',
265 clickableNodeNames: true,
268 $('.add-group').on('click', function(e) {
270 var id = $(this).data('groupId');
274 $('.edit-group').on('click', function(e) {
276 var id = $(this).data('groupId');
277 var parent_id = $(this).data('groupParentId');
278 var title = $(this).data('groupTitle');
279 var description = $(this).data('groupDescription');
280 var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info');
281 var ft_search_groups_opac = $(this).data('groupFt_search_groups_opac');
282 var ft_search_groups_staff = $(this).data('groupFt_search_groups_staff');
283 var ft_local_hold_group = $(this).data('groupFt_local_hold_group');
284 edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group );
287 $('.delete-group').on('click', function(e) {
289 var id = $(this).data('groupId');
290 var title = $(this).data('groupTitle');
291 delete_group( id, title );
294 $('.remove-library').on('click', function(e) {
296 var id = $(this).data('groupId');
297 var library = $(this).data('groupLibrary');
298 var parent_title = $(this).data('groupParentTitle');
299 remove_library( id, library, parent_title );
301 $('#add-group-modal').on('shown.bs.modal', function() {
302 $('#add-group-modal-title').focus();
304 $('#edit-group-modal').on('shown.bs.modal', function() {
305 $('#edit-group-modal-title').focus();
309 function add_group( parent_id ) {
310 $('#add-group-modal-parent-id').val( parent_id );
312 $('#add-group-modal-description').val("");
313 $('#add-group-modal-title').val("");
316 $('#add-group-modal-ft_hide_patron_info').prop('checked', false);
317 $('#add-group-modal-ft_search_groups_opac').prop('checked', false);
318 $('#add-group-modal-ft_search_groups_staff').prop('checked', false);
319 $('#add-group-modal-ft_local_hold_group').prop('checked', false);
321 $('#root-group-features-add').hide();
323 $('#root-group-features-add').show();
325 $('#add-group-modal').modal('show');
329 function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group ) {
330 $('#edit-group-modal-id').val( id );
331 $('#edit-group-modal-title').val( title );
332 $('#edit-group-modal-description').val( description );
335 $('#edit-group-modal-ft_hide_patron_info').prop('checked', false);
336 $('#edit-group-modal-ft_search_groups_opac').prop('checked', false);
337 $('#edit-group-modal-ft_search_groups_staff').prop('checked', false);
338 $('#edit-group-modal-ft_local_hold_group').prop('checked', false);
339 $('#root-group-features-edit').hide();
341 $('#edit-group-modal-ft_hide_patron_info').prop('checked', ft_hide_patron_info ? true : false );
342 $('#edit-group-modal-ft_search_groups_opac').prop('checked', ft_search_groups_opac ? true : false );
343 $('#edit-group-modal-ft_search_groups_staff').prop('checked', ft_search_groups_staff ? true : false );
344 $('#edit-group-modal-ft_local_hold_group').prop('checked', ft_local_hold_group ? true : false );
345 $('#root-group-features-edit').show();
348 $('#edit-group-modal').modal('show');
351 function delete_group( id, title ) {
352 $('#delete-group-modal-title').html(title);
353 $('#delete-group-modal-id').val( id );
354 $('#delete-group-modal').modal('show');
357 function remove_library( id, library, parent_title ) {
358 $('#remove-library-modal-library').html( library );
359 $('#remove-library-modal-group').html(parent_title);
360 $('#remove-library-modal-id').val( id );
361 $('#remove-library-modal').modal('show');
367 [% INCLUDE 'intranet-bottom.inc' %]
370 <tr data-tt-id="[% group.id | html %]" data-tt-parent-id="[% group.parent_id | html %]">
372 [% IF group.branchcode %]
373 [% group.branchcode | html %]
375 [% group.title | html %]
379 [% IF group.branchcode %]
380 [% group.library.branchname | html %]
382 [% group.description | html %]
386 [% UNLESS group.branchcode %]
388 [% IF group.ft_hide_patron_info %]
389 <li>Hide patron's info for librarians outside of this group.</li>
391 [% IF group.ft_search_groups_opac %]
392 <li>Use for OPAC search groups</li>
394 [% IF group.ft_search_groups_staff %]
395 <li>Use for staff search groups</li>
397 [% IF group.ft_local_hold_group %]
398 <li>Is local hold group</li>
404 [% IF group.branchcode %]
405 <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>
407 <div class="btn-group">
408 <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> Actions <span class="caret"></span></button>
409 <ul class="dropdown-menu">
411 <a id="add-group-[% group.id | html %]" href="#" class="add-group" data-group-id="[% group.id | html %]">
412 <i class="fa fa-plus"></i> Add sub-group
417 <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 %]" >
418 <i class="fa fa-pencil"></i> Edit
423 <a class="delete-group" id="delete-group-[% group.id | html %]" href="#" data-group-id="[% group.id | html %]" data-group-title="[% group.title | html %]">
424 <i class="fa fa-trash"></i> Delete
430 <div class="btn-group">
431 <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>
432 <ul class="dropdown-menu">
433 [% FOREACH library IN group.libraries_not_direct_children %]
435 <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 %]">
436 [% library.branchname | html %]
446 [% FOREACH g IN group.children %]
447 [% PROCESS tree group=g %]