Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/themes/CleanFS/templates/common.multiuserselect.tpl
blob: 0692148e0a8f6e23eb73215e7743834c2e5af6b7 (plain)
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
<div class="userSelectWidget">
<label for="find_user" class="inline"><?php echo Filters::noXSS(L('find')); ?>:</label>
<input placeholder="<?php echo Filters::noXSS(L('user')); ?>" type="text" class="text" value="<?php echo Filters::noXSS(Post::val('find_user')); ?>" name="find_user" id="find_user" onkeyup="return entercheck(event)" />
<a class="button" href="javascript:unselectAll()"><?php echo Filters::noXSS(L('noone')); ?></a>
<br />
<select size="8" name="rassigned_to[]" id="rassigned_to" multiple="multiple">
<?php foreach ($userlist as $group => $users): ?>
	<optgroup <?php echo ($users[0][2]==0 ? 'class="globalgroup" title="'.(Filters::noXSS(L('globalgroup'))).'" ':''); ?>label="<?php echo Filters::noXSS($users[0][3]); ?>">
	<?php foreach ($users as $info): ?>
		<option value="<?php echo Filters::noXSS($info[0]); ?>" <?php if (in_array($info[0], $assignees)): ?>selected="selected"<?php endif; ?>><?php echo Filters::noXSS($info[1]); ?></option>
	<?php endforeach; ?>
	</optgroup>
<?php endforeach; ?>
</select>
</div>
<script type="text/javascript">
resetOption = null;

function entercheck(e){
	// Find user and select it
	if ($('find_user').value.length < 1) {
		if (resetOption != null) {
			resetOption.selected = false;
		}
	} else {
		var options = $('rassigned_to').options;
		for (var i = 0; i < options.length; i++) {
			if (options[i].text.toLowerCase().indexOf($('find_user').value.toLowerCase()) >= 0) {
				if (resetOption != null) {
					resetOption.selected = false;
				}
				if (options[i].selected == false) {
					resetOption = options[i];
				}
				options[i].selected=false; // focus
				options[i].selected=true;
				return true;
			}
		}
	}
}

function unselectAll(){
	var options = $('rassigned_to').options;
	for (var i = 0; i < options.length; i++) {
		options[i].selected=false;
	}
}
</script>