-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroups.html
121 lines (107 loc) · 2.95 KB
/
groups.html
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<TMPL_INCLUDE NAME="header.html">
<script language="Javascript">
var selected_rights = new Array();
var not_selected_rights = new Array();
<TMPL_LOOP selected_rights>
selected_rights[<TMPL_VAR __PASS__>] = '<TMPL_VAR group>|<TMPL_VAR right>'
</TMPL_LOOP>
<TMPL_LOOP not_selected_rights>
not_selected_rights[<TMPL_VAR __PASS__>] = '<TMPL_VAR group>|<TMPL_VAR right>'
</TMPL_LOOP>
function populateData(name) {
select = document.groups.selected_rights;
string = "";
count = 0;
select.options.length = count;
for( i = 1; i < selected_rights.length; i++ ) {
string = selected_rights[i].split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1] );
}
}
select = document.groups.not_selected_rights;
string = "";
count = 0;
select.options.length = count;
for( i = 1; i < not_selected_rights.length; i++ ) {
string = not_selected_rights[i].split( "|" );
if( string[0] == name ) {
select.options[count++] = new Option( string[1] );
}
}
}
function moveData(from,to) {
selected_list = eval('document.groups.' + from);
not_selected_list = eval('document.groups.' + to);
var sel = false;
for (i=0;i<from.length;i++) {
var current = selected_list.options[i];
if (current.selected) {
sel = true;
txt = current.text;
val = current.value;
not_selected_list.options[not_selected_list.length] = new Option(txt,val);
selected_list.options[i] = null;
i--;
}
}
}
function allSelect() {
List = document.groups.selected_rights;
for (i=0;i<List.length;i++) {
List.options[i].selected = true;
}
List = document.groups.not_selected_rights;
for (i=0;i<List.length;i++) {
List.options[i].selected = true;
}
return document.groups.selected_rights;
}
</script>
<table class="tickets">
<form name="groups" method="post" action="index.php?whattodo=groups" onSubmit="allSelect() ">
<th colspan="3"><TMPL_VAR title>
<tr>
<td>[[name]]
<td>[[selected rights]]
<td>[[not selected rights]]
</tr>
<tr><td>
<TMPL_SELECT name | size="5" onChange='javascript:populateData(this.options[selectedIndex].text)'>
</td>
<td>
<select name="selected_rights[]" id="selected_rights" size="15" multiple>
</select><br/><br/>
<a href="javascript:moveData('selected_rights','not_selected_rights')">=></a>
</td>
<td>
<select name="not_selected_rights[]" id="not_selected_rights" size="15" multiple>
</select><br/><br/>
<a href="javascript:moveData('not_selected_rights','selected_rights')"><=</a>
</td></tr>
<tr>
<td colspan="3">
<input name="submit" type="submit" value="[[apply]]">
</td>
</form>
</table>
<p>
<table class="tickets">
<form name="addgroup" method="post" action="index.php?whattodo=groups">
<th colspan="2"><TMPL_VAR title>
<tr>
<td>[[name]]
<td>[[selected rights]]
</tr>
<tr><td>
<TMPL_TEXT group_name | size="20">
</td>
<td>
<TMPL_SELECT check_rights[] | size="15" multiple>
</td>
</tr><tr>
<td colspan="2">
<input name="submit" type="submit" value="[[add]]">
</td>
</form>
</table>