<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>

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

<vkc:checkLogin />
<vkc:init/>
<html:html locale="true">
<head>

    <title><vkc:message key="vkc" /></title>

	<vkc:cssinclude />
    
    <meta http-equiv="content-type"  content="text/html; charset=iso-8859-1" />
    <script type="text/javascript" src="<vkc:rewrite page='/common/utils.js'/>"></script>
    
    <script type="text/javascript">

        window.name = "GROUPINFO_MAINVIEW";

        function openUserInfoWindow( id ) {
            var w = 800;
            var h = 600;
            var leftPosition = screen.width/2  - w/2;
            var topPosition  = screen.height/2 - h/2;
            var settings ='height=' + h + ', width=' + w + ', top=' + topPosition + ', left=' + leftPosition;
            settings += ',scrollbars=yes,resizable';
            settings += ',toolbar=no, location=no, directories=no, status=true, menubar=no';
            var win = window.open( '<vkc:rewrite page="/displayUserInfo.do"/>?userId=' + id, 'USERINFO_MAINVIEW', settings );
            win.focus();                              
        }

    </script>

</head>
<body marginwidth=0 marginheight=0 topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<html:form action="displayGroupInfo" method="post">
<bean:define id="form" name="displayGroupInfoForm" type="vkc.view.form.DisplayGroupInfoForm"/>

<table width="100%" cellspacing="0" cellpadding="0" border="0" class="color_tab">
  <tr>
    <td valign="top" height="66" background="<vkc:rewrite page='/templates/${template.name}/gfx/header-bg.gif'/>">
      <table width="100%" cellspacing="0" cellpadding="0" border="0">
          <tr>
          <td><vkc:img page="/templates/${template.name}/gfx/vkc-logo-blau.gif" alt="VKC" hspace="10" vspace="5" height="66" width="66"/></td>
          <td align="left" nowrap="nowrap" width="100%"><span class="whiteHeading"><vkc:message key="vkc.groupinfo"/></span></td>
        </tr>
      </table>
    </td>
  </tr>
  <vkc:hline colspan="1" lineColor="#606060" lineHeight="1" topSpace="0" bottomSpace="0"/>
</table>

<logic:notEmpty name="form" property="group">
<table align='center' width='100%' cellspacing='0' cellpadding='0' border='0'>
  <tr>
    <td colspan="2">	
    <table width=100% border=0 cellpadding=3 cellspacing=1>
	  <tr>
	    <td align=left><b><vkc:message key="vkc.groupinfo.groups.name" />:</b></td>
		<td align=left width="100%"><vkc:write name="form" property="group.name" /></td>
	  </tr>
	  <tr>
	    <td align=left><b><vkc:message key="vkc.groupinfo.groups.description" />:</b></td>
		<td align=left width="100%"><vkc:write name="form" property="group.description"  /></td>
	  </tr>
	  <tr>
	    <td align=left><b><vkc:message key="vkc.groupinfo.groups.adminprivileges" />:</b></td>
		<td align=left width="100%">
        <logic:equal name="form" property="group.adminPrivileges" value="false">
          <vkc:message key="string.no"/>
        </logic:equal>
        <logic:equal name="form" property="group.adminPrivileges" value="true">
          <vkc:message key="string.yes"/>
        </logic:equal>
		</td>
	  </tr>
	  <tr>
		<td align=left valign="top"><b><vkc:message key="vkc.groupinfo.users" />:</b></td>
		<td align=left width="100%">
		  <logic:iterate id="aUser" name="form" property="groupUsers">
          <bean:define id="userId" name="aUser" property="userId" type="java.lang.Integer"/>
          <vkc:link href='<%="javascript:openUserInfoWindow(" + userId.intValue() + ");"%>'>
          <span style="text-decoration:underline">
		  <vkc:write name="aUser" property="fullName"/>
		  </span>
          </vkc:link><br>
          </logic:iterate>
		</td>
	  </tr>
    </table>
    </td>
  </tr>

  <vkc:hline colspan="2" lineClass="hline" lineHeight="1" topSpace="0" bottomSpace="0"/>

  <tr>
    <td colspan="2">    
    <table width=100% border=0 cellpadding=3 cellspacing=1>
      <tr><td width=50%  align=left valign=bottom><b><vkc:message key="vkc.groupinfo.groupCreatedAt" /></b>&nbsp;<vkc:write name="form" property="group.created" formatKey="date.medium.format"/></td></tr>
      <logic:notEmpty name="form" property="creator">
      <tr><td width=50%  align=left valign=bottom><b><vkc:message key="vkc.groupinfo.groupCreatedFrom" /></b>&nbsp;<vkc:write name="form" property="creator.username"/></td></tr>
      </logic:notEmpty>
      <logic:empty name="form" property="creator">
      <tr><td width=50%  align=left valign=bottom><b><vkc:message key="vkc.groupinfo.groupCreatedFrom" /></b>&nbsp;-</td></tr>
      </logic:empty>
    </table>  
    </td>    
  </tr>

  <vkc:hline colspan="2" lineClass="hline" lineHeight="1" topSpace="0" bottomSpace="0"/>

  <tr>
    <td colspan="2">    
    <table width=100% border=0 cellpadding=3 cellspacing=1>
      <tr><td width=50%  align=left valign=bottom><b><vkc:message key="vkc.groupinfo.groupLastChangedAt" /></b>&nbsp;<vkc:write name="form" property="group.lastChanged" formatKey="date.medium.format"/></td></tr>
      <logic:notEmpty name="form" property="lastEditor">
      <tr><td width=50%  align=left valign=bottom><b><vkc:message key="vkc.groupinfo.groupLastChangedFrom" /></b>&nbsp;<vkc:write name="form" property="lastEditor.username"/></td></tr>
      </logic:notEmpty>
      <logic:empty name="form" property="lastEditor">
      <tr><td width=50%  align=left valign=bottom><b><vkc:message key="vkc.groupinfo.groupLastChangedFrom" /></b>&nbsp;-</td></tr>
      </logic:empty>
    </table>
    </td>
  </tr>

  <vkc:hline colspan="2" lineClass="hline" lineHeight="1" topSpace="0" bottomSpace="5"/>

  <tr><td colspan="2" align=center><vkc:button property="action.closeWindow" onclick="javascript:disableAllButtons(this);window.close();"><vkc:message key="vkc.groupinfo.button.closeWindow"/></vkc:button></td></tr>
</table>
</logic:notEmpty>

<logic:empty name="form" property="group">
<table align='center' width='100%' cellspacing='0' cellpadding='0' border='0'>
  <tr><td colspan="2" align=center>&nbsp;</td></tr>
  <tr><td colspan="2" align="center" width="100%"><b><vkc:message key="vkc.groupinfo.error.retrieve" arg0="<%=String.valueOf( form.getGroupId() )%>" /></b></td></tr>
  <tr><td colspan="2" align=center>&nbsp;</td></tr>
  <tr><td colspan="2" align="center" width="100%"><vkc:button property="action.closeWindow" onclick="javascript:disableAllButtons(this);window.close();"><vkc:message key="vkc.groupinfo.button.closeWindow"/></vkc:button></td></tr>
</table>
</logic:empty>

</html:form>
</body>
</html:html>