<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XML Spy v2.5 NT  - http://www.xmlspy.com -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslc="http://xslcomponents.org/TR/WD-xslc">
	<xsl:import href="../../xslc.xsl"/>
	<xsl:import href="../../Common.xsl"/>
	<xsl:template match="/">
		<xsl:apply-templates select="document"/>
	</xsl:template>
	<xsl:template match="document">
		<xsl:call-template name="xslc:Page">
			<xsl:with-param name="Title">FormUser - <xsl:value-of select="/document/User/Name"/>
			</xsl:with-param>
			<xsl:with-param name="ToolbarButtonsLeft">
				<ToolbarButton>
					<xsl:call-template name="ToolButtonRefresh"/>
				</ToolbarButton>
			</xsl:with-param>
			<xsl:with-param name="ToolbarButtonsRight">
				<xsl:call-template name="CommonToolbarButtonsRight"/>
			</xsl:with-param>
			<xsl:with-param name="Body">
				<xsl:call-template name="xslc:TabControl">
					<xsl:with-param name="Width">625</xsl:with-param>
					<xsl:with-param name="ActivePageName">FormUser</xsl:with-param>
					<xsl:with-param name="Tabs">
						<Tab Name="SECURITY">
							<a href="{/document/Aliases/SecurityDLL}SECURITY">Gestion des Utilisateurs</a>
						</Tab>
						<Tab Name="FormUser">
							<a href="{/document/Aliases/SecurityDLL}FormUser?User_ID={/document/Params/ID}">Utilisateur [<xsl:value-of select="/document/User/Name"/>]</a>
						</Tab>
					</xsl:with-param>
					<xsl:with-param name="Page">
						<xsl:call-template name="xslc:ApplicationMessages"/>
						<div id="zoneTAB">
							<ul class="nicetab">
								<li>
									<a href="Security">Utilisateurs</a>
								</li>
								<li class="selected">
									<a href="FormUser?User_ID={/document/Params/ID}">
										<xsl:value-of select="/document/User/Name"/>
									</a>
								</li>
								<li>
									<a href="Options">Options</a>
								</li>
								<li>
									<a href="About">A Propos</a>
								</li>
							</ul>
						</div>
						<xsl:apply-templates select="User"/>
						<xsl:call-template name="xslc:PoweredBy"/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:with-param>
		</xsl:call-template>
	</xsl:template>
	<xsl:template match="User">
		<form name="MainForm" method="POST" action="{/document/Aliases/SecurityDLL}UpdateUser">
			<br/>
			<input type="hidden" name="ID" value="{ID}"/>
			<input type="hidden" name="Group_ID"/>
			<input type="hidden" name="InfoNextAction" value="FormUser"/>
			<input type="hidden" name="Password" value="{Password}"/>
			<table border="0" cellpadding="2" cellspacing="0" width="100%">
				<tr>
					<td nowrap="">
						<b>Utilisateur :</b>
					</td>
					<td style="padding-left: 10px" width="100%">
						<input type="text" class="clFlatTextInput" name="Name" size="45" value="{Name}"/>
					</td>
				</tr>
				<tr>
					<td nowrap="">
						<b>Concession :</b>
					</td>
					<td style="padding-left: 10px" width="100%">
						<input type="text" class="clFlatTextInput" name="cUserConcession" size="20" value="{UserConcession}"/>
					</td>
				</tr>
				<tr>
					<td nowrap="">
						<b>Site :</b>
					</td>
					<td style="padding-left: 10px" width="100%">
						<input type="text" class="clFlatTextInput" name="cUserSite" size="20" value="{UserSite}"/>
					</td>
				</tr>
			</table>
			<br/>
			<br/>
			<table>
				<tr>
					<td>
						<xsl:call-template name="xslc:ButtonPad"/>
					</td>
					<td width="20px"/>
					<td>
						<xsl:call-template name="xslc:Button">
							<xsl:with-param name="HRef">CLEARPassWord?ID=<xsl:value-of select="/document/Params/ID"/>
							</xsl:with-param>
							<xsl:with-param name="Caption">
								<span>
									<b>Effacer le Mot de Passe</b>
								</span>
							</xsl:with-param>
						</xsl:call-template>
					</td>
					<td>
						<xsl:if test="/document/User/DSession!=''"> - Dernière Session : <xsl:value-of select="/document/User/DSession"/>
						</xsl:if>
					</td>
				</tr>
			</table>
			<br/>
			<br/>
		</form>
		<table border="0" cellpadding="2" cellspacing="0" width="600px">
			<tr valign="top">
				<td>
					<xsl:apply-templates select="Groups" mode="User"/>
				</td>
				<td>
					<xsl:apply-templates select="/document/Groups"/>
				</td>
			</tr>
		</table>
	</xsl:template>
	<xsl:template match="Groups" mode="User">
		<table cellspacing="0" class="clFlatTable" width="290px" border="0" cellpadding="2">
			<tr class="clRowHeader">
				<td colspan="2">Groupes de l'Utilisateur</td>
			</tr>
			<xsl:apply-templates select="Group" mode="User">
				<xsl:sort select="Name"/>
			</xsl:apply-templates>
		</table>
	</xsl:template>
	<xsl:template match="Group" mode="User">
		<tr>
			<xsl:attribute name="class">
				<xsl:choose>
					<xsl:when test="position() mod 2 = 1">clRowLight</xsl:when>
					<xsl:otherwise>clRowDark</xsl:otherwise>
				</xsl:choose>
			</xsl:attribute>
			<xsl:variable name="Group_ID">
				<xsl:value-of select="ID"/>
			</xsl:variable>
			<td width="12px" onclick="document.MainForm.Group_ID.value='{ID}'; document.MainForm.action='{/document/Aliases/SecurityDLL}RemoveGroupFromUser';document.MainForm.submit(); return false;">
				<img alt="Suppression du groupe" border="0" src="{$XMLC_PictosPath}ico_xminus.gif"/>
			</td>
			<td width="290px">
				<a href="{/document/Aliases/SecurityDLL}FormGroup?Group_ID={$Group_ID}">
					<xsl:value-of select="/document/Groups/Group[ID=$Group_ID]/Name"/>
				</a>
			</td>
		</tr>
	</xsl:template>
	<xsl:template match="/document/Groups">
		<table border="0" cellpadding="2" cellspacing="0" class="clFlatTable" width="290px">
			<tr class="clRowHeader">
				<td colspan="2">Liste des Groupes</td>
				<xsl:apply-templates select="/document/Groups/Group">
					<xsl:sort select="Name"/>
				</xsl:apply-templates>
			</tr>
		</table>
	</xsl:template>
	<xsl:template match="/document/Groups/Group">
		<xsl:variable name="clValue">
			<xsl:choose>
				<xsl:when test="position() mod 2 = 1">clRowLight</xsl:when>
				<xsl:otherwise>clRowDark</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<tr class="{$clValue}">
			<td width="12px" onclick="document.MainForm.Group_ID.value='{ID}'; document.MainForm.action='{/document/Aliases/SecurityDLL}AddGroupToUser';document.MainForm.submit(); return false;">
				<img alt="Ajout du groupe" border="0" src="{$XMLC_PictosPath}ico_xplus.gif"/>
			</td>
			<td width="290px">
				<a href="{/document/Aliases/SecurityDLL}FormGroup?Group_ID={ID}">
					<xsl:value-of select="Name"/>
				</a>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>
