Wao-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- 2352 discussions
[Suiviobsmer-commits] r903 - in trunk: wao-business/src/main/java/fr/ifremer/wao/service wao-business/src/main/xmi wao-ui/src/main/java/fr/ifremer/wao/ui/pages
by bleny@users.labs.libre-entreprise.org 10 Jan '11
by bleny@users.labs.libre-entreprise.org 10 Jan '11
10 Jan '11
Author: bleny
Date: 2011-01-10 08:39:13 +0000 (Mon, 10 Jan 2011)
New Revision: 903
Log:
refactor contact creation
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-10 07:18:34 UTC (rev 902)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-10 08:39:13 UTC (rev 903)
@@ -40,6 +40,7 @@
import fr.ifremer.wao.bean.ContactStatus;
import fr.ifremer.wao.bean.ContactStatus.NullSampleMonthException;
import fr.ifremer.wao.bean.DataReliability;
+import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.SamplingStrategy;
import fr.ifremer.wao.bean.UserRole;
import fr.ifremer.wao.bean.ValidationResult;
@@ -201,14 +202,25 @@
}
@Override
- public Contact executeGetNewContact(WaoUser user, SampleRow row, Boat boat) {
- Contact result = new ContactImpl();
- result.setMainObserver(user);
- result.setSampleRow(row);
- result.setBoat(boat);
- result.setContactState(ContactState.CONTACT_START);
- result.setDataReliability(DataReliability.UNKNOWN);
- return result;
+ public Contact executeGetNewContact(ObsProgram obsProgram, WaoUser user, SampleRow row, Boat boat) throws WaoBusinessException {
+
+ if (obsProgram.equals(ObsProgram.OBSMER)) {
+ if (boat == null) {
+ throw new NullPointerException("boat can not be null for program " + obsProgram);
+ }
+ if ( ! boat.canCreateContact(user.getCompany())) {
+ throw new WaoBusinessException("Un contact en cours existe déjà pour ce navire");
+ }
+ }
+
+ Contact newContact = new ContactImpl();
+ newContact.setDataReliability(DataReliability.UNKNOWN);
+ newContact.setBoat(boat);
+ newContact.setMainObserver(user);
+ newContact.setSampleRow(row);
+ newContact.setContactState(ContactState.CONTACT_START);
+ saveContact(newContact, Boolean.FALSE);
+ return newContact;
}
@Override
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java 2011-01-10 07:18:34 UTC (rev 902)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Boats.java 2011-01-10 08:39:13 UTC (rev 903)
@@ -39,6 +39,7 @@
import fr.ifremer.wao.entity.Profession;
import fr.ifremer.wao.entity.SampleRow;
import fr.ifremer.wao.service.ServiceBoat;
+import fr.ifremer.wao.service.ServiceContact;
import fr.ifremer.wao.service.ServiceReferential;
import fr.ifremer.wao.service.ServiceSampling;
import fr.ifremer.wao.service.ServiceUser;
@@ -109,6 +110,9 @@
private ServiceBoat serviceBoat;
@Inject
+ private ServiceContact serviceContact;
+
+ @Inject
private PropertyAccess propertyAccess;
@Property
@@ -846,7 +850,12 @@
sampleRow = getSampleRow();
// Get boat from list
boat = getBoats().get(boatImmatriculation);
- contacts.createNewContact(boat, sampleRow);
+ //contacts.createNewContact(boat, sampleRow);
+ Contact newContact = serviceContact.getNewContact(user.getProfile().getObsProgram(),
+ user.getUser(),
+ sampleRow,
+ boat);
+ contacts.setContactSelectedId(newContact.getTopiaId());
return contacts;
}
@@ -854,7 +863,12 @@
// Get sampleRow from elligibleBoat list
ElligibleBoat elligible = getCompanyBoatInfos().getElligibleBoat(sampleRowCode);
sampleRow = elligible.getSampleRow();
- contacts.createNewContact(getBoatSelected(), sampleRow);
+ Contact newContact = serviceContact.getNewContact(user.getProfile().getObsProgram(),
+ user.getUser(),
+ sampleRow,
+ getBoatSelected());
+ // contacts.createNewContact(getBoatSelected(), sampleRow);
+ contacts.setContactSelectedId(newContact.getTopiaId());
return contacts;
}
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-10 07:18:34 UTC (rev 902)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-10 08:39:13 UTC (rev 903)
@@ -333,6 +333,10 @@
@Persist
private String contactSelectedId;
+ public void setContactSelectedId(String contactSelectedId) {
+ this.contactSelectedId = contactSelectedId;
+ }
+
@Property
@Persist
private String contactUserId;
@@ -553,15 +557,4 @@
serviceContact.saveContact(modifiedContact, true);
}
- public void createNewContact(Boat boat, SampleRow sampleRow) throws WaoException {
- contact = serviceContact.getNewContact(user.getUser(), sampleRow, boat);
- // Check boat not null and validation for create the new contact
- if (boat != null && boat.canCreateContact(user.getCompany())) {
- serviceContact.saveContact(contact, Boolean.FALSE);
- String contactSelectedId = contact.getTopiaId();
- } else {
- layout.addError("Un contact en cours existe déjà pour ce navire");
- }
- }
-
}
1
0
[Suiviobsmer-commits] r902 - in trunk: wao-business/src/main/java/fr/ifremer/wao wao-business/src/main/java/fr/ifremer/wao/bean wao-business/src/main/xmi wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/resources/i18n wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 10 Jan '11
by bleny@users.labs.libre-entreprise.org 10 Jan '11
10 Jan '11
Author: bleny
Date: 2011-01-10 07:18:34 +0000 (Mon, 10 Jan 2011)
New Revision: 902
Log:
add new fields in contact filters
Modified:
trunk/wao-business/src/main/java/fr/ifremer/wao/WaoQueryBuilder.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties
trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties
trunk/wao-ui/src/main/webapp/Contacts.tml
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoQueryBuilder.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoQueryBuilder.java 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoQueryBuilder.java 2011-01-10 07:18:34 UTC (rev 902)
@@ -612,6 +612,28 @@
query.addEquals(contactProperty.obsProgramOrdinal(), filter.getObsProgram().ordinal());
}
+ if (filter.getActualSamplingStrategy() != null) {
+ query.addEquals(contactProperty.samplingStrategyOrdinal(), filter.getActualSamplingStrategy().ordinal());
+ }
+
+ List<Boolean> completeSampling = new ArrayList<Boolean>();
+ if (filter.isCompleteSampling()) {
+ completeSampling.add(true);
+ }
+ if (filter.isIncompleteSampling()) {
+ completeSampling.add(false);
+ }
+ if (filter.isNoSamplingCompleteness()) {
+ completeSampling.add(null);
+ }
+ if (completeSampling.size() > 0) {
+ query.addEquals(contactProperty.completeSampling(), completeSampling.toArray());
+ }
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("query with filters on Contacts is " + query);
+ }
+
return query;
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java 2011-01-10 07:18:34 UTC (rev 902)
@@ -52,6 +52,10 @@
isCommentCompany() ||
getDataReliability() != null ||
getFishingGearDCF() != null ||
- getTargetSpeciesDCF() != null;
+ getTargetSpeciesDCF() != null ||
+ getActualSamplingStrategy() != null ||
+ isNoSamplingCompleteness() ||
+ isCompleteSampling() ||
+ isIncompleteSampling();
}
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/SamplingFilterImpl.java 2011-01-10 07:18:34 UTC (rev 902)
@@ -54,7 +54,8 @@
StringUtils.isNotEmpty(getFacadeName()) ||
StringUtils.isNotEmpty(getProgramName()) ||
StringUtils.isNotEmpty(getCodeDCF5()) ||
- getPeriod() != null;
+ getPeriod() != null ||
+ getSamplingStrategy() != null;
return result;
}
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-10 07:18:34 UTC (rev 902)
@@ -30,6 +30,7 @@
import fr.ifremer.wao.bean.ContactFilter;
import fr.ifremer.wao.bean.ContactFilterImpl;
import fr.ifremer.wao.bean.ContactState;
+import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.SamplingFilter;
import fr.ifremer.wao.bean.UserRole;
import fr.ifremer.wao.bean.ValidationResult;
@@ -230,6 +231,10 @@
}
}
+ public boolean showObsVente() {
+ return user.getProfile().getObsProgram() == ObsProgram.OBSVENTE;
+ }
+
/**************************** CONTACT IMPORT/EXPORT ***********************/
@Property
Modified: trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties
===================================================================
--- trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-10 07:18:34 UTC (rev 902)
@@ -87,6 +87,7 @@
wao.ui.field.SampleRow.code=
wao.ui.field.SampleRow.profession=
wao.ui.field.SampleRow.programName=
+wao.ui.field.SampleRow.samplingStrategy=
wao.ui.field.User.firstName=
wao.ui.field.User.lastName=
wao.ui.field.User.login=
Modified: trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties
===================================================================
--- trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-10 07:18:34 UTC (rev 902)
@@ -41,10 +41,10 @@
wao.ui.field.Boat.buildYear=Ann\u00E9e de construction
wao.ui.field.Boat.capacity=Capacit\u00E9 d'accueil du navire en personnels sp\u00E9cialis\u00E9s
wao.ui.field.Boat.districtCode=Quartier
-wao.ui.field.Boat.immatriculation=immatriculation
-wao.ui.field.Boat.name=nom
-wao.ui.field.Boat.shipOwner=armateur
-wao.ui.field.BoatDistrict.code=code quartier
+wao.ui.field.Boat.immatriculation=Immatriculation
+wao.ui.field.Boat.name=Nom
+wao.ui.field.Boat.shipOwner=Armateur
+wao.ui.field.BoatDistrict.code=Code quartier
wao.ui.field.Company.active=Active
wao.ui.field.Company.name=Nom
wao.ui.field.Contact.beginDate=D\u00E9but d'observation
@@ -61,13 +61,14 @@
wao.ui.field.Contact.mammalsCapture=Capture accidentelle
wao.ui.field.Contact.mammalsObservation=Observation exceptionnelle
wao.ui.field.Contact.nbObservants=Nombre d'observateurs
-wao.ui.field.Contact.samplingStrategy=Strat\u00E9gie d'\u00E9chantillonnage
+wao.ui.field.Contact.samplingStrategy=Strat\u00E9gie d'\u00E9chantillonnage suivie
wao.ui.field.Contact.secondaryObservers=Observateurs
wao.ui.field.FishingZone.facadeName=fa\u00E7ade
wao.ui.field.FishingZone.sectorName=quartier
wao.ui.field.SampleRow.code=code ligne
wao.ui.field.SampleRow.profession=M\u00E9tier
wao.ui.field.SampleRow.programName=Programme
+wao.ui.field.SampleRow.samplingStrategy=Strat\u00E9gie d'\u00E9chantillonnage
wao.ui.field.User.firstName=Pr\u00E9nom
wao.ui.field.User.lastName=Nom
wao.ui.field.User.login=Identifiant
Modified: trunk/wao-ui/src/main/webapp/Contacts.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-09 18:52:29 UTC (rev 901)
+++ trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-10 07:18:34 UTC (rev 902)
@@ -148,6 +148,25 @@
<label for="commentAdmin">programme</label>
</t:if>
</div>
+ <t:if t:test="showObsVente()">
+ <label t:for="samplingStrategy">${message:wao.ui.field.SampleRow.samplingStrategy}</label>
+ <input t:type="select" t:id="samplingStrategy" value="contactFilter.samplingStrategy" />
+ <label t:for="actualSamplingStrategy">${message:wao.ui.field.Contact.samplingStrategy}</label>
+ <input t:type="select" t:id="actualSamplingStrategy" value="contactFilter.actualSamplingStrategy" />
+ <label>${message:wao.ui.field.Contact.completeSampling}</label>
+ <input t:type="checkbox" t:id="completeSampling" value="contactFilter.completeSampling" />
+ <label t:for="completeSampling">
+ <img src="${asset:context:img/true-22px.png}" alt="Oui" />
+ </label>
+ <input t:type="checkbox" t:id="incompleteSampling" value="contactFilter.incompleteSampling" />
+ <label t:for="incompleteSampling">
+ <img src="${asset:context:img/false-22px.png}" alt="Non" />
+ </label>
+ <input t:type="checkbox" t:id="noSamplingCompleteness" value="contactFilter.noSamplingCompleteness" />
+ <label t:for="noSamplingCompleteness">
+ <img src="${asset:context:img/help-22px.png}" title="Non précisé" />
+ </label>
+ </t:if>
<div class="fleft" style="margin-top: 15px;">
<input t:type="checkbox" t:id="sortedByBoardingDate" value="contactFilter.sortedByBoardingDate" /> <t:label t:for="sortedByBoardingDate" />
</div>
1
0
[Suiviobsmer-commits] r901 - trunk/wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 09 Jan '11
by bleny@users.labs.libre-entreprise.org 09 Jan '11
09 Jan '11
Author: bleny
Date: 2011-01-09 18:52:29 +0000 (Sun, 09 Jan 2011)
New Revision: 901
Log:
adding defer='false' on submitContext seems to help sometimes
Modified:
trunk/wao-ui/src/main/webapp/Boats.tml
trunk/wao-ui/src/main/webapp/Index.tml
trunk/wao-ui/src/main/webapp/SampleRowForm.tml
Modified: trunk/wao-ui/src/main/webapp/Boats.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Boats.tml 2011-01-09 18:14:18 UTC (rev 900)
+++ trunk/wao-ui/src/main/webapp/Boats.tml 2011-01-09 18:52:29 UTC (rev 901)
@@ -334,10 +334,10 @@
</span>
</span>
<t:if t:test="elligibleBoatCompanyActiveFalse">
- <input t:type="submitContext" t:id="activeBoatInfosSampleRow" class="ico add"
+ <input t:type="submitContext" t:defer="false" t:id="activeBoatInfosSampleRow" class="ico add"
t:context="elligibleBoat.sampleRow.code" />
<p:else>
- <input t:type="submitContext" t:id="removeBoatInfosSampleRow" class="ico remove" value="Remove"
+ <input t:type="submitContext" t:defer="false" t:id="removeBoatInfosSampleRow" class="ico remove" value="Remove"
t:context="elligibleBoat.sampleRow.code" />
</p:else>
</t:if>
Modified: trunk/wao-ui/src/main/webapp/Index.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Index.tml 2011-01-09 18:14:18 UTC (rev 900)
+++ trunk/wao-ui/src/main/webapp/Index.tml 2011-01-09 18:52:29 UTC (rev 901)
@@ -64,7 +64,7 @@
<t:if t:test="canEditNews()">
<p class="aright">
<t:if t:test="editionMode">
- <input t:type="submitContext" t:context="rowIndex" t:id="saveNews" class="ico22px save22px" value="Save"
+ <input t:type="submitContext" t:defer="false" t:context="rowIndex" t:id="saveNews" class="ico22px save22px" value="Save"
title="Enregistrer les modifications" />
<a t:type="actionlink" t:id="cancelEdit">
<img src="${asset:context:img/undo-22px.png}" title="Annuler les modifications"/>
Modified: trunk/wao-ui/src/main/webapp/SampleRowForm.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/SampleRowForm.tml 2011-01-09 18:14:18 UTC (rev 900)
+++ trunk/wao-ui/src/main/webapp/SampleRowForm.tml 2011-01-09 18:52:29 UTC (rev 901)
@@ -92,7 +92,7 @@
t:value="fishingZone" t:index="indexFishingZone">
<div class="fleft width50">
<input t:type="submitContext" class="ico remove" t:context="indexFishingZone"
- t:id="removeFishingZone" value="Remove" title="Retirer cette zone de la liste liée à la ligne d'échantillonnage"/>
+ t:id="removeFishingZone" t:defer="false" value="Remove" title="Retirer cette zone de la liste liée à la ligne d'échantillonnage"/>
</div>
<div class="fleft">
${fishingZone.code}
@@ -140,7 +140,7 @@
<td t:type="loop" class="acenter" volatile="true" t:source="sampleMonths" t:value="sampleMonth" t:index="monthIndex">
<t:output value="sampleMonth.periodDate" format="dateFormat" />
<t:unless t:test="sampleMonth.realTidesValue">
- <input t:type="submitContext" class="ico16px suppr" t:id="deleteMonth" value="Delete" t:context="monthIndex"
+ <input t:type="submitContext" class="ico16px suppr" t:defer="false" t:id="deleteMonth" value="Delete" t:context="monthIndex"
title="Supprimer ce mois"/>
<p:else>
<img src="${asset:context:}/img/suppr-unavailable-16px.png" alt="Supprimer"
1
0
[Suiviobsmer-commits] r900 - in trunk: . wao-business/src/main/java/fr/ifremer/wao/bean wao-business/src/main/java/fr/ifremer/wao/service wao-business/src/main/resources/i18n wao-business/src/main/xmi wao-ui wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/resources/i18n wao-ui/src/main/webapp wao-ui/src/main/webapp/css
by bleny@users.labs.libre-entreprise.org 09 Jan '11
by bleny@users.labs.libre-entreprise.org 09 Jan '11
09 Jan '11
Author: bleny
Date: 2011-01-09 18:14:18 +0000 (Sun, 09 Jan 2011)
New Revision: 900
Log:
refactor contacts
Modified:
trunk/pom.xml
trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java
trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
trunk/wao-business/src/main/xmi/wao.zargo
trunk/wao-ui/pom.xml
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties
trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties
trunk/wao-ui/src/main/webapp/ContactForm.tml
trunk/wao-ui/src/main/webapp/Contacts.tml
trunk/wao-ui/src/main/webapp/css/contacts.css
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/pom.xml 2011-01-09 18:14:18 UTC (rev 900)
@@ -50,7 +50,7 @@
</dependency>
<dependency>
<groupId>org.nuiton.web</groupId>
- <artifactId>nuiton-tapestry-extra</artifactId>
+ <artifactId>nuiton-tapestry</artifactId>
<version>${nuitonWebVersion}</version>
</dependency>
<!-- ToPIA -->
@@ -330,7 +330,7 @@
<!-- libraries version -->
<nuitonI18nVersion>2.1-SNAPSHOT</nuitonI18nVersion>
<nuitonUtilsVersion>1.5.3</nuitonUtilsVersion>
- <nuitonWebVersion>0.1</nuitonWebVersion>
+ <nuitonWebVersion>1.0-SNAPSHOT</nuitonWebVersion>
<topiaVersion>2.5</topiaVersion>
<eugeneVersion>2.3</eugeneVersion>
<tapestryVersion>5.2.4</tapestryVersion>
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ContactFilterImpl.java 2011-01-09 18:14:18 UTC (rev 900)
@@ -49,6 +49,9 @@
getState() != null ||
isComment() ||
isCommentAdmin() ||
- isCommentCompany();
+ isCommentCompany() ||
+ getDataReliability() != null ||
+ getFishingGearDCF() != null ||
+ getTargetSpeciesDCF() != null;
}
}
Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java
===================================================================
--- trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-business/src/main/java/fr/ifremer/wao/service/ServiceContactImpl.java 2011-01-09 18:14:18 UTC (rev 900)
@@ -42,6 +42,8 @@
import fr.ifremer.wao.bean.DataReliability;
import fr.ifremer.wao.bean.SamplingStrategy;
import fr.ifremer.wao.bean.UserRole;
+import fr.ifremer.wao.bean.ValidationResult;
+import fr.ifremer.wao.bean.ValidationResultImpl;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.Company;
import fr.ifremer.wao.entity.Contact;
@@ -275,6 +277,151 @@
}
}
+ @Override
+ protected ValidationResult executeValidateContact(TopiaContext transaction, Contact contact) throws Exception {
+
+ boolean success = true;
+ String message = null;
+
+ if (contact.getMainObserver() == null) {
+ success = false;
+ message = "Il faut au moins un observateur référant";
+ }
+
+ if (success && contact.getSecondaryObservers().contains(contact.getMainObserver())) {
+ success = false;
+ message = "L'utilisateur référant ne doit pas se trouver aussi parmi les observateurs secondaires";
+ }
+
+ // Validation for saving contact depends on contactState
+ ContactState contactState = contact.getContactState();
+ if (log.isDebugEnabled()) {
+ log.debug("For state : " + contactState);
+ }
+
+ Date observationBeginDate = contact.getObservationBeginDate();
+ if (success && observationBeginDate != null && ! contact.getSampleRow().isValid(observationBeginDate)) {
+ success = false;
+ message = "La date de début de la marée doit correspondre à un " +
+ "mois valide (non vide) de la ligne " + contact.getSampleRow().getCode();
+ }
+
+ Date observationEndDate = contact.getObservationEndDate();
+ if (success && observationBeginDate != null && observationEndDate != null
+ && observationEndDate.before(observationBeginDate)) {
+ success = false;
+ message = "La date de fin d'observation ne peut pas être antérieure à celle du début";
+ }
+
+ Date currentDate = context.getCurrentDate();
+
+ if (success && observationEndDate != null && observationEndDate.after(currentDate)) {
+ success = false;
+ message = "La date de fin de la marée ne peut pas être postérieure à la date du jour";
+ }
+
+ Date dataInputDate = contact.getDataInputDate();
+ if (success && observationEndDate != null && dataInputDate != null && observationEndDate.after(dataInputDate)) {
+ success = false;
+ message = "La date de saisie des données ne peut pas être antérieure à la date de fin de la marée";
+ }
+
+ if (success && dataInputDate != null && dataInputDate.after(currentDate)) {
+ success = false;
+ message = "La date de saisie des données ne peut pas être postérieure à la date du jour";
+ }
+
+ // Non abouti, Refus ou Refus Définitif
+ if (success && contactState.isUnfinishedState()) {
+
+ Contact oldContact = null;
+ if (contact.getTopiaId() != null) {
+ oldContact = executeGetContact(transaction, contact.getTopiaId());
+ }
+
+ if (oldContact != null) {
+
+ String newComment = contact.getComment();
+
+ boolean commentDefined = StringUtils.isNotEmpty(newComment);
+ boolean commentChanged = commentDefined &&
+ !newComment.equals(oldContact.getComment());
+
+ // Ano #2540 : NPE on oldState, extract boolean for
+ // previous unfinishedState case
+ boolean previousUnfinishedState = commentDefined &&
+ oldContact.getContactState() != null && oldContact.getContactState().isUnfinishedState();
+
+ // Ano #2440 : no restriction if previous state is unfinished
+ if (previousUnfinishedState || commentChanged) {
+
+ // RAZ des champs
+ contact.setObservationBeginDate(null);
+ contact.setObservationEndDate(null);
+ contact.setNbObservants(0);
+ contact.setMammalsCapture(false);
+ contact.setMammalsObservation(false);
+ contact.setDataInputDate(null);
+
+ } else {
+ success = false;
+ message = "Vous devez ajouter un commentaire pour l'état '" + contactState.libelle() + "'";
+ }
+ }
+ // Embarquement Réalisé
+ } else if (success && contactState.equals(ContactState.BOARDING_DONE)) {
+
+ if (observationBeginDate == null) {
+ success = false;
+ message = "La date de début de marée est obligatoire pour l'état '" + contactState.libelle() + "'";
+ }
+ if (success && observationEndDate == null) {
+ success = false;
+ message = "La date de fin d'observation marée est obligatoire pour l'état '" + contactState.libelle() + "'";
+ }
+ if (success && contact.getNbObservants() == 0) {
+ success = false;
+ message = "Il ne peut y avoir aucun observateur pour l'état '" + contactState.libelle() + "'";
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("validationProgram = " + contact.isValidationProgram());
+ }
+ }
+
+ if (success && BooleanUtils.isTrue(contact.isValidationProgram())) {
+
+ // it's an admin validation, data-reliability field must be filled
+ if (log.isDebugEnabled()) {
+ log.debug("field data reliability is " + contact.getDataReliability());
+ }
+
+ if (contact.getDataReliability() == null ||
+ contact.getDataReliability() == DataReliability.UNKNOWN) {
+ success = false;
+ message = "Il faut préciser la qualité des données avant de valider";
+ } else if (contact.getDataReliability() != DataReliability.RELIABLE
+ && StringUtils.isEmpty(contact.getCommentAdmin())) {
+ success = false;
+ message = "Il faut préciser dans le commentaire administrateur pourquoi la donnée n'est pas exploitable";
+ }
+ }
+
+ ValidationResult result = new ValidationResultImpl();
+ result.setSuccess(success);
+ result.setMessage(message);
+
+ if (log.isDebugEnabled()) {
+ String logMessage = "validation of contact " + contact + " return " + result.isSuccess();
+ if ( ! result.isSuccess()) {
+ logMessage += ". reason is '" + result.getMessage() + "'";
+ }
+ log.debug(logMessage);
+ }
+
+ return result;
+ }
+
/**
* Create or Update a Contact from {@code source} to {@code destination}.
* The sampleMonth referenced to this contact will be automatically updated
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_en_GB.properties 2011-01-09 18:14:18 UTC (rev 900)
@@ -130,6 +130,7 @@
wao.error.serviceContact.saveContact=
wao.error.serviceContact.sendContactDoneEmail=
wao.error.serviceContact.updateSampleMonthTidesValue=
+wao.error.serviceContact.validateContact=
wao.error.serviceNews.getNewNews=
wao.error.serviceNews.getNews=
wao.error.serviceNews.saveNews=
Modified: trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties
===================================================================
--- trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-business/src/main/resources/i18n/wao-business_fr_FR.properties 2011-01-09 18:14:18 UTC (rev 900)
@@ -150,6 +150,7 @@
wao.error.serviceContact.saveContact=Impossible de sauvegarder le contact
wao.error.serviceContact.sendContactDoneEmail=
wao.error.serviceContact.updateSampleMonthTidesValue=
+wao.error.serviceContact.validateContact=
wao.error.serviceNews.getNewNews=
wao.error.serviceNews.getNews=Impossible de r\u00E9cup\u00E9rer l'ensemble des news
wao.error.serviceNews.saveNews=Impossible d'enregistrer la news ayant pour titre '%1$s'
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
Modified: trunk/wao-ui/pom.xml
===================================================================
--- trunk/wao-ui/pom.xml 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/pom.xml 2011-01-09 18:14:18 UTC (rev 900)
@@ -41,7 +41,7 @@
</dependency>
<dependency>
<groupId>org.nuiton.web</groupId>
- <artifactId>nuiton-tapestry-extra</artifactId>
+ <artifactId>nuiton-tapestry</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Tapestry framework + components -->
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/ContactForm.java 2011-01-09 18:14:18 UTC (rev 900)
@@ -7,6 +7,7 @@
import fr.ifremer.wao.bean.DataReliability;
import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.UserRole;
+import fr.ifremer.wao.bean.ValidationResult;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.SampleRow;
import fr.ifremer.wao.entity.WaoUser;
@@ -182,9 +183,6 @@
/****************************** OBSERVERS *********************************/
- @Property
- private boolean refreshObserversForm;
-
@Inject
private Block viewObservers;
@@ -260,16 +258,12 @@
getSecondaryObservers().add(observerToAdd);
}
}
-
- refreshObserversForm = true;
return observersFormZone;
}
@Log
public Zone onActionFromRemoveSecondaryObserver(int secondaryObserverIndex) {
getSecondaryObservers().remove(secondaryObserverIndex);
-
- refreshObserversForm = true;
return observersFormZone;
}
@@ -329,140 +323,162 @@
saveContact = true;
}
+// @Log
+// void onValidateFormFromContactForm() {
+//
+// contactForm.clearErrors();
+//
+// if ( ! saveContact) {
+// return;
+// }
+//
+// if (mainObserverId != null) {
+// WaoUser mainObserver = getObserverSelectModel().findObject(mainObserverId);
+// contact.setMainObserver(mainObserver);
+// if (logger.isDebugEnabled()) {
+// logger.debug("main observer is " + mainObserver);
+// }
+// }
+//
+// contact.setSecondaryObservers(getSecondaryObservers());
+//
+// if (contact.getMainObserver() == null) {
+// contactForm.recordError("Il faut au moins un observateur référant");
+// }
+//
+// if (contact.getSecondaryObservers().contains(contact.getMainObserver())) {
+// contactForm.recordError("L'utilisateur référant ne doit pas se trouver aussi parmi les observateurs secondaires");
+// }
+//
+// // Validation for saving contact depends on contactState (only edition
+// // form)
+// ContactState contactState = contact.getContactState();
+// if (logger.isDebugEnabled()) {
+// logger.debug("For state : " + contactState);
+// }
+//
+// Date begin = contact.getObservationBeginDate();
+// Date end = contact.getObservationEndDate();
+// Date input = contact.getDataInputDate();
+// SampleRow row = contact.getSampleRow();
+//
+// if (logger.isDebugEnabled()) {
+// logger.debug(String.format("begin = %s, end = %s, input = %s", begin, end, input));
+// }
+//
+// if (begin != null && !row.isValid(begin)) {
+// contactForm.recordError(
+// "La date de début de la marée doit correspondre à un " +
+// "mois valide (non vide) de la ligne " + row.getCode());
+// }
+//
+// if (begin != null && end != null && end.before(begin)) {
+// contactForm.recordError("La date de fin de la marée" +
+// " ne peut pas être antérieure à celle de début");
+// }
+//
+// Date current = manager.getCurrentDate();
+//
+// if (end != null && end.after(current)) {
+// contactForm.recordError("La date de fin de la marée" +
+// " ne peut pas être postérieure à la date du jour");
+// }
+//
+// if (end != null && input != null && end.after(input)) {
+// contactForm.recordError("La date de saisie des" +
+// " données ne peut pas être antérieure à la date de" +
+// " fin de la marée");
+// }
+//
+// if (input != null && input.after(current)) {
+// contactForm.recordError("La date de saisie des" +
+// " données ne peut pas être postérieure à la date" +
+// " du jour");
+// }
+//
+// // Non abouti, Refus ou Refus Définitif
+// if (contactState.isUnfinishedState()) {
+// String newComment = contact.getComment();
+//
+// boolean commentDefined = StringUtils.isNotEmpty(newComment);
+// boolean commentChanged = commentDefined &&
+// !newComment.equals(oldContact.getComment());
+//
+// // Ano #2540 : NPE on oldState, extract boolean for
+// // previous unfinishedState case
+// boolean previousUnfinishedState = commentDefined &&
+// oldContact.getContactState() != null && oldContact.getContactState().isUnfinishedState();
+//
+// // Ano #2440 : no restriction if previous state is unfinished
+// if (previousUnfinishedState || commentChanged) {
+//
+// // RAZ des champs
+// contact.setObservationBeginDate(null);
+// contact.setObservationEndDate(null);
+// contact.setNbObservants(0);
+// contact.setMammalsCapture(false);
+// contact.setMammalsObservation(false);
+// contact.setDataInputDate(null);
+//
+// } else {
+// contactForm.recordError("Vous devez ajouter" +
+// " un commentaire pour l'état" +
+// " '" + contactState.libelle() + "'");
+// }
+// // Embarquement Réalisé
+// } else if (contactState.equals(ContactState.BOARDING_DONE)) {
+//
+// if (begin == null) {
+// contactForm.recordError("La date de début de" +
+// " marée est obligatoire pour l'état" +
+// " '" + contactState.libelle() + "'");
+// }
+// if (end == null) {
+// contactForm.recordError("La date de fin de" +
+// " marée est obligatoire pour l'état" +
+// " '" + contactState.libelle() + "'");
+// }
+// if (contact.getNbObservants() == 0) {
+// contactForm.recordError("Il ne peut y" +
+// " avoir aucun observateur pour l'état" +
+// " '" + contactState.libelle() + "'");
+// }
+//
+// if (logger.isDebugEnabled()) {
+// logger.debug("ValidationProgram = " + contact.isValidationProgram());
+// }
+//
+// if (BooleanUtils.isTrue(contact.isValidationProgram())) {
+//
+// // it's an admin validation, data-reliability field must be filled
+// if (logger.isDebugEnabled()) {
+// logger.debug("field data reliability is " +
+// contact.getDataReliability());
+// }
+//
+// if (contact.getDataReliability() == null ||
+// contact.getDataReliability() == DataReliability.UNKNOWN) {
+// contactForm.recordError("Il faut préciser la qualité des données avant de valider");
+// }
+// }
+// }
+// }
+
@Log
void onValidateFormFromContactForm() {
-
contactForm.clearErrors();
- if ( ! saveContact) {
- return;
- }
-
- if (mainObserverId == null) {
- contactForm.recordError("Il faut au moins un observateur");
- } else {
+ if (mainObserverId != null) {
WaoUser mainObserver = getObserverSelectModel().findObject(mainObserverId);
- if (logger.isDebugEnabled()) {
- logger.debug("main observer is " + mainObserver);
- }
contact.setMainObserver(mainObserver);
- contact.setSecondaryObservers(getSecondaryObservers());
}
+ contact.setSecondaryObservers(getSecondaryObservers());
- // Validation for saving contact depends on contactState (only edition
- // form)
- ContactState contactState = contact.getContactState();
- if (logger.isDebugEnabled()) {
- logger.debug("For state : " + contactState);
+ ValidationResult validationResult = serviceContact.validateContact(contact);
+ if ( ! validationResult.isSuccess()) {
+ contactForm.recordError(validationResult.getMessage());
}
-
- Date begin = contact.getObservationBeginDate();
- Date end = contact.getObservationEndDate();
- Date input = contact.getDataInputDate();
- SampleRow row = contact.getSampleRow();
-
- if (logger.isDebugEnabled()) {
- logger.debug(String.format("begin = %s, end = %s, input = %s", begin, end, input));
- }
-
- if (begin != null && !row.isValid(begin)) {
- contactForm.recordError(
- "La date de début de la marée doit correspondre à un " +
- "mois valide (non vide) de la ligne " + row.getCode());
- }
-
- if (begin != null && end != null && end.before(begin)) {
- contactForm.recordError("La date de fin de la marée" +
- " ne peut pas être antérieure à celle de début");
- }
-
- Date current = manager.getCurrentDate();
-
- if (end != null && end.after(current)) {
- contactForm.recordError("La date de fin de la marée" +
- " ne peut pas être postérieure à la date du jour");
- }
-
- if (end != null && input != null && end.after(input)) {
- contactForm.recordError("La date de saisie des" +
- " données ne peut pas être antérieure à la date de" +
- " fin de la marée");
- }
-
- if (input != null && input.after(current)) {
- contactForm.recordError("La date de saisie des" +
- " données ne peut pas être postérieure à la date" +
- " du jour");
- }
-
- // Non abouti, Refus ou Refus Définitif
- if (contactState.isUnfinishedState()) {
- String newComment = contact.getComment();
-
- boolean commentDefined = StringUtils.isNotEmpty(newComment);
- boolean commentChanged = commentDefined &&
- !newComment.equals(oldContact.getComment());
-
- // Ano #2540 : NPE on oldState, extract boolean for
- // previous unfinishedState case
- boolean previousUnfinishedState = commentDefined &&
- oldContact.getContactState() != null && oldContact.getContactState().isUnfinishedState();
-
- // Ano #2440 : no restriction if previous state is unfinished
- if (previousUnfinishedState || commentChanged) {
-
- // RAZ des champs
- contact.setObservationBeginDate(null);
- contact.setObservationEndDate(null);
- contact.setNbObservants(0);
- contact.setMammalsCapture(false);
- contact.setMammalsObservation(false);
- contact.setDataInputDate(null);
-
- } else {
- contactForm.recordError("Vous devez ajouter" +
- " un commentaire pour l'état" +
- " '" + contactState.libelle() + "'");
- }
- // Embarquement Réalisé
- } else if (contactState.equals(ContactState.BOARDING_DONE)) {
-
- if (begin == null) {
- contactForm.recordError("La date de début de" +
- " marée est obligatoire pour l'état" +
- " '" + contactState.libelle() + "'");
- }
- if (end == null) {
- contactForm.recordError("La date de fin de" +
- " marée est obligatoire pour l'état" +
- " '" + contactState.libelle() + "'");
- }
- if (contact.getNbObservants() == 0) {
- contactForm.recordError("Il ne peut y" +
- " avoir aucun observateur pour l'état" +
- " '" + contactState.libelle() + "'");
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("ValidationProgram = " + contact.isValidationProgram());
- }
-
- if (BooleanUtils.isTrue(contact.isValidationProgram())) {
-
- // it's an admin validation, data-reliability field must be filled
- if (logger.isDebugEnabled()) {
- logger.debug("field data reliability is " +
- contact.getDataReliability());
- }
-
- if (contact.getDataReliability() == null ||
- contact.getDataReliability() == DataReliability.UNKNOWN) {
- contactForm.recordError("Il faut préciser la qualité des données avant de valider");
- }
- }
- }
}
-
@Log
Object onFailureFromContactForm() {
// refresh zone to show errors
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-09 18:14:18 UTC (rev 900)
@@ -30,9 +30,9 @@
import fr.ifremer.wao.bean.ContactFilter;
import fr.ifremer.wao.bean.ContactFilterImpl;
import fr.ifremer.wao.bean.ContactState;
-import fr.ifremer.wao.bean.DataReliability;
import fr.ifremer.wao.bean.SamplingFilter;
import fr.ifremer.wao.bean.UserRole;
+import fr.ifremer.wao.bean.ValidationResult;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.Contact;
import fr.ifremer.wao.entity.SampleRow;
@@ -51,7 +51,6 @@
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.tapestry5.ComponentResources;
-import org.apache.tapestry5.Field;
import org.apache.tapestry5.RenderSupport;
import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.annotations.Environmental;
@@ -62,12 +61,10 @@
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.beaneditor.BeanModel;
-import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.corelib.components.Zone;
import org.apache.tapestry5.ioc.Messages;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.PropertyAccess;
-import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.BeanModelSource;
import org.apache.tapestry5.upload.services.UploadedFile;
import org.slf4j.Logger;
@@ -76,9 +73,7 @@
import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Calendar;
-import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
@@ -93,7 +88,6 @@
@SuppressWarnings({"UnusedDeclaration"})
@RequiresAuthentication(allowedRoles = {UserRole.ADMIN, UserRole.COORDINATOR, UserRole.OBSERVER})
@Import(stylesheet = "context:css/contacts.css")
-//@IncludeJavaScriptLibrary("context:js/contacts.js")
public class Contacts extends AbstractFilteredPage {
@Inject
@@ -112,14 +106,19 @@
@Environmental
private RenderSupport renderSupport;
+ @Inject
+ private WaoManager manager;
+
+ @Inject
+ private Messages messages;
+
+ public String getLabelForEnum(Enum value) {
+ return messages.get(value.getDeclaringClass().getSimpleName() + "." + value.name());
+ }
+
@Log
void setupRender() throws WaoException {
- if (logger.isDebugEnabled()) {
- logger.debug("RESET DATA");
- logger.debug("User : " + user.getFullName());
- }
contacts = null;
- contactsForm.clearErrors();
// Initialize filters if needed
if (isFiltersVisible()) {
initSelectFilters(true, true, true);
@@ -132,13 +131,9 @@
initCompanyFilter();
}
- /**
- * Add script to renderSupport
- */
@Log
void afterRender() {
- //addCommentScript();
- //addSendEmailScript();
+ contactSelectedId = null;
}
/**************************** CONTACT FILTERS *****************************/
@@ -233,7 +228,6 @@
if (logger.isDebugEnabled()) {
logger.debug("change sample row code in filter to " + getFilter().getSampleRow());
}
- edited = true;
}
/**************************** CONTACT IMPORT/EXPORT ***********************/
@@ -331,6 +325,9 @@
private GenericSelectModel<WaoUser> userSelectModel;
+ @Persist
+ private String contactSelectedId;
+
@Property
@Persist
private String contactUserId;
@@ -389,6 +386,16 @@
return manager.getTooltipBoat(contact.getBoat());
}
+ public String getSecondaryObservers() {
+ StringBuilder result = new StringBuilder();
+ result.append(contact.getMainObserver().getFullName());
+ for (WaoUser observer : contact.getSecondaryObservers()) {
+ result.append(", ");
+ result.append(observer.getFullName());
+ }
+ return result.toString();
+ }
+
public String getTooltipExportFrom() throws WaoException {
if (getContactFilter().getFromDate() != null) {
return "depuis le " + getDateFormat().format(getContactFilter().getFromDate());
@@ -416,11 +423,6 @@
return new SimpleDateFormat("dd/MM/yyyy HH:mm");
}
- public boolean isEditionMode() {
- //return contact.getTopiaId().equals(contactEditedId);
- return contactEdited != null && contact.equals(contactEdited);
- }
-
public boolean isEmpty(Boolean validation) {
return validation == null;
}
@@ -431,30 +433,6 @@
/**************************** CONTACT ROW ACTION **************************/
- public boolean canUpdateDataReliability() {
- boolean result = user.isAdmin() && ! user.isReadOnly() &&
- contact.getValidationProgram() == null;
- return result;
- }
-
-
- /**
- * Flag to know if it's only edition (=true) or save action (=false)
- */
- private boolean edited;
-
- private boolean deleted;
-
- @Persist
- @Property
- private Contact contactEdited;
-
- @Persist
- private String oldComment;
-
- @Persist
- private ContactState oldState;
-
public boolean hasActions() {
return !user.isAdmin() && contact.getValidationCompany() == null
&& !user.isReadOnly();
@@ -472,9 +450,6 @@
public boolean canValidate() {
// Can't validate during edition of the contact row
- if (isEditionMode()) {
- return false;
- }
switch (user.getRole()) {
case ADMIN:
return contact.getValidationProgram() == null &&
@@ -505,519 +480,83 @@
}
}
- void onSelectedFromAcceptContact(String contactId) throws WaoException {
+ /****************************************** CONTACT ACTIONS *******************************************************/
+
+ private Contact modifiedContact;
+
+ @Log
+ void onActionFromAcceptContact(String contactId) throws WaoException {
if (logger.isDebugEnabled()) {
logger.debug("Accept contact : " + contactId);
}
- contactEdited = getContacts().get(contactId);
+ contactSelectedId = contactId;
+ modifiedContact = getContacts().get(contactId);
if (user.isAdmin()) {
- contactEdited.setValidationProgram(Boolean.TRUE);
+ modifiedContact.setValidationProgram(Boolean.TRUE);
} else {
- // For company accepted, addRealTideTime
-// contactEdited.getSampleRow().addRealTideTime(contactEdited);
- contactEdited.setValidationCompany(Boolean.TRUE);
+ modifiedContact.setValidationCompany(Boolean.TRUE);
}
+ saveContact(modifiedContact);
}
- void onSelectedFromRefuseContact(String contactId) throws WaoException {
+ @Log
+ void onActionFromUnvalidateContact(String contactId) throws WaoException {
if (logger.isDebugEnabled()) {
- logger.debug("Refuse contact : " + contactId);
+ logger.debug("Unvalidate contact : " + contactId);
}
- contactEdited = getContacts().get(contactId);
+ contactSelectedId = contactId;
+ modifiedContact = getContacts().get(contactId);
if (user.isAdmin()) {
- // For program refused, removeRealTideTime
-// contactEdited.getSampleRow().removeRealTideTime(contactEdited);
- contactEdited.setValidationProgram(Boolean.FALSE);
+ modifiedContact.setValidationProgram(null);
} else {
- contactEdited.setValidationCompany(Boolean.FALSE);
+ modifiedContact.setValidationCompany(null);
}
+ saveContact(modifiedContact);
}
- void onSelectedFromUnvalidateContact(String contactId) throws WaoException {
+ @Log
+ void onActionFromRefuseContact(String contactId) throws WaoException {
if (logger.isDebugEnabled()) {
- logger.debug("Unvalidate contact : " + contactId);
+ logger.debug("Refuse contact : " + contactId);
}
- contactEdited = getContacts().get(contactId);
+ contactSelectedId = contactId;
+ modifiedContact = getContacts().get(contactId);
if (user.isAdmin()) {
- // For program unvalidate from previous refused validation, addRealTideTime
-// if (BooleanUtils.isFalse(contactEdited.getValidationProgram())) {
-// contactEdited.getSampleRow().addRealTideTime(contactEdited);
-// }
- contactEdited.setValidationProgram(null);
+ modifiedContact.setValidationProgram(Boolean.FALSE);
} else {
- // For company unvalidate from previous accepted validation,
- // removeRealTideTime
-// if (BooleanUtils.isTrue(contactEdited.getValidationCompany())) {
-// contactEdited.getSampleRow().removeRealTideTime(contactEdited);
-// }
- contactEdited.setValidationCompany(null);
+ modifiedContact.setValidationCompany(Boolean.FALSE);
}
+ saveContact(modifiedContact);
}
- @Log
- void onSelectedFromEditContact(String contactId) throws WaoException {
- if (logger.isDebugEnabled()) {
- logger.debug("Edit contact : " + contactId);
- logger.debug("Contact : " + getContacts().get(contactId));
- logger.debug("Set observerId : " + getContacts().get(contactId).getMainObserver());
+ protected void saveContact(Contact contact) {
+ ValidationResult validationResult = serviceContact.validateContact(contact);
+ if (validationResult.isSuccess()) {
+ serviceContact.saveContact(contact, false);
+ } else {
+ layout.addError(validationResult.getMessage());
}
- contactEdited = getContacts().get(contactId); //prepareContactEdited(contactId);
- contactUserId = contactEdited.getMainObserver().getId();
- //contactEditedId = contactId;
- contactSelectedId = contactId;
- oldComment = contactEdited.getComment();
- oldState = contactEdited.getContactState();
- edited = true;
}
@Log
- void onSelectedFromDeleteContact(String contactId) throws WaoException {
+ void onActionFromDeleteContact(String contactId) throws WaoException {
if (logger.isDebugEnabled()) {
logger.debug("Delete contact : " + contactId);
}
- contactEdited = getContacts().get(contactId);
- deleted = true;
+ contactSelectedId = contactId;
+ modifiedContact = getContacts().get(contactId);
+ serviceContact.saveContact(modifiedContact, true);
}
- @Log
- void onSelectedFromSaveContact(String contactId) throws WaoException {
- if (logger.isDebugEnabled()) {
- logger.debug("Save contact : " + contactId);
- logger.debug("Observer Id : " + contactUserId);
- }
- // ContactEdited is in session, previously set by Edit action
-// contactEdited.setState(contactState.toString());
-// WaoUser contactUser = getUserSelectModel().findObject(contactUserId);
-// contactEdited.setMainObserver(contactUser);
-
- if (logger.isDebugEnabled()) {
- logger.debug("Comment : " + contactEdited.getComment());
- }
- }
-
- void onSelectedFromCancelEditContact() throws WaoException {
- contactEdited = null;
- edited = true;
- }
-
- /**************************** CONTACT SAVE ********************************/
-
- @Persist//(PersistenceConstants.FLASH)
- private String contactSelectedId;
-
- @InjectComponent
- private Form contactsForm;
-
- @InjectComponent
- private Zone gridZone;
-
- @InjectComponent
- private Field beginDate;
-
- @InjectComponent
- private Field endDate;
-
- @InjectComponent
- private Field nbObservants;
-
- @InjectComponent
- private Field comment;
-
- @InjectComponent
- private Field inputDate;
-
- @Inject
- private WaoManager manager;
-
- @Inject
- private Messages messages;
-
- @Property
- private boolean sendEmail;
-
- protected void addSendEmailScript() {
- // Ask user to send an email if not already sent
- if (contactEdited != null && !contactEdited.getEmailSent()) {
-
- String confirmMessage =
- "Souhaitez vous envoyer un email de demande d\\'ajout " +
- "du navire à votre portefeuille Allegro afin de pouvoir " +
- "saisir les données ?";
-
- // TODO-fdesbois-2010-07-27 : manage array of states in JavaScript
- renderSupport.addScript("new ContactSendEmail('%s', '%s');",
- confirmMessage,
- // Check state BOARDING_DONE
- ContactState.BOARDING_DONE.name());
-
- renderSupport.addScript("new ContactSendEmail('%s', '%s');",
- confirmMessage,
- // Check state BOARDING_EXPECTED
- ContactState.BOARDING_EXPECTED.name());
- }
- }
-
- @Log
- void onValidateFormFromContactsForm() {
- contactsForm.clearErrors();
- // Validation for saving contact depends on contactState (only edition
- // form)
- if (!edited && contactEdited != null) {
- ContactState contactState = contactEdited.getContactState();
- if (logger.isDebugEnabled()) {
- logger.debug("For state : " + contactState);
- }
-
- Date begin = contactEdited.getObservationBeginDate();
- Date end = contactEdited.getObservationEndDate();
- Date input = contactEdited.getDataInputDate();
- SampleRow row = contactEdited.getSampleRow();
- //DateFormat dateFormat = new SimpleDateFormat("MM/yyyy");
-
- if (begin != null && !row.isValid(begin)) {
- contactsForm.recordError(beginDate,
- "La date de début de la marée doit correspondre à un " +
- "mois valide (non vide) de la ligne " + row.getCode());
- }
-
- if (begin != null && end != null && end.before(begin)) {
- contactsForm.recordError(endDate, "La date de fin de la marée" +
- " ne peut pas être antérieure à celle de début");
- }
-
- Date current = manager.getCurrentDate();
-
- if (end != null && end.after(current)) {
- contactsForm.recordError(endDate, "La date de fin de la marée" +
- " ne peut pas être postérieure à la date du jour");
- }
-
- if (end != null && input != null && end.after(input)) {
- contactsForm.recordError(inputDate, "La date de saisie des" +
- " données ne peut pas être antérieure à la date de" +
- " fin de la marée");
- }
-
- if (input != null && input.after(current)) {
- contactsForm.recordError(inputDate, "La date de saisie des" +
- " données ne peut pas être postérieure à la date" +
- " du jour");
- }
-
- if (contactEdited.getMainObserver() == null) {
- contactsForm.recordError("Il faut un observateur référant");
- }
-
- // Non abouti, Refus ou Refus Définitif
- if (contactState.isUnfinishedState()) {
- String newComment = contactEdited.getComment();
-
- boolean commentDefined = StringUtils.isNotEmpty(newComment);
- boolean commentChanged = commentDefined &&
- !newComment.equals(oldComment);
-
- // Ano #2540 : NPE on oldState, extract boolean for
- // previous unfinishedState case
- boolean previousUnfinishedState = commentDefined &&
- oldState != null && oldState.isUnfinishedState();
-
- // Ano #2440 : no restriction if previous state is unfinished
- if (previousUnfinishedState || commentChanged) {
-
- // RAZ des champs
- contactEdited.setObservationBeginDate(null);
- contactEdited.setObservationEndDate(null);
- contactEdited.setNbObservants(0);
- contactEdited.setMammalsCapture(false);
- contactEdited.setMammalsObservation(false);
- contactEdited.setDataInputDate(null);
-
- } else {
- contactsForm.recordError(comment, "Vous devez ajouter" +
- " un commentaire pour l'état" +
- " '" + contactState.libelle() + "'");
- }
- // Embarquement Réalisé
- } else if (contactState.equals(ContactState.BOARDING_DONE)) {
-
- if (begin == null) {
- contactsForm.recordError(beginDate, "La date de début de" +
- " marée est obligatoire pour l'état" +
- " '" + contactState.libelle() + "'");
- }
- if (end == null) {
- contactsForm.recordError(endDate, "La date de fin de" +
- " marée est obligatoire pour l'état" +
- " '" + contactState.libelle() + "'");
- }
- if (contactEdited.getNbObservants() == 0) {
- contactsForm.recordError(nbObservants, "Il ne peut y" +
- " avoir aucun observateur pour l'état" +
- " '" + contactState.libelle() + "'");
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("ValidationProgram = " + contactEdited.isValidationProgram());
- }
-
- if (BooleanUtils.isTrue(contactEdited.isValidationProgram())) {
-
- // it's an admin validation, data-reliability field must be filled
- if (logger.isDebugEnabled()) {
- logger.debug("field data reliability is " +
- contactEdited.getDataReliability());
- }
-
- if (contactEdited.getDataReliability() == null ||
- contactEdited.getDataReliability() == DataReliability.UNKNOWN) {
- contactsForm.recordError("Il faut préciser la qualité des données avant de valider");
- }
- }
- }
- }
- }
-
- @Log
- Object onSuccessFromContactsForm() {
- if (!edited && contactEdited != null) {
- if (logger.isDebugEnabled()) {
- logger.debug("Contact save : " + contactEdited);
- logger.debug("Contact sendEmail : " + sendEmail);
- }
- serviceContact.saveContact(contactEdited, deleted);
-
- try {
- if (sendEmail && serviceContact.sendContactDoneEmail(contactEdited)) {
- layout.addInfo("Un email a été envoyé pour l'ajout du navire au portefeuille ALLEGRO.");
- }
- } catch (WaoBusinessException eee) {
- String message = manager.getErrorMessage(eee, messages, logger);
- layout.addError(message);
- }
-
- contactSelectedId = contactEdited.getTopiaId();
- oldComment = null;
- contactEdited = null;
- }
- return this;
- }
-
- @Log
- Object onFailureFromContactsForm() {
- if (logger.isDebugEnabled()) {
- logger.debug("Contact can't be saved with errors");
- }
-
- // ANO #2565 :
- // ContactEdited need to be reset if a validationProgram error occurs
- // isEditionMode need to return false to avoid conflict with other save
- if (BooleanUtils.isTrue(contactEdited.isValidationProgram())) {
- contactEdited = null;
- }
-
- return contactsForm;
- }
-
public void createNewContact(Boat boat, SampleRow sampleRow) throws WaoException {
contact = serviceContact.getNewContact(user.getUser(), sampleRow, boat);
// Check boat not null and validation for create the new contact
if (boat != null && boat.canCreateContact(user.getCompany())) {
serviceContact.saveContact(contact, Boolean.FALSE);
- contactSelectedId = contact.getTopiaId();
+ String contactSelectedId = contact.getTopiaId();
} else {
layout.addError("Un contact en cours existe déjà pour ce navire");
}
}
- /****************************** COMMENT POPUP *****************************/
-
- @Property
- private String contactId;
-
- @Property
- private String extraComment;
-
- protected void addCommentScript() {
- renderSupport.addScript("commentController = new ContactComment('" +
- contactsForm.getClientId() + "');");
- }
-
- /**
- * Retrieve the current contact comment depends on edition. Also a comment
- * can be added separatly by admin or coordinator.
- *
- * @return the current contact comment used for edition in commentWindow
- * @see #getCommentData()
- */
- public String getContactComment() {
- String comment = null;
- if (isEditionMode()) {
- comment = contact.getComment();
- } else {
- switch (user.getRole()) {
- case ADMIN:
- comment = contact.getCommentAdmin(); break;
- case COORDINATOR:
- comment = contact.getCommentCoordinator();
- }
- }
- return comment == null ? "" : comment.replace("'", "\'");
- }
-
- /**
- * Prepare comment data for commentController javascript. This data is
- * used to open the comment window in javascript.
- *
- * @return a JSONObject that contains data needed for javascript
- */
- public JSONObject getCommentData() {
- JSONObject json = new JSONObject();
- if (isEditionMode()) {
- json.put("formId", contactsForm.getClientId());
- }
- json.put("id", contact.getId());
- json.put("edited", isEditionMode());
- json.put("unfinished", contact.getContactState().isUnfinishedState());
- json.put("comment", getContactComment());
- return json;
- }
-
- @Log
- void onSuccessFromCommentForm() {
- serviceContact.saveComment(contactId, user.getRole(), extraComment);
- }
-
- /****************************** OBSERVERS POPUP ***************************/
-
- @Property
- @Persist
- private boolean observersFormZoneVisible;
-
- @InjectComponent
- private Zone observersFormZone;
-
- @InjectComponent
- private Form observersForm;
-
- private boolean saveObservers;
-
- @Persist
- private List<WaoUser> secondaryObservers;
-
- @Persist
- @Property
- private String selectedSecondaryObserverId;
-
- @Property
- private int secondaryObserverIndex;
-
- @Property
- private WaoUser observer; // for loop
-
- public List<WaoUser> getSecondaryObservers() {
- if (secondaryObservers == null) {
- secondaryObservers = new ArrayList<WaoUser>(contactEdited.getSecondaryObservers());
- }
- return secondaryObservers;
- }
-
- public String getSecondaryObserversDescription() {
- StringBuilder result = new StringBuilder();
- result.append(contact.getMainObserver().getFullName());
- for (WaoUser observer : contact.getSecondaryObservers()) {
- result.append(", ");
- result.append(observer.getFullName());
- }
- return result.toString();
- }
-
- @Log
- public Zone onActionFromShowObserversForm() {
- contactUserId = contactEdited.getMainObserver().getTopiaId();
-
- // show form
- observersFormZoneVisible = true;
- return observersFormZone;
- }
-
- @Log
- public void onChangeFromSecondaryObserver(String value) {
- if (StringUtils.isEmpty(value)) {
- selectedSecondaryObserverId = null;
- } else {
- selectedSecondaryObserverId = value;
- }
- if (logger.isDebugEnabled()) {
- logger.debug("selected observer changed to " + selectedSecondaryObserverId);
- }
- }
-
- @Log
- public void onChangeFromMainObserver(String value) {
- if (StringUtils.isEmpty(value)) {
- contactUserId = null;
- } else {
- contactUserId = value;
- }
- }
-
-
- @Log
- public Zone onActionFromAddSecondaryObserver() {
- if (selectedSecondaryObserverId != null) {
- WaoUser observerToAdd = getObserverSelectModel().findObject(selectedSecondaryObserverId);
-
- if (observerToAdd == null) {
- logger.error("observerToAdd is null, id is " + selectedSecondaryObserverId);
- } else if ( ! getSecondaryObservers().contains(observersForm)) {
-
- getSecondaryObservers().add(observerToAdd);
- }
- }
- return observersFormZone;
- }
-
- @Log
- public Zone onActionFromRemoveSecondaryObserver(int secondaryObserverIndex) {
- getSecondaryObservers().remove(secondaryObserverIndex);
- return observersFormZone;
- }
-
- @Log
- public void onSelectedFromCancelEditObservers() {
- saveObservers = false;
- }
-
- @Log
- public void onSelectedFromSaveObservers() {
- saveObservers = true;
- }
-
- @Log
- public void onValidateFromObserversForm() {
- if (saveObservers) {
- if (contactUserId == null) {
- observersForm.recordError("Il faut renseigner au moins un observateur");
- }
- }
- }
-
- @Log
- public Object onSuccessFromObserversForm() {
- if (saveObservers) {
- WaoUser mainObserver = getObserverSelectModel().findObject(contactUserId);
- if (logger.isDebugEnabled()) {
- logger.debug("main observer is " + mainObserver);
- }
- contactEdited.setMainObserver(mainObserver);
- contactEdited.setSecondaryObservers(getSecondaryObservers());
- }
- observersFormZoneVisible = false;
- return this;
- }
-
- public String getLabelForEnum(Enum value) {
- return messages.get(value.getDeclaringClass().getSimpleName() + "." + value.name());
- }
-
}
Modified: trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties
===================================================================
--- trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-09 18:14:18 UTC (rev 900)
@@ -88,6 +88,7 @@
wao.ui.field.SampleRow.profession=
wao.ui.field.SampleRow.programName=
wao.ui.field.User.firstName=
+wao.ui.field.User.lastName=
wao.ui.field.User.login=
wao.ui.field.UserProfile.userRole=
wao.ui.field.WaoUser.login=
@@ -107,6 +108,7 @@
wao.ui.form.programEvaluation=
wao.ui.form.readOnly=
wao.ui.form.removeRole=
+wao.ui.form.roles=
wao.ui.import.activityCalendarImportLabel=
wao.ui.import.activityCalendarImportRunning=
wao.ui.import.activityCalendarLabel=
Modified: trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties
===================================================================
--- trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-09 18:14:18 UTC (rev 900)
@@ -69,7 +69,8 @@
wao.ui.field.SampleRow.profession=M\u00E9tier
wao.ui.field.SampleRow.programName=Programme
wao.ui.field.User.firstName=Pr\u00E9nom
-wao.ui.field.User.login=identifiant
+wao.ui.field.User.lastName=Nom
+wao.ui.field.User.login=Identifiant
wao.ui.field.UserProfile.userRole=R\u00F4le
wao.ui.field.WaoUser.login=Identifiant
wao.ui.field.WaoUser.password=Mot de passe
@@ -88,6 +89,7 @@
wao.ui.form.programEvaluation=\u00C9valuation programme
wao.ui.form.readOnly=lecture seule
wao.ui.form.removeRole=retirer ce role
+wao.ui.form.roles=R\u00F4les
wao.ui.import.activityCalendarImportLabel=de l'import des calendriers d'activit\u00E9
wao.ui.import.activityCalendarImportRunning=Import des calendriers d'activit\u00E9 en cours. Vous pouvez continuer \u00E0 naviguer sur le site en attendant la fin du chargement.
wao.ui.import.activityCalendarLabel=des calendriers d'activit\u00E9
Modified: trunk/wao-ui/src/main/webapp/ContactForm.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/ContactForm.tml 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/webapp/ContactForm.tml 2011-01-09 18:14:18 UTC (rev 900)
@@ -71,7 +71,7 @@
<t:block id="editObservers">
<div>
- <t:label t:for="mainObserver" />
+ <label for="mainObserver">${message:wao.ui.field.Contact.mainObserver}</label>
<input t:type="select" t:id="mainObserver" t:model="observerSelectModel" t:validate="required" t:value="mainObserverId" />
</div>
<t:zone t:id="observersFormZone" t:visible="true" t:update="show">
@@ -161,19 +161,17 @@
</t:if>
</div>
- <t:unless test="connectedUser.observer">
- <div>
- <label>${message:wao.ui.field.Contact.commentCoordinator}</label>
- <t:if t:test="contact.commentCoordinator">
- <div class="value">
- ${contact.commentCoordinator}
- </div>
- <p:else>
- <em>${message:wao.ui.misc.noComment}</em>
- </p:else>
- </t:if>
- </div>
- </t:unless>
+ <div>
+ <label>${message:wao.ui.field.Contact.commentCoordinator}</label>
+ <t:if t:test="contact.commentCoordinator">
+ <div class="value">
+ ${contact.commentCoordinator}
+ </div>
+ <p:else>
+ <em>${message:wao.ui.misc.noComment}</em>
+ </p:else>
+ </t:if>
+ </div>
</t:block>
<t:block id="editObservationReport">
@@ -208,10 +206,6 @@
<input t:type="checkbox" t:id="mammalsCapture" value="contact.mammalsCapture" />
</div>
<div>
- <label for="observerComment">${message:wao.ui.field.Contact.dataInputDate}</label>
- <input t:type="textarea" t:id="observerComment" value="contact.comment" />
- </div>
- <div>
<label for="inputDate">${message:wao.ui.field.Contact.dataInputDate}</label>
<input t:type="datefield" t:id="inputDate" class="date" value="contact.dataInputDate" />
</div>
Modified: trunk/wao-ui/src/main/webapp/Contacts.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-09 18:14:18 UTC (rev 900)
@@ -184,251 +184,129 @@
</t:if>
</p>
<t:zone t:id="gridZone">
- <form t:type="form" t:id="contactsForm" t:zone="gridZone">
- <t:errors id="so-contact-form-errors" t:banner="message:contactsForm-errors-banner"/>
- <input t:type="hidden" t:id="hiddenSendEmail" t:value="sendEmail" />
- <div t:type="grid" t:source="contacts" t:row="contact" class="t-data-grid ${gridClass}" t:model="contactModel" t:rowClass="prop:rowClass"
- t:rowsPerPage="20">
- <p:mainObserverCell>
- <t:if test="contact.secondaryObservers">
- <span t:type="ck/Tooltip" title="${message:wao.ui.field.Contact.secondaryObservers}" t:value="prop:secondaryObserversDescription" t:effect="appear">
- ${contact.mainObserver.fullName}…
- </span>
- <p:else>
- ${contact.mainObserver.fullName}
- </p:else>
- </t:if>
- <!--t:if t:test="editionMode">
- <a t:type="actionlink" t:id="showObserversForm" t:zone="observersFormZone" context="${contact.topiaId}" class="display-form" title="Modifier les observateurs associés à ce contact">...</a>
- </t:if-->
- </p:mainObserverCell>
- <p:sampleRowCell>
- <span t:type="ck/Tooltip" title="Infos" t:value="prop:sampleRowDescription" t:effect="appear">
- ${contact.sampleRow.code}
+ <div t:type="grid" t:source="contacts" t:row="contact" class="t-data-grid ${gridClass}" t:model="contactModel" t:rowClass="prop:rowClass"
+ t:rowsPerPage="20">
+ <p:mainObserverCell>
+ <t:if test="contact.secondaryObservers">
+ <span t:type="ck/Tooltip" title="${message:wao.ui.field.Contact.secondaryObservers}" t:value="prop:secondaryObservers" t:effect="appear">
+ ${contact.mainObserver.fullName}…
</span>
- </p:sampleRowCell>
- <p:topiaCreateDateCell>
- <t:output value="contact.topiaCreateDate" format="dateFormat" />
- </p:topiaCreateDateCell>
- <p:boatCell>
- <span t:type="ck/Tooltip" title="Infos" t:value="prop:boatDescription" t:effect="appear">
- ${contact.boat.name}
+ <p:else>
+ ${contact.mainObserver.fullName}
+ </p:else>
+ </t:if>
+ </p:mainObserverCell>
+ <p:sampleRowCell>
+ <span t:type="ck/Tooltip" title="Infos" t:value="prop:sampleRowDescription" t:effect="appear">
+ ${contact.sampleRow.code}
+ </span>
+ </p:sampleRowCell>
+ <p:topiaCreateDateCell>
+ <t:output value="contact.topiaCreateDate" format="dateFormat" />
+ </p:topiaCreateDateCell>
+ <p:boatCell>
+ <span t:type="ck/Tooltip" title="Infos" t:value="prop:boatDescription" t:effect="appear">
+ ${contact.boat.name}
+ </span>
+ </p:boatCell>
+ <p:stateCell>
+ ${getLabelForEnum(contact.contactState)}
+ </p:stateCell>
+ <p:observationBeginDateCell>
+ <t:output value="contact.observationBeginDate" format="dateTimeFormat" />
+ </p:observationBeginDateCell>
+ <p:observationEndDateCell>
+ <t:output value="contact.observationEndDate" format="dateTimeFormat" />
+ </p:observationEndDateCell>
+ <p:nbObservantsCell>
+ ${contact.nbObservants}
+ </p:nbObservantsCell>
+ <p:mammalsCell>
+ <t:if t:test="contact.mammalsObservation">
+ <img src="${asset:context:img/eye-22px.png}" alt="Observations" title="Observations" />
+ </t:if>
+ <t:if t:test="contact.mammalsCapture">
+ <img src="${asset:context:img/fishing-net-22px.png}" alt="Captures" title="Captures" />
+ </t:if>
+ </p:mammalsCell>
+ <p:validationCell>
+ <t:booleanImage t:value="contact.validationCompany" t:empty="isEmpty(contact.validationCompany)"
+ t:emptyTitle="Non validé par la société"
+ t:trueTitle="Validé par la société" t:falseTitle="Refusé par la société"/>
+ <t:booleanImage t:value="contact.validationProgram" t:empty="isEmpty(contact.validationProgram)"
+ t:emptyTitle="Non validé par le programme"
+ t:trueTitle="Validé par le programme" t:falseTitle="Refusé par le programme"/>
+ </p:validationCell>
+ <p:dataInputDateCell>
+ <t:output value="contact.dataInputDate" format="dateFormat" />
+ </p:dataInputDateCell>
+ <p:commentCell>
+ <t:if t:test="contact.comment">
+ <span t:type="ck/Tooltip" title="Commentaire" t:value="${getCommentTooltip(contact.comment)}" t:effect="appear">
+ ${getCommentDisplayText(contact.comment)}
</span>
- </p:boatCell>
- <p:stateCell>
- <t:if t:test="editionMode">
- <input t:type="select" t:id="contactState" t:value="contactEdited.contactState" t:validate="required"/>
- <p:else>${contact.contactState.libelle()}</p:else>
+ </t:if>
+ </p:commentCell>
+ <p:dataReliabilityCell>
+ <t:if t:test="boardingDone">
+ <t:if t:test="contact.validationCompany">
+ ${getLabelForEnum(contact.dataReliability)}
</t:if>
- </p:stateCell>
- <p:observationBeginDateCell>
- <t:if t:test="editionMode">
- <input t:type="datefield" t:id="beginDate" class="date" value="contactEdited.observationBeginDate" />
- <p:else><t:output value="contact.observationBeginDate" format="dateTimeFormat" /></p:else>
- </t:if>
- </p:observationBeginDateCell>
- <p:observationEndDateCell>
- <t:if t:test="editionMode">
- <input t:type="datefield" t:id="endDate" class="date" value="contactEdited.observationEndDate" />
- <p:else><t:output value="contact.observationEndDate" format="dateTimeFormat" /></p:else>
- </t:if>
- </p:observationEndDateCell>
- <p:nbObservantsCell>
- <t:if t:test="editionMode">
- <input t:type="textfield" t:id="nbObservants" class="nbObservants" value="contactEdited.nbObservants" />
- <p:else>${contact.nbObservants}</p:else>
- </t:if>
- </p:nbObservantsCell>
- <p:mammalsCell>
- <t:if t:test="editionMode">
- <input t:type="checkbox" t:id="mammalsObservation" value="contactEdited.mammalsObservation"/>
- <t:label t:for="mammalsObservation">
- <img src="${asset:context:img/eye-22px.png}" alt="Observations"
- title="Observations" />
- </t:label>
- <input t:type="checkbox" t:id="mammalsCapture" value="contactEdited.mammalsCapture" />
- <t:label t:for="mammalsCapture">
- <img src="${asset:context:img/fishing-net-22px.png}" alt="Captures"
- title="Captures" />
- </t:label>
- <p:else>
- <t:if t:test="contact.mammalsObservation">
- <img src="${asset:context:img/eye-22px.png}" alt="Observations" title="Observations" />
- </t:if>
- <t:if t:test="contact.mammalsCapture">
- <img src="${asset:context:img/fishing-net-22px.png}" alt="Captures" title="Captures" />
- </t:if>
- </p:else>
- </t:if>
- </p:mammalsCell>
- <p:validationCell>
- <t:booleanImage t:value="contact.validationCompany" t:empty="isEmpty(contact.validationCompany)"
- t:emptyTitle="Non validé par la société"
- t:trueTitle="Validé par la société" t:falseTitle="Refusé par la société"/>
- <t:booleanImage t:value="contact.validationProgram" t:empty="isEmpty(contact.validationProgram)"
- t:emptyTitle="Non validé par le programme"
- t:trueTitle="Validé par le programme" t:falseTitle="Refusé par le programme"/>
- </p:validationCell>
- <p:dataInputDateCell>
- <t:if t:test="editionMode">
- <input t:type="datefield" t:id="inputDate" class="date" value="contactEdited.dataInputDate" />
- <p:else><t:output value="contact.dataInputDate" format="dateFormat" /></p:else>
- </t:if>
- </p:dataInputDateCell>
- <p:commentCell>
- <t:if t:test="editionMode">
-
- <a onclick="commentController.openWindow(${commentData})" title="Ajouter un commentaire">
- <img id="commentImage" src="${asset:context:img/comment-22px.png}" alt="Ajout commentaire" />
- <img id="commentInvalidImage" class="hidden" src="${asset:context:img/comment-invalid-22px.png}"
- alt="Commentaire non valide" title="Le commentaire est obligatoire pour un échec" />
- <img id="commentValidImage" class="hidden" src="${asset:context:img/comment-valid-22px.png}"
- alt="Commentaire valide" title="Le commentaire a bien été ajouté" />
- </a>
-
- <textarea t:type="textarea" t:id="comment" class="hidden" value="contactEdited.comment" />
-
- <p:else>
- <t:if t:test="contact.comment">
- <span t:type="ck/Tooltip" title="Commentaire" t:value="${getCommentTooltip(contact.comment)}" t:effect="appear">
- ${getCommentDisplayText(contact.comment)}
- </span>
- </t:if>
- </p:else>
- </t:if>
- </p:commentCell>
- <p:dataReliabilityCell>
- <t:if t:test="boardingDone">
- <t:if t:test="contact.validationCompany">
- <t:if test="contact.validationProgram">
- ${getLabelForEnum(contact.dataReliability)}
- <!--p:else>
- <t:if test="canUpdateDataReliability()">
- <input t:type="select" t:id="dataReliability" t:value="contact.dataReliability" validate="required" />
- </t:if>
- </p:else-->
- </t:if>
- </t:if>
- </t:if>
- </p:dataReliabilityCell>
- <p:commentCoordinatorCell>
+ </t:if>
+ </p:dataReliabilityCell>
+ <p:commentCoordinatorCell>
+ <t:if t:test="contact.commentCoordinator">
<span t:type="ck/Tooltip" title="Commentaire société" t:value="${getCommentTooltip(contact.commentCoordinator)}" t:effect="appear">
${getCommentDisplayText(contact.commentCoordinator)}
</span>
- </p:commentCoordinatorCell>
- <p:commentAdminCell>
+ </t:if>
+ </p:commentCoordinatorCell>
+ <p:commentAdminCell>
+ <t:if t:test="contact.commentAdmin">
<span t:type="ck/Tooltip" title="Commentaire admin" t:value="${getCommentTooltip(contact.commentAdmin)}" t:effect="appear">
${getCommentDisplayText(contact.commentAdmin)}
</span>
- </p:commentAdminCell>
- <p:actionsCell>
- <t:unless t:test="contact.validationProgram">
- <a t:type="pagelink" t:page="contactForm" t:anchor="focus" t:context="contact.topiaId">
- <img src="${asset:context:}/img/edit.png" alt="Modifier" title="Modifier le contact"/>
+ </t:if>
+ </p:commentAdminCell>
+ <p:actionsCell>
+ <t:unless t:test="contact.validationProgram">
+ <a t:type="pagelink" t:page="contactForm" t:anchor="focus" t:context="contact.topiaId">
+ <img src="${asset:context:}/img/edit.png" alt="Modifier" title="Modifier le contact"/>
+ </a>
+ <p:else>
+ <img src="${asset:context:img/edit-unavailable-22px.png}" alt="Edit unavailable" title="Modification du contact indisponible"/>
+ </p:else>
+ </t:unless>
+ <t:if t:test="hasActions()">
+ <a t:type="actionlink" t:id="deleteContact" t:context="contact.topiaId" t:mixins="nuiton/confirm" t:message="literal:Etes-vous sûr de vouloir supprimer définitivement ce contact ?">
+ <img src="${asset:context:img/delete2.png}" alt="Delete contact" />
+ </a>
+ <p:else>
+ <img src="${asset:context:img/delete-unavailable-22px.png}" alt="Delete unavailable" title="Suppression du contact indisponible" />
+ </p:else>
+ </t:if>
+ <t:if t:test="hasValidationActions()">
+ <t:if t:test="canValidate()">
+ <a t:type="actionlink" t:id="acceptContact" t:context="contact.topiaId">
+ <img src="${asset:context:img/accept-22px.png}" alt="Accept contact" />
</a>
+ <a t:type="actionlink" t:id="refuseContact" t:context="contact.topiaId">
+ <img src="${asset:context:img/refuse-22px.png}" alt="Refuse contact" />
+ </a>
<p:else>
- <img src="${asset:context:img/edit-unavailable-22px.png}" alt="Edit unavailable" title="Modification du contact indisponible"/>
- </p:else>
- </t:unless>
- <t:if t:test="hasActions()">
- <t:if t:test="editionMode">
- <input t:type="submit" t:id="cancelEditContact" class="ico22px undo22px" value="Undo"
- title="Annuler les modifications" />
- <input t:type="submitContext" t:id="saveContact" class="ico22px save22px" value="Save"
- t:context="contact.topiaId" title="Enregistrer le contact" />
- <p:else>
- <!--input t:type="submitContext" t:id="editContact" class="ico edit" value="Edit"
- t:context="contact.topiaId" title="Modifier le contact" /-->
- <input t:type="submitContext" t:id="deleteContact" class="ico22px delete" value="Delete"
- t:context="contact.topiaId" title="Supprimer le contact"
- t:mixins="nuiton/confirm" t:message="literal:Etes-vous sûr de vouloir supprimer définitivement ce contact ?" />
- </p:else>
- </t:if>
- <p:else>
- <t:unless t:test="user.admin">
- <!--img src="${asset:context:img/edit-unavailable-22px.png}" alt="Edit unavailable" title="Edition du contact indisponible"/-->
- <img src="${asset:context:img/delete-unavailable-22px.png}" alt="Delete unavailable" title="Suppression du contact indisponible"/>
+ <t:unless t:test="canUnvalidate()">
+ <img src="${asset:context:img/accept-unavailable-22px.png}" alt="Accept unavailable" title="Validation du contact indisponible"/>
+ <img src="${asset:context:img/refuse-unavailable-22px.png}" alt="Refuse unavailable" title="Refus du contact indisponible"/>
</t:unless>
</p:else>
</t:if>
- <t:if t:test="hasValidationActions()">
- <t:if t:test="canValidate()">
- <input t:type="submitContext" t:id="acceptContact" class="ico22px accept" value="Accept"
- t:context="contact.topiaId" title="Valider le contact" />
- <input t:type="submitContext" t:id="refuseContact" class="ico22px refuse" value="Refuse"
- t:context="contact.topiaId" title="Refuser le contact" />
- <p:else>
- <t:unless t:test="canUnvalidate()">
- <img src="${asset:context:img/accept-unavailable-22px.png}" alt="Accept unavailable" title="Validation du contact indisponible"/>
- <img src="${asset:context:img/refuse-unavailable-22px.png}" alt="Refuse unavailable" title="Refus du contact indisponible"/>
- </t:unless>
- </p:else>
- </t:if>
- <t:if t:test="canUnvalidate()">
- <input t:type="submitContext" t:id="unvalidateContact" class="ico22px unvalidate" value="Unvalidate"
- t:context="contact.topiaId" title="Enlever la validation du contact" />
- </t:if>
- <!--t:if t:test="editionMode">
- <img src="${asset:context:img/comment-unavailable-22px.png}" alt="Add comment" />
- <p:else>
- <a class="link" onclick="commentController.openWindow(${commentData});">
- <img src="${asset:context:img/comment-22px.png}" alt="Add comment" />
- </a>
- </p:else>
- </t:if-->
+ <t:if t:test="canUnvalidate()">
+ <a t:type="actionlink" t:id="unvalidateContact" t:context="contact.topiaId">
+ <img src="${asset:context:img/help-22px.png}" alt="Unvalidate contact" />
+ </a>
</t:if>
- </p:actionsCell>
- </div>
- </form>
+ </t:if>
+ </p:actionsCell>
+ </div>
</t:zone>
-<div t:type="ck/Window" t:id="commentWindow" t:show="false" t:modal="true"
- title="literal:Ajouter un commentaire" t:width="510" t:height="195">
- <form t:type="form" t:id="commentForm" action="tapestry">
- <p>
- <textarea t:type="textarea" t:id="editComment" t:value="extraComment" cols="50" rows="7" />
- <input t:type="hidden" t:id="hiddenContactId" t:value="contactId" />
- </p>
- <p> </p>
- <p class="aright">
- <a onclick="commentController.saveComment()" class="save">
- <img src="${asset:context:img/save-22px.png}" alt="Save comment"/>
- </a>
-
- </p>
- </form>
-</div>
-<t:zone t:id="observersFormZone" t:visible="observersFormZoneVisible">
- <t:if test="contactEdited"> <!-- only if contact != null : prevent NPE at peage loading -->
- Modification des observateurs associés à ce contact :
- <form t:type="form" t:id="observersForm" action="tapestry">
- <p>
- <t:errors />
- </p>
- <p>
- <t:label t:for="mainObserver" />:
- <input t:type="select" t:id="mainObserver" t:model="observerSelectModel" t:validate="required" t:value="contactUserId" t:mixins="ck/onEvent" t:event="change" />
- </p>
- <p>
- <t:label t:for="secondaryObserver" />:
- <input t:type="select" t:id="secondaryObserver" t:model="observerSelectModel" t:value="selectedSecondaryObserverId" t:mixins="ck/onEvent" t:event="change" />
- <a t:type="actionlink" t:id="addSecondaryObserver" title="Ajouter un observateur" t:zone="observersFormZone">
- <img src="${asset:context:img/add-16px.png}" />
- </a>
- <ul>
- <li t:type="loop" t:source="secondaryObservers" t:value="observer" t:index="secondaryObserverIndex" t:volatile="true">
- ${observer.fullName}
- <a t:type="actionlink" t:id="removeSecondaryObserver" t:context="secondaryObserverIndex" title="Supprimer cet observateur" t:zone="observersFormZone">
- <img src="${asset:context:img/remove-22px.png}" />
- </a>
- </li>
- </ul>
- </p>
- <p> </p>
- <p class="aright">
- <input t:type="submit" t:id="cancelEditObservers" class="ico22px undo22px" value="Undo" title="Annuler les modifications" />
- <input t:type="submit" t:id="saveObservers" class="ico22px save22px" value="Save" title="Enregistrer les observateurs" />
- </p>
- </form>
- </t:if>
-</t:zone>
</t:layout>
Modified: trunk/wao-ui/src/main/webapp/css/contacts.css
===================================================================
--- trunk/wao-ui/src/main/webapp/css/contacts.css 2011-01-06 11:11:16 UTC (rev 899)
+++ trunk/wao-ui/src/main/webapp/css/contacts.css 2011-01-09 18:14:18 UTC (rev 900)
@@ -141,10 +141,7 @@
white-space: nowrap;
}
-div#so-contacts table.t-data-grid tbody tr td.commentCoordinator,
-div#so-contacts table.t-data-grid tbody tr td.commentAdmin,
div#so-contacts table.t-data-grid tbody tr td.comment,
-div#so-contacts table.t-data-grid thead tr th.comment,
div#so-contacts table.t-data-grid thead tr th.commentCoordinator,
div#so-contacts table.t-data-grid thead tr th.commentAdmin
div#so-contacts table.t-data-grid thead tr th.dataReliability {
1
0
[Suiviobsmer-commits] r899 - trunk/wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 06 Jan '11
by bleny@users.labs.libre-entreprise.org 06 Jan '11
06 Jan '11
Author: bleny
Date: 2011-01-06 11:11:16 +0000 (Thu, 06 Jan 2011)
New Revision: 899
Log:
fix layout for admin page
Modified:
trunk/wao-ui/src/main/webapp/Administration.tml
Modified: trunk/wao-ui/src/main/webapp/Administration.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Administration.tml 2011-01-06 11:09:03 UTC (rev 898)
+++ trunk/wao-ui/src/main/webapp/Administration.tml 2011-01-06 11:11:16 UTC (rev 899)
@@ -108,25 +108,28 @@
<input t:type="textfield" t:id="loginAdministration" value="userEdited.login" t:validate="required" />
</p:login>
<p:password>
+ <label for="passwordAdministration">${message:wao.ui.form.definePasswordManually}</label>
+ <input t:type="passwordfield" t:id="passwordAdministration" class="width100" value="password" />
+ </p:password>
+ <p:generatePassword>
<label for="generatePassword">${message:wao.ui.form.generatePassword}</label>
<input t:type="checkbox" t:id="generatePassword" value="generatePassword" />
- <span> ${message:wao.ui.form.definePasswordManually} </span>
- <input t:type="passwordfield" t:id="passwordAdministration" class="width100" value="password" />
- </p:password>
+ </p:generatePassword>
<p:userRole>
<t:zone id="so-admin-userRoleZone" t:id="userRoleZone" t:update="show">
- <label for="userRole">${message:wao.ui.field.UserProfile.userRole}</label>
- <select t:type="select" t:id="userRole" t:value="role" t:model="userRoleSelectModel"
- t:zone="so-admin-userRoleZone"/>
-
- <label for="readOnly">${message:wao.ui.form.readOnly}</label>
- <input t:type="checkbox" t:id="readOnly" t:value="readOnly"
- t:mixins="ck/onEvent" t:event="change"/>
-
- <a t:type="actionlink" t:id="addRole" title="${message:wao.ui.form.addRole}" t:zone="so-admin-userRoleZone">
- <img src="${asset:context:img/add-16px.png}" alt="${message:wao.ui.form.addRole}"/>
- </a>
- <ul>
+ <label for="userRole">${message:wao.ui.form.roles}</label>
+ <div style="width: 48%; float: left;">
+ <select t:type="select" t:id="userRole" t:value="role" t:model="userRoleSelectModel"
+ t:zone="so-admin-userRoleZone"/>
+ <br />
+ <!--label for="readOnly">${message:wao.ui.form.readOnly} :</label-->
+ <span for="readOnly">${message:wao.ui.form.readOnly} :</span>
+ <input t:type="checkbox" t:id="readOnly" t:value="readOnly" t:mixins="ck/onEvent" t:event="change"/>
+ <a t:type="actionlink" t:id="addRole" title="${message:wao.ui.form.addRole}" t:zone="so-admin-userRoleZone">
+ <img src="${asset:context:img/add-16px.png}" alt="${message:wao.ui.form.addRole}"/>
+ </a>
+ </div>
+ <ul style="clear: both;">
<li t:type="loop" t:source="editedUserProfiles" t:value="profile" t:index="profileIndex" t:volatile="true">
${profile.description}
<a t:type="actionlink" t:id="removeRole" t:context="profileIndex" title="${message:wao.ui.form.removeRole}" t:zone="so-admin-userRoleZone">
1
0
[Suiviobsmer-commits] r898 - trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages
by bleny@users.labs.libre-entreprise.org 06 Jan '11
by bleny@users.labs.libre-entreprise.org 06 Jan '11
06 Jan '11
Author: bleny
Date: 2011-01-06 11:09:03 +0000 (Thu, 06 Jan 2011)
New Revision: 898
Log:
fix sampleRowForm page to not display non-business fields
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-01-06 10:09:56 UTC (rev 897)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SampleRowForm.java 2011-01-06 11:09:03 UTC (rev 898)
@@ -71,6 +71,7 @@
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.PropertyAccess;
import org.apache.tapestry5.services.BeanModelSource;
+import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.util.PeriodDates;
import org.nuiton.util.StringUtil;
import org.slf4j.Logger;
@@ -91,7 +92,6 @@
* @author fdesbois <fdesbois at codelutin.com>
*/
@RequiresAuthentication(allowedRoles = UserRole.ADMIN, readOnlyAllowed = false)
-//@IncludeStylesheet("context:css/sampling.css")
@Import(stylesheet = "context:css/sampling.css")
public class SampleRowForm {
@@ -205,7 +205,11 @@
* @return a BeanModel<Profession>
*/
public BeanModel<Profession> getProfessionModel() {
- return beanModelSource.createDisplayModel(Profession.class, resources.getMessages());
+ BeanModel<Profession> professionModel = beanModelSource.createDisplayModel(Profession.class, resources.getMessages());
+ professionModel.exclude(TopiaEntity.TOPIA_ID);
+ professionModel.exclude(TopiaEntity.TOPIA_CREATE_DATE);
+ professionModel.exclude(TopiaEntity.TOPIA_VERSION);
+ return professionModel;
}
/**
1
0
[Suiviobsmer-commits] r897 - trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages
by bleny@users.labs.libre-entreprise.org 06 Jan '11
by bleny@users.labs.libre-entreprise.org 06 Jan '11
06 Jan '11
Author: bleny
Date: 2011-01-06 10:09:56 +0000 (Thu, 06 Jan 2011)
New Revision: 897
Log:
fix CSS for user Form
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-06 09:25:08 UTC (rev 896)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Administration.java 2011-01-06 10:09:56 UTC (rev 897)
@@ -494,15 +494,17 @@
public BeanModel<WaoUser> getUserModel() {
if (userModel == null) {
userModel = beanModelSource.createEditModel(WaoUser.class, messages);
+ userModel.add("generatePassword", null);
userModel.add("userRole", null);
userModel.include(
WaoUser.PROPERTY_FIRST_NAME,
WaoUser.PROPERTY_LAST_NAME,
WaoUser.PROPERTY_LOGIN,
+ "generatePassword",
WaoUser.PROPERTY_PASSWORD,
WaoUser.PROPERTY_PHONE_NUMBER,
- "userRole",
- WaoUser.PROPERTY_ACTIVE
+ WaoUser.PROPERTY_ACTIVE,
+ "userRole"
);
}
return userModel;
1
0
[Suiviobsmer-commits] r896 - trunk/wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 06 Jan '11
by bleny@users.labs.libre-entreprise.org 06 Jan '11
06 Jan '11
Author: bleny
Date: 2011-01-06 09:25:08 +0000 (Thu, 06 Jan 2011)
New Revision: 896
Log:
fix bad label in Administration
Modified:
trunk/wao-ui/src/main/webapp/Administration.tml
Modified: trunk/wao-ui/src/main/webapp/Administration.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Administration.tml 2011-01-05 21:43:16 UTC (rev 895)
+++ trunk/wao-ui/src/main/webapp/Administration.tml 2011-01-06 09:25:08 UTC (rev 896)
@@ -100,7 +100,7 @@
<input t:type="textfield" t:id="firstName" value="userEdited.firstName" t:validate="required" />
</p:firstName>
<p:lastName>
- <label for="lastName">${message:wao.ui.field.User.firstName}</label>
+ <label for="lastName">${message:wao.ui.field.User.lastName}</label>
<input t:type="textfield" t:id="lastName" value="userEdited.lastName" t:validate="required" />
</p:lastName>
<p:login>
1
0
[Suiviobsmer-commits] r895 - trunk/wao-ui/src/main/webapp
by bleny@users.labs.libre-entreprise.org 05 Jan '11
by bleny@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: bleny
Date: 2011-01-05 21:43:16 +0000 (Wed, 05 Jan 2011)
New Revision: 895
Log:
fix CSS for filters of Boats and Contacts pages
Modified:
trunk/wao-ui/src/main/webapp/Boats.tml
trunk/wao-ui/src/main/webapp/Contacts.tml
Modified: trunk/wao-ui/src/main/webapp/Boats.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Boats.tml 2011-01-05 21:33:59 UTC (rev 894)
+++ trunk/wao-ui/src/main/webapp/Boats.tml 2011-01-05 21:43:16 UTC (rev 895)
@@ -53,26 +53,26 @@
<div class="t-beaneditor">
<div>
<!-- Sampling filter -->
- <label for="facadeName">${message:wao.ui.field.FishingZone.facadeName}:</label>
+ <label for="facadeName">${message:wao.ui.field.FishingZone.facadeName} :</label>
<select t:type="select" t:id="facadeName" t:model="facadeSelectModel" value="filter.facadeName" />
<input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="Refresh"
title="${message:wao.ui.filters.refresh}"/>
- <label for="sectorName">${message:wao.ui.field.FishingZone.sectorName}</label>:
+ <label for="sectorName">${message:wao.ui.field.FishingZone.sectorName} :</label>
<select t:type="select" t:id="sectorName" t:model="sectorSelectModel" value="filter.sectorName" />
<input t:type="submit" class="ico22px refresh" t:id="refreshBySector" value="Refresh"
title="${message:wao.ui.filters.refresh}"/>
- <label for="sampleRow">${message:wao.ui.field.SampleRow.code}:</label>
+ <label for="sampleRow">${message:wao.ui.field.SampleRow.code} :</label>
<select t:type="select" t:id="sampleRow" t:disabled="sampleRowExists" t:model="sampleRowSelectModel" value="sampleRowId" />
</div><p> </p>
<div>
<!-- Boat filter -->
- <label for="boatName">${message:wao.ui.field.Boat.name}</label>
+ <label for="boatName">${message:wao.ui.field.Boat.name} :</label>
<input t:type="textfield" t:id="boatName" class="width150" t:value="boatFilter.boatName" t:mixins="Autocomplete" />
- <span>${message:wao.ui.field.Boat.immatriculation}</span>
+ <span style="margin-left: 15px;">${message:wao.ui.field.Boat.immatriculation} :</span>
<input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="boatFilter.boatImmatriculation" />
- <span>${message:wao.ui.field.BoatDistrict.code}</span>
+ <span style="margin-left: 15px;">${message:wao.ui.field.BoatDistrict.code} :</span>
<input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="boatFilter.boatDistrictCode" />
- <span>${message:wao.ui.field.Boat.shipOwner}</span>
+ <span style="margin-left: 15px;">${message:wao.ui.field.Boat.shipOwner} :</span>
<input t:type="textfield" t:id="shipOwnerName" class="width150" t:value="boatFilter.shipOwnerName" t:mixins="Autocomplete" />
</div>
<div class="t-beaneditor-row aright">
Modified: trunk/wao-ui/src/main/webapp/Contacts.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-05 21:33:59 UTC (rev 894)
+++ trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-05 21:43:16 UTC (rev 895)
@@ -68,6 +68,8 @@
<div>
<t:label t:for="fromDate" />:
<input t:type="datefield" class="width70" t:id="fromDate" value="contactFilter.fromDate" />
+ <t:label t:for="state" />:
+ <select t:type="select" t:id="state" value="contactFilter.state"/>
<t:if t:test="user.admin">
<t:label t:for="company" />:
<input t:type="select" t:id="company" t:model="companySelectModel" value="companyId"/>
@@ -78,13 +80,11 @@
<select t:type="select" t:id="observer" t:model="observerSelectModel" value="observerId" />
</div><p> </p>
<div>
- <!-- Boat filter -->
<label>Navire </label>
<t:label t:for="boatImmatriculation" />:
<input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="contactFilter.boatImmatriculation" />
<t:label t:for="boatDistrictCode" />:
<input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="contactFilter.boatDistrictCode" />
- <!-- Sampling filter -->
<t:label t:for="facadeName" />:
<select t:type="select" t:id="facadeName" t:model="facadeSelectModel" value="contactFilter.facadeName" />
<input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="Refresh"
@@ -95,7 +95,8 @@
title="Rafraîchir les métiers en fonction de la zone sélectionnée"/>
<t:label t:for="sampleRow" />:
<input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" t:mixins="ck/onEvent" t:event="change" />
- <!-- Contact filter -->
+ </div><p> </p>
+ <div>
<label>Observations: </label>
<input t:type="checkbox" t:id="mammalsObservation1" value="contactFilter.mammalsObservation" />
<t:label t:for="mammalsObservation1">
@@ -106,10 +107,6 @@
<t:label t:for="mammalsCapture1">
<img src="${asset:context:img/fishing-net-22px.png}" alt="Captures" title="Captures" />
</t:label>
- </div><p> </p>
- <div>
- <t:label t:for="state" />:
- <select t:type="select" t:id="state" value="contactFilter.state"/>
<label>Validation société: </label>
<input t:type="checkbox" t:id="companyAccepted" value="contactFilter.companyAccepted" />
<t:label t:for="companyAccepted">
@@ -151,7 +148,7 @@
<label for="commentAdmin">programme</label>
</t:if>
</div>
- <div style="margin-top: 15px;">
+ <div class="fleft" style="margin-top: 15px;">
<input t:type="checkbox" t:id="sortedByBoardingDate" value="contactFilter.sortedByBoardingDate" /> <t:label t:for="sortedByBoardingDate" />
</div>
<div class="t-beaneditor-row aright">
1
0
[Suiviobsmer-commits] r894 - trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services
by bleny@users.labs.libre-entreprise.org 05 Jan '11
by bleny@users.labs.libre-entreprise.org 05 Jan '11
05 Jan '11
Author: bleny
Date: 2011-01-05 21:33:59 +0000 (Wed, 05 Jan 2011)
New Revision: 894
Log:
fix visibilities of comment for observer
Modified:
trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java
Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java
===================================================================
--- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java 2011-01-05 21:27:32 UTC (rev 893)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/services/ContactModelFactory.java 2011-01-05 21:33:59 UTC (rev 894)
@@ -127,8 +127,7 @@
}
if (userRole != UserRole.ADMIN && userRole != UserRole.COORDINATOR) {
- model.exclude(Contact.PROPERTY_COMMENT_COORDINATOR,
- Contact.PROPERTY_COMMENT_ADMIN, "dataReliability");
+ model.exclude("dataReliability");
}
}
1
0