- rewrote administrative user list to PrimeFaces with filters and multi-sortable
and resizable columns
- fixed header facet for mobile provider list
- rewrote admin_form_user/contact_data.tpl to response p:panelGrid
- converted div to h:panelGroup
- added more "static" data like personal title, account status and profile mode
- added missing i18n strings
Signed-off-by: Roland Häder <roland@mxchange.org>
// Add employee to cache and list
this.employeeCache.put(event.getEmployee().getEmployeeId(), event.getEmployee());
+ this.allEmployees.add(event.getEmployee());
}
/**
package org.mxchange.jjobs.beans.business.opening_time;
import fish.payara.cdi.jsr107.impl.NamedCache;
+import java.text.MessageFormat;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import javax.cache.Cache;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
+import javax.enterprise.event.Observes;
import javax.inject.Inject;
import javax.inject.Named;
+import org.mxchange.jcontactsbusiness.events.opening_time.added.ObservableOpeningTimeAddedEvent;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTimeSessionBeanRemote;
import org.mxchange.jjobs.beans.BaseJobsBean;
this.allOpeningTimes = new LinkedList<>();
}
+ /**
+ * Observes events being thrown when a new opening time has been added
+ * <p>
+ * @param event Event being fired
+ */
+ public void afterOpeningTimeAddedEvent (@Observes final ObservableOpeningTimeAddedEvent event) {
+ // Validate parameter
+ if (null == event) {
+ // Throw NPE
+ throw new NullPointerException("event is null");
+ } else if (event.getOpeningTime() == null) {
+ // Throw it again
+ throw new NullPointerException("event.openingTime is null");
+ } else if (event.getOpeningTime().getOpeningId() == null) {
+ // Throw it again
+ throw new NullPointerException("event.openingTime.openingId is null");
+ } else if (event.getOpeningTime().getOpeningId() < 1) {
+ // Throw it again
+ throw new NullPointerException(MessageFormat.format("event.openingTime.openingId={0} is invalid", event.getOpeningTime().getOpeningId()));
+ }
+
+ // Add to cache and list
+ this.openingTimesCache.put(event.getOpeningTime().getOpeningId(), event.getOpeningTime());
+ this.allOpeningTimes.add(event.getOpeningTime());
+ }
+
@Override
@SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<OpeningTime> allOpeningTimes () {
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;
+import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
import org.mxchange.jcontactsbusiness.model.opening_time.dayofweek.DayOfTheWeek;
import org.mxchange.jjobs.beans.BaseJobsBean;
import org.mxchange.jproduct.model.payment.PaymentType;
+import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+import org.mxchange.jusercore.model.user.status.UserAccountStatus;
/**
* An application-scoped data bean for any kind of static data
public PaymentType[] getPaymentTypes () {
return PaymentType.values();
}
+
+ /**
+ * Returns a list of all personal titles
+ * <p>
+ * @return A list of all personal titles
+ */
+ public PersonalTitle[] getPersonalTitles () {
+ return PersonalTitle.values();
+ }
+
+ /**
+ * Returns a list of all profile modes <p
+ * <p>
+ * @return A list of all profile modes
+ */
+ public ProfileMode[] getProfileModes () {
+ return ProfileMode.values();
+ }
+
+ /**
+ * Returns a list of all user account statuses
+ * <p>
+ * @return A list of all user account statuses
+ */
+ public UserAccountStatus[] getUserAccountStatuses () {
+ return UserAccountStatus.values();
+ }
}
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 = 542_145_347_916L;
+ /**
+ * List of all users
+ */
+ private final List<User> allUsers;
+
/**
* General contact controller
*/
@Inject
private JobsFeaturesWebApplicationController featureController;
+ /**
+ * List of filtered users
+ */
+ private List<User> filteredUsers;
+
/**
* Locale instance
*/
public JobsUserWebRequestBean () {
// Call super constructor
super();
+
+ // Init list
+ this.allUsers = new LinkedList<>();
}
/**
@Override
@SuppressWarnings ("ReturnOfCollectionOrArrayField")
public List<User> allUsers () {
- // Init list
- final List<User> list = new LinkedList<>();
-
- // Get iterator
- final Iterator<Cache.Entry<Long, User>> iterator = this.userCache.iterator();
-
- // Loop over all
- while (iterator.hasNext()) {
- // Get next entry
- final Cache.Entry<Long, User> next = iterator.next();
-
- // Add value to list
- list.add(next.getValue());
- }
-
- // Return it
- return list;
+ return this.allUsers;
}
/**
return "user_contact_data_saved"; //NOI18N
}
+ /**
+ * Getter for filtered users list
+ * <p>
+ * @return Filtered users list
+ */
+ @SuppressWarnings ("ReturnOfCollectionOrArrayField")
+ public List<User> getFilteredUsers () {
+ return this.filteredUsers;
+ }
+
+ /**
+ * Setter for filtered users list
+ * <p>
+ * @param filteredUsers Filtered users list
+ */
+ @SuppressWarnings ("AssignmentToCollectionOrArrayFieldFromParameter")
+ public void setFilteredUsers (final List<User> filteredUsers) {
+ this.filteredUsers = filteredUsers;
+ }
+
/**
* Getter for user id
* <p>
this.userNameCache.put(next.getUserId(), next.getUserName());
}
}
+
+ // Is cache filled and list is empty
+ if ((this.userCache.iterator().hasNext()) && (this.allUsers.isEmpty())) {
+ // Get iterator
+ final Iterator<Cache.Entry<Long, User>> iterator = this.userCache.iterator();
+
+ // Build up list
+ while (iterator.hasNext()) {
+ // GEt next element
+ final Cache.Entry<Long, User> next = iterator.next();
+
+ // Add to list
+ this.allUsers.add(next.getValue());
+ }
+
+ // Sort list
+ this.allUsers.sort(new Comparator<User>() {
+ @Override
+ public int compare (final User o1, final User o2) {
+ return o1.getUserId() > o2.getUserId() ? 1 : o1.getUserId() < o2.getUserId() ? -1 : 0;
+ }
+ });
+ }
}
@Override
// Remove it from lists
this.userCache.remove(user.getUserId());
+ this.allUsers.remove(user);
// Remove name from list
this.userNameCache.remove(user.getUserId());
// Add/update user
this.userCache.put(user.getUserId(), user);
+ this.allUsers.add(user);
}
}
--- /dev/null
+/*
+ * Copyright (C) 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.jjobs.converter.personal_title;
+
+import javax.faces.convert.EnumConverter;
+import javax.faces.convert.FacesConverter;
+import org.mxchange.jcontacts.model.contact.title.PersonalTitle;
+
+/**
+ * A converter for personal titles
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter("PersonalTitleConverter")
+public class JobsPersonalTitleConverter extends EnumConverter {
+
+ /**
+ * Default constructor which calls the super constructor with the proper
+ * enumeration as class type.
+ */
+ public JobsPersonalTitleConverter () {
+ super(PersonalTitle.class);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 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.jjobs.converter.profile_mode;
+
+import javax.faces.convert.EnumConverter;
+import javax.faces.convert.FacesConverter;
+import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
+
+/**
+ * A converter for profile mode
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter("ProfileModeConverter")
+public class JobsProfileModeConverter extends EnumConverter {
+
+ /**
+ * Default constructor which calls the super constructor with the proper
+ * enumeration as class type.
+ */
+ public JobsProfileModeConverter () {
+ super(ProfileMode.class);
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 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.jjobs.converter.user_account_status;
+
+import javax.faces.convert.EnumConverter;
+import javax.faces.convert.FacesConverter;
+import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+
+/**
+ * A converter for user account status
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@FacesConverter("UserAccountStatusConverter")
+public class JobsUserAccountStatusConverter extends EnumConverter {
+
+ /**
+ * Default constructor which calls the super constructor with the proper
+ * enumeration as class type.
+ */
+ public JobsUserAccountStatusConverter () {
+ super(UserAccountStatus.class);
+ }
+
+}
ADMIN_LINK_ASSIGN_DEPARTMENT_BRANCH_OFFICE_TITLE=Dieser Abteilung eine Filiale zuweisen.
ADMIN_LINK_ASSIGN_DEPARTMENTS_LEAD_EMPLOYEE_TITLE=Dieser Abteilung einen leitenden Mitarbeiter zuweisen.
ADMIN_LINK_ASSIGN_DEPARTMENTS_OWNER_USER_TITLE=Dieser Abteilung einen besitzenden Benutzer zuweisen.
+#@TODO Please fix German umlauts!
+FIELD_PAYMENT_TYPE_REQUIRED=Bitte waehlen Sie eine Zahlungsmethode aus.
+ADMIN_LIST_USERS_HEADER=Liste aller Benutzer
ADMIN_LINK_ASSIGN_DEPARTMENT_BRANCH_OFFICE_TITLE=Assign this department a branch office.
ADMIN_LINK_ASSIGN_DEPARTMENTS_LEAD_EMPLOYEE_TITLE=Assign this department a leading employee.
ADMIN_LINK_ASSIGN_DEPARTMENTS_OWNER_USER_TITLE=Assign this department an owning user.
+FIELD_PAYMENT_TYPE_REQUIRED=Please choose a payment method.
+ADMIN_LIST_USERS_HEADER=List of all users
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
- <p:row rendered="#{empty rendered or rendered}">
- <fieldset class="fieldset">
- <legend title="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE}">
- <h:outputText value="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND}" />
- </legend>
-
- <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full">
- <p:outputLabel for="personalTitle" value="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}" />
- <widgets:outputPersonalTitleSelectionBox targetController="#{adminContactController}" allowEmptyRequiredData="#{allowEmptyRequiredData}" />
-
- <p:outputLabel for="firstName" value="#{msg.ADMIN_PERSONAL_DATA_FIRST_NAME}" />
- <p:inputText styleClass="input" id="firstName" size="10" maxlength="255" value="#{adminContactController.firstName}" />
-
- <p:outputLabel for="title" value="#{msg.ADMIN_PERSONAL_DATA_TITLE}" />
- <p:inputText styleClass="input" id="title" size="5" maxlength="255" value="#{adminContactController.academicTitle}" />
-
- <p:outputLabel for="familyName" value="#{msg.ADMIN_PERSONAL_DATA_FAMILY_NAME}" />
- <p:inputText styleClass="input" id="familyName" size="10" maxlength="255" value="#{adminContactController.familyName}" />
-
- <p:outputLabel for="street" value="#{msg.ADMIN_DATA_STREET_NAME}" />
- <p:inputText styleClass="input" id="street" size="20" maxlength="255" value="#{adminContactController.street}" />
-
- <p:outputLabel for="houseNumber" value="#{msg.ADMIN_DATA_HOUSE_NUMBER}" />
- <p:inputText styleClass="input" id="houseNumber" size="3" maxlength="5" value="#{adminContactController.houseNumber}" validatorMessage="#{msg.ENTERED_HOUSE_NUMBER_INVALID}">
- <f:validateLongRange for="houseNumber" minimum="1" maximum="500" />
- </p:inputText>
-
- <p:outputLabel for="houseNumberExtension" value="#{msg.ADMIN_DATA_HOUSE_NUMBER_EXTENSION}" />
- <p:inputText styleClass="input" id="houseNumberExtension" size="2" maxlength="2" value="#{adminContactController.houseNumberExtension}" />
-
- <p:outputLabel for="zipCode" value="#{msg.ADMIN_DATA_ZIP_CODE}" />
- <p:inputText styleClass="input" id="zipCode" size="5" maxlength="6" value="#{adminContactController.zipCode}" validatorMessage="#{msg.ENTERED_ZIP_CODE_INVALID}">
- <f:validateLongRange for="zipCode" minimum="1" maximum="99999" />
- </p:inputText>
-
- <p:outputLabel for="city" value="#{msg.ADMIN_DATA_CITY}" />
- <p:inputText styleClass="input" id="city" size="10" maxlength="255" value="#{adminContactController.city}" />
-
- <p:outputLabel for="country" value="#{msg.ADMIN_SELECT_COUNTRY}" />
- <widgets:outputCountrySelector id="country" value="#{adminContactController.contactCountry}" />
-
- <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
- <widgets:inputLandLineNumberPanelGrid targetController="#{adminContactController}" />
-
- <p:outputLabel for="faxCountry" value="#{msg.ADMIN_PERSONAL_DATA_FAX_NUMBER}" />
- <widgets:inputFaxNumberPanelGrid targetController="#{adminContactController}" />
-
- <p:outputLabel for="mobileNumber" value="#{msg.ADMIN_PERSONAL_DATA_MOBILE_NUMBER}" />
- <widgets:inputMobileNumberPanelGrid targetController="#{adminContactController}" />
-
- <p:outputLabel for="emailAddress" value="#{msg.DATA_EMAIL_ADDRESS}" />
- <p:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{adminContactController.emailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
- <f:validator for="emailAddress" validatorId="EmailAddressValidator" />
- <f:attribute name="allowEmptyValue" value="#{allowEmptyRequiredData}" />
- </p:inputText>
-
- <p:outputLabel for="contactBirthday" value="#{msg.ADMIN_PERSONAL_DATA_BIRTHDAY}" />
- <p:calendar id="contactBirthday" value="#{contactController.birthday}" />
-
- <p:outputLabel for="contactComment" value="#{msg.ADMIN_PERSONAL_DATA_COMMENT}" />
- <p:inputTextarea id="contactComment" styleClass="input" value="#{adminContactController.comment}" rows="7" cols="35" />
- </p:panelGrid>
- </fieldset>
- </p:row>
-
- <p:row>
- <h:panelGroup styleClass="para notice" layout="block">
- <ul>
- <li>
- <h:outputText value="#{msg.ADMIN_CONTACT_DATA_EMAIL_ADDRESS_NOTICE}" />
- </li>
- </ul>
- </h:panelGroup>
- </p:row>
+ <!--
+ @TODO title="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND_TITLE}"
+ -->
+ <p:fieldset legend="#{msg.ADMIN_CONTACT_PERSONAL_DATA_LEGEND}" rendered="#{empty rendered or rendered}">
+ <p:panelGrid layout="grid" columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
+ <p:outputLabel for="personalTitle" value="#{msg.ADMIN_CONTACT_PERSONAL_TITLE}" />
+ <widgets:outputPersonalTitleSelectionBox targetController="#{adminContactController}" allowEmptyRequiredData="#{allowEmptyRequiredData}" />
+
+ <p:outputLabel for="firstName" value="#{msg.ADMIN_PERSONAL_DATA_FIRST_NAME}" />
+ <p:inputText styleClass="input" id="firstName" size="10" maxlength="255" value="#{adminContactController.firstName}" />
+
+ <p:outputLabel for="title" value="#{msg.ADMIN_PERSONAL_DATA_TITLE}" />
+ <p:inputText styleClass="input" id="title" size="5" maxlength="255" value="#{adminContactController.academicTitle}" />
+
+ <p:outputLabel for="familyName" value="#{msg.ADMIN_PERSONAL_DATA_FAMILY_NAME}" />
+ <p:inputText styleClass="input" id="familyName" size="10" maxlength="255" value="#{adminContactController.familyName}" />
+
+ <p:outputLabel for="street" value="#{msg.ADMIN_DATA_STREET_NAME}" />
+ <p:inputText styleClass="input" id="street" size="20" maxlength="255" value="#{adminContactController.street}" />
+
+ <p:outputLabel for="houseNumber" value="#{msg.ADMIN_DATA_HOUSE_NUMBER}" />
+ <p:inputText styleClass="input" id="houseNumber" size="3" maxlength="5" value="#{adminContactController.houseNumber}" validatorMessage="#{msg.ENTERED_HOUSE_NUMBER_INVALID}">
+ <f:validateLongRange for="houseNumber" minimum="1" maximum="500" />
+ </p:inputText>
+
+ <p:outputLabel for="houseNumberExtension" value="#{msg.ADMIN_DATA_HOUSE_NUMBER_EXTENSION}" />
+ <p:inputText styleClass="input" id="houseNumberExtension" size="2" maxlength="2" value="#{adminContactController.houseNumberExtension}" />
+
+ <p:outputLabel for="zipCode" value="#{msg.ADMIN_DATA_ZIP_CODE}" />
+ <p:inputText styleClass="input" id="zipCode" size="5" maxlength="6" value="#{adminContactController.zipCode}" validatorMessage="#{msg.ENTERED_ZIP_CODE_INVALID}">
+ <f:validateLongRange for="zipCode" minimum="1" maximum="99999" />
+ </p:inputText>
+
+ <p:outputLabel for="city" value="#{msg.ADMIN_DATA_CITY}" />
+ <p:inputText styleClass="input" id="city" size="10" maxlength="255" value="#{adminContactController.city}" />
+
+ <p:outputLabel for="country" value="#{msg.ADMIN_SELECT_COUNTRY}" />
+ <widgets:outputCountrySelector id="country" value="#{adminContactController.contactCountry}" />
+
+ <p:outputLabel for="landLineCountry" value="#{msg.ADMIN_PERSONAL_DATA_PHONE_NUMBER}" />
+ <widgets:inputLandLineNumberPanelGrid targetController="#{adminContactController}" />
+
+ <p:outputLabel for="faxCountry" value="#{msg.ADMIN_PERSONAL_DATA_FAX_NUMBER}" />
+ <widgets:inputFaxNumberPanelGrid targetController="#{adminContactController}" />
+
+ <p:outputLabel for="mobileNumber" value="#{msg.ADMIN_PERSONAL_DATA_MOBILE_NUMBER}" />
+ <widgets:inputMobileNumberPanelGrid targetController="#{adminContactController}" />
+
+ <p:outputLabel for="emailAddress" value="#{msg.DATA_EMAIL_ADDRESS}" />
+ <p:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{adminContactController.emailAddress}" validatorMessage="#{msg.ENTERED_EMAIL_ADDRESS_IS_INVALID}">
+ <f:validator for="emailAddress" validatorId="EmailAddressValidator" />
+ <f:attribute name="allowEmptyValue" value="#{allowEmptyRequiredData}" />
+ </p:inputText>
+
+ <p:outputLabel for="contactBirthday" value="#{msg.ADMIN_PERSONAL_DATA_BIRTHDAY}" />
+ <p:calendar id="contactBirthday" value="#{contactController.birthday}" />
+
+ <p:outputLabel for="contactComment" value="#{msg.ADMIN_PERSONAL_DATA_COMMENT}" />
+ <p:inputTextarea id="contactComment" styleClass="input" value="#{adminContactController.comment}" rows="7" cols="35" />
+ </p:panelGrid>
+ </p:fieldset>
+
+ <h:panelGroup styleClass="para notice" layout="block">
+ <ul>
+ <li>
+ <h:outputText value="#{msg.ADMIN_CONTACT_DATA_EMAIL_ADDRESS_NOTICE}" />
+ </li>
+ </ul>
+ </h:panelGroup>
</ui:composition>
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
- <h:panelGroup styleClass="para" layout="block" rendered="#{not empty mode}">
- <fieldset class="fieldset">
- <legend title="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND_TITLE}">
- <h:outputText value="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND}" />
- </legend>
-
- <h:panelGroup styleClass="table-row" layout="block">
- <div class="table-left-medium">
- <p:outputLabel for="userName" value="#{msg.ADMIN_PERSONAL_DATA_ENTER_USER_NAME}" />
- </div>
-
- <div class="table-right-medium">
- <p:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{adminUserController.userName}" required="true" requiredMessage="#{msg.ADMIN_USER_NAME_IS_REQUIRED}" />
- </div>
- </h:panelGroup>
-
- <h:panelGroup styleClass="error-container" layout="block">
- <p:message for="userName" />
- </h:panelGroup>
-
- <h:panelGroup styleClass="table-row" layout="block">
- <div class="table-left-medium">
- <p:outputLabel for="userPassword" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD}" />
- </div>
-
- <div class="table-right-medium">
- <p:inputText type="secret" styleClass="input" id="userPassword" size="10" maxlength="255" value="#{adminUserController.userPassword}" />
- </div>
- </h:panelGroup>
-
- <h:panelGroup styleClass="error-container" layout="block">
- <p:message for="userPassword" />
- </h:panelGroup>
-
- <h:panelGroup styleClass="table-row" layout="block">
- <div class="table-left-medium">
- <p:outputLabel for="userPasswordRepeat" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD_REPEAT}" />
- </div>
-
- <div class="table-right-medium">
- <p:inputText type="secret" styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{adminUserController.userPasswordRepeat}" />
- </div>
- </h:panelGroup>
-
- <h:panelGroup styleClass="error-container" layout="block">
- <p:message for="userPasswordRepeat" />
- </h:panelGroup>
-
- <h:panelGroup styleClass="table-row" layout="block" rendered="#{featureController.isFeatureEnabled('user_must_change_password')}">
- <div class="table-left-medium">
- <p:outputLabel for="userMustChangePassword" value="#{msg.ADMIN_USER_MUST_CHANGE_PASSWORD}" />
- </div>
-
- <div class="table-right-medium">
- <p:selectBooleanCheckbox id="userMustChangePassword" value="#{adminUserController.userMustChangePassword}" />
- </div>
- </h:panelGroup>
-
- <h:panelGroup styleClass="para notice" layout="block">
- <ul>
- <li><h:outputText value="#{msg.ADMIN_USER_DATA_USER_NAME_NOTICE}" /></li>
-
- <li>
- <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_EDIT_NOTICE}" rendered="#{mode == 'edit'}" />
- <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_ADD_NOTICE}" rendered="#{mode == 'add'}" />
- </li>
- </ul>
- </h:panelGroup>
- </fieldset>
- </h:panelGroup>
+ <!--
+ @TODO title="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND_TITLE}"
+ -->
+ <ui:fragment rendered="#{not empty mode}">
+ <p:fieldset legend="#{msg.ADMIN_USER_DATA_EMAIL_LEGEND}">
+ <p:panelGrid columns="2" columnClasses="ui-grid-col-4, ui-grid-col-8" styleClass="table table-full ui-noborder">
+ <p:outputLabel for="userName" value="#{msg.ADMIN_PERSONAL_DATA_ENTER_USER_NAME}" />
+ <p:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{adminUserController.userName}" required="true" requiredMessage="#{msg.ADMIN_USER_NAME_IS_REQUIRED}" />
+
+ <p:outputLabel for="userPassword" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD}" />
+ <p:inputText type="secret" styleClass="input" id="userPassword" size="10" maxlength="255" value="#{adminUserController.userPassword}" />
+
+ <p:outputLabel for="userPasswordRepeat" value="#{msg.ADMIN_USER_DATA_ENTER_PASSWORD_REPEAT}" />
+ <p:inputText type="secret" styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{adminUserController.userPasswordRepeat}" />
+
+ <p:outputLabel for="userMustChangePassword" value="#{msg.ADMIN_USER_MUST_CHANGE_PASSWORD}" />
+ <p:selectBooleanCheckbox id="userMustChangePassword" value="#{adminUserController.userMustChangePassword}" />
+ </p:panelGrid>
+ </p:fieldset>
+
+ <h:panelGroup styleClass="para notice" layout="block">
+ <ul>
+ <li><h:outputText value="#{msg.ADMIN_USER_DATA_USER_NAME_NOTICE}" /></li>
+
+ <li>
+ <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_EDIT_NOTICE}" rendered="#{mode == 'edit'}" />
+ <h:outputText value="#{msg.ADMIN_USER_DATA_PASSWORD_ADD_NOTICE}" rendered="#{mode == 'add'}" />
+ </li>
+ </ul>
+ </h:panelGroup>
+ </ui:fragment>
</ui:composition>
<widgets:outputAdminUserDataFormFields mode="add" />
- <div class="para notice">
+ <h:panelGroup styleClass="para notice">
<h:outputText value="#{msg.ADMIN_USER_PERSONAL_DATA_MINIMUM_NOTICE}" />
- </div>
+ </h:panelGroup>
<widgets:outputAdminContactDataFormFields allowEmptyRequiredData="true" />
</ui:composition>
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
- <p:panelGrid id="admin_user_profile" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_USER_DATA}" headerClass="table-header-column" styleClass="table table-full" columns="3" rendered="#{not empty beanHelper.user}">
+ <!--
+ @TODO summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_USER_DATA}"
+ -->
+ <p:panelGrid styleClass="table table-full" columns="3" rendered="#{not empty beanHelper.user}">
<f:facet name="header">
<h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_USER}">
<f:param value="#{beanHelper.user.userName}" />
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
- <p:panelGrid id="admin_user_profile" summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_USER_DATA}" headerClass="table-header-column" styleClass="table table-full" columns="3" rendered="#{not empty beanHelper.user}">
+ <!--
+ @TODO summary="#{msg.ADMIN_TABLE_SUMMARY_SHOW_USER_DATA}"
+ -->
+ <p:panelGrid styleClass="table table-full" columns="2" rendered="#{not empty beanHelper.user}">
<f:facet name="header">
<h:outputFormat value="#{msg.ADMIN_HEADER_SHOW_USER}">
<f:param value="#{beanHelper.user.userName}" />
</h:outputFormat>
</f:facet>
- <h:column>
+ <p:column>
<p:outputLabel for="userId" styleClass="table-data-label" value="#{msg.ADMIN_USER_ID}" />
<h:panelGroup styleClass="table-data-field" layout="block">
<f:param name="userId" value="#{beanHelper.user.userId}" />
</p:link>
</h:panelGroup>
- </h:column>
+ </p:column>
<ui:fragment rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
- <h:column>
+ <p:column>
<p:outputLabel for="userName" styleClass="table-data-label" value="#{msg.ADMIN_USER_NAME}" />
<h:outputText id="userName" styleClass="table-data-field" value="#{beanHelper.user.userName}" />
- </h:column>
+ </p:column>
</ui:fragment>
- <h:column>
+ <p:column>
<p:outputLabel for="userCreated" styleClass="table-data-label" value="#{msg.ADMIN_USER_CREATED}" />
<h:outputText id="userCreated" styleClass="table-data-field" value="#{beanHelper.user.userCreated.time}">
<f:convertDateTime for="userCreated" type="both" />
</h:outputText>
- </h:column>
+ </p:column>
- <h:column>
+ <p:column>
<p:outputLabel for="userAccountStatus" styleClass="table-data-label" value="#{msg.ADMIN_USER_ACCOUNT_STATUS}" />
<h:outputText id="userAccountStatus" styleClass="table-data-field #{beanHelper.user.userAccountStatus.styleClass}" value="#{msg[beanHelper.user.userAccountStatus.messageKey]}" />
- </h:column>
+ </p:column>
<widgets:outputContactDataGridColumns />
</p:panelGrid>
tableStyleClass="table table-full"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
- widgetVar="mobileProviderList"
filteredValue="#{mobileProviderController.filteredMobileProviders}"
rows="10"
reflow="true"
>
<f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_MOBILE_PROVIDERS_HEADER}" />
- <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
- <p:columnToggler datasource="table-list-mobile-provider" trigger="toggler" />
+ <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_MOBILE_PROVIDERS_HEADER}" />
+
+ <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
+ <p:columnToggler datasource="table-list-mobile-provider" trigger="toggler" />
+ </p:panelGrid>
</f:facet>
<p:column headerText="#{msg.ADMIN_ID_NUMBER}" sortBy="#{mobileProvider.providerId}" filterBy="#{mobileProvider.providerId}">
title="#{msg.FILTER_BY_MULTIPLE_COUNTRY_TITLE}"
>
<f:converter converterId="CountryConverter" />
- <f:selectItems value="#{countryController.allCountries()}" var="country" itemValue="#{country}" itemLabel="#{msg[country.countryI18nKey]}" />
+ <f:selectItems
+ value="#{countryController.allCountries()}"
+ var="country"
+ itemValue="#{country}"
+ itemLabel="#{msg[country.countryI18nKey]}"
+ />
</p:selectCheckboxMenu>
</f:facet>
value="#{userController.allUsers()}"
tableStyleClass="table table-full"
paginator="true"
+ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
+ filteredValue="#{userController.filteredUsers}"
rows="10"
+ reflow="true"
+ resizableColumns="true"
+ rowsPerPageTemplate="5,10,20,50,100"
+ sortMode="multiple"
summary="#{msg.TABLE_SUMMARY_ADMIN_LIST_USERS}"
emptyMessage="#{msg.ADMIN_EMPTY_LIST_USER}"
widgetVar="userList"
>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_ID}" />
- </f:facet>
+ <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_USERS_HEADER}" />
+
+ <p:commandButton id="toggler" type="button" value="#{msg.SELECT_SHOWN_COLUMNS}" styleClass="column-selector" />
+ <p:columnToggler datasource="table-list-users" trigger="toggler" />
+ </p:panelGrid>
+ </f:facet>
+
+ <p:column headerText="#{msg.ADMIN_USER_ID}" sortBy="#{user.userId}" filterBy="#{user.userId}" filterMatchMode="contains">
<p:link outcome="admin_show_user" title="#{msg.ADMIN_LINK_SHOW_USER_TITLE}" value="#{user.userId}">
<f:param name="userId" value="#{user.userId}" />
</p:link>
</p:column>
- <ui:fragment rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_USER_NAME}" />
- </f:facet>
-
- <h:outputText value="#{user.userName}" />
- </p:column>
- </ui:fragment>
+ <p:column headerText="#{msg.ADMIN_LIST_USER_NAME}" sortBy="#{user.userName}" filterBy="#{user.userName}" filterMatchMode="contains" rendered="#{featureController.isFeatureEnabled('user_login_require_user_name')}">
+ <h:outputText value="#{user.userName}" />
+ </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="#{user.userContact.contactPersonalTitle}" filterBy="#{user.userContact.contactPersonalTitle}" filterMatchMode="exact">
+ <f:facet name="filter">
+ <p:selectOneMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_PERSONAL_TITLES}"
+ onchange="PF('userList').filter()"
+ title="#{msg.FILTER_BY_SINGLE_PERSONAL_TITLE}"
+ >
+ <f:converter converterId="PersonalTitleConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems
+ value="#{dataController.personalTitles}"
+ var="personalTitle"
+ itemValue="#{personalTitle}"
+ itemLabel="#{msg[personalTitle.messageKey]}"
+ />
+ </p:selectOneMenu>
</f:facet>
<h:outputText value="#{msg[user.userContact.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="#{user.userContact.contactFirstName}" filterBy="#{user.userContact.contactFirstName}" filterMatchMode="contains">
<h:outputText value="#{user.userContact.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="#{user.userContact.contactFamilyName}" filterBy="#{user.userContact.contactFamilyName}" filterMatchMode="contains">
<h:outputText value="#{user.userContact.contactFamilyName}" />
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_ACCOUNT_STATUS}" />
+ <p:column headerText="#{msg.ADMIN_USER_ACCOUNT_STATUS}" sortBy="#{user.userAccountStatus}" filterBy="#{user.userAccountStatus}" filterMatchMode="exact">
+ <f:facet name="filter">
+ <p:selectOneMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_ACCOUNT_STATUS}"
+ onchange="PF('userList').filter()"
+ title="#{msg.FILTER_BY_SINGLE_ACCOUNT_STATUS_TITLE}"
+ >
+ <f:converter converterId="UserAccountStatusConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems
+ value="#{dataController.userAccountStatuses}"
+ var="accountStatus"
+ itemValue="#{accountStatus}"
+ itemLabel="#{msg[accountStatus.messageKey]}"
+ />
+ </p:selectOneMenu>
</f:facet>
<h:outputText styleClass="#{user.userAccountStatus.styleClass}" value="#{msg[user.userAccountStatus.messageKey]}" />
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_USER_PROFILE_MODE}" />
+ <p:column headerText="#{msg.ADMIN_USER_PROFILE_MODE}" sortBy="#{user.userProfileMode}" filterBy="#{user.userProfileMode}" filterMatchMode="exact">
+ <f:facet name="filter">
+ <p:selectOneMenu
+ filter="true"
+ filterMatchMode="contains"
+ label="#{msg.LABEL_PROFILE_MODE}"
+ onchange="PF('userList').filter()"
+ title="#{msg.FILTER_BY_SINGLE_PROFILE_MODE_TITLE}"
+ >
+ <f:converter converterId="ProfileModeConverter" />
+ <f:selectItem itemValue="#{null}" itemLabel="#{msg.NONE_SELECTED}" />
+ <f:selectItems
+ value="#{dataController.profileModes}"
+ var="profileMode"
+ itemValue="#{profileMode}"
+ itemLabel="#{msg[profileMode.messageKey]}"
+ />
+ </p:selectOneMenu>
</f:facet>
<h:outputText value="#{msg[user.userProfileMode.messageKey]}" />
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_LIST_ENTRY_CREATED}" />
- </f:facet>
-
+ <p:column headerText="#{msg.ADMIN_LIST_ENTRY_CREATED}" sortBy="#{user.userCreated}" filterable="false">
<h:outputText id="userCreated" value="#{user.userCreated.time}">
<f:convertDateTime for="userCreated" type="both" timeStyle="short" dateStyle="short" />
</h:outputText>
</p:column>
- <p:column>
- <f:facet name="header">
- <h:outputText value="#{msg.ADMIN_ACTION_LINKS}" />
- </f:facet>
-
+ <p:column headerText="#{msg.ADMIN_ACTION_LINKS}" sortable="false" filterable="false">
<links:outputUserAdminMiniLinks user="#{user}" />
</p:column>
</p:dataTable>
</h:form>
<h:form>
- <h:panelGroup styleClass="table table-full" layout="block">
- <div class="table-header">
+ <p:panelGrid columns="1" styleClass="table table-full" layout="grid">
+ <f:facet name="header">
<h:outputText value="#{msg.ADMIN_ADD_USER_TITLE}" />
- </div>
+ </f:facet>
<!-- Whether select contact data .. //-->
- <h:panelGroup id="admin_user_personal_data_option_1" styleClass="para" layout="block">
- <fieldset class="fieldset">
- <legend title="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND_TITLE}">
- <h:outputText value="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND}" />
- </legend>
-
- <h:panelGroup styleClass="table-row" layout="block">
- <div class="table-left-medium">
- <p:outputLabel for="userContact" value="#{msg.ADMIN_SELECT_USER_CONTACT}" />
- </div>
-
- <div class="table-right-medium">
- <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>
- </div>
- </h:panelGroup>
- </fieldset>
- </h:panelGroup>
-
- <h:panelGroup styleClass="para" layout="block">
+ <!--
+ @TODO title="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND_TITLE}"
+ -->
+ <p:fieldset legend="#{msg.ADMIN_SELECT_USER_CONTACT_LEGEND}">
+ <p:panelGrid columns="2" columnClasses="ui-grid-col-3, ui-grid-col-9" styleClass="table table-full ui-noborder" layout="grid">
+ <p:outputLabel for="userContact" value="#{msg.ADMIN_SELECT_USER_CONTACT}" />
+ <p:selectOneMenu
+ id="userContact"
+ value="#{adminUserController.contact}"
+ filter="true"
+ filterMatchMode="contains"
+ >
+ <f:converter converterId="ContactConverter" />
+ <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>
+ </p:panelGrid>
+ </p:fieldset>
+
+ <h:panelGroup layout="block">
<h:outputText value="#{msg.ADMIN_ADD_OR_ENTER_CONTACT_DATA}" />
</h:panelGroup>
<!-- ... or enter it directly together it creating user account //-->
- <h:panelGroup id="admin_user_personal_data_option_2" layout="block">
+ <h:panelGroup layout="block">
<ui:include src="/WEB-INF/templates/admin/user/admin_form_user_personal_data.tpl" />
</h:panelGroup>
- <div class="table-footer">
- <p:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <p:commandButton
- styleClass="submit"
- type="submit"
- id="submit_add_user"
- value="#{msg.BUTTON_ADMIN_ADD_USER}"
- action="#{adminUserController.addUser()}"
- update=":master:form-list-users:table-list-users"
- />
- </div>
- </h:panelGroup>
+ <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"
+ id="submit_add_user"
+ value="#{msg.BUTTON_ADMIN_ADD_USER}"
+ action="#{adminUserController.addUser()}"
+ update=":master:form-list-users:table-list-users"
+ />
+ </p:panelGrid>
+ </f:facet>
+ </p:panelGrid>
</h:form>
</ui:define>
</ui:composition>