]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 27 Apr 2016 15:40:49 +0000 (17:40 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 Apr 2016 20:23:03 +0000 (22:23 +0200)
- the email address is now optional (nullable), so updated all i18n strings
- moved data check to createContactInstance()
- added message about minimum data

src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java
web/admin/contact/admin_contact_list.xhtml

index cda53236c1e8fba5d99fb1eb230b20345bd7e108..46aaba87d97b4e75cba43a0e9fbd9950b69265e1 100644 (file)
@@ -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.
index 20c3430c6963f15b6a8adbcc529c4223b76cb26f..79b38f9e3c454c198f2f0e2318d8e0787cbf45e9 100644 (file)
@@ -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.
index 5a53d610d676f8753786b93b222d4c2c80a6df70..2c633ddd4cfb7ca0e9c26974d982f5146aed5202 100644 (file)
@@ -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());
index 4da2efb2442143a0af90b34dba48a666b9419407..84bfe2834dd26d8c2f670684d909e4a5d8fc1e7f 100644 (file)
                                                #{msg.ADMIN_ADD_CONTACT_TITLE}
                                        </div>
 
+                                       <div class="para">
+                                               <h:outputText value="#{msg.ADMIN_ADD_CONTACT_MINIMUM_DATA}" />
+                                       </div>
+
                                        <ui:include src="/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl" />
 
                                        <div class="table_footer">