Lines 22-30
Link Here
|
22 |
|
22 |
|
23 |
$('.edit-group').on('click', function() { |
23 |
$('.edit-group').on('click', function() { |
24 |
var id = $(this).data('groupId'); |
24 |
var id = $(this).data('groupId'); |
|
|
25 |
var parent_id = $(this).data('groupParentId'); |
25 |
var title = $(this).data('groupTitle'); |
26 |
var title = $(this).data('groupTitle'); |
26 |
var description = $(this).data('groupDescription'); |
27 |
var description = $(this).data('groupDescription'); |
27 |
edit_group( id, title, description ); |
28 |
var ft_hide_patron_info = $(this).data('groupFt_hide_patron_info'); |
|
|
29 |
edit_group( id, parent_id, title, description, ft_hide_patron_info ); |
28 |
}); |
30 |
}); |
29 |
|
31 |
|
30 |
$('.delete-group').on('click', function() { |
32 |
$('.delete-group').on('click', function() { |
Lines 51-64
Link Here
|
51 |
$('#add-group-modal-title').focus(); |
53 |
$('#add-group-modal-title').focus(); |
52 |
}); |
54 |
}); |
53 |
|
55 |
|
|
|
56 |
$('#add-group-modal-ft_hide_patron_info').prop('checked', false); |
57 |
if ( parent_id ) { |
58 |
$('#add-group-modal-ft_hide_patron_info').parent().hide(); |
59 |
} else { |
60 |
$('#add-group-modal-ft_hide_patron_info').parent().show(); |
61 |
} |
54 |
$('#add-group-modal').modal('show'); |
62 |
$('#add-group-modal').modal('show'); |
55 |
} |
63 |
} |
56 |
|
64 |
|
57 |
function edit_group( id, title, description ) { |
65 |
function edit_group( id, parent_id, title, description, ft_hide_patron_info ) { |
58 |
$('#edit-group-modal-id').val( id ); |
66 |
$('#edit-group-modal-id').val( id ); |
59 |
$('#edit-group-modal-title').val( title ); |
67 |
$('#edit-group-modal-title').val( title ); |
60 |
$('#edit-group-modal-description').val( description ); |
68 |
$('#edit-group-modal-description').val( description ); |
61 |
|
69 |
|
|
|
70 |
if ( parent_id ) { |
71 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', false); |
72 |
$('#edit-group-modal-ft_hide_patron_info').parent().hide(); |
73 |
} else { |
74 |
if ( ft_hide_patron_info ) { |
75 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', true); |
76 |
} else { |
77 |
$('#edit-group-modal-ft_hide_patron_info').prop('checked', false); |
78 |
} |
79 |
|
80 |
$('#edit-group-modal-ft_hide_patron_info').parent().show(); |
81 |
} |
82 |
|
62 |
$('#edit-group-modal').on('shown', function() { |
83 |
$('#edit-group-modal').on('shown', function() { |
63 |
$('#edit-group-modal-title').focus(); |
84 |
$('#edit-group-modal-title').focus(); |
64 |
}); |
85 |
}); |
Lines 133-138
Link Here
|
133 |
<tr> |
154 |
<tr> |
134 |
<th> </th> |
155 |
<th> </th> |
135 |
<th>Description</th> |
156 |
<th>Description</th> |
|
|
157 |
<th>Features enabled</th> |
136 |
<th> </th> |
158 |
<th> </th> |
137 |
</tr> |
159 |
</tr> |
138 |
[% PROCESS tree group=root_group %] |
160 |
[% PROCESS tree group=root_group %] |
Lines 157-171
Link Here
|
157 |
<input type="hidden" id="add-group-modal-action" name="action" value="add"> |
179 |
<input type="hidden" id="add-group-modal-action" name="action" value="add"> |
158 |
|
180 |
|
159 |
<p> |
181 |
<p> |
160 |
<label for="title">Title: </label> |
182 |
<label for="add-group-modal-title">Title: </label> |
161 |
<input type="text" name="title" id="add-group-modal-title" required="required" /> |
183 |
<input type="text" name="title" id="add-group-modal-title" required="required" /> |
162 |
<i>required</i> |
184 |
<i>required</i> |
163 |
</p> |
185 |
</p> |
164 |
|
186 |
|
165 |
<p> |
187 |
<p> |
166 |
<label for="description">Description: </label> |
188 |
<label for="add-group-modal-description">Description: </label> |
167 |
<input type="text" name="description" id="add-group-modal-description" /> |
189 |
<input type="text" name="description" id="add-group-modal-description" /> |
168 |
</p> |
190 |
</p> |
|
|
191 |
<p> |
192 |
<label for="add-group-modal-ft_hide_patron_info">Feature hide patron's info</label> |
193 |
<input type="checkbox" name="ft_hide_patron_info" id="add-group-modal-ft_hide_patron_info" value="1" /> |
194 |
</p> |
169 |
</div> |
195 |
</div> |
170 |
<div class="modal-footer"> |
196 |
<div class="modal-footer"> |
171 |
<button type="submit" class="btn btn-primary">Save</button> |
197 |
<button type="submit" class="btn btn-primary">Save</button> |
Lines 188-202
Link Here
|
188 |
<input type="hidden" id="edit-group-modal-action" name="action" value="edit" /> |
214 |
<input type="hidden" id="edit-group-modal-action" name="action" value="edit" /> |
189 |
|
215 |
|
190 |
<p> |
216 |
<p> |
191 |
<label for="title">Title: </label> |
217 |
<label for="edit-group-modal-title">Title: </label> |
192 |
<input type="text" id="edit-group-modal-title" name="title" value="" required="required" /> |
218 |
<input type="text" id="edit-group-modal-title" name="title" value="" required="required" /> |
193 |
<i>required</i> |
219 |
<i>required</i> |
194 |
</p> |
220 |
</p> |
195 |
|
221 |
|
196 |
<p> |
222 |
<p> |
197 |
<label for="description">Description: </label> |
223 |
<label for="edit-group-modal-description">Description: </label> |
198 |
<input type="text" id="edit-group-modal-description" name="description" value="" /> |
224 |
<input type="text" id="edit-group-modal-description" name="description" value="" /> |
199 |
</p> |
225 |
</p> |
|
|
226 |
<p> |
227 |
<label for="edit-group-modal-ft_hide_patron_info">Feature hide patron's info</label> |
228 |
<input type="checkbox" id="edit-group-modal-ft_hide_patron_info" name="ft_hide_patron_info" value="1" /> |
229 |
</p> |
200 |
</div> |
230 |
</div> |
201 |
<div class="modal-footer"> |
231 |
<div class="modal-footer"> |
202 |
<button type="submit" class="btn btn-primary">Update</button> |
232 |
<button type="submit" class="btn btn-primary">Update</button> |
Lines 269-274
Link Here
|
269 |
[% END %] |
299 |
[% END %] |
270 |
</td> |
300 |
</td> |
271 |
<td> |
301 |
<td> |
|
|
302 |
[% UNLESS group.branchcode %] |
303 |
[% IF group.ft_hide_patron_info %] |
304 |
<span> * Hide patron's info for librarians outside of this group.</span> |
305 |
[% END %] |
306 |
[% END %] |
307 |
</td> |
308 |
<td> |
272 |
[% IF group.branchcode %] |
309 |
[% IF group.branchcode %] |
273 |
<button class="btn btn-default btn-sm remove-library" data-group-id="[% group.id %]" data-group-library="[% group.library.branchname %]" data-group-parent-title="[% group.parent.title %]" ><i class="fa fa-trash"></i> Remove from group</button> |
310 |
<button class="btn btn-default btn-sm remove-library" data-group-id="[% group.id %]" data-group-library="[% group.library.branchname %]" data-group-parent-title="[% group.parent.title %]" ><i class="fa fa-trash"></i> Remove from group</button> |
274 |
[% ELSE %] |
311 |
[% ELSE %] |
Lines 282-288
Link Here
|
282 |
</li> |
319 |
</li> |
283 |
|
320 |
|
284 |
<li> |
321 |
<li> |
285 |
<a class="edit-group" id="edit-group-[% group.id %]" href="#" class="edit-group" data-group-id="[% group.id %]" data-group-title="[% group.title | html %]" data-group-description="[% group.description | html %]"> |
322 |
<a class="edit-group" id="edit-group-[% group.id %]" href="#" class="edit-group" data-group-id="[% group.id %]" data-group-parent-id="[% group.parent_id %]" data-group-title="[% group.title | html %]" data-group-description="[% group.description | html %]" data-group-ft_hide_patron_info="[% group.ft_hide_patron_info | html %]"> |
286 |
<i class="fa fa-pencil"></i> Edit |
323 |
<i class="fa fa-pencil"></i> Edit |
287 |
</a> |
324 |
</a> |
288 |
</li> |
325 |
</li> |
289 |
- |
|
|