<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request); 
   c.stringTable("DevResources"); 
   c.stringTable("FwResources"); %>

<HTML>
<HEAD>
<TITLE><%= c.toHTML(c.string("RBSManagement.RoleTaskSummaryTitle")) %></TITLE>
<LINK href="<%= c.getModulesUrl() + "/dev/css/hf_style.css" %>" rel="styleSheet" type="text/css">
<SCRIPT language="JavaScript">

	//==================================
   // onPageLoad()
   //==================================
   function onPageLoad()
   {
   	// Set the initial focus
      var oElement = document.getElementById("taskbutton");

      if (oElement != null) // oElement will be null if there are no roles or tasks in the display
      {
      	oElement.focus();
      }
   }

   //==================================
   // setWaitCursor()
   //==================================
   function setWaitCursor()
   {
	   document.body.style.cursor="wait";
   }

   //==================================
   // modifyRoleTasks()
   //==================================
   function modifyRoleTasks(displayName, fullName)
	{
      var roleDisplayName	= displayName;
      var roleFullName		= fullName;

      setWaitCursor();

      document.EguideRoleTaskSummaryForm.elements["SelectedRoleDisplayName"].value=roleDisplayName;
      document.EguideRoleTaskSummaryForm.elements["SelectedRoleFullName"].value=roleFullName;

      document.EguideRoleTaskSummaryForm.elements["merge"].value="fw.ModifyRoleTasks";
      document.EguideRoleTaskSummaryForm.elements["nextState"].value="setupModifyTasksPage";
      document.EguideRoleTaskSummaryForm.submit();
	}

	//==================================
   // modifyRoleAssociations()
   //==================================
	function modifyRoleAssociations(displayName, fullName)
	{
      var roleDisplayName	= displayName;
      var roleFullName		= fullName;

      setWaitCursor();

      document.EguideRoleTaskSummaryForm.elements["SelectedRoleDisplayName"].value=roleDisplayName;
      document.EguideRoleTaskSummaryForm.elements["SelectedRoleFullName"].value=roleFullName;

      document.EguideRoleTaskSummaryForm.elements["merge"].value="fw.ModifyRoleAssociations";
      document.EguideRoleTaskSummaryForm.elements["nextState"].value="setupModifyAssociationsPage";
      document.EguideRoleTaskSummaryForm.submit();
	}

	//==================================
   // modifyRoleAssociations()
   //==================================
	function getRightsReport(fullName)
	{
      document.EguideRoleTaskSummaryForm.elements["SelectedRoleFullName"].value=fullName;
      document.EguideRoleTaskSummaryForm.elements["merge"].value="fw.RoleRightsReport";
      document.EguideRoleTaskSummaryForm.elements["nextState"].value="getRoleRightsReport";
      document.EguideRoleTaskSummaryForm.submit();
   }


</SCRIPT>
</HEAD>
<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" onload="onPageLoad()">
<FORM name="EguideRoleTaskSummaryForm" method=post action="webacc">
   <input type=hidden name="taskId" value="<%= c.var("taskId") %>">
   <input type=hidden name="merge" value="">
   <input type=hidden name="error" value="dev.GenErr">
   <input type=hidden name="User.context" value="<%= c.var("User.context") %>">
   <input type=hidden name="nextState" value="">
   <input type=hidden name="SelectedRoleDisplayName" value="">
   <input type=hidden name="SelectedRoleFullName" value="">
   <input type=hidden name="RBSAdmin_RoleType" value="eGuide">
   <!-- End of hidden tags -->
   
<DIV class="head2"> 
  	<% c.set("TaskHeader.title", c.toHTML(c.string("eGuideRoleTaskSummary.ModifyRoles"))); 
      c.set("TaskHeader.helpFile", "base/eguideroletasksummary.html"); 
	   c.set("TaskHeader.HelpWindowWidth", "500"); 
	   c.set("TaskHeader.HelpWindowHeight", "500"); %>
   <jsp:include page='<%= c.getPath("dev/TaskHeader_inc.jsp") %>' flush="true" />
   <BR>
   <TABLE width="100%" border="0" cellpadding="2" cellspacing="0">
      <TR> 																	  
      	<TD width="5%" height="26" class="tablecolumnhead2">&nbsp;</TD>
         <TD width="59%" height="26" class="tablecolumnhead2"><DIV align="left" nowrap><%= c.toHTML(c.string("RoleTaskSummary.RolesAndTasks")) %></DIV></TD>
         <TD width="18%" height="26" class="tablecolumnhead2"><DIV align="left" nowrap><%= c.toHTML(c.string("eGuideRoleTaskSummary.RightsAdvisory")) %></DIV></TD>
         <TD width="18%" height="26" class="tablecolumnhead2"><DIV align="left" nowrap><%= c.toHTML(c.string("RoleTaskSummary.SelfManagement")) %></DIV></TD>
    	</TR>
    	
      <!-- Load Roles and description -->
      <% if (c.var("OwnedRoles.Count").equals("0")) { %>
      	<TR bgcolor=<%= c.var("color") %>>
         	<TD colspan="7" class="head5" height="2" bgcolor="#EFEEE9" valign="middle" nowrap>&nbsp;<%= c.toHTML(c.string("eGuideRoleTaskSummary.NoEguideRoles")) %></TD>	
         </TR>
      <% } 
         c.set("i", "0"); 
         c.set("color", "#EFEEE9"); 
         while (c.lt(c.var("i"), c.var("OwnedRoles.Count"))) { %>
	      <TR bgcolor=<%= c.var("color") %>> 
	      	<TD width="5%" class="text10px" height="2" bgcolor="#EFEEE9" nowrap>
               <DIV align="left">
               	<a href="#" id="taskbutton" onClick="javascript:modifyRoleTasks('<%= c.toHTML((c.toScript(c.var("Role."+c.var("i")+ ".DisplayName")))) %>','<%= c.toHTML((c.toScript(c.var("Role."+c.var("i")+ ".FullName")))) %>');return false"><IMG src="<%= c.getModulesUrl() + "/fw/images/" + c.string("Button.ModifyTasks.image") %>" alt="<%= c.toHTML(c.string("Button.ModifyTasks.alt")) %>" title="<%= c.toHTML(c.string("Button.ModifyTasks.alt")) %>" width="16" height="16" border="0"></a>
               	<a href="#" onClick="javascript:modifyRoleAssociations('<%= c.toHTML((c.toScript(c.var("Role."+c.var("i")+ ".DisplayName")))) %>','<%= c.toHTML((c.toScript(c.var("Role."+c.var("i")+ ".FullName")))) %>');return false"><IMG src="<%= c.getModulesUrl() + "/fw/images/" + c.string("Button.ModifyRoles.image") %>" alt="<%= c.toHTML(c.string("Button.ModifyMembers.alt")) %>" title="<%= c.toHTML(c.string("Button.ModifyMembers.alt")) %>" width="16" height="16" border="0"></a>
               </DIV>
	      	</TD>
            <TD width="59%" class="head5" height="2" bgcolor="#EFEEE9" align="left"><%= c.toHTML(c.var("Role."+c.var("i")+ ".DisplayName")) %></TD>
            <TD width="18%" class="head5" height="2"  align="left" bgcolor="#EFEEE9"><a href="#" onClick="javascript:getRightsReport('<%= c.toHTML((c.toScript(c.var("Role."+c.var("i")+ ".FullName")))) %>');return false"><%= c.toHTML(c.string("RoleRightsReport.RightsReport")) %></a></TD>
            <TD width="18%" class="head5" height="2" bgcolor="#EFEEE9" valign="middle" nowrap>
               <% if (c.var("Role."+c.var("i")+ ".SelfManagementRole").equals("true")) { %>
            		<DIV align="center"><input type="checkbox" CHECKED disabled></DIV>
               <% } %>
            </TD>
         </TR>
         
         <!-- Load Tasks for Role -->
         <% c.set("j", "0"); 
            c.set("color", "#FFFFFF"); 
            while (c.lt(c.var("j"), c.var("OwnedRole."+c.var("i")+ ".Tasks.Count"))) { %>
	         <TR> 
			      <TD width="5%">&nbsp;</TD>
               <TD width="59%" class="smalltext">&nbsp;&nbsp;&nbsp;&nbsp;<%= c.toHTML(c.var("Role."+c.var("i")+ ".Task."+c.var("j")+ ".DisplayName")) %></TD>
				      <% if (c.var("Role."+c.var("i")+ ".Task."+c.var("j")+ ".SuperAndSecondaryRights").equals("true")) { %>
	               	&nbsp;<%= c.toHTML(c.string("RBSManagement.SupervisorySecondary")) %>
	               <% } else { 
	               	   if (c.var("Role."+c.var("i")+ ".Task."+c.var("j")+ ".SupervisorRights").equals("true")) { %>
	               	&nbsp;<%= c.toHTML(c.string("RBSManagement.Supervisory")) %>
	                  <% } 
	               	   if (c.var("Role."+c.var("i")+ ".Task."+c.var("j")+ ".SecondaryRights").equals("true")) { %>
	               	&nbsp;<%= c.toHTML(c.string("RBSManagement.Secondary")) %>
	                  <% } 
	                  } %>
               </TD>
               <TD width="18%">&nbsp;</TD>
			      <TD width="18%">&nbsp;</TD>
		    	</TR>
         <% c.inc("j"); 
            } 
   	   c.inc("i"); 
   	   } %>
	</TABLE>
   </FONT>
</DIV>
</FORM>
</BODY></HTML>
