<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition template="/WEB-INF/templates/admin/admin_base.tpl"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:core="http://mxchange.org/jsf/core/widgets"
- xmlns:links="http://mxchange.org/jsf/core/links"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- xmlns:p="http://primefaces.org/ui">
+<ui:composition
+ template="/WEB-INF/templates/admin/admin_base.tpl"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ xmlns:p="http://primefaces.org/ui"
+ >
<ui:define name="document_admin_title">
<h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_EMPLOYEE}" />
</ui:define>
<ui:define name="content">
- <h:form id="form-list-company-employees">
+ <h:form id="form-list-employees">
<p:dataTable
- id="table-list-company-employees"
+ id="employeeList"
var="employee"
- value="#{employeeController.allEmployees()}"
- filteredValue="#{employeeController.filteredEmployees}"
- tableStyleClass="table table-full"
+ value="#{employeeListController.allEmployees}"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ filteredValue="#{employeeListController.filteredEmployees}"
rows="10"
+ rowKey="#{employee.employeeId}"
reflow="true"
resizableColumns="true"
rowsPerPageTemplate="5,10,20,50,100"
sortMode="multiple"
- summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_EMPLOYEES}"
- emptyMessage="#{msg.ADMIN_EMPTY_LIST_EMPLOYEES}"
+ summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_EMPLOYEESS}"
+ emptyMessage="#{msg.ADMIN_EMPTY_LIST_EMPLOYEESS}"
widgetVar="employeeList"
+ selectionMode="single"
+ selection="#{employeeListController.selectedEmployee}"
+ skipChildren="true"
>
<f:facet name="header">
- <p:panelGrid columns="2" columnClasses="ui-grid-col-10,ui-grid-col-2" layout="grid" styleClass="ui-noborder ui-transparent-widget">
- <h:outputText value="#{msg.ADMIN_LIST_EMPLOYEES_HEADER}" />
+ <p:panelGrid
+ columns="3"
+ layout="grid"
+ columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
+ >
+ <p:spacer />
- <h:panelGroup>
- <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
- <p:columnToggler datasource="table-list-company-employees" trigger="toggler" />
- </h:panelGroup>
+ <p:panelGrid
+ columns="2"
+ columnClasses="ui-grid-4,ui-grid-8"
+ layout="grid"
+ styleClass="ui-noborder"
+ >
+ <p:outputLabel
+ for="globalFilter"
+ value="#{msg.SEARCH_ALL_FIELDS}"
+ style="float: right"
+ />
+
+ <p:inputText
+ id="globalFilter"
+ onkeyup="PF('employeeList').filter()"
+ placeholder="#{msg.ENTER_KEYWORD}"
+ />
+ </p:panelGrid>
+
+ <p:outputPanel>
+ <p:spacer height="4" />
+
+ <p:commandButton
+ id="toggler"
+ type="button"
+ value="#{msg.SELECT_SHOWN_COLUMNS}"
+ styleClass="column-selector"
+ />
+
+ <p:columnToggler datasource="employeeList" trigger="toggler" />
+ </p:outputPanel>
</p:panelGrid>
</f:facet>
- <p:column headerText="#{msg.ADMIN_HEADER_ID_NUMBER}" sortBy="#{employee.employeeId}" filterable="false">
- <p:link outcome="admin_show_employee" title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}" value="#{employee.employeeId}">
+ <p:ajax
+ event="rowSelect"
+ update="form-list-employees:employee-details"
+ oncomplete="PF('employeeDialog').show()"
+ />
+
+ <p:column
+ headerText="#{msg.ID_HEADER}"
+ sortBy="#{employee.employeeId}"
+ filterable="false"
+ >
+ <p:link
+ outcome="admin_show_employee"
+ value="#{employee.employeeId}"
+ title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}"
+ >
<f:param name="employeeId" value="#{employee.employeeId}" />
</p:link>
</p:column>
- <p:column headerText="#{msg.ADMIN_ASSIGNED_BRANCH_OFFICE}" sortBy="#{employee.employeeBranchOffice}" filterBy="#{employee.employeeBranchOffice}" filterMatchMode="in">
+ <p:column
+ headerText="#{msg.EMPLOYEE_NUMBER_HEADER}"
+ sortBy="#{employee.employeeNumber}"
+ filterBy="#{employee.employeeNumber}"
+ filterMatchMode="contains"
+ >
+ <h:outputText value="#{employee.employeeNumber}" rendered="#{not empty employee.employeeNumber}" />
+ <h:outputText value="-" rendered="#{empty employee.employeeNumber}" />
+ </p:column>
+
+ <p:column
+ headerText="#{msg.ADMIN_BRANCH_OFFICE_HEADER}"
+ sortBy="#{employee.employeeBranchOffice}"
+ filterBy="#{employee.employeeBranchOffice}"
+ filterMatchMode="in"
+ >
<f:facet name="filter">
<p:selectCheckboxMenu
filter="true"
title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
>
<f:converter converterId="BranchOfficeConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{branchOfficeController.allBranchOffices()}" var="branchOffice" itemValue="#{branchOffice}" itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}" />
+
+ <f:selectItems
+ value="#{branchOfficeListController.allBranchOffices}"
+ var="branchOffice"
+ itemValue="#{branchOffice}"
+ itemLabel="#{beanHelper.renderBranchOffice(branchOffice, false)}"
+ />
</p:selectCheckboxMenu>
</f:facet>
- <p:link outcome="admin_show_branch_office" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}" value="#{beanHelper.renderBranchOffice(employee.employeeBranchOffice)}" rendered="#{not empty employee.employeeBranchOffice}">
+ <p:link
+ outcome="admin_show_branch_office"
+ value="#{beanHelper.renderBranchOffice(employee.employeeBranchOffice, false)}"
+ title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}"
+ rendered="#{not empty employee.employeeBranchOffice}"
+ >
<f:param name="branchId" value="#{employee.employeeBranchOffice.branchId}" />
</p:link>
- <p:link outcome="admin_assign_branch_office" title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty employee.employeeBranchOffice}">
+ <p:link
+ outcome="admin_assign_branch_office"
+ value="#{msg.ADMIN_LINK_ASSIGN}"
+ title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE}"
+ rendered="#{empty employee.employeeBranchOffice}"
+ >
<f:param name="employeeId" value="#{employee.employeeId}" />
</p:link>
</p:column>
- <p:column headerText="#{msg.ADMIN_HEADER_ASSIGNED_USER}" sortBy="#{employee.employeeUserOwner}" filterBy="#{employee.employeeUserOwner}" filterMatchMode="in">
+ <p:column
+ headerText="#{msg.ADMIN_USER_HEADER}"
+ sortBy="#{employee.employeeUserOwner}"
+ filterBy="#{employee.employeeUserOwner}"
+ filterMatchMode="in"
+ >
<f:facet name="filter">
<p:selectCheckboxMenu
filter="true"
updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}"
>
<f:converter converterId="UserConverter" />
- <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{userController.allUsers()}" var="user" itemValue="#{user}" itemLabel="#{user.userName}" />
+
+ <f:selectItems
+ value="#{userListController.allUsers}"
+ var="user"
+ itemValue="#{user}"
+ itemLabel="#{beanHelper.renderUser(user)}"
+ />
</p:selectCheckboxMenu>
</f:facet>
- <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_EMPLOYEES_OWNER_USER_TITLE}" value="#{employee.employeeUserOwner.userId}" rendered="#{not empty employee.employeeUserOwner}">
+ <p:link
+ outcome="admin_show_user"
+ value="#{employee.employeeUserOwner.userId}"
+ title="#{msg.ADMIN_LINK_SHOW_EMPLOYEES_OWNER_USER_TITLE}"
+ rendered="#{not empty employee.employeeUserOwner}"
+ >
<f:param name="userId" value="#{employee.employeeUserOwner.userId}" />
</p:link>
- <p:link outcome="admin_assign_user_owner" title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty employee.employeeUserOwner}">
+ <p:link
+ outcome="admin_assign_user_owner"
+ value="#{msg.ADMIN_LINK_ASSIGN}"
+ title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE}"
+ rendered="#{empty employee.employeeUserOwner}"
+ >
<f:param name="employeeId" value="#{employee.employeeId}" />
</p:link>
</p:column>
- <p:column headerText="#{msg.ADMIN_HEADER_BASIC_DATA_COMPANY_NAME}" sortBy="#{employee.employeeBasicData}" filterBy="#{employee.employeeBasicData}" filterMatchMode="in">
+ <p:column
+ headerText="#{msg.ADMIN_BASIC_DATA_COMPANY_NAME_HEADER}"
+ sortBy="#{employee.employeeBasicData}"
+ filterBy="#{employee.employeeBasicData}"
+ filterMatchMode="in"
+ >
<f:facet name="filter">
<p:selectCheckboxMenu
filter="true"
title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
>
<f:converter converterId="BasicCompanyDataConverter" />
- <f:selectItems value="#{basicCompanyDataController.allBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+
+ <f:selectItems
+ value="#{basicDataListController.allBasicData}"
+ var="basicData"
+ itemValue="#{basicData}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}"
+ />
</p:selectCheckboxMenu>
</f:facet>
- <h:outputLink value="#{employee.employeeBasicData.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty employee.employeeBasicData.companyWebsiteUrl}">
- <h:outputText value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" />
- </h:outputLink>
-
- <h:outputText value="#{beanHelper.renderBasicData(employee.employeeBasicData)}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty employee.employeeBasicData.companyWebsiteUrl}" />
+ <p:link
+ outcome="admin_show_basic_data"
+ value="#{beanHelper.renderBasicData(employee.employeeBasicData, true, false)}"
+ title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
+ >
+ <f:param name="basicDataId" value="#{employee.employeeBasicData.basicDataId}" />
+ </p:link>
</p:column>
- <p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{employee.employeeEmailAddress}" filterBy="#{employee.employeeEmailAddress}" filterMatchMode="contains">
- <p:link href="mailto:#{employee.employeeEmailAddress}" value="#{employee.employeeEmailAddress}" rendered="#{not empty employee.employeeEmailAddress}" />
+ <p:column
+ headerText="#{msg.DATA_EMAIL_ADDRESS}"
+ sortBy="#{employee.employeeEmailAddress}"
+ filterBy="#{employee.employeeEmailAddress}"
+ filterMatchMode="contains"
+ >
+ <p:link
+ href="mailto:#{employee.employeeEmailAddress}"
+ value="#{employee.employeeEmailAddress}"
+ rendered="#{not empty employee.employeeEmailAddress}"
+ />
<h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty employee.employeeEmailAddress}" />
</p:column>
- <p:column headerText="#{msg.ADMIN_HEADER_ENTRY_CREATED}" sortBy="#{employee.employeeCreated}" filterable="false">
- <h:outputText id="employeeCreated" value="#{employee.employeeCreated.time}">
- <f:convertDateTime for="employeeCreated" type="both" timeStyle="short" dateStyle="short" />
+ <p:column
+ headerText="#{msg.ENTRY_CREATED_HEADER}"
+ sortBy="#{employee.employeeEntryCreated}"
+ filterable="false"
+ >
+ <h:outputText value="#{employee.employeeEntryCreated}">
+ <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
</h:outputText>
</p:column>
- <p:column headerText="#{msg.ADMIN_HEADER_ACTION_LINKS}" sortable="false" filterable="false">
- <links:outputEmployeeAdminMiniLinks employee="#{employee}" />
+ <p:column
+ headerText="#{msg.ENTRY_UPDATED_HEADER}"
+ sortBy="#{employee.employeeEntryUpdated}"
+ filterable="false"
+ >
+ <h:outputText value="#{employee.employeeEntryUpdated}">
+ <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
+ </h:outputText>
+ </p:column>
+
+ <p:column
+ headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
+ sortable="false"
+ filterable="false"
+ >
+ <p:menuButton value="#{msg.OPTIONS}">
+ <p:menuitem
+ outcome="admin_show_employee"
+ value="#{msg.ADMIN_LINK_SHOW_SHORT}"
+ title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}"
+ >
+ <f:param name="employeeId" value="#{employee.employeeId}" />
+ </p:menuitem>
+
+ <p:menuitem
+ outcome="admin_edit_employee"
+ value="#{msg.ADMIN_LINK_EDIT_SHORT}"
+ title="#{msg.ADMIN_LINK_EDIT_EMPLOYEE_TITLE}"
+ >
+ <f:param name="employeeId" value="#{employee.employeeId}" />
+ </p:menuitem>
+
+ <p:menuitem outcome="admin_delete_employee">
+ <h:outputText
+ styleClass="link-danger"
+ value="#{msg.ADMIN_LINK_DELETE_SHORT}"
+ title="#{msg.ADMIN_LINK_DELETE_EMPLOYEE_TITLE}"
+ />
+ <f:param name="employeeId" value="#{employee.employeeId}" />
+ </p:menuitem>
+ </p:menuButton>
</p:column>
</p:dataTable>
+
+ <p:dialog
+ dynamic="true"
+ modal="true"
+ resizable="false"
+ header="#{msg.ADMIN_SINGLE_EMPLOYEE_DETAILS_HEADER}"
+ hideEffect="fade"
+ showEffect="fade"
+ widgetVar="employeeDialog"
+ position="top"
+ responsive="true"
+ closeOnEscape="true"
+ >
+ <p:outputPanel id="employee-details">
+ <p:panelGrid
+ columns="2"
+ rendered="#{not empty employeeListController.selectedEmployee}"
+ >
+ <f:facet name="header">
+ <h:outputFormat
+ value="#{msg.ADMIN_EMPLOYEE_NUMBER_DETAILS_HEADER}"
+ rendered="#{empty employeeListController.selectedEmployee.employeePersonalData}"
+ >
+ <f:param value="#{employeeListController.selectedEmployee.employeeId}" />
+ </h:outputFormat>
+
+ <h:outputFormat
+ value="#{msg.ADMIN_EMPLOYEE_NAME_DETAILS_HEADER}"
+ rendered="#{not empty employeeListController.selectedEmployee.employeePersonalData}"
+ >
+ <f:param value="#{beanHelper.renderContact(employeeListController.selectedEmployee.employeePersonalData)}" />
+ </h:outputFormat>
+ </f:facet>
+
+ <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.EMPLOYEE_ID_NUMBER_TITLE}" />
+ <h:outputText value="#{employeeListController.selectedEmployee.employeeId}" />
+ </p:panelGrid>
+ </p:outputPanel>
+ </p:dialog>
</h:form>
<h:form>
- <p:panelGrid layout="grid" columns="1" styleClass="table table-full">
+ <p:panelGrid
+ columns="1"
+ layout="grid"
+ >
<f:facet name="header">
<h:outputText value="#{msg.ADMIN_ADD_EMPLOYEE_TITLE}" />
</f:facet>
<h:outputText value="#{msg.ADMIN_ADD_EMPLOYEE_MINIMUM_DATA}" />
- <h:column>
+ <p:column>
<ui:include src="/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl" />
- </h:column>
+ </p:column>
<f:facet name="footer">
<p:panelGrid columns="2" layout="grid">
<p:commandButton
- styleClass="reset"
type="reset"
value="#{msg.BUTTON_RESET_FORM}"
/>
<p:commandButton
- styleClass="submit"
type="submit"
value="#{msg.BUTTON_ADMIN_ADD_EMPLOYEE}"
action="#{adminEmployeeController.addEmployee()}"
- update=":master:form-list-company-employees:table-list-company-employees"
+ update="form-list-employees:employeeList"
/>
</p:panelGrid>
</f:facet>