Lines 1-113
Link Here
|
1 |
[% USE raw %] |
1 |
[% USE raw %] |
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
3 |
[% USE KohaSpan %] |
3 |
[% USE KohaSpan %] |
|
|
4 |
[% SET footerjs = 1 %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title>Koha › Administration › Library groups</title> |
6 |
<title>Koha › Administration › Library groups</title> |
6 |
[% INCLUDE 'doc-head-close.inc' %] |
7 |
[% INCLUDE 'doc-head-close.inc' %] |
7 |
[% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %] |
8 |
[% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %] |
8 |
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %] |
|
|
9 |
<script type="text/javascript"> |
10 |
//<![CDATA[ |
11 |
$(document).ready(function() { |
12 |
$('.library-groups').treetable( |
13 |
{ |
14 |
expandable: true, |
15 |
initialState: 'expanded', |
16 |
clickableNodeNames: true, |
17 |
} |
18 |
); |
19 |
|
20 |
$('.add-group').on('click', function() { |
21 |
var id = $(this).data('groupId'); |
22 |
add_group( id ); |
23 |
}); |
24 |
|
25 |
$('.edit-group').on('click', function() { |
26 |
var id = $(this).data('groupId'); |
27 |
var parent_id = $(this).data('groupParentId'); |
28 |
var title = $(this).data('groupTitle'); |
29 |
var description = $(this).data('groupDescription'); |
30 |
var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info'); |
31 |
var ft_search_groups_opac = $(this).data('groupFt_search_groups_opac'); |
32 |
var ft_search_groups_staff = $(this).data('groupFt_search_groups_staff'); |
33 |
edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ); |
34 |
}); |
35 |
|
36 |
$('.delete-group').on('click', function() { |
37 |
var id = $(this).data('groupId'); |
38 |
var title = $(this).data('groupTitle'); |
39 |
delete_group( id, title ); |
40 |
}); |
41 |
|
42 |
$('.remove-library').on('click', function() { |
43 |
var id = $(this).data('groupId'); |
44 |
var library = $(this).data('groupLibrary'); |
45 |
var parent_title = $(this).data('groupParentTitle'); |
46 |
remove_library( id, library, parent_title ); |
47 |
}); |
48 |
}); |
49 |
|
50 |
function add_group( parent_id ) { |
51 |
$('#add-group-modal-parent-id').val( parent_id ); |
52 |
|
53 |
$('#add-group-modal-description').val(""); |
54 |
$('#add-group-modal-title').val(""); |
55 |
|
56 |
$('#add-group-modal').on('shown', function() { |
57 |
$('#add-group-modal-title').focus(); |
58 |
}); |
59 |
|
60 |
$('#add-group-modal-ft_hide_patron_info').prop('checked', false); |
61 |
$('#add-group-modal-ft_search_groups_opac').prop('checked', false); |
62 |
$('#add-group-modal-ft_search_groups_staff').prop('checked', false); |
63 |
if ( parent_id ) { |
64 |
$('#root-group-features-add').hide(); |
65 |
} else { |
66 |
$('#root-group-features-add').show(); |
67 |
} |
68 |
$('#add-group-modal').modal('show'); |
69 |
} |
70 |
|
71 |
function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ) { |
72 |
$('#edit-group-modal-id').val( id ); |
73 |
$('#edit-group-modal-title').val( title ); |
74 |
$('#edit-group-modal-description').val( description ); |
75 |
|
76 |
if ( parent_id ) { |
77 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', false); |
78 |
$('#edit-group-modal-ft_search_groups_opac').prop('checked', false); |
79 |
$('#edit-group-modal-ft_search_groups_staff').prop('checked', false); |
80 |
$('#root-group-features-edit').hide(); |
81 |
} else { |
82 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', ft_hide_patron_info ? true : false ); |
83 |
$('#edit-group-modal-ft_search_groups_opac').prop('checked', ft_search_groups_opac ? true : false ); |
84 |
$('#edit-group-modal-ft_search_groups_staff').prop('checked', ft_search_groups_staff ? true : false ); |
85 |
$('#root-group-features-edit').show(); |
86 |
} |
87 |
|
88 |
$('#edit-group-modal').on('shown', function() { |
89 |
$('#edit-group-modal-title').focus(); |
90 |
}); |
91 |
|
92 |
$('#edit-group-modal').modal('show'); |
93 |
} |
94 |
|
95 |
function delete_group( id, title ) { |
96 |
$('#delete-group-modal-title').html(title); |
97 |
$('#delete-group-modal-id').val( id ); |
98 |
$('#delete-group-modal').modal('show'); |
99 |
} |
100 |
|
101 |
function remove_library( id, library, parent_title ) { |
102 |
$('#remove-library-modal-library').html( library ); |
103 |
$('#remove-library-modal-group').html(parent_title); |
104 |
$('#remove-library-modal-id').val( id ); |
105 |
$('#remove-library-modal').modal('show'); |
106 |
} |
107 |
|
108 |
//]]> |
109 |
</script> |
110 |
</head> |
9 |
</head> |
|
|
10 |
|
111 |
<body id="admin_library_groups" class="admin"> |
11 |
<body id="admin_library_groups" class="admin"> |
112 |
[% INCLUDE 'header.inc' %] |
12 |
[% INCLUDE 'header.inc' %] |
113 |
[% INCLUDE 'cat-search.inc' %] |
13 |
[% INCLUDE 'cat-search.inc' %] |
Lines 140-150
Link Here
|
140 |
</div> |
40 |
</div> |
141 |
[% END %] |
41 |
[% END %] |
142 |
|
42 |
|
143 |
<div id="doc3" class="yui-t2"> |
43 |
<div class="main container-fluid"> |
144 |
<div id="bd"> |
44 |
<div class="row"> |
145 |
<div id="yui-main"> |
45 |
<div class="col-sm-10 col-sm-push-2"> |
146 |
<div class="yui-b"> |
46 |
<main> |
147 |
<div class="yui-g"> |
47 |
|
148 |
<div id="toolbar" class="btn-toolbar"> |
48 |
<div id="toolbar" class="btn-toolbar"> |
149 |
<div class="btn-group"> |
49 |
<div class="btn-group"> |
150 |
<a id="add-group-root" class="btn btn-default btn-sm add-group" href="#"> |
50 |
<a id="add-group-root" class="btn btn-default btn-sm add-group" href="#"> |
Lines 152-158
Link Here
|
152 |
</a> |
52 |
</a> |
153 |
</div> |
53 |
</div> |
154 |
</div> |
54 |
</div> |
155 |
</div> |
55 |
|
|
|
56 |
<h2>Library groups</h2> |
156 |
|
57 |
|
157 |
[% FOREACH root_group IN root_groups %] |
58 |
[% FOREACH root_group IN root_groups %] |
158 |
<table class="library-groups"> |
59 |
<table class="library-groups"> |
Lines 165-178
Link Here
|
165 |
[% PROCESS tree group=root_group %] |
66 |
[% PROCESS tree group=root_group %] |
166 |
</table> |
67 |
</table> |
167 |
[% END %] |
68 |
[% END %] |
168 |
</div> |
|
|
169 |
</div> |
170 |
|
69 |
|
171 |
<div class="yui-b"> |
70 |
</main> |
172 |
[% INCLUDE 'admin-menu.inc' %] |
71 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
173 |
</div> |
|
|
174 |
|
72 |
|
175 |
<div id="add-group-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="add-group-modal-label" aria-hidden="true"> |
73 |
<div class="col-sm-2 col-sm-pull-10"> |
|
|
74 |
<aside> |
75 |
[% INCLUDE 'admin-menu.inc' %] |
76 |
</aside> |
77 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
78 |
</div> <!-- /.row --> |
79 |
|
80 |
<div id="add-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="add-group-modal-label" aria-hidden="true"> |
176 |
<form id="add-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal"> |
81 |
<form id="add-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal"> |
177 |
<div class="modal-dialog"> |
82 |
<div class="modal-dialog"> |
178 |
<div class="modal-content"> |
83 |
<div class="modal-content"> |
Lines 186-192
Link Here
|
186 |
<p> |
91 |
<p> |
187 |
<label for="add-group-modal-title">Title: </label> |
92 |
<label for="add-group-modal-title">Title: </label> |
188 |
<input type="text" name="title" id="add-group-modal-title" required="required" /> |
93 |
<input type="text" name="title" id="add-group-modal-title" required="required" /> |
189 |
<i>required</i> |
94 |
<span class="required">Required</span> |
190 |
</p> |
95 |
</p> |
191 |
|
96 |
|
192 |
<p> |
97 |
<p> |
Lines 214-228
Link Here
|
214 |
</div> |
119 |
</div> |
215 |
</div> |
120 |
</div> |
216 |
<div class="modal-footer"> |
121 |
<div class="modal-footer"> |
217 |
<button type="submit" class="btn btn-primary">Save</button> |
122 |
<button type="submit" class="btn btn-default">Save</button> |
218 |
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button> |
123 |
<a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> |
219 |
</div> |
124 |
</div> |
220 |
</div> |
125 |
</div> |
221 |
</div> |
126 |
</div> |
222 |
</form> |
127 |
</form> |
223 |
</div> |
128 |
</div> |
224 |
|
129 |
|
225 |
<div id="edit-group-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="edit-library-modal-label" aria-hidden="true"> |
130 |
<div id="edit-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="edit-group-modal-label" aria-hidden="true"> |
226 |
<form id="edit-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal"> |
131 |
<form id="edit-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal"> |
227 |
<div class="modal-dialog"> |
132 |
<div class="modal-dialog"> |
228 |
<div class="modal-content"> |
133 |
<div class="modal-content"> |
Lines 236-242
Link Here
|
236 |
<p> |
141 |
<p> |
237 |
<label for="edit-group-modal-title">Title: </label> |
142 |
<label for="edit-group-modal-title">Title: </label> |
238 |
<input type="text" id="edit-group-modal-title" name="title" value="" required="required" /> |
143 |
<input type="text" id="edit-group-modal-title" name="title" value="" required="required" /> |
239 |
<i>required</i> |
144 |
<span class="required">Required</span> |
240 |
</p> |
145 |
</p> |
241 |
|
146 |
|
242 |
<p> |
147 |
<p> |
Lines 264-278
Link Here
|
264 |
</div> |
169 |
</div> |
265 |
</div> |
170 |
</div> |
266 |
<div class="modal-footer"> |
171 |
<div class="modal-footer"> |
267 |
<button type="submit" class="btn btn-primary">Update</button> |
172 |
<button type="submit" class="btn btn-default">Update</button> |
268 |
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button> |
173 |
<a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a> |
269 |
</div> |
174 |
</div> |
270 |
</div> |
175 |
</div> |
271 |
</div> |
176 |
</div> |
272 |
</form> |
177 |
</form> |
273 |
</div> |
178 |
</div> |
274 |
|
179 |
|
275 |
<div id="delete-group-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="delete-group-modal-label" aria-hidden="true"> |
180 |
<div id="delete-group-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="delete-group-modal-label" aria-hidden="true"> |
276 |
<form action="/cgi-bin/koha/admin/library_groups.pl" /> |
181 |
<form action="/cgi-bin/koha/admin/library_groups.pl" /> |
277 |
<div class="modal-dialog"> |
182 |
<div class="modal-dialog"> |
278 |
<div class="modal-content"> |
183 |
<div class="modal-content"> |
Lines 293-299
Link Here
|
293 |
</form> |
198 |
</form> |
294 |
</div> |
199 |
</div> |
295 |
|
200 |
|
296 |
<div id="remove-library-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="remove-library-modal-label" aria-hidden="true"> |
201 |
<div id="remove-library-modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="remove-library-modal-label" aria-hidden="true"> |
297 |
<form action="/cgi-bin/koha/admin/library_groups.pl" /> |
202 |
<form action="/cgi-bin/koha/admin/library_groups.pl" /> |
298 |
<div class="modal-dialog"> |
203 |
<div class="modal-dialog"> |
299 |
<div class="modal-content"> |
204 |
<div class="modal-content"> |
Lines 315-320
Link Here
|
315 |
</div> |
220 |
</div> |
316 |
|
221 |
|
317 |
</div> |
222 |
</div> |
|
|
223 |
|
224 |
[% MACRO jsinclude BLOCK %] |
225 |
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %] |
226 |
<script> |
227 |
$(document).ready(function() { |
228 |
$('.library-groups').treetable({ |
229 |
expandable: true, |
230 |
initialState: 'expanded', |
231 |
clickableNodeNames: true, |
232 |
}); |
233 |
|
234 |
$('.add-group').on('click', function() { |
235 |
var id = $(this).data('groupId'); |
236 |
add_group( id ); |
237 |
}); |
238 |
|
239 |
$('.edit-group').on('click', function() { |
240 |
var id = $(this).data('groupId'); |
241 |
var parent_id = $(this).data('groupParentId'); |
242 |
var title = $(this).data('groupTitle'); |
243 |
var description = $(this).data('groupDescription'); |
244 |
var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info'); |
245 |
var ft_search_groups_opac = $(this).data('groupFt_search_groups_opac'); |
246 |
var ft_search_groups_staff = $(this).data('groupFt_search_groups_staff'); |
247 |
edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ); |
248 |
}); |
249 |
|
250 |
$('.delete-group').on('click', function() { |
251 |
var id = $(this).data('groupId'); |
252 |
var title = $(this).data('groupTitle'); |
253 |
delete_group( id, title ); |
254 |
}); |
255 |
|
256 |
$('.remove-library').on('click', function() { |
257 |
var id = $(this).data('groupId'); |
258 |
var library = $(this).data('groupLibrary'); |
259 |
var parent_title = $(this).data('groupParentTitle'); |
260 |
remove_library( id, library, parent_title ); |
261 |
}); |
262 |
}); |
263 |
|
264 |
function add_group( parent_id ) { |
265 |
$('#add-group-modal-parent-id').val( parent_id ); |
266 |
|
267 |
$('#add-group-modal-description').val(""); |
268 |
$('#add-group-modal-title').val(""); |
269 |
|
270 |
$('#add-group-modal').on('shown', function() { |
271 |
$('#add-group-modal-title').focus(); |
272 |
}); |
273 |
|
274 |
$('#add-group-modal-ft_hide_patron_info').prop('checked', false); |
275 |
$('#add-group-modal-ft_search_groups_opac').prop('checked', false); |
276 |
$('#add-group-modal-ft_search_groups_staff').prop('checked', false); |
277 |
if ( parent_id ) { |
278 |
$('#root-group-features-add').hide(); |
279 |
} else { |
280 |
$('#root-group-features-add').show(); |
281 |
} |
282 |
$('#add-group-modal').modal('show'); |
283 |
} |
284 |
|
285 |
function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ) { |
286 |
$('#edit-group-modal-id').val( id ); |
287 |
$('#edit-group-modal-title').val( title ); |
288 |
$('#edit-group-modal-description').val( description ); |
289 |
|
290 |
if ( parent_id ) { |
291 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', false); |
292 |
$('#edit-group-modal-ft_search_groups_opac').prop('checked', false); |
293 |
$('#edit-group-modal-ft_search_groups_staff').prop('checked', false); |
294 |
$('#root-group-features-edit').hide(); |
295 |
} else { |
296 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', ft_hide_patron_info ? true : false ); |
297 |
$('#edit-group-modal-ft_search_groups_opac').prop('checked', ft_search_groups_opac ? true : false ); |
298 |
$('#edit-group-modal-ft_search_groups_staff').prop('checked', ft_search_groups_staff ? true : false ); |
299 |
$('#root-group-features-edit').show(); |
300 |
} |
301 |
|
302 |
$('#edit-group-modal').on('shown', function() { |
303 |
$('#edit-group-modal-title').focus(); |
304 |
}); |
305 |
|
306 |
$('#edit-group-modal').modal('show'); |
307 |
} |
308 |
|
309 |
function delete_group( id, title ) { |
310 |
$('#delete-group-modal-title').html(title); |
311 |
$('#delete-group-modal-id').val( id ); |
312 |
$('#delete-group-modal').modal('show'); |
313 |
} |
314 |
|
315 |
function remove_library( id, library, parent_title ) { |
316 |
$('#remove-library-modal-library').html( library ); |
317 |
$('#remove-library-modal-group').html(parent_title); |
318 |
$('#remove-library-modal-id').val( id ); |
319 |
$('#remove-library-modal').modal('show'); |
320 |
} |
321 |
|
322 |
</script> |
323 |
[% END %] |
324 |
|
318 |
[% INCLUDE 'intranet-bottom.inc' %] |
325 |
[% INCLUDE 'intranet-bottom.inc' %] |
319 |
|
326 |
|
320 |
[% BLOCK tree %] |
327 |
[% BLOCK tree %] |
Lines 350-359
Link Here
|
350 |
</td> |
357 |
</td> |
351 |
<td> |
358 |
<td> |
352 |
[% IF group.branchcode %] |
359 |
[% IF group.branchcode %] |
353 |
<button class="btn btn-default btn-sm 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> |
360 |
<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> |
354 |
[% ELSE %] |
361 |
[% ELSE %] |
355 |
<div class="btn-group"> |
362 |
<div class="btn-group"> |
356 |
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> Actions <span class="caret"></span></button> |
363 |
<button class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> Actions <span class="caret"></span></button> |
357 |
<ul class="dropdown-menu"> |
364 |
<ul class="dropdown-menu"> |
358 |
<li> |
365 |
<li> |
359 |
<a id="add-group-[% group.id | html %]" href="#" class="add-group" data-group-id="[% group.id | html %]"> |
366 |
<a id="add-group-[% group.id | html %]" href="#" class="add-group" data-group-id="[% group.id | html %]"> |
Lines 376-386
Link Here
|
376 |
</div> |
383 |
</div> |
377 |
|
384 |
|
378 |
<div class="btn-group"> |
385 |
<div class="btn-group"> |
379 |
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus"></i> Add library <span class="caret"></span></button> |
386 |
<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> |
380 |
<ul class="dropdown-menu"> |
387 |
<ul class="dropdown-menu"> |
381 |
[% FOREACH library IN group.libraries_not_direct_children %] |
388 |
[% FOREACH library IN group.libraries_not_direct_children %] |
382 |
<li> |
389 |
<li> |
383 |
<a class="add-library" id="add-library-[% group.id | html %]" href="/cgi-bin/koha/admin/library_groups.pl?action=add&parent_id=[% group.id | html %]&branchcode=[% library.id | html %]"> |
390 |
<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 %]"> |
384 |
[% library.branchname | html %] |
391 |
[% library.branchname | html %] |
385 |
</a> |
392 |
</a> |
386 |
</li> |
393 |
</li> |
387 |
- |
|
|