From: Roland Häder Date: Wed, 27 Apr 2016 15:40:49 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0ce9f642972db6a8d8f28638072f8a39c65d6e8a;p=pizzaservice-war.git Continued: - the email address is now optional (nullable), so updated all i18n strings - moved data check to createContactInstance() - added message about minimum data --- diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index cda53236..46aaba87 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -149,10 +149,10 @@ ADMIN_PERSONAL_DATA_COUNTRY_CODE=Land ausw\u00e4hlen: ADMIN_PERSONAL_DATA_PHONE_NUMBER=Telefonnummer: ADMIN_PERSONAL_DATA_FAX_NUMBER=Faxnummer: ADMIN_PERSONAL_DATA_CELLPHONE_NUMBER=Handynummer: -ADMIN_USER_DATA_EMAIL_LEGEND=Benutzernamen und Email-Adresse: -ADMIN_USER_DATA_EMAIL_LEGEND_TITLE=Vergeben Sie hier den Benutzernamen und geben Sie die Email-Adresse ein. +ADMIN_USER_DATA_EMAIL_LEGEND=Benutzernamen: +ADMIN_USER_DATA_EMAIL_LEGEND_TITLE=Vergeben Sie hier den Benutzernamen. ADMIN_USER_DATA_ENTER_USER_NAME=Benutzername (*1): -ADMIN_USER_DATA_ENTER_EMAIL=Email-Adresse (*2): +ADMIN_PERSONAL_DATA_ENTER_EMAIL=Email-Adresse (*2): ADMIN_USER_DATA_USER_NAME_NOTICE=*1: Der Benutzername darf nur einmal vorhanden sein, das System pr\u00fcft dies f\u00fcr Sie. ADMIN_USER_DATA_PASSWORD_ADD_NOTICE=Lassen Sie beide Passwortfelder leer und es wird ein Passwort per Zufall generiert. Das Passwort wird dem Benutzer nach Erstellung des Zugangs an die Email-Adresse gesendet. ADMIN_USER_DATA_EMAIL_ADDRESS_NOTICE=*2: Die Email-Adresse darf nur einmal vorhanden sein. @@ -356,3 +356,4 @@ ADMIN_MENU_CONTACT_TITLE=Manage contact data LINK_ADMIN_LIST_CONTACT=Kontaktdaten auflisten LINK_ADMIN_LIST_CONTACT_TITLE=Listet alle Kontaktdaten auf, egal wo her sie angelegt wurden. ERROR_PARAMETER_CELLPHONE_NUMBER_USER_NOT_SET=Fehler: Parameter 'cellphoneNumber' und 'user' nicht gesetzt. +ADMIN_ADD_CONTACT_MINIMUM_DATA=Bitte geben Sie mindestens Anrede, Vorname und Nachname an. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 20c3430c..79b38f9e 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -150,10 +150,10 @@ ADMIN_PERSONAL_DATA_COUNTRY_CODE=Select country: ADMIN_PERSONAL_DATA_PHONE_NUMBER=Phone number: ADMIN_PERSONAL_DATA_FAX_NUMBER=Fax number: ADMIN_PERSONAL_DATA_CELLPHONE_NUMBER=Mobile number: -ADMIN_USER_DATA_EMAIL_LEGEND=User name and email address: -ADMIN_USER_DATA_EMAIL_LEGEND_TITLE=Enter here a user name and email address. +ADMIN_USER_DATA_EMAIL_LEGEND=User name: +ADMIN_USER_DATA_EMAIL_LEGEND_TITLE=Enter here a user name. ADMIN_USER_DATA_ENTER_USER_NAME=User name (*1): -ADMIN_USER_DATA_ENTER_EMAIL=Email address (*2): +ADMIN_PERSONAL_DATA_ENTER_EMAIL=Email address (*2): ADMIN_USER_DATA_USER_NAME_NOTICE=*1: The user name must be unique which is checked by the system for you. ADMIN_USER_DATA_PASSWORD_ADD_NOTICE=Keep both password fields empty to create a random password. The password is being sent to the user's email address after creation of the account. ADMIN_USER_DATA_EMAIL_ADDRESS_NOTICE=*2: The email address must be unique. @@ -357,3 +357,4 @@ ADMIN_MENU_CONTACT_TITLE=Manage contact data LINK_ADMIN_LIST_CONTACT=List contact data LINK_ADMIN_LIST_CONTACT_TITLE=Lists all contact data regardless where they was created. ERROR_PARAMETER_CELLPHONE_NUMBER_USER_NOT_SET=Error: Parameter 'cellphoneNumber' and 'user' are not set. +ADMIN_ADD_CONTACT_MINIMUM_DATA=Please enter at least gender, first name and family name. diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java index 5a53d610..2c633ddd 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java @@ -247,24 +247,6 @@ public class PizzaAdminContactWebRequestBean implements PizzaAdminContactWebRequ @Override public String addContact () { - // Are all minimum fields set? - if (this.getGender() == null) { - // Throw NPE - throw new NullPointerException("gender is null"); //NOI18N - } else if (this.getFirstName() == null) { - // Throw NPE - throw new NullPointerException("firstName is null"); //NOI18N - } else if (this.getFirstName().isEmpty()) { - // Empty string - throw new IllegalStateException("firstName is empty"); //NOI18N - } else if (this.getFamilyName() == null) { - // Throw NPE - throw new NullPointerException("familyName is null"); //NOI18N - } else if (this.getFamilyName().isEmpty()) { - // Empty string - throw new IllegalStateException("familyName is empty"); //NOI18N - } - // Create new contact instance Contact contact = this.createContactInstance(); @@ -391,6 +373,24 @@ public class PizzaAdminContactWebRequestBean implements PizzaAdminContactWebRequ @Override public Contact createContactInstance () { + // Are all minimum fields set? + if (this.getGender() == null) { + // Throw NPE + throw new NullPointerException("gender is null"); //NOI18N + } else if (this.getFirstName() == null) { + // Throw NPE + throw new NullPointerException("firstName is null"); //NOI18N + } else if (this.getFirstName().isEmpty()) { + // Empty string + throw new IllegalStateException("firstName is empty"); //NOI18N + } else if (this.getFamilyName() == null) { + // Throw NPE + throw new NullPointerException("familyName is null"); //NOI18N + } else if (this.getFamilyName().isEmpty()) { + // Empty string + throw new IllegalStateException("familyName is empty"); //NOI18N + } + // Generate phone number DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber()); DialableCellphoneNumber cellphone = new CellphoneNumber(this.getCellphoneCarrier(), this.getCellphoneNumber()); diff --git a/web/admin/contact/admin_contact_list.xhtml b/web/admin/contact/admin_contact_list.xhtml index 4da2efb2..84bfe283 100644 --- a/web/admin/contact/admin_contact_list.xhtml +++ b/web/admin/contact/admin_contact_list.xhtml @@ -64,6 +64,10 @@ #{msg.ADMIN_ADD_CONTACT_TITLE} +
+ +
+