<%@ page language="java" buffer="100kb" %>

<%@ page import="vkc.view.WebShare" 		 %>
<%@ page import="vkc.administration.form.*"  %>
<%@ page import="vkc.view.TabId" 			 %>
<%@ page import="org.apache.struts.Globals"  %>

<%@ 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/overlib/overlib.js'/>"><!-- overLIB (c) Erik Bosrup --></script>

    <script type="text/javascript">

    window.name = "MAINVIEW";
    var associatedTabId = <%=TabId.ADMIN_USERMANAGEMENT_TAB%>;
    	
    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: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>

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

    function sort(mode) {
        var form = document.forms[0];
        form.sortMode.value   = mode;
        
        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.sortmode=true";
        } else {
          form.action = form.action + "&action.change.sortmode=true";
        }
        
        form.submit();
    }

    function changeListIndex() {
        var form = document.forms[0];
        
        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.listindex=true";
        } else {
          form.action = form.action + "&action.change.listindex=true";
        }
        
        form.submit();
    }

    function changeUsersPerPage() {
        var form = document.forms[0];
        
        if (form.action.indexOf('?') == -1) {
          form.action = form.action + "?action.change.usersperpage=true";
        } else {
          form.action = form.action + "&action.change.usersperpage=true";
        }
        
        form.submit();
    }

    function gotoFirstPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;

        if ( field.selectedIndex==0 )
            return;

        field.selectedIndex = 0;
        changeListIndex();
    }

    function gotoPrevPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
        var index  = field.selectedIndex;

        if ( index-1 < 0 )
            return;

        field.selectedIndex = index-1;
        changeListIndex();
    }

    function gotoNextPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
        var index  = field.selectedIndex;

        index = index + 1;
        if ( index>=field.options.length )
            return;

        field.selectedIndex = index;
        changeListIndex();
    }

    function gotoLastPage() {
        var form   = document.forms[ 0 ];
        var field  = form.listIndex;
        var length = field.options.length;

        if ( field.selectedIndex==length - 1 )
            return;

        field.selectedIndex = length - 1;
        changeListIndex();
    }

    function checkAll( mForm ) {
        for(var i=0 ; i<mForm.elements.length ; i++){
            var elem = mForm.elements[i];
            if(elem.name!='allItems') {
                elem.checked=mForm.allItems.checked;
            }
        }
    }

    function getNumberOfCheckedEntries() {
        var form  = document.forms[ 0 ];
        var field = form.selectedIds;

        if ( !field )
            return 0;

        if ( !field.length ) {

            <%-- nur eine Checkbox auf der Seite --%>
            if ( field.checked ) {
                return 1;
            } else {
                return 0;
            }
        }

        var checked = 0;
        for ( var i=0 ; i<field.length ; i++ ) {
            if ( field[i].checked ) {
                checked++;
            }
        }
        return checked;
    }

    function deleteUsers(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.users"/>' );
            return;
        }

        if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.delete.user"/>' ) )
                return;
        } else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.delete.users"/>' ) )
                return;
        }

        var form  = document.forms[0];

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

        disableAllButtons(elem);
        form.submit();
    }

    function disableUsers(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.users"/>' );
            return;
        }

        if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.lock.user"/>' ) )
                return;
        } else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.lock.users"/>' ) )
                return;
        }

        var form  = document.forms[0];

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

        disableAllButtons(elem);
        form.submit();
    }

    function enableUsers(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.users"/>' );
            return;
        }

        if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.unlock.user"/>' ) )
                return;
        } else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.unlock.users"/>' ) )
                return;
        }

        var form  = document.forms[0];

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

        disableAllButtons(elem);
        form.submit();
    }

    function unlockUsers(elem) {
        var numChecked = getNumberOfCheckedEntries();

        if ( numChecked == 0 ) {
            alert( '<vkc:message javascript="true" filter="false" key="vkc.administration.select.users"/>' );
            return;
        }

        if ( numChecked==1 ) {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.unlock.user"/>' ) )
                return;
        } else {
            if ( !confirm( '<vkc:message javascript="true" filter="false" key="vkc.administration.confirm.unlock.users"/>' ) )
                return;
        }

        var form  = document.forms[0];

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

        disableAllButtons(elem);
        form.submit();
    }
    

    function modifyUsers(elem) {
        var form = document.forms[ 0 ];
        var field = form.selectedCmdAction.value;

        if ( field == "noaction" || field == "noaction1" ) {
               alert( '<vkc:message javascript="true" filter="false" key="error.noaction_choosen"/>' );
               return false;
        }

        if ( field == "delete.users" ) {
            deleteUsers(elem);
        }

        if ( field == "disable.users" ) {
            disableUsers(elem);
        }

        if ( field == "enable.users" ) {
            enableUsers(elem);
        }
        if ( field == "unlock.users") {
            unlockUsers(elem)
        }
    }

    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 showHelpText() {
    	var text = '<vkc:message javascript="true" filter="false" key="vkc.administration.userssearch.help"/>';
        
        return overlib( text, STICKY, MOUSEOFF, WIDTH, 400, OFFSETX, 0, OFFSETY, 40, CENTER );
    }

    </script>
</head>
<body onload="init();" topmargin="0" marginheight="0">
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<table width="100%" align="center" cellspacing="0" cellpadding="0" border="0">
  <html:form action="/userList" method="post">

  <bean:define id="form"         name="userListForm" scope="request" type="vkc.administration.form.UserListForm"/>
  <bean:define id="sortMode"     name="form" property="sortMode"          type="java.lang.Integer"/>
  <bean:define id="selectedIds"  name="form" property="selectedIds"       type="java.lang.Integer[]"/>
  <bean:define id="pageCount"    name="form" property="userInfoPageCount" type="java.lang.Integer"/>
  <bean:define id="usersPerPage" name="form" property="usersPerPage"      type="java.lang.Integer"/>

  <html:hidden property="sortMode"/>

  <logic:present name="<%=Globals.ERROR_KEY%>">
  <tr><td align="left" nowrap="nowrap" colspan="3"><font color="red"><b><vkc:errors/></b></font></td></tr>
  <tr><td align="left" nowrap="nowrap" colspan="3"><hr></td></tr>
  </logic:present>

  <logic:equal name="form" property="allUsersCount" value="0">
  <tr>
    <td align="left" nowrap="nowrap" colspan="3"><vkc:message key="vkc.administration.noUserEntry"/></td>
    <td width="100%">&nbsp;</td>
    <td nowrap="nowrap">
   	<vkc:link page="/newUser.do"><vkc:message key="vkc.administration.newuser" /></vkc:link>
    </td>
  </tr>
  </logic:equal>

  <logic:notEqual name="form" property="allUsersCount" value="0">
  <tr>
    <td>
      <table width="100%">
        <tr>
          <td nowrap="nowrap"><vkc:link href="javascript:gotoFirstPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/rewind.gif" border='0' alt=""/></vkc:link>&nbsp;&nbsp;</td>
          <td nowrap="nowrap"><vkc:link href="javascript:gotoPrevPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/arrow-left.gif" border='0' alt=""/></vkc:link>&nbsp;&nbsp;</td>

          <td>
            <html:select name="form" property="listIndex" onchange="changeListIndex();">
              <logic:iterate id="pageIndex" type="java.lang.Integer" name="form" property="pageIndices">
              <html:option value="<%=String.valueOf( pageIndex )%>" key="key">
              <bean:define id="userInfoRange" name="form" property='<%=String.valueOf( "rangeValue(" + pageIndex.intValue() + ")")%>' type="vkc.view.bean.UserInfoRange"/>
                <logic:equal value="true" name="form" property="sortByUsername">
                    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.username" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.username" />]&nbsp;
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByFirstname">
                    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.firstname" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.firstname" />]&nbsp;
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByLastname">
                    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.lastname" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.lastname" />]&nbsp;
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByCreator">
                    <logic:empty name="userInfoRange" property="from.creator">
                      <logic:empty name="userInfoRange" property="to.creator">
                        <vkc:message key="string.from"/>&nbsp;[]&nbsp;<vkc:message key="string.to"/>&nbsp;[]&nbsp;
                      </logic:empty>
                    </logic:empty>
                    <logic:empty name="userInfoRange" property="from.creator">
                      <logic:notEmpty name="userInfoRange" property="to.creator">
                        <vkc:message key="string.from"/>&nbsp;[]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.creator.username" />]&nbsp;
                      </logic:notEmpty>
                    </logic:empty>
                    <logic:notEmpty name="userInfoRange" property="from.creator">
                      <logic:empty name="userInfoRange" property="to.creator">
                        <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.creator.username" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[]&nbsp;
                      </logic:empty>
                    </logic:notEmpty>
                    <logic:notEmpty name="userInfoRange" property="from.creator">
                      <logic:notEmpty name="userInfoRange" property="to.creator">
                        <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.creator.username" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.creator.username" />]&nbsp;
                      </logic:notEmpty>
                    </logic:notEmpty>
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByCreated">
                    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.createdStr" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.createdStr" />]&nbsp;
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByLastLogin">
                    <vkc:message key="string.from"/>&nbsp;[<vkc:write name="userInfoRange" property="from.mostRecentLogin" formatKey="date.short.format" />]&nbsp;<vkc:message key="string.to"/>&nbsp;[<vkc:write name="userInfoRange" property="to.mostRecentLogin" formatKey="date.short.format" />]&nbsp;
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByAccountStatus">
                  <vkc:message key="string.Page"/>&nbsp;<%=(pageIndex.intValue()/usersPerPage.intValue()+1)%>&nbsp;<vkc:message key="string.of"/>&nbsp;<%=pageCount.intValue()%>&nbsp;
                </logic:equal>
                <logic:equal value="true" name="form" property="sortByPwd">
                  <vkc:message key="string.Page"/>&nbsp;<%=(pageIndex.intValue()/usersPerPage.intValue()+1)%>&nbsp;<vkc:message key="string.of"/>&nbsp;<%=pageCount.intValue()%>&nbsp;
                </logic:equal>
                </html:option>
              </logic:iterate>
            </html:select>
          </td>

          <td nowrap="nowrap">&nbsp;&nbsp;<vkc:link href="javascript:gotoNextPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/arrow-right.gif" border='0' alt=""/></vkc:link></td>
          <td nowrap="nowrap">&nbsp;&nbsp;<vkc:link href="javascript:gotoLastPage();" onclick="this.blur();"><vkc:img page="/templates/${template.name}/gfx/forward.gif" border='0' alt=""/></vkc:link></td>
          <td nowrap="nowrap">&nbsp;&nbsp;<b><vkc:message key="vkc.administration.usersperpage"/>:</b></td>

          <td nowrap="nowrap">&nbsp;&nbsp;
            <html:select name="form" property="usersPerPage" onchange="changeUsersPerPage();">
              <html:option value="5"><vkc:message key="vkc.administration.usersperpage.five"/></html:option>
              <html:option value="10"><vkc:message key="vkc.administration.usersperpage.ten"/></html:option>
              <html:option value="20"><vkc:message key="vkc.administration.usersperpage.twenty"/></html:option>
              <html:option value="30"><vkc:message key="vkc.administration.usersperpage.thirty"/></html:option>
              <html:option value="40"><vkc:message key="vkc.administration.usersperpage.forty"/></html:option>
              <html:option value="50"><vkc:message key="vkc.administration.usersperpage.fifty"/></html:option>
            </html:select>
          </td>

          <td nowrap="nowrap">
            &nbsp;&nbsp;<b><vkc:message key="vkc.administration.userssearch"/>:</b>&nbsp;&nbsp;
            <vkc:text property="searchQuery" style="width:200;"/>
          </td>

          <td nowrap="nowrap">
            <vkc:image property="btn_search" page="/templates/${template.name}/gfx/search.bmp" alt="" titleKey="vkc.administration.userssearch.start"/>
            <vkc:img page="/templates/${template.name}/gfx/help.bmp" onmouseover='return showHelpText();' onmouseout="return nd();" width="16" height="16" border="0"/>
          </td>

          <td width="100%">&nbsp;</td>
       	  <td nowrap="nowrap"><vkc:link page="/newUser.do"><vkc:message key="vkc.administration.newuser" /></vkc:link></td>
        </tr>
      </table>
    </td>
  </tr>

  <logic:equal name="form" property="visibleUserInfoSizes" value="0">
  <vkc:hline colspan="5" lineClass="hline" lineHeight="1" topSpace="5" bottomSpace="5"/>
  <tr><td align="left" nowrap="nowrap"><vkc:message key="vkc.administration.noUserEntry"/></td></tr>
  </logic:equal>

  <logic:notEqual name="form" property="visibleUserInfoSizes" value="0">
  <tr>
    <td class="tableLineColor">
      <table width="100%" cellspacing="1" cellpadding="2" border="0" class="tableLineColor">
         <tr>
          <% String usernameColStyle        = "columnUnselected"; %>
          <% String firstnameColStyle      	= "columnUnselected"; %>
          <% String lastnameColStyle       	= "columnUnselected"; %>
          <% String creatorColStyle       	= "columnUnselected"; %>
          <% String createdColStyle       	= "columnUnselected"; %>
          <% String passwordColStyle       	= "columnUnselected"; %>
          <% String accountStatusColStyle  	= "columnUnselected"; %>
          <% String captureAccountColStyle 	= "columnUnselected"; %>
          <% String lastLoginColStyle 		= "columnUnselected"; %>

          <td class="headerUnselected">&nbsp;</td>
          <vkc:hasAdminPrivileges>
            <td class="headerUnselected">&nbsp;</td>
          </vkc:hasAdminPrivileges>

          <logic:equal value="true" name="form" property="sortByUsername">
            <% usernameColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_USERNAME_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.username"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_USERNAME_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_USERNAME_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.username"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_USERNAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByUsername">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.username"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_USERNAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByFirstname">
            <% firstnameColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_FIRSTNAME_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.firstname"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_FIRSTNAME_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_FIRSTNAME_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.firstname"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_FIRSTNAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByFirstname">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.firstname"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_FIRSTNAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByLastname">
            <% lastnameColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_LASTNAME_UP )%>" name="form" property="sortMode">
            <td width="100%" align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.lastname"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_LASTNAME_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_LASTNAME_DOWN )%>" name="form" property="sortMode">
            <td width="100%" align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.lastname"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_LASTNAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByLastname">
            <td width="100%" align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.lastname"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_LASTNAME_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByPwd">
            <% passwordColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_PWDCHANGED_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.pwdChanged"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_PWDCHANGED_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_PWDCHANGED_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.pwdChanged"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_PWDCHANGED_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByPwd">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.pwdChanged"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_PWDCHANGED_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <td align="left" nowrap="nowrap" class="headerUnselected">&nbsp;<b><vkc:message key="vkc.administration.countPubDocs"/></b>&nbsp;</td>

          <logic:equal value="true" name="form" property="sortByAccountStatus">
            <% accountStatusColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_ACCOUNTSTATUS_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.accountState"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_ACCOUNTSTATUS_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_ACCOUNTSTATUS_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.accountState"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_ACCOUNTSTATUS_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByAccountStatus">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.accountState"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_ACCOUNTSTATUS_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByCreator">
            <% creatorColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_CREATOR_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.creator"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_CREATOR_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_CREATOR_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.creator"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_CREATOR_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByCreator">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.creator"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_CREATOR_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByCreated">
            <% createdColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_CREATED_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.created"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_CREATED_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_CREATED_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.created"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_CREATED_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByCreated">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.created"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_CREATED_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>

          <logic:equal value="true" name="form" property="sortByLastLogin">
            <% lastLoginColStyle  = "columnSelected"; %>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_LASTLOGIN_UP )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.lastlogin"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_LASTLOGIN_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-up.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
            <logic:equal value="<%=String.valueOf( UserListForm.SORT_LASTLOGIN_DOWN )%>" name="form" property="sortMode">
            <td align="left" nowrap="nowrap" class="headerSelected">
              &nbsp;<b><vkc:message key="vkc.administration.lastlogin"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_LASTLOGIN_UP + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
            </logic:equal>
          </logic:equal>
          <logic:equal value="false" name="form" property="sortByLastLogin">
            <td align="left" nowrap="nowrap" class="headerUnselected">
              &nbsp;<b><vkc:message key="vkc.administration.lastlogin"/></b>
              <vkc:link href='<%="javascript:sort(" + UserListForm.SORT_LASTLOGIN_DOWN + ")"%>'><vkc:img page="/templates/${template.name}/gfx/arrow-down-shaded.gif" border="0" alt=""/></vkc:link>&nbsp;
            </td>
          </logic:equal>
        </tr>

        <logic:iterate id="userInfo" name="form" property="visibleUserInfos" indexId="index" type="vkc.view.bean.UserInfo">
        <tr>
          <td class="columnUnselected">
            <html:multibox name="form" property="selectedIds" onfocus="this.blur();"><vkc:write name="userInfo" property="userId"/></html:multibox>
          </td>
          <vkc:hasAdminPrivileges>
          <td align="center" valign="middle" nowrap="nowrap" class="columnUnselected">
            <vkc:link page="/captureAccount.do" paramId="userId" paramName="userInfo" paramProperty="userId"><vkc:img page="/templates/${template.name}/gfx/button-captureaccount.gif" border="0" alt="" titleKey="vkc.tooltip.captureaccount" /></vkc:link>&nbsp;
          </td>
          </vkc:hasAdminPrivileges>
          <td align="left" nowrap="nowrap" class="<%=usernameColStyle%>" >
            <logic:equal name="userInfo" property="admin" value="true">
            <b>&nbsp;<vkc:img page="/templates/${template.name}/gfx/profile-admin.gif" align="middle" border="0" alt=""/>&nbsp;<vkc:link page="<%=form.getEditUserLink()%>" paramId="userId" paramName="userInfo" paramProperty="userId" titleKey="vkc.tooltip.user.admin"><vkc:write name="userInfo" property="username" /></vkc:link>&nbsp;</b>
            </logic:equal>
            <logic:equal name="userInfo" property="adminByGroup" value="true">
            <b><i>&nbsp;<vkc:img page="/templates/${template.name}/gfx/profile-admin.gif" align="middle" border="0" alt=""/>&nbsp;<vkc:link page="<%=form.getEditUserLink()%>" paramId="userId" paramName="userInfo" paramProperty="userId" titleKey="vkc.tooltip.user.adminbygroup" ><vkc:write name="userInfo" property="username" /></vkc:link>&nbsp;</i></b>
            </logic:equal>
            <logic:equal name="userInfo" property="dedicatedAdmin" value="true">
            <i>&nbsp;<vkc:img page="/templates/${template.name}/gfx/profile-dadmin.gif" align="middle" border="0" alt=""/>&nbsp;<vkc:link page="<%=form.getEditUserLink()%>" paramId="userId" paramName="userInfo" paramProperty="userId" titleKey="vkc.tooltip.user.dedicatedadmin" style="font-weight:normal;"><vkc:write name="userInfo" property="username" /></vkc:link>&nbsp;</i>
            </logic:equal>
            <logic:equal name="userInfo" property="usualUser" value="true">
            &nbsp;<vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="15" height="18" align="middle" border="0"/>&nbsp;<vkc:link page="<%=form.getEditUserLink()%>" paramId="userId" paramName="userInfo" paramProperty="userId" titleKey="vkc.tooltip.user.usualuser" style="font-weight:normal;"><vkc:write name="userInfo" property="username" /></vkc:link>&nbsp;
            </logic:equal>
            <logic:equal name="userInfo" property="externalUser" value="true">
            &nbsp;<vkc:img page="/templates/${template.name}/gfx/profile-external.gif" align="middle" border="0" alt=""/>&nbsp;<vkc:link page="<%=form.getEditUserLink()%>" paramId="userId" paramName="userInfo" paramProperty="userId" titleKey="vkc.tooltip.user.usualuser" style="font-weight:normal;"><vkc:write name="userInfo" property="username" /></vkc:link>&nbsp;
            </logic:equal>
          </td>
          <td align="left" nowrap="nowrap" class="<%=firstnameColStyle%>">&nbsp;<vkc:write name="userInfo" property="firstname"/>&nbsp;</td>
          <td width="100%" align="left" nowrap="nowrap" class="<%=lastnameColStyle%>">&nbsp;<vkc:write name="userInfo" property="lastname" />&nbsp;</td>

          <logic:equal name="userInfo" property="pwdChanged" value="false">
            <td align="left" nowrap="nowrap" class="<%=passwordColStyle%>">&nbsp;<vkc:message key="vkc.administration.pwdChanged.No"/>&nbsp;</td>
          </logic:equal>
          <logic:equal name="userInfo" property="pwdChanged" value="true">
            <td align="left" nowrap="nowrap" class="<%=passwordColStyle%>">&nbsp;<vkc:message key="vkc.administration.pwdChanged.Yes"/>&nbsp;</td>
          </logic:equal>

          <td align="right" nowrap="nowrap" class="columnUnselected">
            &nbsp;<vkc:write name="userInfo" property="userStatistics.formattedNumPublishedDocuments" />&nbsp;
          </td>

          <td align="left" nowrap="nowrap" class="<%=accountStatusColStyle%>">
            <logic:equal name="userInfo" property="userValid" value="false">
            &nbsp;<vkc:message key="vkc.administration.accountState.disabled"/>&nbsp;
            </logic:equal>
            <logic:equal name="userInfo" property="userValid" value="true">
            &nbsp;<vkc:message key="vkc.administration.accountState.active"/>&nbsp;
            </logic:equal>         
          </td>

          <td align="left" nowrap="nowrap" class="<%=creatorColStyle%>">
            <logic:notEmpty name="userInfo" property="creator">
            &nbsp;<vkc:link href='<%="javascript:openUserInfoWindow(" + userInfo.getCreatorId() + ");"%>' style="font-weight:normal;"><vkc:write name="userInfo" property="creator.username"/></vkc:link>&nbsp;
            </logic:notEmpty>
            <logic:empty name="userInfo" property="creator">
              &nbsp;
            </logic:empty>
          </td>
          <td align="left" nowrap="nowrap" class="<%=createdColStyle%>">
            &nbsp;<vkc:write name="userInfo" property="created" formatKey="date.short.format"/>&nbsp;
          </td>
          <td align="left" nowrap="nowrap" class="<%=lastLoginColStyle%>">
            &nbsp;<vkc:write name="userInfo" property="mostRecentLogin" formatKey="date.medium.format"/>&nbsp;
          </td>
        </tr>
        </logic:iterate>
       </table>
     </td>
  </tr>

  <tr><td align="center"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="5" border="0"/></td></tr>
  <tr><td colspan="2">&nbsp;<input type="checkbox" name="allItems" value="allItems" onclick="javascript:checkAll(this.form);">&nbsp;<vkc:message key="vkc.string.checkAll"/></td></tr>
  <tr><td align="center"><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" height="5" border="0"/></td></tr>
  <tr>
    <td colspan="2">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><vkc:img page="/templates/${template.name}/gfx/trans.gif" alt="" width="5" border="0"/><vkc:img page="/templates/${template.name}/gfx/function-arrow.gif" alt="-->" border="0"/></td>
          <td>
            <html:select name="form" property="selectedCmdAction" value="noaction">
              <html:option value="noaction"><vkc:message key="vkc.string.chooseFunction"/></html:option>
              <html:option value="noaction1">------------------------------------</html:option>
              <html:option value="delete.users"><vkc:message key="button.delete"/></html:option>
              <html:option value="disable.users"><vkc:message key="button.lock"/></html:option>
              <html:option value="enable.users"><vkc:message key="button.unlock"/></html:option>              
            </html:select>
          </td>
          <td>&nbsp;<vkc:button property="action.execute" onclick="modifyUsers(this);"><vkc:message key="button.execute"/></vkc:button></td>
        </tr>
      </table>
    </td>
  </tr>
  </logic:notEqual>
  </logic:notEqual>
  </html:form>
</table>
</html:html>
