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

<%@ page import="vkc.view.WebShare" %>
<%@ page import="vkc.view.TabId" %>
<%@ page import="org.apache.struts.Globals" %>
<%@ page import="vkc.misc.VKCLogManager" %>

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

<vkc:checkLogin />
<vkc:init/>
<html:html locale="true">
<head>
    
  	<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" src="<vkc:rewrite page='/common/calendar.js'/>"></script>

    <script type="text/javascript">

    window.name = "MAINVIEW";
    var associatedTabId = <%=TabId.ADMIN_USERMANAGEMENT_TAB%>;
    var currentCalendar = null;
    var windowOpen = null;
    	
    function init() {
      	var tabView = getTabView();
        var tabViewForm = tabView.document.forms[0];

        if (tabView && tabView.systemviewtype == "administrationview" && tabView.selectedTabId != associatedTabId) {
          	tabView.location.replace("<%=ctxPath%>/adminTabView.do?selectedTabId=<%=TabId.ADMIN_USERMANAGEMENT_TAB%>"
          						   + "&lastCategoryId=" + tabViewForm.lastCategoryId.value
          						   + "&lastFunctionalId=" + tabViewForm.lastFunctionalId.value
          						   + "&lastProjectId=" + tabViewForm.lastProjectId.value);
        }

        <logic:equal name="editUserForm" property="languageChanged" value="true">
          if (tabViewForm) {
            if (tabView.systemviewtype == "procobaview") {
                tabViewForm.action = tabViewForm.action + "?reloadMainview=false&ignoreTabviewLoad=true&selectedTabId=<vkc:write name='categorySettings' property='projectManagementRootId'/>";
            }
            
          	tabViewForm.submit();
          }

      	  var copyrightView = getCopyrightView();
          var copyrightViewForm = copyrightView.document.forms[0];
          
          if (copyrightViewForm) {
          	copyrightViewForm.submit();
          }
        </logic:equal>

        <logic:present name="<%=WebShare.INFO_KEY%>" scope="request">
          <bean:define id="msg" type="java.lang.String" scope="request" name="<%=WebShare.INFO_KEY%>"/>
          alert( '<vkc:message javascript="true" filter="false" key="<%=msg%>"/>' );
        </logic:present>

        setAnchor();
    }

    function setAnchor() {
        <logic:present parameter="anchor">
          <bean:parameter id="anchor2" name="anchor"/>
          this.location.hash = '<%=anchor2%>';
        </logic:present>
    }

    function proxyRemoveSelectChanged()	{
        var form = document.forms[ 0 ];

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.proxy.remove.select.changed=true";
        } else {
          form.action = form.action + "&action.proxy.remove.select.changed=true";
        }

        form.submit();
    }
	
	function deleteAttribute( index ) {		
        var form = document.forms[ 0 ];        
        form.selectedIndex.value = index;
        return true;
    }
    
    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();
    }

    function showExplorer() {
        var w = 200;
        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';
        windowOpen = window.open( '<vkc:rewrite page="/explorerTreeView.do"/>', 'EXPLORER_MAINVIEW', settings );
        windowOpen.focus();
        return false;
    }

    function setCategoryId(id) {
        var form = document.forms[0];
        form.selectedCategoryId.value = id;

        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.category=true";
        } else {
          form.action = form.action + "&action.change.category=true";
        }

        windowOpen = null;
        form.submit();
    }

    function unloadPage() {
        if ( currentCalendar != null ) {
              hideCalendar();
        }

        if ( windowOpen != null ) {
            windowOpen.close();
        }
    }
    
   
    </script>

</head>
<body onload="init();" onUnload="unloadPage();" topmargin="0" marginheight="0">
<html:form action="/editUser" method="post">

<bean:define id="form" name="editUserForm" scope="request" type="vkc.administration.form.EditUserForm"/>
<bean:define id="editUser" name="editUserForm" property="editUser" scope="request" type="vkc.db.entities.VKCUser"/>

<logic:iterate id="gid" name="form" property="addGroupIds" type="java.lang.Integer">
  <html:hidden property="addGroupIds" name="form" value='<%=String.valueOf(gid.toString())%>'/>
</logic:iterate>

<logic:iterate id="uid" name="form" property="addProxyUserIds" type="java.lang.Integer">
  <html:hidden property="addProxyUserIds" name="form" value='<%=String.valueOf(uid.toString())%>'/>
</logic:iterate>

<html:hidden property="userId"/>
<html:hidden property="selectedIndex" name="form" value="-1"/>
<html:hidden property="redirect"/>
<html:hidden property="currentProxyUserId"/>
<html:hidden property="selectedCategoryId"/>



<table width="1%" align="center" cellspacing="3" cellpadding="0" border="0">
    <logic:present name="<%=Globals.ERROR_KEY%>">
    <tr><td align="left" nowrap="nowrap" colspan="5"><font color="red"><b><vkc:errors/></b></font></td></tr>
    <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="3" bottomSpace="3"/>
    </logic:present>

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


    <logic:equal name="form" property="editUser.externalUser" value="false">
    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.username" />:</b>&nbsp;<vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/></td>
      <td width="100%" align="left"><vkc:text name="form" property="username" styleClass="profileField" maxlengthProperty="user.username"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>

      <logic:equal name="form" property="accountValid" value="true">
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.accountValid.from" />:</b></td>
      <td width="100%" align="left">
        <table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td><html:text property="validFrom" maxlength="10" size="10" styleClass="dateField"/></td>
            <td><vkc:calendarbutton buttonName="btn_validFrom" /></td>
            <td>&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
          </tr>
        </table>
      </td>
      </logic:equal>

      <logic:equal name="form" property="accountValid" value="false">
      <td align="left" nowrap="nowrap"><font style="color:#aaaaaa" ><b><vkc:message key="vkc.administration.accountValid.from" />:</b></font></td>
      <td width="100%" align="left">
        <table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td><html:text property="validFrom" maxlength="10" size="10" styleClass="dateField" disabled="true"/></td>
            <td>&nbsp;<font style="color:#aaaaaa" >[<vkc:message key="vkc.profile.date_format" />]</font></td>
          </tr>
        </table>
      </td>
      </logic:equal>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.accountValid" />:</b></td>
      <td width="100%" align="left"><html:checkbox name="form" property="accountValid" value="true" onclick="submit();"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>

      <logic:equal name="form" property="accountValid" value="true">
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.accountValid.until" />:</b></td>
      <td width="100%" align="left">
        <table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td><html:text property="validUntil" maxlength="10" size="10" styleClass="dateField"/></td>
            <td><vkc:calendarbutton buttonName="btn_validUntil" /></td>
            <td>&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
          </tr>
        </table>
      </td>
      </logic:equal>

      <logic:equal name="form" property="accountValid" value="false">
      <td align="left" nowrap="nowrap"><font style="color:#aaaaaa" ><b><vkc:message key="vkc.administration.accountValid.until" />:</b></font></td>
      <td width="100%" align="left">
        <table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td><html:text property="validUntil" maxlength="10" size="10" styleClass="dateField" disabled="true"/></td>
            <td>&nbsp;<font style="color:#aaaaaa" >[<vkc:message key="vkc.profile.date_format" />]</font></td>
          </tr>
        </table>
      </td>
      </logic:equal>    
    </tr>
    
    <vkc:hasAdminPrivileges>
    <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>

    <tr>
      <td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.administration.adminPrivileges" />:</b></td>
      <td width="100%" align="left" valign="top" nowrap="nowrap"><html:checkbox name="form" property="adminPrivileges" value="true" /></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td valign="top"><b><vkc:message key="vkc.administration.dAdmin" />:</b></td>
      <td valign="top">
        <html:checkbox name="form" property="manageOwnUsers" value="true" onclick="submit();"/><vkc:message key="vkc.administration.dAdminManageOwnUsers" /><br>
	    <logic:equal name="categorySettings" property="projectManagementEnabled" value="true">
	      <logic:equal name="form" property="manageOwnUsers" value="true">
	        <html:checkbox name="form" property="manageOwnUsersSystemViews" value="true"/><vkc:message key="vkc.administration.dAdminManageOwnUsersSystemViews" /><br>
	      </logic:equal>
	      <logic:equal name="form" property="manageOwnUsers" value="false">
	        <html:checkbox name="form" property="manageOwnUsersSystemViews" value="true" disabled="true"/><font style="color:#aaaaaa" ><vkc:message key="vkc.administration.dAdminManageOwnUsersSystemViews" /></font><br>
	      </logic:equal>
	    </logic:equal>
        <html:checkbox name="form" property="manageOwnGroups" value="true"/><vkc:message key="vkc.administration.dAdminManageOwnGroups" /><br>
        <html:checkbox name="form" property="manageOwnProxies" value="true"/><vkc:message key="vkc.administration.dAdminManageOwnProxies" /><br>
        <html:checkbox name="form" property="manageVirtualDocumentQueries" value="true"/><vkc:message key="vkc.administration.dAdminManageVirtualDocumentQueries" />
      </td>
    </tr>
    </vkc:hasAdminPrivileges>

    <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>
    </logic:equal>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.usertitle" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="title" styleClass="profileField" maxlengthProperty="user.salutation" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.company" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="company" styleClass="profileField" maxlengthProperty="user.company" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.firstname" />:</b>&nbsp;
       <logic:equal name="form" property="editUser.externalUser" value="false">
        <vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/>
       </logic:equal>
      </td>
      <td width="100%" align="left"><vkc:text name="form" property="firstname" styleClass="profileField" maxlengthProperty="user.firstname" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.department" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="department" styleClass="profileField" maxlengthProperty="user.department" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.lastname" />:</b>&nbsp;
       <logic:equal name="form" property="editUser.externalUser" value="false">
        <vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/>
       </logic:equal>
      </td>
      <td width="100%" align="left"><vkc:text name="form" property="lastname" styleClass="profileField" maxlengthProperty="user.lastname" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.street" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="street" styleClass="profileField" maxlengthProperty="user.street" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.email" />:</b>&nbsp;
       <logic:equal name="form" property="editUser.externalUser" value="false">
         <vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/>
       </logic:equal>
      </td>
      <td width="100%" align="left"><vkc:text name="form" property="email" styleClass="profileField" maxlengthProperty="user.email" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.zip" />/<vkc:message key="vkc.administration.city" />:</b></td>
      <td width="100%" align="left">
        <table align="left" cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td align="left" nowrap="nowrap"><vkc:text name="form" property="zip" size="5" maxlengthProperty="user.zip" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
            <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="4" /></td>
            <td width="100%" align="left" nowrap="nowrap"><vkc:text name="form" property="city" maxlengthProperty="user.city" style="width:100%;" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
          </tr>
        </table>
      </td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.showemail" />:</b></td>
      <td width="100%" align="left"><html:checkbox name="form" property="showEmail" value="true" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.phone" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="phone" styleClass="profileField" maxlengthProperty="user.phone" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
    </tr>

	<tr>
   		<td nowrap="nowrap"><b><vkc:message key="vkc.profile.enablehtmlnotification" />:</b></td>
    	<td width="100%" align="left"><html:checkbox name="form" property="enableHtmlNotification" /></td>
    	<td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
    	<td nowrap="nowrap"><b></b></td>
    	<td width="100%" align="left"></td>
  	</tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.homepageurl" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="homepageURL" styleClass="profileField" maxlengthProperty="user.homepage.url" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.fax" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="fax" styleClass="profileField" maxlengthProperty="user.fax" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.contacturl" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="contactURL" styleClass="profileField" maxlengthProperty="user.contact.url" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.mobile" />:</b></td>
      <td width="100%" align="left"><vkc:text name="form" property="mobile" styleClass="profileField" maxlengthProperty="user.mobile" disabled="<%=form.getEditUser().isExternalUser()%>"/></td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.language" />:</b></td>
      <td width="100%" align="left">
        <bean:define id="languages" name="form" property="languageLabels" type="java.util.List"/>
        <html:select name="form" property="selectedLanguageId" size="1">
          <vkc:options collection="languages" property="languageId" labelProperty="name_key" handleLabelAsKey="true"/>
        </html:select>
      </td>
      <vkc:hasAdminPrivileges>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.quota" />:</b></td>
      <td width="100%" align="left">
        <html:select property="selectedQuota" size="1">
          <html:option value="">&nbsp;</html:option>
          <html:option value="null"><vkc:message key="vkc.administration.quota.unlimited" /></html:option>
          <html:option value="10"><vkc:message key="vkc.administration.quota.10MB" /></html:option>
          <html:option value="50"><vkc:message key="vkc.administration.quota.50MB" /></html:option>
          <html:option value="100"><vkc:message key="vkc.administration.quota.100MB" /></html:option>
          <html:option value="200"><vkc:message key="vkc.administration.quota.200MB" /></html:option>
          <html:option value="500"><vkc:message key="vkc.administration.quota.500MB" /></html:option>
          <html:option value="1000"><vkc:message key="vkc.administration.quota.1GB" /></html:option>
          <html:option value="2000"><vkc:message key="vkc.administration.quota.2GB" /></html:option>
          <html:option value="5000"><vkc:message key="vkc.administration.quota.5GB" /></html:option>
          <html:option value="10000"><vkc:message key="vkc.administration.quota.10GB" /></html:option>
        </html:select>
      </td>
      </vkc:hasAdminPrivileges>
    </tr>

    <vkc:hasAdminPrivileges>
    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.sessiontimeout" />:</b></td>
      <td width="100%" align="left">
        <html:select property="selectedSessionTimeout" size="1">
          <html:option value="30" ><vkc:message key="vkc.administration.sessiontimeout.30min" /></html:option>
          <html:option value="60" ><vkc:message key="vkc.administration.sessiontimeout.60min" /></html:option>
          <html:option value="120"><vkc:message key="vkc.administration.sessiontimeout.120min"/></html:option>
        </html:select>&nbsp;
        <b><vkc:message key="vkc.administration.sessiontimeout.inactivity"/></b>
      </td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <logic:notEmpty name="form" property="userQuota">
      <bean:define id="userQuota" name="form" property="userQuota" />
      <td><b><vkc:message key="vkc.administration.used.quota" />:</b></td>
      <td><vkc:write name="userQuota" property="usedQuotaInMegaByteString"/>MB
        <logic:notEmpty name="userQuota" property="usedQuotaInPercentString">
        [ <vkc:write name="userQuota" property="usedQuotaInPercentString"/> ]
        </logic:notEmpty>
      </td>
      </logic:notEmpty>
    </tr>

    <tr>
	  <logic:equal name="categorySettings" property="projectManagementEnabled" value="true">
        <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.systemviewtype.allowmanage" />:</b></td>
        <td width="100%" align="left"><html:checkbox name="form" property="allowManageSystemViewType"/></td>
	  </logic:equal>
	  <logic:equal name="categorySettings" property="projectManagementEnabled" value="false">
	    <html:hidden name="form" property="allowManageSystemViewType"/>
	    <td>&nbsp;</td>
	    <td>&nbsp;</td>
	  </logic:equal>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.quota.published.docs" />:</b></td>
      <td width="100%" align="left"><vkc:write name="form" property="userStatistics.numPublishedDocuments" /></td>
    </tr>

    <tr>
	  <logic:equal name="categorySettings" property="projectManagementEnabled" value="true">
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.systemviewtype" />:</b></td>
      <td width="100%" align="left">
        <html:select name="form" property="selectedSystemViewTypeId" size="1">
          <html:option value='<%=vkc.view.PageId.FUNCTIONAL_VIEW.toString()%>'><vkc:message key="vkc.systemviewtype.functionview"/></html:option>
          <html:option value='<%=vkc.view.PageId.PROJECT_VIEW.toString()%>'><vkc:message key="vkc.systemviewtype.projectview"/></html:option>
          <html:option value='<%=vkc.view.PageId.CATEGORY_VIEW.toString()%>'><vkc:message key="vkc.systemviewtype.categoryview"/></html:option>
        </html:select>
	  </td>
	  </logic:equal>
	  <logic:equal name="categorySettings" property="projectManagementEnabled" value="false">
	    <html:hidden name="form" property="selectedSystemViewTypeId"/>
	    <td>&nbsp;</td>
	    <td>&nbsp;</td>
	  </logic:equal>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.quota.published.cats" />:</b></td>
      <td width="100%" align="left"><vkc:write name="form" property="userStatistics.numCreatedCategories" /></td>
    </tr>
    </vkc:hasAdminPrivileges>

	<logic:equal name="categorySettings" property="projectManagementEnabled" value="true">
    <logic:equal name="form" property="user.dedicatedUsersAdmin" value="true">
    <logic:equal name="form" property="user.manageOwnUsersSystemViews" value="true">
    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.systemviewtype.allowmanage" />:</b></td>
      <td width="100%" align="left"><html:checkbox name="form" property="allowManageSystemViewType"/></td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap">&nbsp;</td>
      <td width="100%" align="left">&nbsp;</td>
    </tr>

    <tr>
      <td align="left" nowrap="nowrap"><b><vkc:message key="vkc.systemviewtype" />:</b></td>
      <td width="100%" align="left">
        <html:select name="form" property="selectedSystemViewTypeId" size="1">
          <html:option value='<%=vkc.view.PageId.FUNCTIONAL_VIEW.toString()%>'><vkc:message key="vkc.systemviewtype.functionview"/></html:option>
          <html:option value='<%=vkc.view.PageId.PROJECT_VIEW.toString()%>'><vkc:message key="vkc.systemviewtype.projectview"/></html:option>
          <html:option value='<%=vkc.view.PageId.CATEGORY_VIEW.toString()%>'><vkc:message key="vkc.systemviewtype.categoryview"/></html:option>
        </html:select>
	  </td>
      <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
      <td align="left" nowrap="nowrap">&nbsp;</td>
      <td width="100%" align="left">&nbsp;</td>
    </tr>
    </logic:equal>
    <logic:equal name="form" property="user.manageOwnUsersSystemViews" value="false">
      <html:hidden name="form" property="allowManageSystemViewType"/>
      <html:hidden name="form" property="selectedSystemViewTypeId"/>
    </logic:equal>
    </logic:equal>
    </logic:equal>
	
	
	<vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="0"/>
    <!-- Beginn - Verwaltung dynamischer Attribute -->   
    <tr>
      <td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.string.dynaAttributes"/>:</b></td>
      <td width="100%" align="left" valign="top" colspan="4">
        <logic:empty name="form" property="dynaAttributes">
        <vkc:button property="action.add.dynaattribute" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.addDynaAttribute"/></vkc:button>
        </logic:empty>

	    <logic:notEmpty name="form" property="dynaAttributes">
	      <a name="dynaattributes"></a>
	      <table width="100%" cellspacing="3" cellpadding="0" border="0">
	        <tr>
	          <td>&nbsp;</td>
	          <td width="200"><b><vkc:message key="vkc.string.name"/>:</b>&nbsp;<vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/></td>
	          <td width="100%"><b><vkc:message key="vkc.string.value"/>:</b></td>
	          <td nowrap="nowrap"><b><vkc:message key="vkc.administration.userpermission.description"/></b></td>
	          <td>&nbsp;</td>
	        </tr>
			
	        <logic:iterate id="dynaAttribute" name="form" property="dynaAttributes" indexId="index">
	        <tr>
	          <td align="right"><b><%=String.valueOf(((Integer)index).intValue() + 1) + "."%></b></td>
	          <td align="left" nowrap="nowrap"><input type="text" name='dynaAttributeName_<%=index%>' value='<vkc:write name="dynaAttribute" property="name"/>' style="width:200px;"></td>
	          <td width="100%" align="left"><input type="text" name='dynaAttributeValue_<%=index%>' value='<vkc:write name="dynaAttribute" property="value"/>' style="width:100%;"></td>
	          <td align="left">          
	            <html:select name="dynaAttribute" property="autorization" size="1" > 
	              <html:option value="0"><vkc:message key="vkc.administration.userpermission.no" /></html:option>    
	              <html:option value="1"><vkc:message key="vkc.administration.userpermission.read" /></html:option>
	              <html:option value="2"><vkc:message key="vkc.administration.userpermission.write" /></html:option>                  
	            </html:select>
	          </td>
	          <td align="left" ><vkc:image page="/templates/${template.name}/gfx/button-deletecategory.gif" property="action.delete.dynaattribute" onclick='<%= String.valueOf("return deleteAttribute(" + index + ")")%>' titleKey="vkc.document.remove.attribute"/></td>
	        </tr>
	        </logic:iterate>
	
	        <tr>
	          <td align="left" colspan="5"><vkc:button property="action.add.dynaattribute" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.addDynaAttribute"/></vkc:button></td>
	        </tr>
	      </table>
	    </logic:notEmpty>
	  </td>
    </tr>
    <!-- Ende - Verwaltung dynamischer Attribute -->
	
    <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="0"/>

    <tr>
  	  <td nowrap="nowrap"><b><vkc:message key="vkc.profile.showtree" />:</b></td>
      <td width="100%" align="left" colspan="4"><html:checkbox name="form" property="showTree" disabled="<%=form.getUser().isExternalUser()%>"/></td>
    </tr>
  
    <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="0"/>

    <!-- Homecategory für - ANFANG - -->
    <tr>
      <td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.profile.homecategory" />:</b></td>
      <td width="100%" align="left" valign="top" colspan="4">
        <table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td><vkc:image page="/templates/${template.name}/gfx/navigator.gif" property="btn_explorer" onclick="this.blur();return showExplorer();" titleKey="vkc.string.show.explorer"/></td>
            <td>&nbsp;</td>
            <td><vkc:link page="/showCategory.do" name="form" property="homeLinkParams"><vkc:write name="form" property="categoryPath"/></vkc:link></td>
          </tr>
        </table>
      </td>
    </tr>
    <!-- Homecategory für - ENDE - -->

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

    <tr>
      <td align="center" colspan="5">
      <a name="groups"></a>
      <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td width="50%" align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.registeredGroups"/></b></td>
          <td width="1" align="center" nowrap="nowrap"></td>
          <td width="50%" align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.grouplist"/>:</b></td>
        </tr>

        <tr><td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="3" width="1"/></td></tr>

        <tr>
          <td width="50%" align="center" nowrap="nowrap">
            <bean:define id="addGroupLabels" name="form" property="addGroupLabels" type="java.util.List"/>
            <html:select name="form" property="selectedRemoveGroupIds" multiple="true" size="10" style="width:99%;">
              <vkc:options collection="addGroupLabels" property="groupId" labelProperty="name"/>
            </html:select>
          </td>
          <td width="1" align="center" nowrap="nowrap">
            <table width="1" align="center" cellpadding="0" cellspacing="0" border="0">
              <tr>
                <td align="center" nowrap="nowrap">&nbsp;<vkc:button property="action.add.groupsToUser" onclick="javascript:disableAllButtonsAndSubmit(this);">&lt;&lt;</vkc:button>&nbsp;</td>
              </tr>

              <tr><td align="center">&nbsp;</td></tr>

              <tr>
                <td align="center" nowrap="nowrap">&nbsp;<vkc:button property="action.remove.groupsFromUser" onclick="javascript:disableAllButtonsAndSubmit(this);">&gt;&gt;</vkc:button>&nbsp;</td>
              </tr>
            </table>
          </td>
          <td width="50%" align="center" nowrap="nowrap">
            <bean:define id="removeGroupLabels" name="form" property="removeGroupLabels" type="java.util.List"/>
            <html:select name="form" property="selectedAddGroupIds" multiple="true" size="10" style="width:99%;">
              <vkc:options collection="removeGroupLabels" property="groupId" labelProperty="name"/>
            </html:select>
          </td>
        </tr>
      </table>
      </td>
    </tr>

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

    <!-- Stellvertreter für - ANFANG - -->
    <tr>
      <td align="center" colspan="5">
      <table border=0 cellpadding=0 cellspacing=0 align=left>
        <tr>
          <td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.administration.proxyFor" />:</b></td>
        </tr>
        <logic:iterate id="userInfo" indexId="ctr" name="form" property="proxiesAsUserInfoSortedByLastname" >
        <bean:define id="userId" name="userInfo" property="userId" type="java.lang.Integer"/>
        <bean:define id="proxyUser" name="form" property='<%="proxyUser[" + userId.intValue() + "]"%>' type="vkc.db.entities.VKCProxyUser"/>
        <logic:equal name="ctr" value="0">
        <tr>
          <td align="left" valign="top" nowrap="nowrap"><b>&nbsp;</b></td>
        </tr>
        </logic:equal>
        <tr>
          <td align="left" valign="top" nowrap="nowrap">
            <vkc:link href='<%="javascript:openUserInfoWindow(" + userId.intValue() + ");"%>'>
              <span style="text-decoration:underline"><vkc:write name="userInfo" property="lastnameLabel"/></span>
            </vkc:link>&nbsp;<br>
          </td>
          <td align="left" valign="top" nowrap="nowrap">
            <logic:notEmpty name="proxyUser" property="validFrom">
            <vkc:message key="string.from"/>&nbsp;<b><vkc:write name="proxyUser" property="validFromLabel"/></b>&nbsp;
            </logic:notEmpty>
            <logic:notEmpty name="proxyUser" property="validUntil">
            <vkc:message key="string.to"/>&nbsp;<b><vkc:write name="proxyUser" property="validUntilLabel"/></b>&nbsp;
            </logic:notEmpty>
          </td>
          <td align="left" valign="top">
            <vkc:write name="proxyUser" property="description"/>
          </td>
        </tr>
        </logic:iterate>
      </table>
      </td>
    </tr>
    <!-- Stellvertreter für - ENDE - -->

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

    <logic:notEmpty name="form" property="addProxyUserLabels">
      <logic:iterate id="apu" indexId="ctr" name="form" property="addProxyUserLabels" type="vkc.view.bean.UserInfo">
        <vkc:hidden property='<%=  String.valueOf("dynaValue(proxyDescription_" + apu.getUserId().toString() + ")" ) %>'/>
        <html:hidden property='<%=  String.valueOf("dynaValue(proxyValidFrom_" + apu.getUserId().toString() + ")" ) %>'/>
        <html:hidden property='<%=  String.valueOf("dynaValue(proxyValidUntil_" + apu.getUserId().toString() + ")" ) %>'/>
      </logic:iterate>
    </logic:notEmpty>

    <vkc:hasAdminPrivileges>
    <!-- ProxyUsers -->
     <tr>
      <td align="center" colspan="5">
        <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td width="50%" align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.registeredProxys"/>:</b></td>
            <td width="1" align="center" nowrap="nowrap"></td>
            <td width="50%" align="left" nowrap="nowrap"><b><vkc:message key="vkc.administration.userlist"/>:</b></td>
          </tr>
          <tr>
            <td width="50%" align="center" nowrap="nowrap">
              <a name="proxys"></a>
              <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr>
                  <td colspan="2">
                    <bean:define id="addProxyUserLabels" name="form" property="addProxyUserLabels" type="java.util.List"/>
                    <html:select name="form" property="selectedRemoveProxyUserIds" size="6" style="width:99%;" onchange="javascript:proxyRemoveSelectChanged()">
                      <vkc:options collection="addProxyUserLabels" property="userId" labelProperty="lastnameLabel"/>
                    </html:select>
                  </td>
                </tr>
                <tr>
                  <td nowrap="nowrap">
                    <b><vkc:message key="vkc.administration.proxyValidFrom"/>:</b>&nbsp;
                  </td>
                  <td width="100%" align="left">
                    <table cellpadding="0" cellspacing="0" border="0">
                      <tr>
                        <td><html:text property="proxyValidFrom" maxlength="10" size="10" styleClass="dateField"/></td>
                        <td><vkc:calendarbutton buttonName="btn_proxyValidFrom" /></td>
                        <td>&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr>
                  <td nowrap="nowrap">
                    <b><vkc:message key="vkc.administration.proxyValidUntil"/>:</b>&nbsp;
                  </td>
                  <td width="100%" align="left">
                    <table cellpadding="0" cellspacing="0" border="0">
                      <tr>
                        <td><html:text property="proxyValidUntil" maxlength="10" size="10" styleClass="dateField"/></td>
                        <td><vkc:calendarbutton buttonName="btn_proxyValidUntil" /></td>
                        <td>&nbsp;[<vkc:message key="vkc.profile.date_format"/>]</td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr>
                  <td>
                    <b><vkc:message key="vkc.administration.proxyDescription"/>:</b>&nbsp;
                  </td>
                  <td>
                    <vkc:text name="form" property="proxyDescription" style="width:100%;"/>
                  </td>
                </tr>
              </table>
            </td>
            <td width="1" align="center" valign="top" nowrap="nowrap">
              <table width="1" align="center" cellpadding="0" cellspacing="0" border="0">
                <tr><td align="center">&nbsp;</td></tr>
                <tr>
                  <td align="center" nowrap="nowrap">&nbsp;<vkc:button property="action.add.proxyUserToUser" onclick="javascript:disableAllButtonsAndSubmit(this);">&lt;&lt;</vkc:button>&nbsp;</td>
                </tr>
                <tr><td align="center">&nbsp;</td></tr>
                <tr>
                  <td align="center" nowrap="nowrap">&nbsp;<vkc:button property="action.remove.proxyUserFromUser" onclick="javascript:disableAllButtonsAndSubmit(this);">&gt;&gt;</vkc:button>&nbsp;</td>
                </tr>
              </table>
            </td>
            <td width="50%" align="center" valign="top" nowrap="nowrap">
              <bean:define id="removeProxyUserLabels" name="form" property="removeProxyUserLabels" type="java.util.List"/>
              <html:select name="form" property="selectedAddProxyUserIds" multiple="true" size="10" style="width:99%;">
                <vkc:options collection="removeProxyUserLabels" property="userId" labelProperty="lastnameLabel"/>
              </html:select>
            </td>
          </tr>
        </table>
      </td>
    </tr>

    <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>
    </vkc:hasAdminPrivileges>
    
    <logic:equal name="form" property="editUser.externalUser" value="false">
      <tr>
        <td align="left" nowrap="nowrap" colspan="5"><vkc:message key="mandatory.field1"/>&nbsp;<vkc:img page="/templates/${template.name}/gfx/mandatoryField.gif" alt="*" border="0"/>&nbsp;<vkc:message key="mandatory.field2"/></td>
      </tr>
    </logic:equal>
    <logic:equal name="form" property="editUser.externalUser" value="true">
      <tr>
        <td align="left" nowrap="nowrap" colspan="5">&nbsp;</td>
      </tr>
    </logic:equal>
    

    <tr>
      <td align="center" colspan="5">
      <vkc:button property="action.save.profile" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.save"/></vkc:button>
      <vkc:button property="action.change.password" disabled="<%=form.getEditUser().isExternalUser()%>" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.administration.button.changePassword" /></vkc:button>
      <vkc:button property="action.change.publisher" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.administration.button.changePublisherCreator" /></vkc:button>
      <vkc:hasAdminPrivileges>
      <vkc:button property="action.copy.adminrights" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.administration.button.copyAdminRights" /></vkc:button>
      </vkc:hasAdminPrivileges>
	  <vkc:button property="action.back" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.back"/></vkc:button>     
      </td>
    </tr>
</table>
</html:form>
</body>
</html:html>
