From af906900e95f0ff184ec28ba02f63ef79f3eaef8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Aug 2016 18:05:34 +0200 Subject: [PATCH] Please cherry-pick: - fixed phone -> landLine != mobile number --- .../JobsAdminContactWebRequestBean.java | 98 +++++++++---------- .../JobsAdminContactWebRequestController.java | 12 +-- .../contact/JobsContactWebSessionBean.java | 78 +++++++-------- .../JobsContactWebSessionController.java | 12 +-- .../admin/contact/admin_form_contact_data.tpl | 6 +- .../templates/contact/form_contact_data.tpl | 8 +- 6 files changed, 107 insertions(+), 107 deletions(-) diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java index 83e517dc..63d9e053 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestBean.java @@ -194,39 +194,39 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement private boolean isMobileUnlinked; /** - * Land-line id number + * Land-line number area code */ - private Long landLineId; + private Integer landLineAreaCode; /** - * Mobile number + * Country instance for land-line number */ - private Long mobileNumber; + private Country landLineCountry; /** - * Mobile id number + * Land-line id number */ - private Long mobileNumberId; + private Long landLineId; /** - * Mobile provider + * Land-line number */ - private MobileProvider mobileProvider; + private Long landLineNumber; /** - * Phone number area code + * Mobile number */ - private Integer phoneAreaCode; + private Long mobileNumber; /** - * Country instance for phone number + * Mobile id number */ - private Country phoneCountry; + private Long mobileNumberId; /** - * Phone number + * Mobile provider */ - private Long phoneNumber; + private MobileProvider mobileProvider; /** * Street @@ -390,9 +390,9 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement // .. land-line data if (contact.getContactLandLineNumber() instanceof DialableLandLineNumber) { this.setLandLineId(contact.getContactLandLineNumber().getPhoneId()); - this.setPhoneAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode()); - this.setPhoneCountry(contact.getContactLandLineNumber().getPhoneCountry()); - this.setPhoneNumber(contact.getContactLandLineNumber().getPhoneNumber()); + this.setLandLineAreaCode(contact.getContactLandLineNumber().getPhoneAreaCode()); + this.setLandLineCountry(contact.getContactLandLineNumber().getPhoneCountry()); + this.setLandLineNumber(contact.getContactLandLineNumber().getPhoneNumber()); } } @@ -669,73 +669,73 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement } @Override - public Long getLandLineId () { - return this.landLineId; + public Integer getLandLineAreaCode () { + return this.landLineAreaCode; } @Override - public void setLandLineId (final Long landLineId) { - this.landLineId = landLineId; + public void setLandLineAreaCode (final Integer landLineAreaCode) { + this.landLineAreaCode = landLineAreaCode; } @Override - public Long getMobileNumber () { - return this.mobileNumber; + public Country getLandLineCountry () { + return this.landLineCountry; } @Override - public void setMobileNumber (Long mobileNumber) { - this.mobileNumber = mobileNumber; + public void setLandLineCountry (final Country landLineCountry) { + this.landLineCountry = landLineCountry; } @Override - public Long getMobileNumberId () { - return this.mobileNumberId; + public Long getLandLineId () { + return this.landLineId; } @Override - public void setMobileNumberId (final Long mobileNumberId) { - this.mobileNumberId = mobileNumberId; + public void setLandLineId (final Long landLineId) { + this.landLineId = landLineId; } @Override - public MobileProvider getMobileProvider () { - return this.mobileProvider; + public Long getLandLineNumber () { + return this.landLineNumber; } @Override - public void setMobileProvider (final MobileProvider mobileProvider) { - this.mobileProvider = mobileProvider; + public void setLandLineNumber (final Long landLineNumber) { + this.landLineNumber = landLineNumber; } @Override - public Integer getPhoneAreaCode () { - return this.phoneAreaCode; + public Long getMobileNumber () { + return this.mobileNumber; } @Override - public void setPhoneAreaCode (final Integer phoneAreaCode) { - this.phoneAreaCode = phoneAreaCode; + public void setMobileNumber (Long mobileNumber) { + this.mobileNumber = mobileNumber; } @Override - public Country getPhoneCountry () { - return this.phoneCountry; + public Long getMobileNumberId () { + return this.mobileNumberId; } @Override - public void setPhoneCountry (final Country phoneCountry) { - this.phoneCountry = phoneCountry; + public void setMobileNumberId (final Long mobileNumberId) { + this.mobileNumberId = mobileNumberId; } @Override - public Long getPhoneNumber () { - return this.phoneNumber; + public MobileProvider getMobileProvider () { + return this.mobileProvider; } @Override - public void setPhoneNumber (final Long phoneNumber) { - this.phoneNumber = phoneNumber; + public void setMobileProvider (final MobileProvider mobileProvider) { + this.mobileProvider = mobileProvider; } @Override @@ -794,9 +794,9 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement // - contact data this.setEmailAddress(null); - this.setPhoneCountry(null); - this.setPhoneAreaCode(null); - this.setPhoneNumber(null); + this.setLandLineCountry(null); + this.setLandLineAreaCode(null); + this.setLandLineNumber(null); this.setMobileProvider(null); this.setMobileNumber(null); this.setFaxCountry(null); @@ -868,7 +868,7 @@ public class JobsAdminContactWebRequestBean extends BaseJobsController implement this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileProvider(), this.getMobileNumber()); // Update contact's land-line number - this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber()); + this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); // Update contact's fax number this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java index 127f1218..388a0487 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsAdminContactWebRequestController.java @@ -350,42 +350,42 @@ public interface JobsAdminContactWebRequestController extends Serializable { *

* @return Phone number's area code */ - Integer getPhoneAreaCode (); + Integer getLandLineAreaCode (); /** * Setter for phone number's area code *

* @param phoneAreaCode Phone number's area code */ - void setPhoneAreaCode (final Integer phoneAreaCode); + void setLandLineAreaCode (final Integer phoneAreaCode); /** * Getter for phone number's country instance *

* @return Phone number's country instance */ - Country getPhoneCountry (); + Country getLandLineCountry (); /** * Setter for phone number's country instance *

* @param phoneCountry Phone number's country instance */ - void setPhoneCountry (final Country phoneCountry); + void setLandLineCountry (final Country phoneCountry); /** * Getter for phone number *

* @return Phone number */ - Long getPhoneNumber (); + Long getLandLineNumber (); /** * Setter for phone number *

* @param phoneNumber Phone number */ - void setPhoneNumber (final Long phoneNumber); + void setLandLineNumber (final Long phoneNumber); /** * Street diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index 0fe1152a..2022b318 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -175,29 +175,29 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job private boolean isMobileUnlinked; /** - * Mobile number + * Land-line number area code */ - private Long mobileNumber; + private Integer landLineAreaCode; /** - * Mobile provider + * Country instance for land-line number */ - private MobileProvider mobileProvider; + private Country landLineCountry; /** - * Phone number area code + * Land-line number */ - private Integer phoneAreaCode; + private Long landLineNumber; /** - * Country instance for phone number + * Mobile number */ - private Country phoneCountry; + private Long mobileNumber; /** - * Phone number + * Mobile provider */ - private Long phoneNumber; + private MobileProvider mobileProvider; /** * A list of all selectable contacts @@ -473,7 +473,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job } // Generate phone number - DialableLandLineNumber phone = new LandLineNumber(this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber()); + DialableLandLineNumber phone = new LandLineNumber(this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); DialableMobileNumber mobile = new MobileNumber(this.getMobileProvider(), this.getMobileNumber()); DialableFaxNumber fax = new FaxNumber(this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); @@ -492,7 +492,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job // Debug message //* NOISY-DEBUG: */ System.out.println(MessageFormat.format("{0}.createContactInstance: this.emailAddress={1}", this.getClass().getSimpleName(), this.getEmailAddress())); // Don't set null or wrong references - if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) && (this.getPhoneNumber() > 0)) { + if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getLandLineAreaCode() != null) && (this.getLandLineNumber() != null) && (this.getLandLineAreaCode() > 0) && (this.getLandLineNumber() > 0)) { // Now the number must be given if (phone.getPhoneAreaCode() == null) { // Is null @@ -592,7 +592,7 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job this.isMobileUnlinked = ContactUtils.updateCellPhoneNumber(contact, this.getMobileProvider(), this.getMobileNumber()); // Update contact's land-line number - this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getPhoneCountry(), this.getPhoneAreaCode(), this.getPhoneNumber()); + this.isLandLineUnlinked = ContactUtils.updateLandLineNumber(contact, this.getLandLineCountry(), this.getLandLineAreaCode(), this.getLandLineNumber()); // Update contact's fax number this.isFaxUnlinked = ContactUtils.updateFaxNumber(contact, this.getFaxCountry(), this.getFaxAreaCode(), this.getFaxNumber()); @@ -758,53 +758,53 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job } @Override - public Long getMobileNumber () { - return this.mobileNumber; + public Integer getLandLineAreaCode () { + return this.landLineAreaCode; } @Override - public void setMobileNumber (Long mobileNumber) { - this.mobileNumber = mobileNumber; + public void setLandLineAreaCode (final Integer landLineAreaCode) { + this.landLineAreaCode = landLineAreaCode; } @Override - public MobileProvider getMobileProvider () { - return this.mobileProvider; + public Country getLandLineCountry () { + return this.landLineCountry; } @Override - public void setMobileProvider (final MobileProvider mobileProvider) { - this.mobileProvider = mobileProvider; + public void setLandLineCountry (final Country landLineCountry) { + this.landLineCountry = landLineCountry; } @Override - public Integer getPhoneAreaCode () { - return this.phoneAreaCode; + public Long getLandLineNumber () { + return this.landLineNumber; } @Override - public void setPhoneAreaCode (final Integer phoneAreaCode) { - this.phoneAreaCode = phoneAreaCode; + public void setLandLineNumber (final Long landLineNumber) { + this.landLineNumber = landLineNumber; } @Override - public Country getPhoneCountry () { - return this.phoneCountry; + public Long getMobileNumber () { + return this.mobileNumber; } @Override - public void setPhoneCountry (final Country phoneCountry) { - this.phoneCountry = phoneCountry; + public void setMobileNumber (Long mobileNumber) { + this.mobileNumber = mobileNumber; } @Override - public Long getPhoneNumber () { - return this.phoneNumber; + public MobileProvider getMobileProvider () { + return this.mobileProvider; } @Override - public void setPhoneNumber (final Long phoneNumber) { - this.phoneNumber = phoneNumber; + public void setMobileProvider (final MobileProvider mobileProvider) { + this.mobileProvider = mobileProvider; } @Override @@ -1047,9 +1047,9 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job // - contact data this.setEmailAddress(null); this.setEmailAddressRepeat(null); - this.setPhoneAreaCode(null); - this.setPhoneCountry(null); - this.setPhoneNumber(null); + this.setLandLineAreaCode(null); + this.setLandLineCountry(null); + this.setLandLineNumber(null); this.setMobileProvider(null); this.setMobileNumber(null); this.setFaxAreaCode(null); @@ -1102,9 +1102,9 @@ public class JobsContactWebSessionBean extends BaseJobsController implements Job // - contact data if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneAreaCode() > 0)) { - this.setPhoneCountry(phone.getPhoneCountry()); - this.setPhoneAreaCode(phone.getPhoneAreaCode()); - this.setPhoneNumber(phone.getPhoneNumber()); + this.setLandLineCountry(phone.getPhoneCountry()); + this.setLandLineAreaCode(phone.getPhoneAreaCode()); + this.setLandLineNumber(phone.getPhoneNumber()); } if ((mobile instanceof DialableMobileNumber) && (mobile.getMobileProvider() instanceof MobileProvider)) { diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java index bdc31008..ee3c6a00 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionController.java @@ -371,42 +371,42 @@ public interface JobsContactWebSessionController extends Serializable { *

* @return Phone number's area code */ - Integer getPhoneAreaCode (); + Integer getLandLineAreaCode (); /** * Setter for phone number's area code *

* @param phoneAreaCode Phone number's area code */ - void setPhoneAreaCode (final Integer phoneAreaCode); + void setLandLineAreaCode (final Integer phoneAreaCode); /** * Getter for phone number's country instance *

* @return Phone number's country instance */ - Country getPhoneCountry (); + Country getLandLineCountry (); /** * Setter for phone number's country instance *

* @param phoneCountry Phone number's country instance */ - void setPhoneCountry (final Country phoneCountry); + void setLandLineCountry (final Country phoneCountry); /** * Getter for phone number *

* @return Phone number */ - Long getPhoneNumber (); + Long getLandLineNumber (); /** * Setter for phone number *

* @param phoneNumber Phone number */ - void setPhoneNumber (final Long phoneNumber); + void setLandLineNumber (final Long phoneNumber); /** * Street diff --git a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl index f2ed6374..78bd8891 100644 --- a/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl +++ b/web/WEB-INF/templates/admin/contact/admin_form_contact_data.tpl @@ -186,17 +186,17 @@

- + - + - +
diff --git a/web/WEB-INF/templates/contact/form_contact_data.tpl b/web/WEB-INF/templates/contact/form_contact_data.tpl index 9b9bcbd4..ab13d057 100644 --- a/web/WEB-INF/templates/contact/form_contact_data.tpl +++ b/web/WEB-INF/templates/contact/form_contact_data.tpl @@ -202,17 +202,17 @@
- + - + - +
@@ -272,7 +272,7 @@ - + -- 2.39.5