This is an automated email from the git hooks/post-receive script. New commit to branch feature/2264 in repository wao. See http://git.codelutin.com/wao.git commit 912ef1e1fd070bec6fcc878afbfcffea2aa902d6 Author: Brendan Le Ny <bleny@codelutin.com> Date: Wed Dec 24 16:31:14 2014 +0100 Ébauche du formulaire de modification d'un contact scléro --- .../wao/services/service/ContactsService.java | 38 ++--- ...ismatchContactMainObserverCompanyException.java | 12 +- ...chContactSecondaryObserverCompanyException.java | 12 +- .../resources/i18n/wao-services_en_GB.properties | 2 +- .../resources/i18n/wao-services_fr_FR.properties | 2 +- .../wao/services/service/ContactsServiceTest.java | 17 +++ .../services/service/SclerochronologyFixtures.java | 11 ++ .../ifremer/wao/web/action/EditContactAction.java | 8 +- .../wao/web/action/ValidateContactJsonAction.java | 4 +- .../main/resources/i18n/wao-web_en_GB.properties | 6 +- .../main/resources/i18n/wao-web_fr_FR.properties | 6 +- .../webapp/WEB-INF/content/edit-contact-input.jsp | 155 +++++++++++++-------- 12 files changed, 168 insertions(+), 105 deletions(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java index c7aafc3..798e593 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsService.java @@ -31,7 +31,6 @@ import fr.ifremer.wao.ContactsFilter; import fr.ifremer.wao.WaoTechnicalException; import fr.ifremer.wao.WaoUtils; import fr.ifremer.wao.entity.Boat; -import fr.ifremer.wao.entity.Company; import fr.ifremer.wao.entity.Contact; import fr.ifremer.wao.entity.ContactImpl; import fr.ifremer.wao.entity.ContactState; @@ -473,9 +472,9 @@ public class ContactsService extends WaoServiceSupport { String message = l(l, "wao.import.contact.failure.missingComment", state, lineNumber); throw new ImportErrorException(message); } catch (MismatchContactMainObserverCompanyException e) { - String companyName = e.getCompany().getName(); + String organisationName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); - String message = l(l, "wao.import.contact.failure.mismatchCompanyForObserver", lineNumber, observerLogin, companyName); + String message = l(l, "wao.import.contact.failure.mismatchCompanyForObserver", lineNumber, observerLogin, organisationName); throw new ImportErrorException(message); } catch (ContactRestitutionDateBeforeDataInputDateException e) { String message = l(l, "wao.import.contact.failure.transmissionDateBeforeDataInputDate", lineNumber); @@ -490,9 +489,9 @@ public class ContactsService extends WaoServiceSupport { String message = l(l, "wao.import.contact.failure.missingDataReliability", lineNumber); throw new ImportErrorException(message); } catch (MismatchContactSecondaryObserverCompanyException e) { - String companyName = e.getCompany().getName(); + String organisationName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); - String message = l(l, "wao.import.contact.failure.mismatchCompanyForObserver", lineNumber, observerLogin, companyName); + String message = l(l, "wao.import.contact.failure.mismatchCompanyForObserver", lineNumber, observerLogin, organisationName); throw new ImportErrorException(message); } catch (MissingContactObservedDataControlException e) { String message = l(l, "wao.import.contact.failure.missingObservedDataControl", lineNumber); @@ -608,23 +607,17 @@ public class ContactsService extends WaoServiceSupport { // Pass validation controls Contact contact = updateContactCommand.getContact(); - Company company = contact.getSampleRow().getCompany(); + SampleRow sampleRow = contact.getSampleRow(); WaoUser mainObserver = contact.getMainObserver(); - { - //--- - // mainObserver - //--- - - if (mainObserver == null) { - throw new MissingContactMainObserverException(contact); - } + if (mainObserver == null) { + throw new MissingContactMainObserverException(contact); + } - boolean observerWorksForCompanyInSampleRow = mainObserver.getCompany().equals(company); - if (!observerWorksForCompanyInSampleRow) { - throw new MismatchContactMainObserverCompanyException(contact, mainObserver, company); - } + Set<WaoUser> possibleObservers = getPossibleObservers(sampleRow); + if ( ! possibleObservers.contains(mainObserver)) { + throw new MismatchContactMainObserverCompanyException(contact, mainObserver, sampleRow.getOrganisation()); } if (contact.isSecondaryObserversNotEmpty()) { @@ -637,10 +630,9 @@ public class ContactsService extends WaoServiceSupport { throw new DuplicatedContactMainObserverInSecondaryObserversException(contact); } - for (WaoUser observer : contact.getSecondaryObservers()) { - boolean observerWorksForCompanyInSampleRow = observer.getCompany().equals(company); - if (!observerWorksForCompanyInSampleRow) { - throw new MismatchContactSecondaryObserverCompanyException(contact, observer, company); + for (WaoUser secondaryObserver : contact.getSecondaryObservers()) { + if ( ! possibleObservers.contains(secondaryObserver)) { + throw new MismatchContactSecondaryObserverCompanyException(contact, secondaryObserver, sampleRow.getOrganisation()); } } } @@ -649,8 +641,6 @@ public class ContactsService extends WaoServiceSupport { Date observationEndDate = contact.getObservationEndDate(); Date dataInputDate = contact.getDataInputDate(); - SampleRow sampleRow = contact.getSampleRow(); - if (observationBeginDate != null) { //--- diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java index f5a2a61..ea13dff 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactMainObserverCompanyException.java @@ -21,8 +21,8 @@ package fr.ifremer.wao.services.service; * #L% */ -import fr.ifremer.wao.entity.Company; import fr.ifremer.wao.entity.Contact; +import fr.ifremer.wao.entity.Organisation; import fr.ifremer.wao.entity.WaoUser; /** @@ -35,18 +35,18 @@ public class MismatchContactMainObserverCompanyException extends ContactValidati private static final long serialVersionUID = 1L; - protected Company company; + protected Organisation organisation; protected WaoUser observer; - public MismatchContactMainObserverCompanyException(Contact contact, WaoUser observer, Company company) { + public MismatchContactMainObserverCompanyException(Contact contact, WaoUser observer, Organisation organisation) { super(contact); - this.company = company; + this.organisation = organisation; this.observer = observer; } - public Company getCompany() { - return company; + public Organisation getOrganisation() { + return organisation; } public WaoUser getObserver() { diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactSecondaryObserverCompanyException.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactSecondaryObserverCompanyException.java index 8a9b0d8..e41e04e 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactSecondaryObserverCompanyException.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/MismatchContactSecondaryObserverCompanyException.java @@ -21,8 +21,8 @@ package fr.ifremer.wao.services.service; * #L% */ -import fr.ifremer.wao.entity.Company; import fr.ifremer.wao.entity.Contact; +import fr.ifremer.wao.entity.Organisation; import fr.ifremer.wao.entity.WaoUser; /** @@ -37,19 +37,19 @@ public class MismatchContactSecondaryObserverCompanyException extends ContactVal protected WaoUser observer; - protected Company company; + protected Organisation organisation; - public MismatchContactSecondaryObserverCompanyException(Contact contact, WaoUser observer, Company company) { + public MismatchContactSecondaryObserverCompanyException(Contact contact, WaoUser observer, Organisation organisation) { super(contact); this.observer = observer; - this.company = company; + this.organisation = organisation; } public WaoUser getObserver() { return observer; } - public Company getCompany() { - return company; + public Organisation getOrganisation() { + return organisation; } } diff --git a/wao-services/src/main/resources/i18n/wao-services_en_GB.properties b/wao-services/src/main/resources/i18n/wao-services_en_GB.properties index 77607c5..47dcf3e 100644 --- a/wao-services/src/main/resources/i18n/wao-services_en_GB.properties +++ b/wao-services/src/main/resources/i18n/wao-services_en_GB.properties @@ -41,7 +41,7 @@ wao.import.contact.failure.duplicatedMainObserverInSecondaryObservers=Main obser wao.import.contact.failure.illegalAcceptation=Contact must be accepted by company before being accepted by program wao.import.contact.failure.invalidObservationBeginDate=La date de début de la marée doit correspondre à un mois valide (non vide) de la ligne wao.import.contact.failure.locationTypeMissing=The type of the location must be filled -wao.import.contact.failure.mismatchCompanyForObserver=L'observateur %s n'est pas membre de la société %s +wao.import.contact.failure.mismatchCompanyForObserver=Observer %s is not member of %s wao.import.contact.failure.missingComment=You must give a comment for state '%s' wao.import.contact.failure.missingCommentAdmin=You must precise in admin comment why data reliability is '%s' wao.import.contact.failure.missingContactMammalsInfo=You must provide information about capture diff --git a/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties b/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties index 01f18dd..a89b1dc 100644 --- a/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties +++ b/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties @@ -39,7 +39,7 @@ wao.import.contact.failure.duplicatedMainObserverInSecondaryObservers=L'utilisat wao.import.contact.failure.illegalAcceptation=Le contact doit être accepté par la société avant d'être accepté par le programme wao.import.contact.failure.invalidObservationBeginDate=Ligne %s \: La date de début de la marée doit correspondre à un mois valide (non vide) de la ligne wao.import.contact.failure.locationTypeMissing=Le type du lieu doit être renseigné -wao.import.contact.failure.mismatchCompanyForObserver=Ligne %s \: L'observateur %s n'est pas membre de la société %s +wao.import.contact.failure.mismatchCompanyForObserver=Ligne %s \: L'observateur %s n'est pas membre de %s wao.import.contact.failure.missingComment=Ligne %s \: Il faut préciser un commentaire pour l'état '%s' wao.import.contact.failure.missingCommentAdmin=Ligne %s \: Il faut préciser dans le commentaire administrateur pourquoi la donnée est '%s' wao.import.contact.failure.missingContactMammalsInfo=Ligne %s \: Il faut préciser le détail des espèces capturées diff --git a/wao-services/src/test/java/fr/ifremer/wao/services/service/ContactsServiceTest.java b/wao-services/src/test/java/fr/ifremer/wao/services/service/ContactsServiceTest.java index 003b07b..259d8e2 100644 --- a/wao-services/src/test/java/fr/ifremer/wao/services/service/ContactsServiceTest.java +++ b/wao-services/src/test/java/fr/ifremer/wao/services/service/ContactsServiceTest.java @@ -155,4 +155,21 @@ public class ContactsServiceTest extends AbstractWaoServiceTest { Assert.assertEquals(contact, Iterables.getOnlyElement(contactsList.getContacts().getElements())); } + + @Test + public void testModifyContact() { + AuthenticatedWaoUser alex = sclerochronologyFixtures.alex(); + Contact contact = sclerochronologyFixtures.contact(); + try { + UpdateContactCommand updateContactCommand = service.newUpdateContactCommand(alex, contact.getTopiaId()); + service.preValidate(updateContactCommand); + service.validate(alex, updateContactCommand); + service.save(updateContactCommand); + } catch (ContactValidationException | ContactNotUpdatableException | UnknownContactIdException e) { + if (log.isDebugEnabled()) { + log.debug("unexpected exception", e); + } + Assert.fail("no exception expected"); + } + } } diff --git a/wao-services/src/test/java/fr/ifremer/wao/services/service/SclerochronologyFixtures.java b/wao-services/src/test/java/fr/ifremer/wao/services/service/SclerochronologyFixtures.java index 57b818c..77a5bfa 100644 --- a/wao-services/src/test/java/fr/ifremer/wao/services/service/SclerochronologyFixtures.java +++ b/wao-services/src/test/java/fr/ifremer/wao/services/service/SclerochronologyFixtures.java @@ -1,6 +1,8 @@ package fr.ifremer.wao.services.service; +import com.google.common.base.Optional; import fr.ifremer.wao.WaoTechnicalException; +import fr.ifremer.wao.entity.Contact; import fr.ifremer.wao.entity.Laboratory; import fr.ifremer.wao.entity.ObsProgram; import fr.ifremer.wao.entity.SampleRow; @@ -103,4 +105,13 @@ public class SclerochronologyFixtures extends WaoFixtures { IOUtils.closeQuietly(input); } } + + public Contact contact() { + AuthenticatedWaoUser alex = alex(); + SampleRow sampleRow = sampleRow3(); + String sampleRowId = sampleRow.getTopiaId(); + Contact contact = serviceContext.newService(ContactsService.class).createContact(alex, sampleRowId, Optional.<String>absent()); + return contact; + } + } diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java index e408c20..5ce9b9d 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/EditContactAction.java @@ -279,9 +279,9 @@ public class EditContactAction extends WaoJspActionSupport implements Preparable addFieldError("updateContactCommand.contact.comment", t("wao.ui.form.Contact.error.missingComment", state)); } catch (MismatchContactMainObserverCompanyException e) { - String companyName = e.getCompany().getName(); + String organisationName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); - addFieldError("updateContactCommand.contact.mainObserver", t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName)); + addFieldError("updateContactCommand.contact.mainObserver", t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, organisationName)); } catch (ContactRestitutionDateBeforeDataInputDateException e) { addFieldError("updateContactCommand.contact.restitution", t("wao.ui.form.Contact.error.transmissionDateBeforeDataInputDate")); @@ -296,9 +296,9 @@ public class EditContactAction extends WaoJspActionSupport implements Preparable addFieldError("updateContactCommand.contact.dataReliability", t("wao.ui.form.Contact.error.missingDataReliability")); } catch (MismatchContactSecondaryObserverCompanyException e) { - String companyName = e.getCompany().getName(); + String organisationName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); - addFieldError("updateContactCommand.contact.secondaryObservers", t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName)); + addFieldError("updateContactCommand.contact.secondaryObservers", t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, organisationName)); } catch (MissingContactObservedDataControlException e) { addFieldError("updateContactCommand.contact.observedDataControl", t("wao.ui.form.Contact.error.missingObservedDataControl")); diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java index b41f82f..bd62216 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/ValidateContactJsonAction.java @@ -196,7 +196,7 @@ public class ValidateContactJsonAction extends WaoJsonActionSupport implements P errorMessage = t("wao.ui.form.Contact.error.missingComment", state); } catch (MismatchContactMainObserverCompanyException e) { - String companyName = e.getCompany().getName(); + String companyName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); errorMessage = t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName); @@ -213,7 +213,7 @@ public class ValidateContactJsonAction extends WaoJsonActionSupport implements P errorMessage = t("wao.ui.form.Contact.error.missingDataReliability"); } catch (MismatchContactSecondaryObserverCompanyException e) { - String companyName = e.getCompany().getName(); + String companyName = e.getOrganisation().getName(); String observerLogin = e.getObserver().getLogin(); errorMessage = t("wao.ui.form.Contact.error.mismatchCompanyForObserver", observerLogin, companyName); diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties index 397b46f..18dfe5d 100644 --- a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties +++ b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties @@ -228,7 +228,11 @@ wao.ui.field.Contact.observationTimeInDays=Observation time in days wao.ui.field.Contact.observationType=Observation type wao.ui.field.Contact.observedDataControl=Observed Data control wao.ui.field.Contact.restitution=Restitution +wao.ui.field.Contact.sampleReception= wao.ui.field.Contact.sampleRow=Sample row +wao.ui.field.Contact.sampleSize= +wao.ui.field.Contact.sampleSubmission= +wao.ui.field.Contact.sampleTreatment= wao.ui.field.Contact.samplingStrategy=Sampling strategy followed wao.ui.field.Contact.secondaryObservers=Secondary observers wao.ui.field.Contact.terrestrialLocation=Observation's place @@ -309,7 +313,7 @@ wao.ui.form.Contact.error.dataInputDateBeforeObservationEndDate=The data input d wao.ui.form.Contact.error.duplicatedMainObserverInSecondaryObservers=The main observer cannot also be a secondary observer wao.ui.form.Contact.error.illegalAcceptationException=Contact must be validated by company before being validated by program wao.ui.form.Contact.error.invalidObservationBeginDate=The observation begin date must be a date in a month with an expected effort in the sampling plan -wao.ui.form.Contact.error.mismatchCompanyForObserver=Observers must belong to the company attached to the sample row +wao.ui.form.Contact.error.mismatchCompanyForObserver=Observer %s is not member of %s wao.ui.form.Contact.error.missingComment=The comment is mandatory wao.ui.form.Contact.error.missingCommentAdmin=The admin comment is mandatory wao.ui.form.Contact.error.missingContactMammalsInfo=You must provide information about captured mammals diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties index 5ad3387..f917979 100644 --- a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties +++ b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties @@ -229,7 +229,11 @@ wao.ui.field.Contact.observationTimeInDays=Jours d'observation wao.ui.field.Contact.observationType=Type d'observation wao.ui.field.Contact.observedDataControl=Contrôle des données observées wao.ui.field.Contact.restitution=Transmission de la restitution +wao.ui.field.Contact.sampleReception= wao.ui.field.Contact.sampleRow=Ligne du plan +wao.ui.field.Contact.sampleSize= +wao.ui.field.Contact.sampleSubmission= +wao.ui.field.Contact.sampleTreatment= wao.ui.field.Contact.samplingStrategy=Stratégie d'échantillonnage suivie wao.ui.field.Contact.secondaryObservers=Observateurs secondaires wao.ui.field.Contact.terrestrialLocation=Lieu d'observation @@ -310,7 +314,7 @@ wao.ui.form.Contact.error.dataInputDateBeforeObservationEndDate=La date de saisi wao.ui.form.Contact.error.duplicatedMainObserverInSecondaryObservers=L'utilisateur référant ne doit pas se trouver aussi parmi les observateurs secondaires wao.ui.form.Contact.error.illegalAcceptationException=Le contact doit être accepté par la société avant d'être accepté ou refusé par le programme wao.ui.form.Contact.error.invalidObservationBeginDate=La date de début de la marée doit correspondre à un mois valide (non vide) de la ligne -wao.ui.form.Contact.error.mismatchCompanyForObserver=L'observateur %s n'est pas membre de la société %s +wao.ui.form.Contact.error.mismatchCompanyForObserver=L'observateur %s n'est pas membre de %s wao.ui.form.Contact.error.missingComment=Il faut préciser un commentaire pour l'état '%s' wao.ui.form.Contact.error.missingCommentAdmin=Il faut préciser dans le commentaire administrateur pourquoi la donnée est '%s' wao.ui.form.Contact.error.missingContactMammalsInfo=Il faut préciser les informations concernants les captures accidentelles diff --git a/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp b/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp index 2029a39..1598c2f 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/edit-contact-input.jsp @@ -122,52 +122,55 @@ <s:param value="%{formatDate(updateContactCommand.contact.creationDate)}"/> </s:text> - <h3><s:text name="wao.ui.field.Contact.boat"/></h3> - - <table class="table"> - <tbody> - <tr> - <th> - <s:text name="wao.ui.field.Boat.name"/> - </th> - <td> - <s:property value="updateContactCommand.contact.boat.name"/> - </td> - </tr> - <tr> - <th> - <s:text name="wao.ui.field.Boat.registrationCode"/> - </th> - <td> - <s:property value="updateContactCommand.contact.boat.registrationCode"/> - </td> - </tr> - <tr> - <th> - <s:text name="wao.ui.field.Boat.districtCode"/> - </th> - <td> - <s:property value="updateContactCommand.contact.boat.districtCode"/> - </td> - </tr> - <tr> - <th> - <s:text name="wao.ui.field.Boat.boatLength"/> - </th> - <td> - <s:property value="%{'' + updateContactCommand.contact.boat.boatLength}"/> cm. - </td> - </tr> - <tr> - <th> - <s:text name="wao.ui.field.Boat.buildYear"/> - </th> - <td> - <s:property value="%{'' + updateContactCommand.contact.boat.buildYear}"/> - </td> - </tr> - </tbody> - </table> + <s:if test="updateContactCommand.contact.obsProgram.obsMer || updateContactCommand.contact.obsProgram.obsVente"> + + <h3><s:text name="wao.ui.field.Contact.boat"/></h3> + + <table class="table"> + <tbody> + <tr> + <th> + <s:text name="wao.ui.field.Boat.name"/> + </th> + <td> + <s:property value="updateContactCommand.contact.boat.name"/> + </td> + </tr> + <tr> + <th> + <s:text name="wao.ui.field.Boat.registrationCode"/> + </th> + <td> + <s:property value="updateContactCommand.contact.boat.registrationCode"/> + </td> + </tr> + <tr> + <th> + <s:text name="wao.ui.field.Boat.districtCode"/> + </th> + <td> + <s:property value="updateContactCommand.contact.boat.districtCode"/> + </td> + </tr> + <tr> + <th> + <s:text name="wao.ui.field.Boat.boatLength"/> + </th> + <td> + <s:property value="%{'' + updateContactCommand.contact.boat.boatLength}"/> cm. + </td> + </tr> + <tr> + <th> + <s:text name="wao.ui.field.Boat.buildYear"/> + </th> + <td> + <s:property value="%{'' + updateContactCommand.contact.boat.buildYear}"/> + </td> + </tr> + </tbody> + </table> + </s:if> <h3><s:text name="wao.ui.field.Contact.sampleRow"/></h3> @@ -181,14 +184,16 @@ <s:property value="updateContactCommand.contact.sampleRow.code"/> </td> </tr> - <tr> - <th> - <s:text name="wao.ui.field.SampleRow.profession"/> - </th> - <td> - <s:property value="updateContactCommand.contact.sampleRow.professionDescription"/> - </td> - </tr> + <s:if test="updateContactCommand.contact.obsProgram.obsMer || updateContactCommand.contact.obsProgram.obsVente"> + <tr> + <th> + <s:text name="wao.ui.field.SampleRow.profession"/> + </th> + <td> + <s:property value="updateContactCommand.contact.sampleRow.professionDescription"/> + </td> + </tr> + </s:if> <tr> <th> <s:text name="wao.ui.field.SampleRow.programName"/> @@ -326,11 +331,43 @@ </s:if> - <s:textfield name="updateContactCommand.contact.dataInputDate" - label="%{getText('wao.ui.field.Contact.dataInputDate')}" - placeholder="%{getDatePlaceholder()}" - disabled="%{!#editObservationReport}" - cssClass="date"/> + <s:if test="updateContactCommand.contact.obsProgram.obsMer || updateContactCommand.contact.obsProgram.obsVente"> + + <s:textfield name="updateContactCommand.contact.dataInputDate" + label="%{getText('wao.ui.field.Contact.dataInputDate')}" + placeholder="%{getDatePlaceholder()}" + disabled="%{!#editObservationReport}" + cssClass="date"/> + + </s:if> + + <s:if test="updateContactCommand.contact.obsProgram.sclerochronology"> + + <s:textfield name="updateContactCommand.contact.sampleSize" + label="%{getText('wao.ui.field.Contact.sampleSize')}" + type="number" + disabled="%{!#editObservationReport}" + cssClass="input-small" /> + + <s:textfield name="updateContactCommand.contact.sampleSubmission" + label="%{getText('wao.ui.field.Contact.sampleSubmission')}" + placeholder="%{getDatePlaceholder()}" + disabled="%{!#editObservationReport}" + cssClass="date"/> + + <s:textfield name="updateContactCommand.contact.sampleReception" + label="%{getText('wao.ui.field.Contact.sampleReception')}" + placeholder="%{getDatePlaceholder()}" + disabled="%{!#editObservationReport}" + cssClass="date"/> + + <s:textfield name="updateContactCommand.contact.sampleTreatment" + label="%{getText('wao.ui.field.Contact.sampleTreatment')}" + placeholder="%{getDatePlaceholder()}" + disabled="%{!#editObservationReport}" + cssClass="date"/> + + </s:if> <s:if test="updateContactCommand.contact.obsProgram.obsMer"> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.