import fish.payara.cdi.jsr107.impl.NamedCache;
import java.text.MessageFormat;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
*/
private static final long serialVersionUID = 5_028_697_360_461L;
+ /**
+ * A list of all branch offices
+ */
+ private final List<BranchOffice> allBranchOffices;
+
/**
* EJB for administrative purposes
*/
@NamedCache (cacheName = "branchOfficeCache")
private Cache<Long, BranchOffice> branchOfficeCache;
+ /**
+ * A list of filtered branch offices
+ */
+ private List<BranchOffice> filteredBranchOffices;
+
/**
* Default constructor
*/
public AddressbookBranchOfficeWebRequestBean () {
// Call super constructor
super();
+
+ // Init list
+ this.allBranchOffices = new LinkedList<>();
}
/**
* <p>
* @param event Event being fired
* <p>
- * @throws NullPointerException If the parameter or it's carried instance is null
+ * @throws NullPointerException If the parameter or it's carried instance is
+ * null
* @throws IllegalArgumentException If the branchId is zero or lower
*/
public void afterBranchOfficeAddedEvent (@Observes final ObservableBranchOfficeAddedEvent event) {
// Add instance to cache
this.branchOfficeCache.put(event.getBranchOffice().getBranchId(), event.getBranchOffice());
+ this.allBranchOffices.add(event.getBranchOffice());
}
@Override
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<BranchOffice> allBranchOffices () {
- // Init list
- final List<BranchOffice> list = new LinkedList<>();
-
- // Get iterator
- final Iterator<Cache.Entry<Long, BranchOffice>> iterator = this.branchOfficeCache.iterator();
-
- // Loop over all
- while (iterator.hasNext()) {
- // Get next entry
- final Cache.Entry<Long, BranchOffice> next = iterator.next();
+ return this.allBranchOffices;
+ }
- // Add value to list
- list.add(next.getValue());
- }
+ /**
+ * Getter for a list of filtered branch offices
+ * <p>
+ * @return Filtered branch offices
+ */
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<BranchOffice> getFilteredBranchOffices () {
+ return this.filteredBranchOffices;
+ }
- // Return it
- return list;
+ /**
+ * Setter for a list of filtered branch offices
+ * <p>
+ * @param filteredBranchOffices Filtered branch offices
+ */
+ @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+ public void setFilteredBranchOffices (final List<BranchOffice> filteredBranchOffices) {
+ this.filteredBranchOffices = filteredBranchOffices;
}
/**
this.branchOfficeCache.put(next.getBranchId(), next);
}
}
+
+ // Is the list empty, but filled cache?
+ if (this.allBranchOffices.isEmpty() && this.branchOfficeCache.iterator().hasNext()) {
+ // Get iterator
+ final Iterator<Cache.Entry<Long, BranchOffice>> iterator = this.branchOfficeCache.iterator();
+
+ // Build up list
+ while (iterator.hasNext()) {
+ // GEt next element
+ final Cache.Entry<Long, BranchOffice> next = iterator.next();
+
+ // Add to list
+ this.allBranchOffices.add(next.getValue());
+ }
+
+ // Sort list
+ this.allBranchOffices.sort(new Comparator<BranchOffice>() {
+ @Override
+ public int compare (final BranchOffice o1, final BranchOffice o2) {
+ return o1.getBranchId() > o2.getBranchId() ? 1 : o1.getBranchId() < o2.getBranchId() ? -1 : 0;
+ }
+ }
+ );
+ }
}
}
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicCompanyDataNotFoundException;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote;
+import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
/**
- * Converter for contact id <-> valid business contact instance
+ * Converter for basic company data id <-> valid basic company data instance
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
BASIC_DATA_BEAN = (BasicCompanyDataSessionBeanRemote) initial.lookup("java:global/addressbook-ejb/basicCompanyData!org.mxchange.jcontactsbusiness.model.basicdata.BasicCompanyDataSessionBeanRemote");
} catch (final NamingException ex) {
// Throw it again
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
}
}
--- /dev/null
+/*
+ * Copyright (C) 2016, 2017 Roland Häder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.addressbook.converter.business.branchoffice;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.convert.FacesConverter;
+import javax.faces.validator.ValidatorException;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFoundException;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
+import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote;
+
+/**
+ * Converter for branch office id <-> valid basic company data instance
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter ("BranchOfficeConverter")
+public class AddressbookBranchOfficeConverter implements Converter<BranchOffice> {
+
+ /**
+ * Branch office EJB
+ */
+ private static BranchOfficeSessionBeanRemote BRANCH_OFFICE_BEAN;
+
+ @Override
+ public BranchOffice getAsObject (final FacesContext context, final UIComponent component, final String submittedValue) {
+ // Is the instance there?
+ if (BRANCH_OFFICE_BEAN == null) {
+ try {
+ // Not yet, attempt lookup
+ final Context initial = new InitialContext();
+
+ // Lookup EJB
+ BRANCH_OFFICE_BEAN = (BranchOfficeSessionBeanRemote) initial.lookup("java:global/addressbook-ejb/branchOffice!org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeSessionBeanRemote");
+ } catch (final NamingException ex) {
+ // Throw it again
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+ }
+ }
+
+ // Is the value null or empty?
+ if ((null == submittedValue) || (submittedValue.trim().isEmpty())) {
+ // Warning message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logWarning(MessageFormat.format("{0}.getAsObject(): submittedValue is null or empty - EXIT!", this.getClass().getSimpleName())); //NOI18N
+
+ // Return null
+ return null;
+ }
+
+ // Init instance
+ BranchOffice branchOffice = null;
+
+ try {
+ // Try to parse the value as long
+ final Long branchOfficeId = Long.valueOf(submittedValue);
+
+ // Try to get user instance from it
+ branchOffice = BRANCH_OFFICE_BEAN.findBranchOfficeById(branchOfficeId);
+ } catch (final NumberFormatException ex) {
+ // Throw again
+ throw new ConverterException(ex);
+ } catch (final BranchOfficeNotFoundException ex) {
+ // Debug message
+ // @TODO Not working with JNDI (no remote interface) this.loggerBeanLocal.logDebug(MessageFormat.format("{0}.getAsObject(): Exception: {1} - Returning null ...", this.getClass().getSimpleName(), ex)); //NOI18N
+ }
+
+ // Return it
+ return branchOffice;
+ }
+
+ @Override
+ public String getAsString (final FacesContext context, final UIComponent component, final BranchOffice value) {
+ // Is the object null?
+ if ((null == value) || (String.valueOf(value).isEmpty())) {
+ // Is null
+ return ""; //NOI18N
+ }
+
+ // Return id number
+ return String.valueOf(value.getBranchId());
+ }
+
+}
COMPANY_EMPLOYEE_BEAN = (CompanyEmployeeSessionBeanRemote) initial.lookup("java:global/addressbook-ejb/companyEmployee!org.mxchange.jcontactsbusiness.model.employee.CompanyEmployeeSessionBeanRemote");
} catch (final NamingException ex) {
// Throw it again
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
}
}
COMPANY_HEADQUARTERS_BEAN = (CompanyHeadquartersSessionBeanRemote) initial.lookup("java:global/addressbook-ejb/companyEmployee!org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersSessionBeanRemote");
} catch (final NamingException ex) {
// Throw it again
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Cannot lookup EJB", ex.getMessage()), ex); //NOI18N
}
}
LINK_ADMIN_EXPORT_CONTACT=Kontaktdaten exportieren
LINK_ADMIN_EXPORT_CONTACT_TITLE=Kontaktdaten exportieren
PERSONAL_DATA_BIRTHDAY=Geburtsdatum (tt.mm.jjjj):
-BIRTHDAY_PATTERN=dd.MM.yyyy
-INVALID_BIRTHDAY=Ung\u00fcltiges Geburtsdatum eingegeben.
+DATE_PATTERN=dd.MM.yyyy
ADMIN_EXPORT_CONTACT_ID=Kontaktdaten-Id
ADMIN_EXPORT_CONTACT_PERSONAL_TITLE=Anrede
ADMIN_EXPORT_CONTACT_ACADEMIC_TITLE=Titel
ADMIN_BASIC_COMPANY_DATA_ID=Id-Nummer:
#@TODO Please fix German umlauts!
ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE=Stammdaten des Unternehmens anzeigen.
-ADMIN_ASSIGNED_USER_ID=Zugew. Benutzer:
+ADMIN_ASSIGNED_USER=Zugew. Benutzer:
ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Benutzerprofil des zugewiesenen Benutzers anzeigen.
ADMIN_LINK_ASSIGN=Zuweisen
#@TODO Please fix German umlauts!
#@TODO Please fix German umlauts!
ADMIN_MOBILE_PROVIDER_COUNTRY_REQUIRED=Bitte waehlen Sie ein Land fuer den Mobilfunkanbieter aus.
#@TODO Please fix German umlauts!
-COUNTRIES=Laender
+LABEL_COUNTRIES=Laender
#@TODO Please fix German umlauts!
FILTER_BY_MULTIPLE_COUNTRY_TITLE=Liste durch Auswahl von ein oder mehr Laendern durchsuchen.
ADMIN_LIST_MOBILE_PROVIDERS_HEADER=Liste aller Mobilfunkanbieter
SELECT_SHOWN_COLUMNS=Angezeigte Spalten
+ADMIN_LIST_BRANCH_OFFICES_HEADER=Alle Filialen auflisten
+LABEL_USERS=Benutzer
+FILTER_BY_MULTIPLE_USER_TITLE=Liste durch Auswahl von ein oder mehr Benutzern durchsuchen.
+LABEL_COMPANIES=Firmen
+FILTER_BY_MULTIPLE_COMPANIES_TITLE=Liste durch Auswahl von ein oder mehr Unternehmen durchsuchen.
+LABEL_COMPANY_EMPLOYEES=Mitarbeiter
+FILTER_BY_MULTIPLE_COMPANY_EMPLOYEES_TITLE=Liste durch Auswahl von ein oder mehr Mitarbeiter durchsuchen.
LINK_ADMIN_EXPORT_CONTACT=Export data
LINK_ADMIN_EXPORT_CONTACT_TITLE=Export contact data
PERSONAL_DATA_BIRTHDAY=Birthday (mm-dd-yyyy):
-BIRTHDAY_PATTERN=MM-dd-yyyy
-INVALID_BIRTHDAY=Wrong birthday entered.
+DATE_PATTERN=MM-dd-yyyy
ADMIN_EXPORT_CONTACT_ID=Contact data id
ADMIN_EXPORT_CONTACT_PERSONAL_TITLE=Gender
ADMIN_EXPORT_CONTACT_ACADEMIC_TITLE=Title
TABLE_SUMMARY_ADMIN_LIST_BASIC_COMPANY_DATA=This table lists basic company data.
ADMIN_BASIC_COMPANY_DATA_ID=Id Number:
ADMIN_LINK_SHOW_BASIC_COMAPNY_DATA_TITLE=Show details of this business contact.
-ADMIN_ASSIGNED_USER_ID=Assigned user:
+ADMIN_ASSIGNED_USER=Assigned user:
ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Shows assigned user profile.
ADMIN_LINK_ASSIGN=Assign
ADMIN_LINK_ASSIGN_BASIC_COMPANY_DATA_OWNER_USER_TITLE=Assigns this business contact to a user account.
ADMIN_MOBILE_NUMBER_LIST_EMPTY=There are no mobile numbers in database. Or your search criteria doesn't match anything.
ADMIN_CONTACT_MOBILE_LIST_EMPTY=There are no mobile numbers of contacts in database. Or your search criteria doesn't match anything.
ADMIN_MOBILE_PROVIDER_COUNTRY_REQUIRED=Please select a country for mobile provider.
-COUNTRIES=Countries
+LABEL_COUNTRIES=Countries
+#Filter list by selecting one or more users.
FILTER_BY_MULTIPLE_COUNTRY_TITLE=Filter list by selecting one or more countries.
ADMIN_LIST_MOBILE_PROVIDERS_HEADER=List of all mobile providers
SELECT_SHOWN_COLUMNS=Shown columns
+ADMIN_LIST_BRANCH_OFFICES_HEADER=List all branch offices
+LABEL_USERS=Users
+FILTER_BY_MULTIPLE_USER_TITLE=Filter list by selecting one or more users.
+LABEL_COMPANIES=Companies
+FILTER_BY_MULTIPLE_COMPANIES_TITLE=Filter list by selecting one or more companies.
+LABEL_COMPANY_EMPLOYEES=Employees
+FILTER_BY_MULTIPLE_COMPANY_EMPLOYEES_TITLE=Filter list by selecting one or more employees.
</div>
<div class="table-right-medium">
- <widgets:outputCountrySelector id="country" value="#{adminContactController.contactCountry}"
+ <widgets:outputCountrySelector id="country" value="#{adminContactController.contactCountry}" />
</div>
</h:panelGroup>
</div>
<div class="table-right-medium">
- <p:inputText styleClass="input" id="contactBirthday" value="#{adminContactController.birthday}" size="10" converterMessage="#{msg.INVALID_BIRTHDAY}">
- <f:convertDateTime pattern="#{msg.BIRTHDAY_PATTERN}" />
- </p:inputText>
+ <p:calendar id="contactBirthday" value="#{contactController.birthday}" />
</div>
</h:panelGroup>
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="mobileProvider" value="#{adminPhoneController.mobileProvider}" required="true" requiredMessage="#{msg.ADMIN_MOBILE_PROVIDER_REQUIRED}">
+ <p:selectOneMenu
+ id="mobileProvider"
+ value="#{adminPhoneController.mobileProvider}"
+ filter="true"
+ filterMatchMode="contains"
+ required="true"
+ requiredMessage="#{msg.ADMIN_MOBILE_PROVIDER_REQUIRED}"
+ >
<f:converter converterId="MobileProviderConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{mobileProviderController.allMobileProviders()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
- <p:selectOneMenu id="#{id}" value="#{value}" styleClass="#{empty styleClass ? 'select' : styleClass}" rendered="#{empty rendered or rendered}" required="#{empty required ? false : required}" requiredMessage="#{requiredMessage}">
+ <p:selectOneMenu
+ id="#{id}"
+ value="#{value}"
+ styleClass="#{empty styleClass ? 'select' : styleClass}"
+ filter="true"
+ filterMatchMode="contains"
+ rendered="#{empty rendered or rendered}"
+ required="#{empty required ? false : required}"
+ requiredMessage="#{requiredMessage}"
+ >
<f:converter converterId="CountryConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" rendered="#{empty allowNull or allowNull}" />
<f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{country.countryCode} (#{msg[country.countryI18nKey]})" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="mobileProvider" value="#{targetController.mobileProvider}">
+ <p:selectOneMenu
+ id="mobileProvider"
+ value="#{targetController.mobileProvider}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="MobileProviderConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{mobileProviderController.allMobileProviders()}" var="mobileProvider" itemValue="#{mobileProvider}" itemLabel="#{mobileProvider.providerCountry.countryExternalDialPrefix}#{mobileProvider.providerDialPrefix} (#{mobileProvider.providerName})" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="userPersonalTitle" value="#{targetController.personalTitle}" required="#{(empty allowEmptyRequiredData or not allowEmptyRequiredData) and featureController.isFeatureEnabled(targetController.controllerType.concat('_personal_title'))}" requiredMessage="#{msg.FIELD_PERSONAL_TITLE_REQUIRED}">
+ <p:selectOneMenu
+ id="userPersonalTitle"
+ value="#{targetController.personalTitle}"
+ filter="true"
+ filterMatchMode="contains"
+ required="#{(empty allowEmptyRequiredData or not allowEmptyRequiredData) and featureController.isFeatureEnabled(targetController.controllerType.concat('_personal_title'))}"
+ requiredMessage="#{msg.FIELD_PERSONAL_TITLE_REQUIRED}">
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" />
<f:selectItems value="#{genderController.selectableGenders}" var="personalTitle" itemValue="#{personalTitle}" itemLabel="#{msg[personalTitle.messageKey]}" />
</p:selectOneMenu>
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="profileMode" value="#{targetController.userProfileMode}">
+ <p:selectOneMenu
+ id="profileMode"
+ value="#{targetController.userProfileMode}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:selectItems value="#{profileModeController.allProfileModes()}" var="mode" itemValue="#{mode}" itemLabel="#{msg[mode.messageKey]}" />
</p:selectOneMenu>
</div>
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="companyUserOwner" value="#{adminCompanyDataController.companyUserOwner}">
+ <p:selectOneMenu
+ id="companyUserOwner"
+ value="#{adminCompanyDataController.companyUserOwner}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="UserConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{userController.allUsers()}" var="companyUserOwner" itemValue="#{companyUserOwner}" itemLabel="#{companyUserOwner.userContact.contactFirstName} #{companyUserOwner.userContact.contactFamilyName} (#{companyUserOwner.userName})" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="companyContactEmployee" value="#{adminCompanyDataController.companyContactEmployee}">
+ <p:selectOneMenu
+ id="companyContactEmployee"
+ value="#{adminCompanyDataController.companyContactEmployee}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="CompanyEmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{companyEmployeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="companyFounder" value="#{adminCompanyDataController.companyFounder}">
+ <p:selectOneMenu
+ id="companyFounder"
+ value="#{adminCompanyDataController.companyFounder}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="CompanyEmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{companyEmployeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="companyHeadQuarters" value="#{adminCompanyDataController.companyHeadQuarters}">
+ <p:selectOneMenu
+ id="companyHeadQuarters"
+ value="#{adminCompanyDataController.companyHeadQuarters}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="CompanyHeadquartersConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{companyHeadquartersController.allCompanyHeadquarters()}" var="companyHeadQuarters" itemValue="#{companyHeadQuarters}" itemLabel="#{companyHeadQuarters.foo}" />
</div>
<div class="table-right-medium">
- <p:inputTextarea styleClass="input" id="companyComments" rows="7" cols="25" value="#{adminCompanyDataController.companyComments}" />
+ <p:inputTextarea
+ styleClass="input"
+ id="companyComments"
+ rows="7"
+ cols="25"
+ value="#{adminCompanyDataController.companyComments}"
+ />
</div>
</h:panelGroup>
</fieldset>
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="branchCompany" value="#{adminBranchOfficeController.branchCompany}" required="true" requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED}">
+ <p:selectOneMenu
+ id="branchCompany"
+ value="#{adminBranchOfficeController.branchCompany}"
+ filter="true"
+ filterMatchMode="contains"
+ required="true"
+ requiredMessage="#{msg.ADMIN_BRANCH_OFFICE_COMPANY_REQUIRED}"
+ >
<f:converter converterId="BasicCompanyDataConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" noSelectionOption="true" itemDisabled="true" />
<f:selectItems value="#{basicDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="branchContactEmployee" value="#{adminBranchOfficeController.branchContactEmployee}">
+ <p:selectOneMenu
+ id="branchContactEmployee"
+ value="#{adminBranchOfficeController.branchContactEmployee}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="CompanyEmployeeConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{companyEmployeeController.allCompanyEmployees()}" var="companyHeadQuarters" itemValue="#{companyEmployee}" itemLabel="#{companyEmployee.foo}" />
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="branchUserOwner" value="#{adminBranchOfficeController.branchUserOwner}">
+ <p:selectOneMenu
+ id="branchUserOwner"
+ value="#{adminBranchOfficeController.branchUserOwner}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:converter converterId="UserConverter" />
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{userController.allUsers()}" var="branchUserOwner" itemValue="#{branchUserOwner}" itemLabel="#{branchUserOwner.userContact.contactFirstName} #{branchUserOwner.userContact.contactFamilyName} (#{branchUserOwner.userName})" />
</f:facet>
<f:loadBundle var="msg" basename="org.mxchange.localization.bundle" />
+ <f:loadBundle var="project" basename="org.mxchange.localization.project" />
<h:outputStylesheet name="/css/default.css" />
<h:outputStylesheet name="/css/layout.css" />
</div>
<div class="table-right-medium">
- <p:inputText styleClass="input" id="birthday" value="#{contactController.birthday}" required="true" size="10" requiredMessage="#{msg.GUEST_CONTACT_DATA_BIRTHDAY_REQUIRED}" converterMessage="#{msg.INVALID_BIRTHDAY}">
- <f:convertDateTime pattern="#{msg.BIRTHDAY_PATTERN}" />
- </p:inputText>
+ <p:calendar id="birthday" value="#{contactController.birthday}" required="true" requiredMessage="#{msg.GUEST_CONTACT_DATA_BIRTHDAY_REQUIRED}" />
</div>
</h:panelGroup>
<div class="table-right">
<p:inputText type="secret" styleClass="input" id="currentPassword" size="10" maxlength="255" value="#{userLoginController.userCurrentPassword}" required="true" validatorMessage="#{msg.ERROR_USER_CURRENT_PASSWORD_MISMATCHING}">
- <!-- <f:validator for="currentPassword" validatorId="FinancialsUserPasswordValidator" /> //-->
+ <!-- <f:validator for="currentPassword" validatorId="AddressbookUserPasswordValidator" /> //-->
</p:inputText>
</div>
</h:panelGroup>
<p:column>
<f:facet name="header">
- <h:outputText value="#{msg.ADMIN_ASSIGNED_USER_ID}" />
+ <h:outputText value="#{msg.ADMIN_ASSIGNED_USER}" />
</f:facet>
<p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BASIC_COMPANY_DATA_OWNER_USER_TITLE}" value="#{basicData.companyUserOwner.userId}" rendered="#{not empty basicData.companyUserOwner}">
</ui:define>
<ui:define name="content">
- <p:dataTable id="table_list_branch_offices" var="branchOffice" value="#{branchOfficeController.allBranchOffices()}" tableStyleClass="table table-full" paginator="true" rows="10" summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES}" emptyMessage="#{msg.ADMIN_BRANCH_OFFICES_LIST_EMPTY}">
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_ID_NUMBER}" />
- </f:facet>
-
- <p:link outcome="admin_show_branch_office" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}" value="#{branchOffice.branchId}">
- <f:param name="branchId" value="#{branchOffice.branchId}" />
- </p:link>
- </p:column>
-
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_ASSIGNED_USER_ID}" />
- </f:facet>
-
- <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICES_OWNER_USER_TITLE}" value="#{branchOffice.branchUserOwner.userId}" rendered="#{not empty branchOffice.branchUserOwner}">
- <f:param name="userId" value="#{branchOffice.branchUserOwner.userId}" />
- </p:link>
-
- <p:link outcome="admin_assign_branch_office_owner" title="#{msg.ADMIN_LINK_ASSIGN_BRANCH_OFFICES_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty branchOffice.branchUserOwner}">
- <f:param name="branchId" value="#{branchOffice.branchId}" />
- </p:link>
- </p:column>
-
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_BASIC_COMPANY_DATA_COMPANY_NAME}" />
- </f:facet>
-
- <h:outputLink value="#{branchOffice.branchCompany.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty branchOffice.branchCompany.companyWebsiteUrl}">
- <h:outputText value="#{branchOffice.branchCompany.companyName}" />
- </h:outputLink>
-
- <h:outputText value="#{branchOffice.branchCompany.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty branchOffice.branchCompany.companyWebsiteUrl}" />
- </p:column>
-
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.DATA_EMAIL_ADDRESS}" />
- </f:facet>
+ <h:form id="form-list-branch-offices">
+ <p:dataTable
+ id="table-list-branch-offices"
+ var="branchOffice"
+ value="#{branchOfficeController.allBranchOffices()}"
+ tableStyleClass="table table-full"
+ paginator="true"
+ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ widgetVar="branchOfficeTable"
+ filteredValue="#{branchOfficeController.filteredBranchOffices}"
+ rows="10"
+ reflow="true"
+ resizableColumns="true"
+ rowsPerPageTemplate="5,10,20,50,100"
+ sortMode="multiple"
+ summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_BRANCH_OFFICES}"
+ emptyMessage="#{msg.ADMIN_BRANCH_OFFICES_LIST_EMPTY}"
+ >
- <h:outputLink value="mailto:#{branchOffice.branchEmailAddress}" rendered="#{not empty branchOffice.branchEmailAddress}" />
-
- <h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty branchOffice.branchEmailAddress}" />
- </p:column>
-
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.DATA_ADDRESS}" />
- </f:facet>
-
- <h:outputText value="#{branchOffice.branchZipCode} #{branchOffice.branchCity}" title="#{branchOffice.branchStreet} #{branchOffice.branchHouseNumber} (#{msg.DATA_STORE} #{branchOffice.branchStore}, #{msg.DATA_SUITE_NUMBER} #{branchOffice.branchSuiteNumber})" />
- </p:column>
-
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_CONTACT_PERSON}" />
- </f:facet>
-
- <p:link outcome="admin_show_business_employee" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICES_CONTACT_PERSON_TITLE}" value="#{branchOffice.branchContactEmployee.employeeId}" rendered="#{not empty branchOffice.branchContactEmployee}">
- <f:param name="employeeId" value="#{branchOffice.branchContactEmployee.employeeId}" />
- </p:link>
-
- <p:link outcome="admin_assign_branch_office_employee" title="#{msg.ADMIN_LINK_ASSIGN_BRANCH_OFFICES_CONTACT_PERSON_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty branchOffice.branchContactEmployee}">
- <f:param name="branchId" value="#{branchOffice.branchId}" />
- </p:link>
- </p:column>
-
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_ENTRY_CREATED}" />
- </f:facet>
-
- <h:outputText id="branchCreated" value="#{branchOffice.branchCreated.time}">
- <f:convertDateTime for="branchCreated" type="both" timeStyle="short" dateStyle="short" />
- </h:outputText>
- </p:column>
-
- <p:column>
<f:facet name="header">
- <h:outputText value="#{msg.ADMIN_ACTION_LINKS}" />
+ <h:outputText value="#{msg.ADMIN_LIST_BRANCH_OFFICES_HEADER}" />
+ <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
+ <p:columnToggler datasource="table-list-branch-offices" trigger="toggler" />
</f:facet>
- <links:outputBranchOfficeAdminMiniLinks branchOffice="#{branchOffice}" />
- </p:column>
- </p:dataTable>
+ <p:column headerText="#{msg.ADMIN_ID_NUMBER}" sortBy="#{branchOffice.branchId}" filterBy="#{branchOffice.branchId}">
+ <p:link outcome="admin_show_branch_office" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICE_TITLE}" value="#{branchOffice.branchId}">
+ <f:param name="branchId" value="#{branchOffice.branchId}" />
+ </p:link>
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_ASSIGNED_USER}" sortBy="#{branchOffice.branchUserOwner.userName}" filterBy="#{branchOffice.branchUserOwner}" filterMatchMode="in">
+ <f:facet name="filter">
+ <p:selectCheckboxMenu filter="true" filterMatchMode="contains" label="#{msg.LABEL_USERS}" onchange="PF('branchOfficeTable').filter()" updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_USER_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}" />
+ </p:selectCheckboxMenu>
+ </f:facet>
+
+ <p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICES_OWNER_USER_TITLE}" value="#{branchOffice.branchUserOwner.userId}" rendered="#{not empty branchOffice.branchUserOwner}">
+ <f:param name="userId" value="#{branchOffice.branchUserOwner.userId}" />
+ </p:link>
+
+ <p:link outcome="admin_assign_branch_office_owner" title="#{msg.ADMIN_LINK_ASSIGN_BRANCH_OFFICES_OWNER_USER_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty branchOffice.branchUserOwner}">
+ <f:param name="branchId" value="#{branchOffice.branchId}" />
+ </p:link>
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_BASIC_COMPANY_DATA_COMPANY_NAME}" sortBy="#{branchOffice.branchCompany.companyName}" filterBy="#{branchOffice.branchCompany}" filterMatchMode="in">
+ <f:facet name="filter">
+ <p:selectCheckboxMenu filter="true" filterMatchMode="contains" label="#{msg.LABEL_COMPANIES}" onchange="PF('branchOfficeTable').filter()" updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_COMPANIES_TITLE}">
+ <f:converter converterId="BasicCompanyDataConverter" />
+ <f:selectItems value="#{basicDataController.allCompanyBasicData()}" var="basicData" itemValue="#{basicData}" itemLabel="#{basicData.companyName}" />
+ </p:selectCheckboxMenu>
+ </f:facet>
+
+ <h:outputLink value="#{branchOffice.branchCompany.companyWebsiteUrl}" target="_blank" title="#{msg.LINK_COMPANY_WEBSITE_URL_TITLE}" rel="external" rendered="#{not empty branchOffice.branchCompany.companyWebsiteUrl}">
+ <h:outputText value="#{branchOffice.branchCompany.companyName}" />
+ </h:outputLink>
+
+ <h:outputText value="#{branchOffice.branchCompany.companyName}" title="#{msg.NO_WEBSITE_URL_ENTERED}" rendered="#{empty branchOffice.branchCompany.companyWebsiteUrl}" />
+ </p:column>
+
+ <p:column headerText="#{msg.DATA_EMAIL_ADDRESS}" sortBy="#{branchOffice.branchEmailAddress}" filterBy="#{branchOffice.branchEmailAddress}" filterMatchMode="contains">
+ <h:outputLink value="mailto:#{branchOffice.branchEmailAddress}" rendered="#{not empty branchOffice.branchEmailAddress}" />
+
+ <h:outputText value="#{msg.NO_EMAIL_ADDRESS_ENTERED}" rendered="#{empty branchOffice.branchEmailAddress}" />
+ </p:column>
+
+ <p:column headerText="#{msg.DATA_ADDRESS}" sortBy="#{branchOffice.branchCity}" filterBy="#{branchOffice.branchCity}" filterMatchMode="contains">
+ <h:outputText value="#{branchOffice.branchZipCode} #{branchOffice.branchCity}" title="#{branchOffice.branchStreet} #{branchOffice.branchHouseNumber} (#{msg.DATA_STORE} #{branchOffice.branchStore}, #{msg.DATA_SUITE_NUMBER} #{branchOffice.branchSuiteNumber})" />
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_CONTACT_PERSON}" sortBy="#{branchOffice.branchContactEmployee.employeePersonalData.contactFamilyName}" filterBy="#{branchOffice.branchContactEmployee}" filterMatchMode="in">
+ <f:facet name="filter">
+ <p:selectCheckboxMenu filter="true" filterMatchMode="contains" label="#{msg.LABEL_COMPANY_EMPLOYEES}" onchange="PF('branchOfficeTable').filter()" updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_COMPANY_EMPLOYEES_TITLE}">
+ <f:converter converterId="CompanyEmployeeConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems value="#{companyEmployeeController.allCompanyEmployees()}" var="employee" itemValue="#{employee}" itemLabel="#{employee.employeePersonalData.contactFirstName} #{employee.employeePersonalData.contactFamilyName}" />
+ </p:selectCheckboxMenu>
+ </f:facet>
+
+ <p:link outcome="admin_show_business_employee" title="#{msg.ADMIN_LINK_SHOW_BRANCH_OFFICES_CONTACT_PERSON_TITLE}" value="#{branchOffice.branchContactEmployee.employeeId}" rendered="#{not empty branchOffice.branchContactEmployee}">
+ <f:param name="employeeId" value="#{branchOffice.branchContactEmployee.employeeId}" />
+ </p:link>
+
+ <p:link outcome="admin_assign_branch_office_employee" title="#{msg.ADMIN_LINK_ASSIGN_BRANCH_OFFICES_CONTACT_PERSON_TITLE}" value="#{msg.ADMIN_LINK_ASSIGN}" rendered="#{empty branchOffice.branchContactEmployee}">
+ <f:param name="branchId" value="#{branchOffice.branchId}" />
+ </p:link>
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_LIST_ENTRY_CREATED}" sortBy="#{branchOffice.branchCreated}">
+ <h:outputText id="branchCreated" value="#{branchOffice.branchCreated.time}">
+ <f:convertDateTime for="branchCreated" type="both" timeStyle="short" dateStyle="short" />
+ </h:outputText>
+ </p:column>
+
+ <p:column headerText="#{msg.ADMIN_ACTION_LINKS}" sortable="false">
+ <links:outputBranchOfficeAdminMiniLinks branchOffice="#{branchOffice}" />
+ </p:column>
+ </p:dataTable>
+ </h:form>
<h:form id="form_admin_add_branch_office">
<h:panelGroup styleClass="table table-medium" layout="block">
id="table-list-mobile-provider"
var="mobileProvider"
value="#{mobileProviderController.allMobileProviders()}"
- widgetVar="mobileProviderTable"
- filteredValue="#{mobileProviderController.filteredMobileProviders}"
tableStyleClass="table table-medium"
- rows="10"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ widgetVar="mobileProviderTable"
+ filteredValue="#{mobileProviderController.filteredMobileProviders}"
+ rows="10"
reflow="true"
resizableColumns="true"
rowsPerPageTemplate="5,10,20,50,100"
sortMode="multiple"
summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_MOBILE_PROVIDERS}"
- emptyMessage="#{msg.ADMIN_MOBILE_PROVIDER_LIST_EMPTY}">
+ emptyMessage="#{msg.ADMIN_MOBILE_PROVIDER_LIST_EMPTY}"
+ >
<f:facet name="header">
<h:outputText value="#{msg.ADMIN_LIST_MOBILE_PROVIDERS_HEADER}" />
<p:columnToggler datasource="table-list-mobile-provider" trigger="toggler" />
</f:facet>
- <p:column filterBy="#{mobileProvider.providerId}" sortBy="#{mobileProvider.providerId}" headerText="#{msg.ADMIN_ID_NUMBER}">
+ <p:column headerText="#{msg.ADMIN_ID_NUMBER}" sortBy="#{mobileProvider.providerId}" filterBy="#{mobileProvider.providerId}">
<p:link outcome="admin_show_mobile_provider" title="#{msg.ADMIN_LINK_SHOW_MOBILE_PROVIDER_TITLE}" value="#{mobileProvider.providerId}">
<f:param name="providerId" value="#{mobileProvider.providerId}" />
</p:link>
</p:column>
- <p:column filterBy="#{mobileProvider.providerName}" sortBy="#{mobileProvider.providerName}" headerText="#{msg.ADMIN_LIST_MOBILE_PROVIDER_NAME}" filterMatchMode="contains">
+ <p:column headerText="#{msg.ADMIN_LIST_MOBILE_PROVIDER_NAME}" sortBy="#{mobileProvider.providerName}" filterBy="#{mobileProvider.providerName}" filterMatchMode="contains">
<h:outputText value="#{mobileProvider.providerName}" />
</p:column>
- <p:column filterBy="#{mobileProvider.providerDialPrefix}" sortBy="#{mobileProvider.providerDialPrefix}" headerText="#{msg.ADMIN_LIST_MOBILE_PROVIDER_DIAL_PREFIX}" filterMatchMode="contains">
+ <p:column headerText="#{msg.ADMIN_LIST_MOBILE_PROVIDER_DIAL_PREFIX}" sortBy="#{mobileProvider.providerDialPrefix}" filterBy="#{mobileProvider.providerDialPrefix}" filterMatchMode="contains">
<h:outputText value="#{mobileProvider.providerDialPrefix}" />
</p:column>
- <p:column filterBy="#{mobileProvider.providerCountry}" sortBy="#{mobileProvider.providerCountry.countryPhoneCode}" headerText="#{msg.ADMIN_LIST_MOBILE_PROVIDER_COUNTRY}" filterMatchMode="in">
+ <p:column headerText="#{msg.ADMIN_LIST_MOBILE_PROVIDER_COUNTRY}" sortBy="#{mobileProvider.providerCountry.countryPhoneCode}" filterBy="#{mobileProvider.providerCountry}" filterMatchMode="in">
<f:facet name="filter">
- <p:selectCheckboxMenu filter="true" label="#{msg.COUNTRIES}" onchange="PF('mobileProviderTable').filter()" updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_COUNTRY_TITLE}">
+ <p:selectCheckboxMenu filter="true" filterMatchMode="contains" label="#{msg.LABEL_COUNTRIES}" onchange="PF('mobileProviderTable').filter()" updateLabel="true" title="#{msg.FILTER_BY_MULTIPLE_COUNTRY_TITLE}">
<f:converter converterId="CountryConverter" />
<f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{msg[country.countryI18nKey]}" />
</p:selectCheckboxMenu>
<h:outputText value="#{msg[mobileProvider.providerCountry.countryI18nKey]}" />
</p:column>
- <p:column sortBy="#{mobileProvider.providerEntryCreated}" headerText="#{msg.ADMIN_LIST_ENTRY_CREATED}">
+ <p:column headerText="#{msg.ADMIN_LIST_ENTRY_CREATED}" sortBy="#{mobileProvider.providerEntryCreated}">
<h:outputText id="providerEntryCreated" value="#{mobileProvider.providerEntryCreated.time}">
<f:convertDateTime for="providerEntryCreated" type="both" timeStyle="short" dateStyle="short" />
</h:outputText>
</p:column>
- <p:column sortable="false" headerText="#{msg.ADMIN_ACTION_LINKS}">
+ <p:column headerText="#{msg.ADMIN_ACTION_LINKS}" sortable="false">
<links:outputMobileProviderAdminMiniLinks mobileProvider="#{mobileProvider}" />
</p:column>
</p:dataTable>
</div>
<div class="table-right-medium">
- <p:selectOneMenu id="userContact" value="#{adminUserController.contact}" converter="ContactConverter">
+ <p:selectOneMenu
+ id="userContact"
+ value="#{adminUserController.contact}"
+ filter="true"
+ filterMatchMode="contains"
+ >
<f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
<f:selectItems value="#{contactController.selectableContacts()}" var="contact" itemValue="#{contact}" itemLabel="#{contact.contactId}: #{msg[contact.contactPersonalTitle.messageKey]} #{contact.contactFirstName} #{contact.contactFamilyName}" />
</p:selectOneMenu>