]> git.mxchange.org Git - jjobs-war.git/blobdiff - web/admin/contact/admin_contact_list.xhtml
Please cherry-pick/repeat:
[jjobs-war.git] / web / admin / contact / admin_contact_list.xhtml
index eec56139a8cbc0ca5906853d78d6bc267a725b0d..15ce96640b363958847c6216f6466f81f05011c7 100644 (file)
                        <p:dataTable
                                id="contactList"
                                var="contact"
-                               value="#{contactController.allContacts()}"
+                               value="#{contactListController.allContacts}"
                                paginator="true"
+                               paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+                               filteredValue="#{contactListController.filteredContacts}"
                                rows="10"
+                               rowKey="#{contact.contactId}"
+                               reflow="true"
+                               resizableColumns="true"
+                               rowsPerPageTemplate="5,10,20,50,100"
+                               sortMode="multiple"
                                summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_CONTACT}"
                                emptyMessage="#{msg.ADMIN_EMPTY_LIST_CONTACT}"
                                widgetVar="contactList"
+                               selectionMode="single"
+                               selection="#{contactListController.selectedContact}"
+                               skipChildren="true"
                                >
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_ID}" />
-                                       </f:facet>
 
+                               <f:facet name="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('contactList').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="contactList" trigger="toggler" />
+                                               </p:outputPanel>
+                                       </p:panelGrid>
+                               </f:facet>
+
+                               <p:ajax
+                                       event="rowSelect"
+                                       update=":master:form-list-contacts:contact-details"
+                                       oncomplete="PF('contactDialog').show()"
+                                       />
+
+                               <p:column
+                                       headerText="#{msg.ID_HEADER}"
+                                       sortBy="#{contact.contactId}"
+                                       filterable="false"
+                                       >
                                        <p:link
                                                outcome="admin_show_contact"
                                                value="#{contact.contactId}"
                                        </p:link>
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}" />
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}"
+                                       sortBy="#{contact.contactPersonalTitle}"
+                                       filterBy="#{contact.contactPersonalTitle}"
+                                       filterMatchMode="exact"
+                                       >
+                                       <f:facet name="filter">
+                                               <p:selectOneMenu onchange="PF('contactList').filter()">
+                                                       <f:converter converterId="PersonalTitleConverter" />
+                                                       <f:selectItem itemLabel="#{msg.CHOICE_ALL}" itemValue="#{null}" />
+                                                       <f:selectItems
+                                                               value="#{dataController.personalTitles}"
+                                                               var="personalTitle"
+                                                               itemValue="#{personalTitle}"
+                                                               itemLabel="#{msg[personalTitle.messageKey]}"
+                                                               />
+                                               </p:selectOneMenu>
                                        </f:facet>
-
                                        <h:outputText value="#{msg[contact.contactPersonalTitle.messageKey]}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_FIRST_NAME}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_FIRST_NAME}"
+                                       sortBy="#{contact.contactFirstName}"
+                                       filterBy="#{contact.contactFirstName}"
+                                       filterMatchMode="contains"
+                                       >
                                        <h:outputText value="#{contact.contactFirstName}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_FAMILY_NAME}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_FAMILY_NAME}"
+                                       sortBy="#{contact.contactFamilyName}"
+                                       filterBy="#{contact.contactFamilyName}"
+                                       filterMatchMode="contains"
+                                       >
                                        <h:outputText value="#{contact.contactFamilyName}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_CONTACT_USAGE}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ADMIN_CONTACT_USAGE}"
+                                       sortable="false"
+                                       filterable="false"
+                                       >
                                        <h:outputText value="#{msg[beanHelper.getContactUsageMessageKey(contact)]}" />
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ENTRY_CREATED_HEADER}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ENTRY_CREATED_HEADER}"
+                                       sortBy="#{contact.contactCreated}"
+                                       filterBy="#{contact.contactCreated}"
+                                       filterMatchMode="contains"
+                                       >
                                        <h:outputText id="contactCreated" value="#{contact.contactCreated}">
                                                <f:convertDateTime type="both" timeStyle="short" dateStyle="short" />
                                        </h:outputText>
                                </p:column>
 
-                               <p:column>
-                                       <f:facet name="header">
-                                               <h:outputText value="#{msg.ADMIN_ACTION_LINKS_HEADER}" />
-                                       </f:facet>
-
+                               <p:column
+                                       headerText="#{msg.ADMIN_ACTION_LINKS_HEADER}"
+                                       sortable="false"
+                                       filterable="false"
+                                       >
                                        <links:outputContactAdminDropdownMenu contact="#{contact}" />
                                </p:column>
                        </p:dataTable>
+
+                       <p:dialog
+                               dynamic="true"
+                               modal="true"
+                               resizable="false"
+                               header="#{msg.ADMIN_SINGLE_CONTACT_DETAILS_HEADER}"
+                               hideEffect="fade"
+                               showEffect="fade"
+                               widgetVar="contactDialog"
+                               position="top"
+                               responsive="true"
+                               closeOnEscape="true"
+                               >
+                               <p:outputPanel id="contact-details">
+                                       <p:panelGrid columns="2" rendered="#{not empty contactListController.selectedContact}">
+                                               <f:facet name="header">
+                                                       <h:outputFormat value="#{msg.ADMIN_CONTACT_DETAILS_HEADER}">
+                                                               <f:param value="#{contactListController.selectedContact.companyName}" />
+                                                               <f:param value="#{contactListController.selectedContact.contactId}" />
+                                                       </h:outputFormat>
+                                               </f:facet>
+
+                                               <p:outputLabel value="#{msg.ID_HEADER}" title="#{msg.CONTACT_ID_NUMBER_TITLE}" />
+                                               <h:outputText value="#{contactListController.selectedContact.contactId}" />
+                                       </p:panelGrid>
+                               </p:outputPanel>
+                       </p:dialog>
                </h:form>
 
                <h:form>