<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.emframe.dev.MUtils" %>
<HTML>
<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/c-rt.tld" prefix="c-rt" %>

<iman:stringtable bundle="DevResources"/>
<iman:stringtable bundle="FwResources"/>

<% if(request.getHeader("User-Agent").indexOf("PalmSource") != -1) { %>
<head>
   <title>iManager</title>
</head>
<body leftmargin="0" topmargin="0" bottommargin="0" rightmargin="0" bgcolor="#EFF0E8" text="#000000" link="#0000a0" vlink="#0000a0" alink="#0000a0">
<c:set var="TaskHeader.title" value="Roles and Tasks" scope="request" />
<iman:include page="dev/TaskHeader_inc.jsp" />
<% } else { // not palm%>
<head>
   <title><iman:string key="RBAInstall.RolesTitle" /></title>
</head>
<body bgcolor="#EFF0E8" text="#000000" link="#0000a0" vlink="#0000a0" alink="#0000a0">
<%/*SET TaskHeader.title={STRING Common.ProductName} */%>
<iman:include page="dev/TaskHeader_inc.jsp" /><BR>
&nbsp;&nbsp;&nbsp;<font color="#000080" size=+1><b><c:if test="${requestScope['eMFrame.Debug.enable']}"><a href="webacc?taskId=fw.Launch&merge=fw.Launch&view=<c:choose><c:when test="${view !='debug'}">Debug</c:when><c:otherwise><c:out value="${view}" /></c:otherwise></c:choose></c:if>">Administration Roles<c:if test="${requestScope['eMFrame.Debug.enable']}"></a></c:if></b></font>
<br>
<br>
<% } // end not palm%>
<c:if test="${!empty requestScope['GeneralMsg.MsgBody']}">
   <iman:include page="dev/Messagebar_inc.jsp" />
   <br>
</c:if>
   <c:choose><c:when test="${requestScope['Task_Role_Count']=='0'}">
<table align="center" border="0" cellpadding="5">
<tr><td align="center"><b><iman:string key="Launch.NoRolesText" /></b></td></tr>
</table>
</c:when><c:otherwise>
<%	 int roleCount = ((Integer)request.getAttribute("Task_Role_Count")).intValue(); %>
	<c-rt:forEach var="currRoleIdx" begin="0" end="<%= roleCount -1 %>">
		<c:set var="menuItemNameParam">Task_Role_<c:out value="${currRoleIdx}" />_Name</c:set>
   	&nbsp;&nbsp;&nbsp;<IMG src="<%= MUtils.getModulesUrl(request) %>/fw/images/menu_folder_open.gif" border=0>&nbsp;&nbsp;<c:out value="${requestScope[menuItemNameParam]}" />
   	<br>
<%	 	int taskCount = ((Integer)request.getAttribute("Task_Role_" + pageContext.getAttribute("currRoleIdx")+"_Task_Count")).intValue(); %>
		<c-rt:if test="<%= taskCount > 0 %>">
			<c-rt:forEach var="currTaskIdx" begin="0" end="<%=taskCount - 1%>">
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=-1>
<%-- Any changes to the line below must be copied into the LaunchMenuCode.htt in browser --%>
			<c:set var="currTaskParam" value="Task_Role_${currRoleIdx}_Task_${currTaskIdx}" />
			<c-rt:set var="currTaskUrl" value="<%=request.getAttribute((String)pageContext.getAttribute("currTaskParam")+"_Url")%>" />
			<c:if test="${empty currTaskUrl}">
				<c:set var="currTaskUrl">frameservice?NPService=fw.LaunchService&NPAction=Delegate&delegate=<c-rt:out value="<%=request.getAttribute((String)pageContext.getAttribute("currTaskParam")+"_TaskId")%>" />&launcher=fw.Launch&lifecycle=Recreate</c:set>
			</c:if>
			<a href="<c:out value="${currTaskUrl}" />"><c-rt:out value="<%=request.getAttribute((String)pageContext.getAttribute("currTaskParam")+"_Name")%>" /></a>

         </font>
      <br>
	   	</c-rt:forEach>
	   </c-rt:if>
   <br>
   </c-rt:forEach>
</c:otherwise></c:choose>
&nbsp;&nbsp;&nbsp;<font size=-1><a href="portalservice?NPService=iManagerContainer&exit=true"><IMG src="<%= MUtils.getModulesUrl(request) %>/fw/images/logout.gif" border=0></a>&nbsp;&nbsp;<a href="portalservice?NPService=iManagerContainer&exit=true"><iman:string key="Logout.Name" /></a></font>
<br><br>
<%--
	<font size=-2>
		&nbsp;&nbsp;&nbsp;&nbsp;<iman:string key="Launch.LoggedInAs" />
		<br>
		&nbsp;&nbsp;&nbsp;&nbsp;<b><c:out value="${requestScope['Common.UserName']" /></b>
	</font>
--%>
</body>
</HTML>
