1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<h2>{{lang_organizationList}}</h2>
<div class="panel panel-default">
<div class="panel-heading">
{{lang_organizationListHeader}}
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-stripped table-condensed">
<thead>
<tr>
<th>{{lang_organization}}</th>
<th><span class="glyphicon glyphicon-ok" title="{{lang_canLogin}}"></span></th>
</tr>
</thead>
<tbody>
{{#organizations}}
<tr>
<td class="text-left slx-nowrap">{{displayname}}</td>
<td class="text-nowrap">
<input onclick="seto('setorglogin', this, '{{organizationid}}')" type="checkbox" {{{canlogin}}}>
</td>
</tr>
{{/organizations}}
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript"><!--
function seto(action, el, orgid) {
var box = $(el);
var v = el.checked ? '1' : '0';
var old = el.checked == true;
box.css('display', 'none');
$.post('?do=DozMod', { token: TOKEN, section: 'users', action: action, organizationid: orgid, value: v }).done(function (data) {
if (data !== '1' && data !== '0') {
el.checked = !old;
box.parent().css('background-color', 'red !important');
} else {
el.checked = (data == 1);
box.parent().css('background-color', '');
/* show success notification */
$notification = $('<span></span>')
.addClass('glyphicon glyphicon-saved')
.css('color', '#2ecc71')
.css('width', '0px')
.css('position', 'relative')
.css('right', '20px')
.hide();
box.before($notification);
$notification.fadeIn('fast', function () {
$notification.fadeOut('slow', function () { $notification.remove() });
});
}
box.css('display', '');
}).fail(function() {
el.checked = !old;
box.parent().css('background-color', 'red !important');
box.css('display', '');
});
}
--> </script>
|