##<!-- $Header: Exp $ -->
## Site group list
<script type="text/javascript" language="JavaScript">
	function submitform(id)
	{
		var theForm = document.getElementById(id);
		if(theForm && theForm.onsubmit)
		{
			theForm.onsubmit();
		}
		if(theForm && theForm.submit)
		{
			theForm.submit();
		}
	}
</script>
<div class ="portletBody">
	<h3>
	#if ($!newgroup)
		$tlang.getString('group.newgroup')
	#else
		$tlang.getString('group.editgroup')
	#end
	</h3>
	#if ($alertMessage)
		<div class="alertMessage">$tlang.getString("ediacc.alert") $validator.escapeHtml($alertMessage)</div>
		<div class="clear"></div>
	#end
	<p class="instruction">$tlang.getString("editgroup.instruction")</p>
	<form name="groupForm" id="groupForm" action="#toolForm($action)" method="post">
		<p class="shorttext required">
			<span class="reqStar">*</span>
			<label for="$tlang.getString('group.title')">
				$tlang.getString("group.title")
			</label>
			<input type="text" name="$tlang.getString('group.title')" id="$tlang.getString('group.title')" size="20" value="$validator.escapeHtml($!title)" />
		</p>
		<p class="shorttext">
			<label for="$tlang.getString('group.description')">
				$tlang.getString("group.description")
			</label>
			<textarea wrap="virtual" name="$tlang.getString('group.description')" id="$tlang.getString('group.description')"  rows="3" cols="50">$validator.escapeHtml($!description)</textarea>
		</p>
		<h4>
			$tlang.getString("editgroup.membership")
		</h4>
<table cellspacing="0" cellpadding="0" border="0" class="sidebyside" summary="layout">
	<tbody>
			<tr>
				<th>
					$tlang.getString("editgroup.generallist")
				</th>
				<th  class="act">
						<input type="button"  name="$tlang.getString('editgroup.addmember')" value="$tlang.getString('editgroup.addmember')" onclick="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=add')';submitform('groupForm');" 
						onkeypress="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=add')';submitform('groupForm');" />
				</th>
				<th>
					$tlang.getString("editgroup.grouplist")
				</th>
				<th  class="act">
						<input type="button"  name="$tlang.getString('editgroup.removemember')" value="$tlang.getString('editgroup.removemember')" onclick="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=remove')';submitform('groupForm');"  onkeypress="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=remove')';submitform('groupForm');" />
				</th>
			</tr>
			<tr>
				<td align="center" colspan="2">
					<select name="generallist" multiple="multiple" size="20" ondblclick="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=add')';submitform('groupForm');">
    		#foreach ($member in $generalMembers)
							#set($found=false)
							#foreach ($gM in $groupMembersClone)
								#if (!$found && $gM.UserId.equals($member.Uniqname))
									#set($found=true)
								#end
							#end
							#if(!$found)
    				<option  value="$member.Uniqname" >$member.Name</option>
							#end
    		#end
    	</select>
				</td>
				<td align="center" colspan="2">
					<select name="grouplist" multiple="multiple" size="20" ondblclick="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=remove')';submitform('groupForm');">
						#foreach ($gmember in $groupMembers)
    			#set($gUser = $!userDirectoryService.getUser($gmember.UserId))
							#if ($!gUser)
    				<option  value="$gmember.UserId" >$gUser.SortName</option>
							#end
    		#end
    	</select>
				</td>
			</tr>
</tbody>
		</table>		
		<input type="hidden" name="template-index" value="50" />
		<input type="hidden" name="back" value="49" />
		<div class ="act">
				<input type="button" accesskey="s" class="active" name="$tlang.getString('editgroup.update')" value="$tlang.getString('editgroup.update')" onclick="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=save')';submitform('groupForm');" />
				<input type="button" accesskey="x" name="eventSubmit_doBack" value="$tlang.getString('editgroup.cancel')" onclick="javascript:document.getElementById('groupForm').action='#toolLinkParam('$action' 'doGroup_update' 'option=cancel')';submitform('groupForm');" />
		</div>
	</form>
</div>
