From 2f6b9f05e6cb1a9a92537fd63b91074bb0aa8354 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 2 Oct 2022 19:42:56 +0200 Subject: [PATCH] Please cherry-pick: - these checks on if registered or not or provided or not makes here no sense and has caused forms not accepting email addresses - renamed template - added country Hungary --- .../basicdata/JobsBasicDataEmailAddressValidator.java | 8 +------- .../JobsBranchOfficeEmailAddressValidator.java | 8 +------- .../employee/JobsEmployeeEmailAddressValidator.java | 8 +------- .../headquarter/JobsHeadquarterEmailAddressValidator.java | 8 +------- .../org/mxchange/localization/generic_de_DE.properties | 1 + .../org/mxchange/localization/generic_en_US.properties | 1 + ...rm_headquarter.tpl => admin_form_headquarter_data.tpl} | 0 web/admin/headquarter/admin_headquarter_list.xhtml | 2 +- 8 files changed, 7 insertions(+), 29 deletions(-) rename web/WEB-INF/templates/admin/headquarter/{admin_form_headquarter.tpl => admin_form_headquarter_data.tpl} (100%) diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java index 0967f56d..e594288c 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/basicdata/JobsBasicDataEmailAddressValidator.java @@ -109,16 +109,10 @@ public class JobsBasicDataEmailAddressValidator extends BaseStringValidator { final Boolean isRegistered = BASIC_DATA_LIST_CONTROLLER.isEmailAddressRegistered(emailAddress); // Is the email address already registered? - if ((!clientId.endsWith("companyEmailAddress")) && (isRegistered)) { //NOI18N + if ((clientId.endsWith("companyEmailAddress")) && isRegistered) { //NOI18N // Generate message final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N - // No, then abort here - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); - } else if ((clientId.endsWith("companyEmailAddress")) && (!isRegistered)) { //NOI18N - // Generate message - final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N - // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); } diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java index 79522ecd..53b8dadf 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/branchoffice/JobsBranchOfficeEmailAddressValidator.java @@ -106,16 +106,10 @@ public class JobsBranchOfficeEmailAddressValidator extends BaseStringValidator { final Boolean isRegistered = BRANCH_OFFICE_LIST_CONTROLLER.isEmailAddressRegistered(emailAddress); // Is the email address already registered? - if ((!clientId.endsWith("branchEmailAddress")) && (isRegistered)) { //NOI18N + if ((clientId.endsWith("branchEmailAddress")) && isRegistered) { //NOI18N // Generate message final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N - // No, then abort here - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); - } else if ((clientId.endsWith("branchEmailAddress")) && (!isRegistered)) { //NOI18N - // Generate message - final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N - // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); } diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/employee/JobsEmployeeEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/employee/JobsEmployeeEmailAddressValidator.java index fbe1ddbc..e2706e25 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/employee/JobsEmployeeEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/employee/JobsEmployeeEmailAddressValidator.java @@ -109,16 +109,10 @@ public class JobsEmployeeEmailAddressValidator extends BaseStringValidator { final Boolean isRegistered = EMPLOYEE_LIST_CONTROLLER.isEmailAddressRegistered(emailAddress); // Is the email address already registered? - if ((!clientId.endsWith("employeeEmailAddress")) && (isRegistered)) { //NOI18N + if ((clientId.endsWith("employeeEmailAddress")) && isRegistered) { //NOI18N // Generate message final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N - // No, then abort here - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); - } else if ((clientId.endsWith("employeeEmailAddress")) && (!isRegistered)) { //NOI18N - // Generate message - final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N - // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); } diff --git a/src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java b/src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java index a9c5ef78..aca5ed5e 100644 --- a/src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java +++ b/src/java/org/mxchange/jjobs/validator/emailaddress/headquarter/JobsHeadquarterEmailAddressValidator.java @@ -109,16 +109,10 @@ public class JobsHeadquarterEmailAddressValidator extends BaseStringValidator { final Boolean isRegistered = HEADQUARTER_LIST_CONTROLLER.isEmailAddressRegistered(emailAddress); // Is the email address already registered? - if ((!clientId.endsWith("headquarterEmailAddress")) && (isRegistered)) { //NOI18N + if ((clientId.endsWith("headquarterEmailAddress")) && isRegistered) { //NOI18N // Generate message final String message = MessageFormat.format("Email address {0} is already registered.", emailAddress); //NOI18N - // No, then abort here - throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); - } else if ((clientId.endsWith("headquarterEmailAddress")) && (!isRegistered)) { //NOI18N - // Generate message - final String message = MessageFormat.format("Email address {0} is not registered.", emailAddress); //NOI18N - // No, then abort here throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_INFO, message, message)); } diff --git a/src/java/org/mxchange/localization/generic_de_DE.properties b/src/java/org/mxchange/localization/generic_de_DE.properties index 5b754648..1c615275 100644 --- a/src/java/org/mxchange/localization/generic_de_DE.properties +++ b/src/java/org/mxchange/localization/generic_de_DE.properties @@ -132,6 +132,7 @@ COUNTRY_DANMARK=D\u00e4nemark COUNTRY_FRANCE=Frankreich COUNTRY_GERMANY=Deutschland COUNTRY_GREECE=Griechenland +COUNTRY_HUNGARY=Ungarn COUNTRY_ITALIA=Italien COUNTRY_NETHERLANDS=Niederlande COUNTRY_PHILIPPINES=Philippinen diff --git a/src/java/org/mxchange/localization/generic_en_US.properties b/src/java/org/mxchange/localization/generic_en_US.properties index 9c8323cc..60610585 100644 --- a/src/java/org/mxchange/localization/generic_en_US.properties +++ b/src/java/org/mxchange/localization/generic_en_US.properties @@ -132,6 +132,7 @@ COUNTRY_DANMARK=Danmark COUNTRY_FRANCE=France COUNTRY_GERMANY=Germany COUNTRY_GREECE=Greece +COUNTRY_HUNGARY=Hungary COUNTRY_ITALIA=Italia COUNTRY_NETHERLANDS=Netherlands COUNTRY_PHILIPPINES=Philippines diff --git a/web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl b/web/WEB-INF/templates/admin/headquarter/admin_form_headquarter_data.tpl similarity index 100% rename from web/WEB-INF/templates/admin/headquarter/admin_form_headquarter.tpl rename to web/WEB-INF/templates/admin/headquarter/admin_form_headquarter_data.tpl diff --git a/web/admin/headquarter/admin_headquarter_list.xhtml b/web/admin/headquarter/admin_headquarter_list.xhtml index c19e0f27..28cd7296 100644 --- a/web/admin/headquarter/admin_headquarter_list.xhtml +++ b/web/admin/headquarter/admin_headquarter_list.xhtml @@ -310,7 +310,7 @@ - + -- 2.39.5