<%@ page language="java" buffer="100kb" errorPage="/common/error.jsp"%>
 
<%@ page import="org.apache.struts.Globals" %>
<%@ page import="vkc.view.form.ShowBestsellerForm" %>
<%@ page import="vkc.view.form.ShowLatestAdditionsForm" %>
<%@ page import="vkc.view.form.ShowCategoryForm" %>
<%@ page import="vkc.search.form.SearchDocumentsForm" %>

<%@ 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>

	<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 currentCalendar = null;
    var windowOpen = null;

    function init(){
        <logic:equal name="userProfileForm" property="languageChanged" value="true">
      	  var tabView = getTabView();
          var tabViewForm = tabView.document.forms[0];

          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>

        setAnchor();
    }

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

    function openGroupInfoWindow( 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="/displayGroupInfo.do"/>?groupId=' + id, 'GROUPINFO_MAINVIEW', settings );
        win.focus();
    }

    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 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 unloadPage() {
        if ( currentCalendar != null ) {
              hideCalendar();
        }

        if ( windowOpen != null ) {
            windowOpen.close();
        }
    }

    </script>

</head>
<body onload="init();" onUnload="unloadPage();" topmargin="0" marginheight="0">
<center>
<table cellspacing="3" cellpadding="0" border="0" width="1%">

  <html:form action="/userProfile" method="post">

  <bean:define id="form" name="userProfileForm" scope="request" type="vkc.profile.form.UserProfileForm"/>

  <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="currentProxyUserId"/>
  <html:hidden property="selectedCategoryId"/>
  <vkc:isLdapUser><input type="hidden" name="isLdapUser" value="true"></vkc:isLdapUser>

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

  <logic:present name="<%=Globals.ERROR_KEY%>">
  <tr><td 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>

  <tr>
   <vkc:isExternalUser value="false">
    <td 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>
   </vkc:isExternalUser>
   <vkc:isExternalUser value="true">
    <td nowrap="nowrap" colspan="5">&nbsp;</td>
   </vkc:isExternalUser>
  </tr>

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

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

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

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

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

  <tr>
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.showemail" />:</b></td>
    <td width="100%" align="left"><html:checkbox name="form" property="showEmail" disabled="<%=form.getUser().isExternalUser()%>"/></td>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.phone" />:</b></td>
    <td width="100%" align="left"><vkc:text name="form" property="phone" maxlengthProperty="user.phone" styleClass="profileField" disabled="<%=form.getUser().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 nowrap="nowrap"><b><vkc:message key="vkc.profile.homepageurl" />:</b></td>
    <td width="100%" align="left"><vkc:text name="form" property="homepageURL" maxlengthProperty="user.homepage.url" styleClass="profileField" disabled="<%=form.getUser().isExternalUser()%>"/></td>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.fax" />:</b></td>
    <td width="100%" align="left"><vkc:text name="form" property="fax" maxlengthProperty="user.fax" styleClass="profileField" disabled="<%=form.getUser().isExternalUser()%>"/></td>
  </tr>

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

  <tr>
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.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>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>

    <td nowrap="nowrap"><b><vkc:message key="vkc.administration.quota.used" />:</b></td>
    <logic:notEmpty name="form" property="userQuotaInfo">
      <bean:define id="quotaInfo" name="form" property="userQuotaInfo" type="vkc.view.bean.VKCQuotaInfo"/>
      <logic:notEmpty name="quotaInfo" property="quota">
      <td><vkc:write name="quotaInfo" property="formattedQuota"/> MB</td>
      </logic:notEmpty>
      <logic:empty name="quotaInfo" property="quota">
        <td><vkc:message key="vkc.administration.quota.unlimited" /></td>
      </logic:empty>
    </logic:notEmpty>
  </tr>

  <tr height="20">
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.searchdocumentsortmode" />:</b></td>
	<td width="100%">
	  <html:select property="searchDocumentSortMode" size="1">
	    <html:option value="1"><vkc:message key="vkc.search.sortResults.descendingByScore" /></html:option>
	    <html:option value="0"><vkc:message key="vkc.search.sortResults.ascendingByScore" /></html:option>
		<logic:equal name="categorySettings" property="showCreationDate" value="true">
        <html:option value="7"><vkc:message key="vkc.search.sortResults.descendingByCreationDate" /></html:option>
        <html:option value="6"><vkc:message key="vkc.search.sortResults.ascendingByCreationDate" /></html:option>
		</logic:equal>
	    <html:option value="3"><vkc:message key="vkc.search.sortResults.descendingByPublishingDate" /></html:option>
	    <html:option value="2"><vkc:message key="vkc.search.sortResults.ascendingByPublishingDate" /></html:option>
	    <html:option value="5"><vkc:message key="vkc.search.sortResults.descendingByAuthor" /></html:option>
	    <html:option value="4"><vkc:message key="vkc.search.sortResults.ascendingByAuthor" /></html:option>
	  </html:select>
	</td>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>

    <logic:notEmpty name="form" property="userQuotaInfo">
      <bean:define id="userQuota" name="form" property="userQuotaInfo" />
      <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 height="20">
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.bestsellerdocumentsortmode" />:</b></td>
    <td width="100%">
      <html:select property="bestsellerDocumentSortMode" size="1">
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_ACCESSCOUNT_UP ) %>'><vkc:message key="vkc.document.sort.ascbyaccesscount"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_ACCESSCOUNT_DOWN ) %>'><vkc:message key="vkc.document.sort.descbyaccesscount"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_PUBLISHING_DATE_UP ) %>'><vkc:message key="vkc.document.sort.ascbypublishingdate"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_PUBLISHING_DATE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbypublishingdate"/></html:option>
        <logic:equal name="categorySettings" property="showCreationDate" value="true">
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_CREATION_DATE_UP ) %>'><vkc:message key="vkc.document.sort.ascbycreationdate"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_CREATION_DATE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbycreationdate"/></html:option>
        </logic:equal>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_TITLE_UP ) %>'><vkc:message key="vkc.document.sort.ascbytitle"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_TITLE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbytitle"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_AUTHOR_UP ) %>'><vkc:message key="vkc.document.sort.ascbyauthor"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_AUTHOR_DOWN ) %>'><vkc:message key="vkc.document.sort.descbyauthor"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_PUBLISHER_UP ) %>'><vkc:message key="vkc.document.sort.ascbypublisher"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_PUBLISHER_DOWN ) %>'><vkc:message key="vkc.document.sort.descbypublisher"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_SIZE_UP ) %>'><vkc:message key="vkc.document.sort.ascbysize"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_SIZE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbysize"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_TYPE_UP ) %>'><vkc:message key="vkc.document.sort.ascbytype"/></html:option>
        <html:option value='<%= String.valueOf( ShowBestsellerForm.DOCUMENT_SORT_TYPE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbytype"/></html:option>
      </html:select>
    </td>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
    <td nowrap="nowrap"><b><vkc:message key="vkc.administration.quota.published.docs" />:</b></td>
    <td><vkc:write name="form" property="userStatistics.numPublishedDocuments" /></td>
  </tr>

  <tr height="20">
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.latestadditionsdocumentsortmode" />:</b></td>
	<td width="100%">
	  <html:select property="latestAdditionsDocumentSortMode" size="1">
        <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_PUBLISHING_DATE_UP ) %>'><vkc:message key="vkc.document.sort.ascbypublishingdate"/></html:option>
        <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_PUBLISHING_DATE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbypublishingdate"/></html:option>
        <logic:equal name="categorySettings" property="showCreationDate" value="true">
        <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_CREATION_DATE_UP ) %>'><vkc:message key="vkc.document.sort.ascbycreationdate"/></html:option>
        <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_CREATION_DATE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbycreationdate"/></html:option>
        </logic:equal>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_TITLE_UP ) %>'><vkc:message key="vkc.document.sort.ascbytitle"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_TITLE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbytitle"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_AUTHOR_UP ) %>'><vkc:message key="vkc.document.sort.ascbyauthor"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_AUTHOR_DOWN ) %>'><vkc:message key="vkc.document.sort.descbyauthor"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_PUBLISHER_UP ) %>'><vkc:message key="vkc.document.sort.ascbypublisher"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_PUBLISHER_DOWN ) %>'><vkc:message key="vkc.document.sort.descbypublisher"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_SIZE_UP ) %>'><vkc:message key="vkc.document.sort.ascbysize"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_SIZE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbysize"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_TYPE_UP ) %>'><vkc:message key="vkc.document.sort.ascbytype"/></html:option>
	    <html:option value='<%= String.valueOf( ShowLatestAdditionsForm.DOCUMENT_SORT_TYPE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbytype"/></html:option>
	  </html:select>
	</td>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
    <td nowrap="nowrap"><b><vkc:message key="vkc.administration.quota.published.cats" />:</b></td>
    <td><vkc:write name="form" property="userStatistics.numCreatedCategories" /></td>
  </tr>

  <tr height="20">
    <td nowrap="nowrap"><b><vkc:message key="vkc.profile.categoryviewdocumentsortmode" />:</b></td>
	<td width="100%">
      <html:select property="categoryViewDocumentSortMode" size="1">
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_PUBLISHING_DATE_UP ) %>'><vkc:message key="vkc.document.sort.ascbypublishingdate"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_PUBLISHING_DATE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbypublishingdate"/></html:option>
        <logic:equal name="categorySettings" property="showCreationDate" value="true">
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_CREATION_DATE_UP ) %>'><vkc:message key="vkc.document.sort.ascbycreationdate"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_CREATION_DATE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbycreationdate"/></html:option>
        </logic:equal>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_TITLE_UP ) %>'><vkc:message key="vkc.document.sort.ascbytitle"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_TITLE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbytitle"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_AUTHOR_UP ) %>'><vkc:message key="vkc.document.sort.ascbyauthor"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_AUTHOR_DOWN ) %>'><vkc:message key="vkc.document.sort.descbyauthor"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_PUBLISHER_UP ) %>'><vkc:message key="vkc.document.sort.ascbypublisher"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_PUBLISHER_DOWN ) %>'><vkc:message key="vkc.document.sort.descbypublisher"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_SIZE_UP ) %>'><vkc:message key="vkc.document.sort.ascbysize"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_SIZE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbysize"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_TYPE_UP ) %>'><vkc:message key="vkc.document.sort.ascbytype"/></html:option>
        <html:option value='<%= String.valueOf( ShowCategoryForm.DOCUMENT_SORT_TYPE_DOWN ) %>'><vkc:message key="vkc.document.sort.descbytype"/></html:option>
      </html:select>
    </td>
    <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" height="1" width="5"/></td>
    <td nowrap="nowrap"><b><vkc:message key="vkc.administration.lastlogin" />:</b></td>
    <td><vkc:write name="form" property="user.mostRecentLogin" formatKey="date.medium.format" /></td>
  </tr>

  <tr height="20">
	<logic:equal name="categorySettings" property="projectManagementEnabled" value="true">
	  <logic:equal name="user" property="allowManageSystemViewType" value="false">
	    <html:hidden name="form" property="selectedSystemViewTypeId"/>
	    <td>&nbsp;</td>
	    <td>&nbsp;</td>
	  </logic:equal>
	  <logic:equal name="user" property="allowManageSystemViewType" value="true">
	    <td nowrap="nowrap"><b><vkc:message key="vkc.systemviewtype" />:</b></td>
	    <td width="100%">
	      <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>
	<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 nowrap="nowrap"><b><vkc:message key="vkc.administration.sessiontimeout" />:</b></td>
    <logic:notEqual name="user.sessionTimeout" value="0">
      <td><vkc:write name="form" property="user.sessionTimeout" />&nbsp;<vkc:message key="vkc.administration.sessiontimeout.minutes"/>&nbsp;<b><vkc:message key="vkc.administration.sessiontimeout.inactivity"/></b></td>
    </logic:notEqual>
    <logic:equal name="user.sessionTimeout" value="0">
      <td><vkc:message key="vkc.administration.sessiontimeout.never"/></td>
    </logic:equal>
  </tr>

  <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="0" bottomSpace="0"/>
  
  <logic:equal name="user" property="allowManageSystemViewType" value="false">
  <logic:notEqual name="user" property="systemViewTypeId" value='<%=vkc.view.PageId.CATEGORY_VIEW.toString()%>'>
    <logic:equal name="form" property="showTree" value="true">
    <html:hidden name="form" property="showTree"/>
    </logic:equal>
  </logic:notEqual>

  <logic:equal name="user" property="systemViewTypeId" value='<%=vkc.view.PageId.CATEGORY_VIEW.toString()%>'>
  <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="0" bottomSpace="0"/>
  </logic:equal>
  </logic:equal>

  <logic:equal name="user" property="allowManageSystemViewType" value="true">
  <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="0" bottomSpace="0"/>
  </logic:equal>

  <!-- Dynamische Attribute anzeigen-->
  <logic:equal name="form" property="readableDynAttr" value="true">    
  <tr><td align="left" valign="top" nowrap="nowrap"><b><vkc:message key="vkc.string.dynaAttributes"/>:</b></td></tr>
  <tr>    
    <td width="100%" align="left" valign="top" colspan="5">
      <table width="100%" cellspacing="3" cellpadding="0" border="0">
       <logic:notEqual name="user" property="hasAdminPrivileges" value="true">
        <logic:iterate id="dynaAttribute" name="form" property="dynaAttributes" indexId="index" type="vkc.view.bean.UserDynAttr">
        <logic:notEqual name="dynaAttribute" property="autorization" value='<%=String.valueOf(vkc.view.bean.UserDynAttr.AUTORIZATION_NO)%>'>
        <tr>
          <td align="right"><b><%=String.valueOf(((Integer) index).intValue() + 1) + "."%></b></td>
          <td align="left" nowrap="nowrap"><b><vkc:write name="dynaAttribute" property="name"/>:</b></td>
          <td width="100%" align="left">
            <logic:equal name="dynaAttribute" property="autorization" value='<%=String.valueOf(vkc.view.bean.UserDynAttr.AUTORIZATION_READ)%>'>
            <input type="hidden" name="dynaAttributeValue_<%=index%>" value="<vkc:write name='dynaAttribute' property='value'/>">
            <vkc:text name="dynaAttribute" property="value" style="width:100%;" disabled="true"/>
            </logic:equal>
            <logic:equal name="dynaAttribute" property="autorization" value='<%=String.valueOf(vkc.view.bean.UserDynAttr.AUTORIZATION_WRITE)%>'>
            <input type="text" name="dynaAttributeValue_<%=index%>" value="<vkc:write name='dynaAttribute' property='value'/>" style="width:100%;">
            </logic:equal>
		  </td>           
        </tr>
        </logic:notEqual>
        </logic:iterate>  
        </logic:notEqual>     
        <logic:equal name="user" property="hasAdminPrivileges" value="true">
        <logic:iterate id="dynaAttribute" name="form" property="dynaAttributes" indexId="index" type="vkc.view.bean.UserDynAttr">
        <tr>
          <td align="right"><b><%=String.valueOf(((Integer) index).intValue() + 1) + "."%></b></td>
          <td align="left" nowrap="nowrap"><b><vkc:write name="dynaAttribute" property="name"/>:</b></td>
          <td width="100%" align="left">           
            <input type="text" name="dynaAttributeValue_<%=index%>" value="<vkc:write name='dynaAttribute' property='value'/>" style="width:100%;">
          </td>           
        </tr>
        </logic:iterate>      
        </logic:equal>
          
      </table>
    </td>
  </tr>

  <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="0" bottomSpace="0"/>
  </logic:equal>
  <!-- Dynamische Attribute anzeigen Ende-->

  <tr>
    <td valign="top" nowrap="nowrap"><b><vkc:message key="vkc.profile.userprivileges" />:</b></td>
    <td width="100%" valign="top" colspan="4">
       &nbsp;<vkc:img page='<%="/templates/${template.name}/gfx/" + user.getUserTypeIcon()%>' align="middle" border="0" alt=""/>&nbsp;
       <logic:equal name="form" property="user.admin" value="true">
         <vkc:message key="vkc.profile.userprivileges.fullAdmin" />
       </logic:equal>
       <logic:equal name="form" property="user.adminByGroup" value="true">
         <vkc:message key="vkc.profile.userprivileges.adminByGroup" />
       </logic:equal>
       <logic:equal name="form" property="user.dedicatedAdmin" value="true">
         <vkc:message key="vkc.profile.userprivileges.dedAdmin" />
       </logic:equal>
       <logic:equal name="form" property="user.normalUser" value="true">
         <vkc:message key="vkc.profile.userprivileges.none" />
       </logic:equal>
    </td>
    <td>&nbsp;</td>
  </tr>

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

  <logic:equal name="user" property="allowManageSystemViewType" value="true">
  <tr>
    <td valign="top" nowrap="nowrap"><b><vkc:message key="vkc.profile.homecategory" />:</b></td>
    <td width="100%" 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>

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

  <logic:equal name="user" property="allowManageSystemViewType" value="false">
  <logic:equal name="user" property="systemViewTypeId" value='<%=vkc.view.PageId.CATEGORY_VIEW.toString()%>'>
  <tr>
    <td valign="top" nowrap="nowrap"><b><vkc:message key="vkc.profile.homecategory" />:</b></td>
    <td width="100%" 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>

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

  <tr>
    <td valign="top" nowrap="nowrap"><b><vkc:message key="vkc.profile.groups" />:</b></td>
    <td width="100%" valign="top" colspan="4">
      <logic:iterate id="aGroup" name="form" property="user.groupsSortedByName">
        <bean:define id="groupId" name="aGroup" property="groupId" type="java.lang.Integer"/>
        <vkc:link href='<%="javascript:openGroupInfoWindow(" + groupId.intValue() + ");"%>'>
          <span style="text-decoration:underline"><vkc:write name="aGroup" property="name"/></span>
        </vkc:link><br>
      </logic:iterate>
    </td>
  </tr>

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

  <tr>
    <td colspan="5">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td 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 valign="top" nowrap="nowrap"><b>&nbsp;</b></td>
        </tr>
        </logic:equal>
        <tr>
          <td 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 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 valign="top">
            <vkc:write name="proxyUser" property="description"/>
          </td>
        </tr>
        </logic:iterate>
      </table>
    </td>
  </tr>


  <logic:equal name="form" property="editOwnProxys" value="false">
  <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>

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

  <logic:equal name="form" property="editOwnProxys" value="true">
  <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>

  <!-- ProxyUsers -->
  <tr>
    <td align="center" colspan="5">
      <table width="100%" align="center" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td width="50%" nowrap="nowrap"><b><vkc:message key="vkc.administration.registeredProxys"/>:</b></td>
          <td width="1" align="center" nowrap="nowrap"></td>
          <td width="50%" 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>
  </logic:equal>

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

  <tr>
    <td align="center" colspan="10">      	
        <vkc:button property="action.save.profile" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="button.save"/></vkc:button>      	
        <vkc:isNotLdapUser><vkc:button property="action.change.password" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.profile.button.changePassword"/></vkc:button></vkc:isNotLdapUser>
        <vkc:button property="action.manage.expired.documents" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.profile.button.manageUserExpiredDocuments"/></vkc:button>
        <vkc:button property="action.manage.document.view.settings" onclick="javascript:disableAllButtonsAndSubmit(this);"><vkc:message key="vkc.profile.button.manageUserDocumentViewSettings"/></vkc:button>
      
    </td>
  </tr>
  </html:form>
</table>
</center>
</body>
</html:html>