5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Library groups › Administration › Koha</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 [% WRAPPER 'header.inc' %]
13 [% INCLUDE 'cat-search.inc' %]
16 [% WRAPPER 'sub-header.inc' %]
17 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
20 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
23 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
26 <a href="#" aria-current="page">Library groups</a>
32 [% FOR m IN messages %]
33 <div class="dialog [% m.type | html %]">
35 [% CASE 'error_on_insert' %]
36 <span>An error occurred when adding this library. The library id might already exist in this group.</span>
38 <span>[% m.code | html %]</span>
44 <div class="dialog message group-added">
45 [% IF added.branchcode %]
46 <span>[% added.library.branchname | html | $KohaSpan class = 'name' %] added to group.</span>
48 <span>Group [% added.title | html | $KohaSpan class = 'name' %] created.</span>
52 <div class="dialog message group-deleted">
53 [% IF deleted.title %]
54 <span>Group [% deleted.title | html | $KohaSpan class = 'name' %] has been deleted.</span>
56 <span>[% deleted.library | html | $KohaSpan class = 'name' %] has been removed from group.</span>
59 [% ELSIF error_duplicate_title %]
60 <div class="dialog alert error-duplicate-group-title">
61 A group with the title [% error_duplicate_title | html | $KohaSpan class = 'name' %] already exists.
65 <div class="main container-fluid">
67 <div class="col-sm-10 col-sm-push-2">
70 <div id="toolbar" class="btn-toolbar">
71 <div class="btn-group">
72 <a id="add-group-root" class="btn btn-default add-group" href="#">
73 <i class="fa fa-plus"></i> Add group
78 <h1>Library groups</h1>
80 [% FOREACH root_group IN root_groups %]
81 <table class="library-groups">
85 <th>Features enabled</th>
88 [% PROCESS tree group=root_group %]
93 </div> <!-- /.col-sm-10.col-sm-push-2 -->
95 <div class="col-sm-2 col-sm-pull-10">
97 [% INCLUDE 'admin-menu.inc' %]
99 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
100 </div> <!-- /.row -->
102 <div id="add-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="add-group-modal-label" aria-hidden="true">
103 <form id="add-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal">
104 <div class="modal-dialog">
105 <div class="modal-content">
106 <div class="modal-header">
107 <h3 id="add-group-modal-label">Add group</h3>
109 <div class="modal-body">
110 <fieldset class="rows">
111 <input type="hidden" id="add-group-modal-parent-id" name="parent_id" value="" />
112 <input type="hidden" id="add-group-modal-action" name="action" value="add">
115 <label for="add-group-modal-title">Title: </label>
116 <input type="text" size="40" maxlength="100" name="title" id="add-group-modal-title" required="required" />
117 <span class="required">Required</span>
118 <div class="hint">Displayed in the library group search dropdowns.</div>
121 <label for="add-group-modal-description">Description: </label>
122 <input type="text" size="40" name="description" id="add-group-modal-description" />
126 <div id="root-group-features-add">
128 <div class="checkbox">
131 <input type="checkbox" name="ft_hide_patron_info" id="add-group-modal-ft_hide_patron_info" value="1" />
132 Limit patron data access by group
137 <input type="checkbox" name="ft_search_groups_opac" id="add-group-modal-ft_search_groups_opac" value="1" />
138 Use for OPAC search groups
143 <input type="checkbox" name="ft_search_groups_staff" id="add-group-modal-ft_search_groups_staff" value="1" />
144 Use for staff search groups
149 <input type="checkbox" name="ft_local_hold_group" id="add-group-modal-ft_local_hold_group" value="1" />
156 <div class="modal-footer">
157 <button type="submit" class="btn btn-default">Save</button>
158 <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
165 <div id="edit-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="edit-group-modal-label" aria-hidden="true">
166 <form id="edit-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal">
167 <div class="modal-dialog">
168 <div class="modal-content">
169 <div class="modal-header">
170 <h3 id="edit-group-modal-label">Edit group</h3>
172 <div class="modal-body">
173 <input type="hidden" id="edit-group-modal-id" name="id" value="" />
174 <input type="hidden" id="edit-group-modal-action" name="action" value="edit" />
175 <fieldset class="rows">
178 <label for="edit-group-modal-title">Title: </label>
179 <input type="text" size="40" maxlength="100" id="edit-group-modal-title" name="title" value="" required="required" />
180 <span class="required">Required</span>
181 <div class="hint">Displayed in the library group search dropdowns.</div>
185 <label for="edit-group-modal-description">Description: </label>
186 <input type="text" size="40" id="edit-group-modal-description" name="description" value="" />
190 <div id="root-group-features-edit">
192 <div class="checkbox">
195 <input type="checkbox" id="edit-group-modal-ft_hide_patron_info" name="ft_hide_patron_info" value="1" />
196 Limit patron data access by group
201 <input type="checkbox" id="edit-group-modal-ft_search_groups_opac" name="ft_search_groups_opac" value="1" />
202 Use for OPAC search groups
207 <input type="checkbox" id="edit-group-modal-ft_search_groups_staff" name="ft_search_groups_staff" value="1" />
208 Use for staff search groups
213 <input type="checkbox" id="edit-group-modal-ft_local_hold_group" name="ft_local_hold_group" value="1" />
220 <div class="modal-footer">
221 <button type="submit" class="btn btn-default">Update</button>
222 <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
229 <div id="delete-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="delete-group-modal-label" aria-hidden="true">
230 <form action="/cgi-bin/koha/admin/library_groups.pl">
231 <div class="modal-dialog">
232 <div class="modal-content">
233 <input id="delete-group-modal-action" type="hidden" name="action" value="delete" />
234 <input id="delete-group-modal-id" type="hidden" name="id" value="" />
235 <div class="modal-header">
236 <h3 id="delete-group-modal-label">Delete group</h3>
238 <div class="modal-body">
239 Are you sure you want to delete <span id="delete-group-modal-title" class="name"></span>?
241 <div class="modal-footer">
242 <button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Delete</button>
243 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
250 <div id="remove-library-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="remove-library-modal-label" aria-hidden="true">
251 <form action="/cgi-bin/koha/admin/library_groups.pl">
252 <div class="modal-dialog">
253 <div class="modal-content">
254 <input id="remove-library-modal-action" type="hidden" name="action" value="delete" />
255 <input id="remove-library-modal-id" type="hidden" name="id" value="" />
256 <div class="modal-header">
257 <h3 id="remove-library-modal-label">Remove library from group</h3>
259 <div class="modal-body">
260 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>?
262 <div class="modal-footer">
263 <button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Remove</button>
264 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
271 [% MACRO jsinclude BLOCK %]
272 [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
274 $(document).ready(function() {
275 $('.library-groups').treetable({
277 initialState: 'expanded',
278 clickableNodeNames: true,
281 $('.add-group').on('click', function(e) {
283 var id = $(this).data('groupId');
287 $('.edit-group').on('click', function(e) {
289 var id = $(this).data('groupId');
290 var parent_id = $(this).data('groupParentId');
291 var title = $(this).data('groupTitle');
292 var description = $(this).data('groupDescription');
293 var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info');
294 var ft_search_groups_opac = $(this).data('groupFt_search_groups_opac');
295 var ft_search_groups_staff = $(this).data('groupFt_search_groups_staff');
296 var ft_local_hold_group = $(this).data('groupFt_local_hold_group');
297 edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group );
300 $('.delete-group').on('click', function(e) {
302 var id = $(this).data('groupId');
303 var title = $(this).data('groupTitle');
304 delete_group( id, title );
307 $('.remove-library').on('click', function(e) {
309 var id = $(this).data('groupId');
310 var library = $(this).data('groupLibrary');
311 var parent_title = $(this).data('groupParentTitle');
312 remove_library( id, library, parent_title );
314 $('#add-group-modal').on('shown.bs.modal', function() {
315 $('#add-group-modal-title').focus();
317 $('#edit-group-modal').on('shown.bs.modal', function() {
318 $('#edit-group-modal-title').focus();
322 function add_group( parent_id ) {
323 $('#add-group-modal-parent-id').val( parent_id );
325 $('#add-group-modal-description').val("");
326 $('#add-group-modal-title').val("");
329 $('#add-group-modal-ft_hide_patron_info').prop('checked', false);
330 $('#add-group-modal-ft_search_groups_opac').prop('checked', false);
331 $('#add-group-modal-ft_search_groups_staff').prop('checked', false);
332 $('#add-group-modal-ft_local_hold_group').prop('checked', false);
334 $('#root-group-features-add').hide();
336 $('#root-group-features-add').show();
338 $('#add-group-modal').modal('show');
342 function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff, ft_local_hold_group ) {
343 $('#edit-group-modal-id').val( id );
344 $('#edit-group-modal-title').val( title );
345 $('#edit-group-modal-description').val( description );
348 $('#edit-group-modal-ft_hide_patron_info').prop('checked', false);
349 $('#edit-group-modal-ft_search_groups_opac').prop('checked', false);
350 $('#edit-group-modal-ft_search_groups_staff').prop('checked', false);
351 $('#edit-group-modal-ft_local_hold_group').prop('checked', false);
352 $('#root-group-features-edit').hide();
354 $('#edit-group-modal-ft_hide_patron_info').prop('checked', ft_hide_patron_info ? true : false );
355 $('#edit-group-modal-ft_search_groups_opac').prop('checked', ft_search_groups_opac ? true : false );
356 $('#edit-group-modal-ft_search_groups_staff').prop('checked', ft_search_groups_staff ? true : false );
357 $('#edit-group-modal-ft_local_hold_group').prop('checked', ft_local_hold_group ? true : false );
358 $('#root-group-features-edit').show();
361 $('#edit-group-modal').modal('show');
364 function delete_group( id, title ) {
365 $('#delete-group-modal-title').text( title );
366 $('#delete-group-modal-id').val( id );
367 $('#delete-group-modal').modal('show');
370 function remove_library( id, library, parent_title ) {
371 $('#remove-library-modal-library').text( library );
372 $('#remove-library-modal-group').text( parent_title );
373 $('#remove-library-modal-id').val( id );
374 $('#remove-library-modal').modal('show');
380 [% INCLUDE 'intranet-bottom.inc' %]
383 <tr data-tt-id="[% group.id | html %]" data-tt-parent-id="[% group.parent_id | html %]">
385 [% IF group.branchcode %]
386 [% group.branchcode | html %]
388 [% group.title | html %]
392 [% IF group.branchcode %]
393 [% group.library.branchname | html %]
395 [% group.description | html %]
399 [% UNLESS group.branchcode %]
401 [% IF group.ft_hide_patron_info %]
402 <li>Hide patron's info for librarians outside of this group.</li>
404 [% IF group.ft_search_groups_opac %]
405 <li>Use for OPAC search groups</li>
407 [% IF group.ft_search_groups_staff %]
408 <li>Use for staff search groups</li>
410 [% IF group.ft_local_hold_group %]
411 <li>Is local hold group</li>
417 [% IF group.branchcode %]
418 <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>
420 <div class="btn-group">
421 <button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> Actions <span class="caret"></span></button>
422 <ul class="dropdown-menu">
424 <a id="add-group-[% group.id | html %]" href="#" class="add-group" data-group-id="[% group.id | html %]">
425 <i class="fa fa-plus"></i> Add sub-group
430 <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 %]" >
431 <i class="fa fa-pencil"></i> Edit
436 <a class="delete-group" id="delete-group-[% group.id | html %]" href="#" data-group-id="[% group.id | html %]" data-group-title="[% group.title | html %]">
437 <i class="fa fa-trash"></i> Delete
443 <div class="btn-group">
444 <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>
445 <ul class="dropdown-menu">
446 [% FOREACH library IN group.libraries_not_direct_children %]
448 <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 %]">
449 [% library.branchname | html %]
459 [% FOREACH g IN group.children %]
460 [% PROCESS tree group=g %]