<%--
 * Copyright by Intland Software
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Intland Software. ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Intland.
 *
 * $Revision$ $Date$
--%>
<meta name="decorator" content="main">
<meta name="module" content="members">
<meta name="moduleCSSClass" content="membersModule">
<meta name="stylesheet" content="members.css">


<%@ taglib uri="jstl-c" prefix="c" %>
<%@ taglib uri="jstl-fmt" prefix="fmt" %>
<%@ taglib uri="jstl-fn" prefix="fn" %>


<%@ taglib uri="struts-html" prefix="html" %>

<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

<%@ taglib uri="acltaglib" prefix="acl" %>
<%@ taglib uri="taglib" prefix="tag" %>
<%@ taglib uri="uitaglib" prefix="ui" %>

You can assign roles to groups. Groups can be created by the system administrator.
<ui:title style="top-sub-headline-decoration" bottomMargin="10" separatorGapHeight="2" titleStyle="" topMargin="0" />

<c:set var="controlButtons">
	&nbsp;&nbsp;<html:submit styleClass="button" property="SAVE" value="Save" />
</c:set>

<html:form action="/proj/members/linkPortalRolesToProject">

<html:hidden property="initialized" value="true" />
<html:hidden property="proj_id" />

<c:if test="${hasMemberRoleAdmin}">
	<div class="actionBar">
		<c:out value="${controlButtons}" escapeXml="false" />
	</div>
</c:if>

<display:table class="expandTextArea" requestURI="" name="${portalRoles}" id="portalRole" cellpadding="0" defaultsort="1">
	<acl:info var="accountsWithRole" value="usersWithRole" role_id="${portalRole.id}" />
	<c:set var="nrOfUsersWithRole" value="${fn:length(accountsWithRole)}" />

	<display:column title="Group" headerClass="textData" class="textData" sortable="true" sortProperty="description">
		<c:out value="${portalRole.description}" /> (<fmt:formatNumber value="${nrOfUsersWithRole}" />)
	</display:column>

	<c:forEach items="${projectRoles}" var="projectRole">
		<c:set var="idx" value="${projectRole.id},${portalRole.id}" />

		<display:column class="${COLUMN_SEPARATOR}" media="html" decorator="com.intland.codebeamer.ui.view.table.TrimmedColumnDecorator" />

		<display:column title="${projectRole.description}" headerClass="textDataWrap">
			<html:multibox property="item" value="${idx}" />
		</display:column>
	</c:forEach>
</display:table>

</html:form>