<ui:composition
template="/WEB-INF/templates/admin/admin_base.tpl"
xmlns="http://www.w3.org/1999/xhtml"
- 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"
</ui:define>
<ui:define name="content">
- <h:form id="form-list-company-employees">
+ <h:form id="form-list-employees">
<p:dataTable
id="employeeList"
var="employee"
- value="#{employeeController.allEmployees()}"
- filteredValue="#{employeeController.filteredEmployees}"
+ 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 />
+
+ <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" />
- <h:panelGroup>
<p:commandButton
id="toggler"
type="button"
/>
<p:columnToggler datasource="employeeList" trigger="toggler" />
- </h:panelGroup>
+ </p:outputPanel>
</p:panelGrid>
</f:facet>
+ <p:ajax
+ event="rowSelect"
+ update="form-list-employees:employee-details"
+ oncomplete="PF('employeeDialog').show()"
+ />
+
<p:column
headerText="#{msg.ID_HEADER}"
sortBy="#{employee.employeeId}"
<f:converter converterId="BranchOfficeConverter" />
<f:selectItems
- value="#{branchOfficeListController.allBranchOffices()}"
+ value="#{branchOfficeListController.allBranchOffices}"
var="branchOffice"
itemValue="#{branchOffice}"
- itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}"
+ itemLabel="#{beanHelper.renderBranchOffice(branchOffice, false)}"
/>
</p:selectCheckboxMenu>
</f:facet>
<p:link
outcome="admin_show_branch_office"
- value="#{beanHelper.renderBranchOffice(employee.employeeBranchOffice)}"
+ value="#{beanHelper.renderBranchOffice(employee.employeeBranchOffice, false)}"
title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}"
rendered="#{not empty employee.employeeBranchOffice}"
>
<f:converter converterId="UserConverter" />
<f:selectItems
- value="#{userController.allUsers()}"
+ value="#{userListController.allUsers}"
var="user"
itemValue="#{user}"
itemLabel="#{beanHelper.renderUser(user)}"
value="#{basicDataListController.allBasicData}"
var="basicData"
itemValue="#{basicData}"
- itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
+ itemLabel="#{beanHelper.renderBasicData(basicData, true, false)}"
/>
</p:selectCheckboxMenu>
</f:facet>
<p:link
outcome="admin_show_basic_data"
- value="#{beanHelper.renderBasicData(employee.employeeBasicData, true)}"
+ value="#{beanHelper.renderBasicData(employee.employeeBasicData, true, false)}"
title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
>
<f:param name="basicDataId" value="#{employee.employeeBasicData.basicDataId}" />
<p:column
headerText="#{msg.ENTRY_CREATED_HEADER}"
- sortBy="#{employee.employeeCreated}"
+ 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.ENTRY_UPDATED_HEADER}"
+ sortBy="#{employee.employeeEntryUpdated}"
filterable="false"
>
- <h:outputText id="employeeCreated" value="#{employee.employeeCreated}">
+ <h:outputText value="#{employee.employeeEntryUpdated}">
<f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
</h:outputText>
</p:column>
sortable="false"
filterable="false"
>
- <links:outputEmployeeAdminDropdownMenu employee="#{employee}" />
+ <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>
type="submit"
value="#{msg.BUTTON_ADMIN_ADD_EMPLOYEE}"
action="#{adminEmployeeController.addEmployee()}"
- update="form-list-company-employees:employeeList"
+ update="form-list-employees:employeeList"
/>
</p:panelGrid>
</f:facet>