]> git.mxchange.org Git - jjobs-war.git/blob - web/admin/employee/admin_employee_list.xhtml
Please cherry-pick:
[jjobs-war.git] / web / admin / employee / admin_employee_list.xhtml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <ui:composition
3         template="/WEB-INF/templates/admin/admin_base.tpl"
4         xmlns="http://www.w3.org/1999/xhtml"
5         xmlns:links="http://mxchange.org/jsf/core/links"
6         xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
7         xmlns:h="http://xmlns.jcp.org/jsf/html"
8         xmlns:f="http://xmlns.jcp.org/jsf/core"
9         xmlns:p="http://primefaces.org/ui"
10         >
11
12         <ui:define name="document_admin_title">
13                 <h:outputText value="#{msg.PAGE_TITLE_ADMIN_LIST_EMPLOYEE}" />
14         </ui:define>
15
16         <ui:define name="content_header">
17                 <h:outputText value="#{msg.CONTENT_TITLE_ADMIN_LIST_EMPLOYEE}" />
18         </ui:define>
19
20         <ui:define name="content">
21                 <h:form id="form-list-employees">
22                         <p:dataTable
23                                 id="employeeList"
24                                 var="employee"
25                                 value="#{employeeListController.allEmployees}"
26                                 paginator="true"
27                                 paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
28                                 filteredValue="#{employeeListController.filteredEmployees}"
29                                 rows="10"
30                                 rowKey="#{employee.employeeId}"
31                                 reflow="true"
32                                 resizableColumns="true"
33                                 rowsPerPageTemplate="5,10,20,50,100"
34                                 sortMode="multiple"
35                                 summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_EMPLOYEESS}"
36                                 emptyMessage="#{msg.ADMIN_EMPTY_LIST_EMPLOYEESS}"
37                                 widgetVar="employeeList"
38                                 selectionMode="single"
39                                 selection="#{employeeListController.selectedEmployee}"
40                                 skipChildren="true"
41                                 >
42
43                                 <f:facet name="header">
44                                         <p:panelGrid
45                                                 columns="3"
46                                                 layout="grid"
47                                                 columnClasses="ui-grid-col-4,ui-grid-col-6,ui-grid-col-2"
48                                                 >
49                                                 <p:spacer />
50
51                                                 <p:panelGrid
52                                                         columns="2"
53                                                         columnClasses="ui-grid-4,ui-grid-8"
54                                                         layout="grid"
55                                                         styleClass="ui-noborder"
56                                                         >
57                                                         <p:outputLabel
58                                                                 for="globalFilter"
59                                                                 value="#{msg.SEARCH_ALL_FIELDS}"
60                                                                 style="float: right"
61                                                                 />
62
63                                                         <p:inputText
64                                                                 id="globalFilter"
65                                                                 onkeyup="PF('employeeList').filter()"
66                                                                 placeholder="#{msg.ENTER_KEYWORD}"
67                                                                 />
68                                                 </p:panelGrid>
69
70                                                 <p:outputPanel>
71                                                         <p:spacer height="4" />
72
73                                                         <p:commandButton
74                                                                 id="toggler"
75                                                                 type="button"
76                                                                 value="#{msg.SELECT_SHOWN_COLUMNS}"
77                                                                 styleClass="column-selector"
78                                                                 />
79
80                                                         <p:columnToggler datasource="employeeList" trigger="toggler" />
81                                                 </p:outputPanel>
82                                         </p:panelGrid>
83                                 </f:facet>
84
85                                 <p:ajax
86                                         event="rowSelect"
87                                         update="form-list-employees:employee-details"
88                                         oncomplete="PF('employeeDialog').show()"
89                                         />
90
91                                 <p:column
92                                         headerText="#{msg.ID_HEADER}"
93                                         sortBy="#{employee.employeeId}"
94                                         filterable="false"
95                                         >
96                                         <p:link
97                                                 outcome="admin_show_employee"
98                                                 value="#{employee.employeeId}"
99                                                 title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}"
100                                                 >
101                                                 <f:param name="employeeId" value="#{employee.employeeId}" />
102                                         </p:link>
103                                 </p:column>
104
105                                 <p:column
106                                         headerText="#{msg.EMPLOYEE_NUMBER_HEADER}"
107                                         sortBy="#{employee.employeeNumber}"
108                                         filterBy="#{employee.employeeNumber}"
109                                         filterMatchMode="contains"
110                                         >
111                                         <h:outputText value="#{employee.employeeNumber}" rendered="#{not empty employee.employeeNumber}" />
112                                         <h:outputText value="-" rendered="#{empty employee.employeeNumber}" />
113                                 </p:column>
114
115                                 <p:column
116                                         headerText="#{msg.ADMIN_BRANCH_OFFICE_HEADER}"
117                                         sortBy="#{employee.employeeBranchOffice}"
118                                         filterBy="#{employee.employeeBranchOffice}"
119                                         filterMatchMode="in"
120                                         >
121                                         <f:facet name="filter">
122                                                 <p:selectCheckboxMenu
123                                                         filter="true"
124                                                         filterMatchMode="contains"
125                                                         label="#{msg.LABEL_BRANCH_OFFICES}"
126                                                         onchange="PF('employeeList').filter()"
127                                                         updateLabel="true"
128                                                         title="#{msg.FILTER_BY_MULTIPLE_EMPLOYEES_TITLE}"
129                                                         >
130                                                         <f:converter converterId="BranchOfficeConverter" />
131
132                                                         <f:selectItems
133                                                                 value="#{branchOfficeListController.allBranchOffices}"
134                                                                 var="branchOffice"
135                                                                 itemValue="#{branchOffice}"
136                                                                 itemLabel="#{beanHelper.renderBranchOffice(branchOffice)}"
137                                                                 />
138                                                 </p:selectCheckboxMenu>
139                                         </f:facet>
140
141                                         <p:link
142                                                 outcome="admin_show_branch_office"
143                                                 value="#{beanHelper.renderBranchOffice(employee.employeeBranchOffice)}"
144                                                 title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}"
145                                                 rendered="#{not empty employee.employeeBranchOffice}"
146                                                 >
147                                                 <f:param name="branchId" value="#{employee.employeeBranchOffice.branchId}" />
148                                         </p:link>
149
150                                         <p:link
151                                                 outcome="admin_assign_branch_office"
152                                                 value="#{msg.ADMIN_LINK_ASSIGN}"
153                                                 title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEE_BRANCH_OFFICE_TITLE}"
154                                                 rendered="#{empty employee.employeeBranchOffice}"
155                                                 >
156                                                 <f:param name="employeeId" value="#{employee.employeeId}" />
157                                         </p:link>
158                                 </p:column>
159
160                                 <p:column
161                                         headerText="#{msg.ADMIN_USER_HEADER}"
162                                         sortBy="#{employee.employeeUserOwner}"
163                                         filterBy="#{employee.employeeUserOwner}"
164                                         filterMatchMode="in"
165                                         >
166                                         <f:facet name="filter">
167                                                 <p:selectCheckboxMenu
168                                                         filter="true"
169                                                         filterMatchMode="contains"
170                                                         label="#{msg.LABEL_USERS}"
171                                                         onchange="PF('employeeList').filter()"
172                                                         updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_USERS_TITLE}"
173                                                         >
174                                                         <f:converter converterId="UserConverter" />
175
176                                                         <f:selectItems
177                                                                 value="#{userListController.allUsers}"
178                                                                 var="user"
179                                                                 itemValue="#{user}"
180                                                                 itemLabel="#{beanHelper.renderUser(user)}"
181                                                                 />
182                                                 </p:selectCheckboxMenu>
183                                         </f:facet>
184
185                                         <p:link
186                                                 outcome="admin_show_user"
187                                                 value="#{employee.employeeUserOwner.userId}"
188                                                 title="#{msg.ADMIN_LINK_SHOW_EMPLOYEES_OWNER_USER_TITLE}"
189                                                 rendered="#{not empty employee.employeeUserOwner}"
190                                                 >
191                                                 <f:param name="userId" value="#{employee.employeeUserOwner.userId}" />
192                                         </p:link>
193
194                                         <p:link
195                                                 outcome="admin_assign_user_owner"
196                                                 value="#{msg.ADMIN_LINK_ASSIGN}"
197                                                 title="#{msg.ADMIN_LINK_ASSIGN_EMPLOYEES_OWNER_USER_TITLE}"
198                                                 rendered="#{empty employee.employeeUserOwner}"
199                                                 >
200                                                 <f:param name="employeeId" value="#{employee.employeeId}" />
201                                         </p:link>
202                                 </p:column>
203
204                                 <p:column
205                                         headerText="#{msg.ADMIN_BASIC_DATA_COMPANY_NAME_HEADER}"
206                                         sortBy="#{employee.employeeBasicData}"
207                                         filterBy="#{employee.employeeBasicData}"
208                                         filterMatchMode="in"
209                                         >
210                                         <f:facet name="filter">
211                                                 <p:selectCheckboxMenu
212                                                         filter="true"
213                                                         filterMatchMode="contains"
214                                                         label="#{msg.LABEL_COMPANIES}"
215                                                         onchange="PF('employeeList').filter()"
216                                                         updateLabel="true"
217                                                         title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}"
218                                                         >
219                                                         <f:converter converterId="BasicCompanyDataConverter" />
220
221                                                         <f:selectItems
222                                                                 value="#{basicDataListController.allBasicData}"
223                                                                 var="basicData"
224                                                                 itemValue="#{basicData}"
225                                                                 itemLabel="#{beanHelper.renderBasicData(basicData, true)}"
226                                                                 />
227                                                 </p:selectCheckboxMenu>
228                                         </f:facet>
229
230                                         <p:link
231                                                 outcome="admin_show_basic_data"
232                                                 value="#{beanHelper.renderBasicData(employee.employeeBasicData, true)}"
233                                                 title="#{msg.ADMIN_LINK_SHOW_BASIC_DATA_TITLE}"
234                                                 >
235                                                 <f:param name="basicDataId" value="#{employee.employeeBasicData.basicDataId}" />
236                                         </p:link>
237                                 </p:column>
238
239                                 <p:column
240                                         headerText="#{msg.DATA_EMAIL_ADDRESS}"
241                                         sortBy="#{employee.employeeEmailAddress}"
242                                         filterBy="#{employee.employeeEmailAddress}"
243                                         filterMatchMode="contains"
244                                         >
245                                         <p:link
246                                                 href="mailto:#{employee.employeeEmailAddress}"
247                                                 value="#{employee.employeeEmailAddress}"
248                                                 rendered="#{not empty employee.employeeEmailAddress}"
249                                                 />
250
251                                         <h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty employee.employeeEmailAddress}" />
252                                 </p:column>
253
254                                 <p:column
255                                         headerText="#{msg.ENTRY_CREATED_HEADER}"
256                                         sortBy="#{employee.employeeEntryCreated}"
257                                         filterable="false"
258                                         >
259                                         <h:outputText value="#{employee.employeeEntryCreated}">
260                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
261                                         </h:outputText>
262                                 </p:column>
263
264                                 <p:column
265                                         headerText="#{msg.ENTRY_UPDATED_HEADER}"
266                                         sortBy="#{employee.employeeEntryUpdated}"
267                                         filterable="false"
268                                         >
269                                         <h:outputText value="#{employee.employeeEntryUpdated}">
270                                                 <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
271                                         </h:outputText>
272                                 </p:column>
273
274                                 <p:column
275                                         headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
276                                         sortable="false"
277                                         filterable="false"
278                                         >
279                                         <p:menuButton value="#{msg.OPTIONS}">
280                                                 <p:menuitem
281                                                         outcome="admin_show_employee"
282                                                         value="#{msg.ADMIN_LINK_SHOW_SHORT}"
283                                                         title="#{msg.ADMIN_LINK_SHOW_EMPLOYEE_TITLE}"
284                                                         >
285                                                         <f:param name="employeeId" value="#{employee.employeeId}" />
286                                                 </p:menuitem>
287
288                                                 <p:menuitem
289                                                         outcome="admin_edit_employee"
290                                                         value="#{msg.ADMIN_LINK_EDIT_SHORT}"
291                                                         title="#{msg.ADMIN_LINK_EDIT_EMPLOYEE_TITLE}"
292                                                         >
293                                                         <f:param name="employeeId" value="#{employee.employeeId}" />
294                                                 </p:menuitem>
295
296                                                 <p:menuitem outcome="admin_delete_employee">
297                                                         <h:outputText
298                                                                 styleClass="link-danger"
299                                                                 value="#{msg.ADMIN_LINK_DELETE_SHORT}"
300                                                                 title="#{msg.ADMIN_LINK_DELETE_EMPLOYEE_TITLE}"
301                                                                 />
302                                                         <f:param name="employeeId" value="#{employee.employeeId}" />
303                                                 </p:menuitem>
304                                         </p:menuButton>
305                                 </p:column>
306                         </p:dataTable>
307
308                         <p:dialog
309                                 dynamic="true"
310                                 modal="true"
311                                 resizable="false"
312                                 header="#{msg.ADMIN_SINGLE_EMPLOYEE_DETAILS_HEADER}"
313                                 hideEffect="fade"
314                                 showEffect="fade"
315                                 widgetVar="employeeDialog"
316                                 position="top"
317                                 responsive="true"
318                                 closeOnEscape="true"
319                                 >
320                                 <p:outputPanel id="employee-details">
321                                         <p:panelGrid
322                                                 columns="2"
323                                                 rendered="#{not empty employeeListController.selectedEmployee}"
324                                                 >
325                                                 <f:facet name="header">
326                                                         <h:outputFormat
327                                                                 value="#{msg.ADMIN_EMPLOYEE_NUMBER_DETAILS_HEADER}"
328                                                                 rendered="#{empty employeeListController.selectedEmployee.employeePersonalData}"
329                                                                 >
330                                                                 <f:param value="#{employeeListController.selectedEmployee.employeeId}" />
331                                                         </h:outputFormat>
332
333                                                         <h:outputFormat
334                                                                 value="#{msg.ADMIN_EMPLOYEE_NAME_DETAILS_HEADER}"
335                                                                 rendered="#{not empty employeeListController.selectedEmployee.employeePersonalData}"
336                                                                 >
337                                                                 <f:param value="#{beanHelper.renderContact(employeeListController.selectedEmployee.employeePersonalData)}" />
338                                                         </h:outputFormat>
339                                                 </f:facet>
340
341                                                 <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.EMPLOYEE_ID_NUMBER_TITLE}" />
342                                                 <h:outputText value="#{employeeListController.selectedEmployee.employeeId}" />
343                                         </p:panelGrid>
344                                 </p:outputPanel>
345                         </p:dialog>
346                 </h:form>
347
348                 <h:form>
349                         <p:panelGrid
350                                 columns="1"
351                                 layout="grid"
352                                 >
353                                 <f:facet name="header">
354                                         <h:outputText value="#{msg.ADMIN_ADD_EMPLOYEE_TITLE}" />
355                                 </f:facet>
356
357                                 <h:outputText value="#{msg.ADMIN_ADD_EMPLOYEE_MINIMUM_DATA}" />
358
359                                 <p:column>
360                                         <ui:include src="/WEB-INF/templates/admin/employee/admin_form_employee_data.tpl" />
361                                 </p:column>
362
363                                 <f:facet name="footer">
364                                         <p:panelGrid columns="2" layout="grid">
365                                                 <p:commandButton
366                                                         type="reset"
367                                                         value="#{msg.BUTTON_RESET_FORM}"
368                                                         />
369
370                                                 <p:commandButton
371                                                         type="submit"
372                                                         value="#{msg.BUTTON_ADMIN_ADD_EMPLOYEE}"
373                                                         action="#{adminEmployeeController.addEmployee()}"
374                                                         update="form-list-employees:employeeList"
375                                                         />
376                                         </p:panelGrid>
377                                 </f:facet>
378                         </p:panelGrid>
379                 </h:form>
380         </ui:define>
381 </ui:composition>