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
January 2011
- 2 participants
- 91 discussions
[Suiviobsmer-commits] r906 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages resources/i18n 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 14:57:08 +0000 (Mon, 10 Jan 2011)
New Revision: 906
Log:
i18n for page Contacts
Modified:
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-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 09:21:32 UTC (rev 905)
+++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2011-01-10 14:57:08 UTC (rev 906)
@@ -192,10 +192,6 @@
return true;
}
- public boolean canFilterExtraComments() {
- return user.isAdmin() || user.isCoordinator();
- }
-
Object onActionFromShowFilters() {
// Initialize filters
initSelectFilters(true, true, true);
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-10 09:21:32 UTC (rev 905)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_en_GB.properties 2011-01-10 14:57:08 UTC (rev 906)
@@ -1,3 +1,10 @@
+${message\:wao.ui.action.unvalidateContact"\ />=
+</a>=
+</div>=
+</p\:actionsCell>=
+</t\:if>=
+</t\:layout>=
+</t\:zone>=
ContactState.BOARDING_DONE=
ContactState.BOARDING_EXPECTED=
ContactState.BOAT_DEFINITIVE_REFUSED=
@@ -15,8 +22,10 @@
SamplingStrategy.SPECIFIC_STOCK=
code-label=
dup-label=
+nContactsFound=
shipOwner-label=
wao.filters.filters=
+wao.ui.action.acceptContact=
wao.ui.action.add=
wao.ui.action.addNewContactFromBoat=
wao.ui.action.back=
@@ -26,20 +35,29 @@
wao.ui.action.createUser=
wao.ui.action.deleteCompany=
wao.ui.action.deleteCompany.confirm=
+wao.ui.action.deleteContact=
+wao.ui.action.deleteContact.confirm=
wao.ui.action.deleteUser=
wao.ui.action.deleteUser.confirm=
+wao.ui.action.enlargeView=
wao.ui.action.exportBoats=
wao.ui.action.filter=
wao.ui.action.hideFilters=
wao.ui.action.login=
wao.ui.action.logout=
+wao.ui.action.modify=
+wao.ui.action.reduceView=
wao.ui.action.refresh=
+wao.ui.action.refuseContact=
wao.ui.action.resetFields=
wao.ui.action.revert=
+wao.ui.action.runExport=
+wao.ui.action.runImport=
wao.ui.action.runSearch=
wao.ui.action.save=
wao.ui.action.showDetails=
wao.ui.action.showFilters=
+wao.ui.action.unvalidateContact=
wao.ui.action.viewIndicatorsHistory=
wao.ui.boatList=
wao.ui.boatinfo.title=
@@ -82,6 +100,8 @@
wao.ui.field.Contact.nbObservants=
wao.ui.field.Contact.samplingStrategy=
wao.ui.field.Contact.secondaryObservers=
+wao.ui.field.Contact.validationCompany=
+wao.ui.field.Contact.validationProgram=
wao.ui.field.FishingZone.facadeName=
wao.ui.field.FishingZone.sectorName=
wao.ui.field.SampleRow.code=
@@ -99,6 +119,7 @@
wao.ui.forgotPassword=
wao.ui.form.addRole=
wao.ui.form.boardingFrom=
+wao.ui.form.contactsFile=
wao.ui.form.definePasswordManually=
wao.ui.form.editComment=
wao.ui.form.generatePassword=
@@ -106,10 +127,12 @@
wao.ui.form.period=
wao.ui.form.period.from=
wao.ui.form.period.to=
+wao.ui.form.program=
wao.ui.form.programEvaluation=
wao.ui.form.readOnly=
wao.ui.form.removeRole=
wao.ui.form.roles=
+wao.ui.form.sortByTideBegin=
wao.ui.import.activityCalendarImportLabel=
wao.ui.import.activityCalendarImportRunning=
wao.ui.import.activityCalendarLabel=
@@ -119,6 +142,7 @@
wao.ui.import.description=
wao.ui.import.fishingZoneLabel=
wao.ui.import.fullDescription=
+wao.ui.import.longTitle=
wao.ui.import.samplingPlanLabel=
wao.ui.import.title=
wao.ui.indicator.bounds=
@@ -135,13 +159,26 @@
wao.ui.layout.userDescription\=currentUser.fullName,currentUser.company.name,currentUser.profile.description=
wao.ui.message.chooseProfile=
wao.ui.misc.N/A=
+wao.ui.misc.accepted=
+wao.ui.misc.advancedSearch=
wao.ui.misc.comment=
+wao.ui.misc.comments=
wao.ui.misc.companies=
+wao.ui.misc.import-export=
wao.ui.misc.information=
wao.ui.misc.logFile.description=
+wao.ui.misc.no=
wao.ui.misc.noComment=
+wao.ui.misc.notValidated=
wao.ui.misc.observationReport=
+wao.ui.misc.observations=
+wao.ui.misc.observer=
wao.ui.misc.observers=
+wao.ui.misc.refused=
+wao.ui.misc.since=
+wao.ui.misc.undefined=
+wao.ui.misc.validated=
+wao.ui.misc.yes=
wao.ui.page.Administration.title=
wao.ui.page.Boats.title=
wao.ui.page.Cartography.title=
@@ -150,5 +187,6 @@
wao.ui.page.SamplingPlan.title=
wao.ui.page.Synthesis.title=
wao.ui.page.UserProfileForm.title=
+wao.ui.unavailableOperation=
wao.ui.userList=
wao.ui.validLogin=
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-10 09:21:32 UTC (rev 905)
+++ trunk/wao-ui/src/main/resources/i18n/wao-ui_fr_FR.properties 2011-01-10 14:57:08 UTC (rev 906)
@@ -1,45 +1,56 @@
+nContactsFound=%s contacts trouv\u00e9s
+wao.ui.action.acceptContact=Valider le contact
wao.ui.action.add=Ajouter
-wao.ui.action.addNewContactFromBoat=Cr\u00E9er un nouveau contact pour ce navire et la ligne s\u00E9lectionn\u00E9e dans les filtres
-wao.ui.action.back=Revenier \u00E0 l'\u00E9cran pr\u00E9c\u00E9dent
+wao.ui.action.addNewContactFromBoat=Cr\u00e9er un nouveau contact pour ce navire et la ligne s\u00e9lectionn\u00e9e dans les filtres
+wao.ui.action.back=Revenier \u00e0 l'\u00e9cran pr\u00e9c\u00e9dent
wao.ui.action.cancel=Annuler
wao.ui.action.contactAdmin=Contacter un responsable ObsMer
-wao.ui.action.createCompany=Cr\u00E9er une soci\u00E9t\u00E9
-wao.ui.action.createUser=Cr\u00E9er un utilisateur
-wao.ui.action.deleteCompany=Supprimer la soci\u00E9t\u00E9
-wao.ui.action.deleteCompany.confirm=\u00CAtes-vous s\u00FBr de vouloir supprimer la soci\u00E9t\u00E9 ?
+wao.ui.action.createCompany=Cr\u00e9er une soci\u00e9t\u00e9
+wao.ui.action.createUser=Cr\u00e9er un utilisateur
+wao.ui.action.deleteCompany=Supprimer la soci\u00e9t\u00e9
+wao.ui.action.deleteCompany.confirm=\u00cates-vous s\u00fbr de vouloir supprimer la soci\u00e9t\u00e9 ?
+wao.ui.action.deleteContact=Supprimer le contact
+wao.ui.action.deleteContact.confirm=\u00cates-vous s\u00fbr de vouloir supprimer d\u00e9finitivement ce contact ?
wao.ui.action.deleteUser=Supprimer l'utilisateur
-wao.ui.action.deleteUser.confirm=\u00CAtes-vous s\u00FBr de vouloir supprimer l'utilisateur ?
-wao.ui.action.exportBoats=Exporter les $s navires avec leurs informations priv\u00E9es
+wao.ui.action.deleteUser.confirm=\u00cates-vous s\u00fbr de vouloir supprimer l'utilisateur ?
+wao.ui.action.enlargeView=Agrandir la vue
+wao.ui.action.exportBoats=Exporter les $s navires avec leurs informations priv\u00e9es
wao.ui.action.filter=Filtrer
wao.ui.action.hideFilters=Masquer les filtres
wao.ui.action.login=Connexion
-wao.ui.action.logout=D\u00E9connexion
-wao.ui.action.refresh=Rafra\u00EEchir
-wao.ui.action.resetFields=Remettre le formulaire \u00E0 z\u00E9ro
+wao.ui.action.logout=D\u00e9connexion
+wao.ui.action.modify=Modifier
+wao.ui.action.reduceView=R\u00e9duire la vue
+wao.ui.action.refresh=Rafra\u00eechir
+wao.ui.action.refuseContact=Refuser le contact
+wao.ui.action.resetFields=Remettre le formulaire \u00e0 z\u00e9ro
wao.ui.action.revert=Annuler
+wao.ui.action.runExport=Lancer l'export
+wao.ui.action.runImport=Lancer l'import
wao.ui.action.runSearch=Lancer la recherche
wao.ui.action.save=Enregistrer
-wao.ui.action.showDetails=Voir les d\u00E9tails
+wao.ui.action.showDetails=Voir les d\u00e9tails
wao.ui.action.showFilters=Afficher les filtres
+wao.ui.action.unvalidateContact=
wao.ui.action.viewIndicatorsHistory=Voir l'historique des modifications des indicateurs
wao.ui.boatList=Liste de %s navires
wao.ui.boatinfo.title=Informations sur %s
-wao.ui.boats.associatedLine=Ligne(s) du plan associ\u00E9e(s) \u00E0 ce navire
-wao.ui.boats.nbBoarding=%s embarquement(s) dont %s dans votre soci\u00E9t\u00E9
-wao.ui.contact.lastContact=Dernier contact avec le navire pour votre soci\u00E9t\u00E9
-wao.ui.contacts.createFromBoat=Cr\u00E9er un nouveau contact pour ce navire et cette ligne du plan
-wao.ui.contacts.createFromBoat.fail=Cr\u00E9ation d'un nouveau contact impossible
-wao.ui.contacts.createFromBoat.warn=Attention, cette ligne du plan est arriv\u00E9e \u00E0 \u00E9ch\u00E9ance, \u00EAtes-vous s\u00FBr de vouloir cr\u00E9er un nouveau contact ?
-wao.ui.disclaimer=Le site de "SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER" a fait l'objet d'une d\u00E9claration \u00E0 la CNIL sous le num\u00E9ro suivant \: 1414476
-wao.ui.disclaimer.boats=Les donn\u00E9es saisies dans cette page sont la propri\u00E9t\u00E9 exclusive de la soci\u00E9t\u00E9. En dehors de la soci\u00E9t\u00E9, seul l'administrateur peut les consulter pour des questions de maintenance sur le site. L'administrateur est une personne de l'Ifremer.
+wao.ui.boats.associatedLine=Ligne(s) du plan associ\u00e9e(s) \u00e0 ce navire
+wao.ui.boats.nbBoarding=%s embarquement(s) dont %s dans votre soci\u00e9t\u00e9
+wao.ui.contact.lastContact=Dernier contact avec le navire pour votre soci\u00e9t\u00e9
+wao.ui.contacts.createFromBoat=Cr\u00e9er un nouveau contact pour ce navire et cette ligne du plan
+wao.ui.contacts.createFromBoat.fail=Cr\u00e9ation d'un nouveau contact impossible
+wao.ui.contacts.createFromBoat.warn=Attention, cette ligne du plan est arriv\u00e9e \u00e0 \u00e9ch\u00e9ance, \u00eates-vous s\u00fbr de vouloir cr\u00e9er un nouveau contact ?
+wao.ui.disclaimer=Le site de "SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER" a fait l'objet d'une d\u00e9claration \u00e0 la CNIL sous le num\u00e9ro suivant \: 1414476
+wao.ui.disclaimer.boats=Les donn\u00e9es saisies dans cette page sont la propri\u00e9t\u00e9 exclusive de la soci\u00e9t\u00e9. En dehors de la soci\u00e9t\u00e9, seul l'administrateur peut les consulter pour des questions de maintenance sur le site. L'administrateur est une personne de l'Ifremer.
wao.ui.email=Adresse e-mail
wao.ui.entity.Boat=Navire
-wao.ui.entity.Company=Soci\u00E9t\u00E9
+wao.ui.entity.Company=Soci\u00e9t\u00e9
wao.ui.entity.Contact=Contact
-wao.ui.entity.SampleRow=Ligne du plan d'\u00E9chantillonnage
+wao.ui.entity.SampleRow=Ligne du plan d'\u00e9chantillonnage
wao.ui.field.Boat.boatLength=Longueur
-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.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
@@ -47,89 +58,109 @@
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
+wao.ui.field.Contact.beginDate=D\u00e9but d'observation
wao.ui.field.Contact.comment=Commentaire observateur
wao.ui.field.Contact.commentAdmin=Commentaire programme
wao.ui.field.Contact.commentCoordinator=Commentaire coordinateur
-wao.ui.field.Contact.completeSampling=\u00C9chantillonnage compl\u00E9t\u00E9
-wao.ui.field.Contact.contactState=\u00C9tat du contact
-wao.ui.field.Contact.creationDate=Date de cr\u00E9ation du contact
-wao.ui.field.Contact.dataInputDate=Saisie des donn\u00E9es dans Allegro
-wao.ui.field.Contact.dataReliability=Qualit\u00E9 des donn\u00E9es
+wao.ui.field.Contact.completeSampling=\u00c9chantillonnage compl\u00e9t\u00e9
+wao.ui.field.Contact.contactState=\u00c9tat du contact
+wao.ui.field.Contact.creationDate=Date de cr\u00e9ation du contact
+wao.ui.field.Contact.dataInputDate=Saisie des donn\u00e9es dans Allegro
+wao.ui.field.Contact.dataReliability=Qualit\u00e9 des donn\u00e9es
wao.ui.field.Contact.endDate=Fin d'observation
-wao.ui.field.Contact.mainObserver=Observateur r\u00E9f\u00E9rant
+wao.ui.field.Contact.mainObserver=Observateur r\u00e9f\u00e9rant
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 suivie
+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.Contact.validationCompany=Validation soci\u00e9t\u00e9
+wao.ui.field.Contact.validationProgram=Validation programme
+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.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.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
-wao.ui.field.UserProfile.userRole=R\u00F4le
+wao.ui.field.UserProfile.userRole=R\u00f4le
wao.ui.field.WaoUser.login=Identifiant
wao.ui.field.WaoUser.password=Mot de passe
wao.ui.filters.filters=Filtres de recherche
-wao.ui.filters.refresh=Rafra\u00EEchir les champs du filtre
-wao.ui.forgotPassword=Mot de passe oubli\u00E9 ?
-wao.ui.form.addRole=Ajouter ce r\u00F4le
+wao.ui.filters.refresh=Rafra\u00eechir les champs du filtre
+wao.ui.forgotPassword=Mot de passe oubli\u00e9 ?
+wao.ui.form.addRole=Ajouter ce r\u00f4le
wao.ui.form.boardingFrom=Sollicitations du navire depuis le
-wao.ui.form.definePasswordManually=d\u00E9finir manuellement
+wao.ui.form.contactsFile=Fichier des contacts
+wao.ui.form.definePasswordManually=d\u00e9finir manuellement
wao.ui.form.editComment=Commentaire sur la modification
-wao.ui.form.generatePassword=G\u00E9n\u00E9rer le mot de passe
+wao.ui.form.generatePassword=G\u00e9n\u00e9rer le mot de passe
wao.ui.form.otherBoatInfos=Autres informations sur le navire
-wao.ui.form.period=P\u00E9riode
+wao.ui.form.period=P\u00e9riode
wao.ui.form.period.from=du
wao.ui.form.period.to=au
-wao.ui.form.programEvaluation=\u00C9valuation programme
+wao.ui.form.program=Programme
+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
-wao.ui.import.activityCalendarUserAccessesLabel=des acc\u00E8s utilisateurs aux calendriers d'activit\u00E9
-wao.ui.import.boatDistrictLabel=des coordonn\u00E9es des quartiers des navires
+wao.ui.form.roles=R\u00f4les
+wao.ui.form.sortByTideBegin=Trier par date de d\u00e9but de mar\u00e9e (du plus r\u00e9cent au plus ancien)
+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
+wao.ui.import.activityCalendarUserAccessesLabel=des acc\u00e8s utilisateurs aux calendriers d'activit\u00e9
+wao.ui.import.boatDistrictLabel=des coordonn\u00e9es des quartiers des navires
wao.ui.import.boatsLabel=des navires
wao.ui.import.description=Fichier %s %s \:
-wao.ui.import.fishingZoneLabel=des zones de p\u00EAches
+wao.ui.import.fishingZoneLabel=des zones de p\u00eaches
wao.ui.import.fullDescription=Import %s (format %s avec encodage UTF-8)
-wao.ui.import.samplingPlanLabel=du plan d'\u00E9chantillonnage
+wao.ui.import.longTitle=Import/Export CSV (UTF-8)
+wao.ui.import.samplingPlanLabel=du plan d'\u00e9chantillonnage
wao.ui.import.title=Import %s
wao.ui.indicator.andMore=%s et plus
wao.ui.indicator.bounds=Bornes
-wao.ui.indicator.coefficient=Pond\u00E9ration
+wao.ui.indicator.coefficient=Pond\u00e9ration
wao.ui.indicator.editions=Modifications
wao.ui.indicator.indicator=Indicateur \:
-wao.ui.indicator.legend=En jaune, la position actuelle de la soci\u00E9t\u00E9 selon cet indicateur.
+wao.ui.indicator.legend=En jaune, la position actuelle de la soci\u00e9t\u00e9 selon cet indicateur.
wao.ui.indicator.levels=Niveaux
-wao.ui.indicator.useRightDecimalSymbol=Attention \u00E0 bien utiliser ',' et non '.' pour les d\u00E9cimales
+wao.ui.indicator.useRightDecimalSymbol=Attention \u00e0 bien utiliser ',' et non '.' pour les d\u00e9cimales
wao.ui.indicators.coefficientsSum=Total coefficient
-wao.ui.indicators.title=Indicateurs qualit\u00E9s prestataires
+wao.ui.indicators.title=Indicateurs qualit\u00e9s prestataires
wao.ui.invalidLogin=Identifiant invalide
-wao.ui.layout.userDescription=Vous \u00EAtes %s de la soci\u00E9t\u00E9 %s (%s)
+wao.ui.layout.userDescription=Vous \u00eates %s de la soci\u00e9t\u00e9 %s (%s)
wao.ui.message.chooseProfile=Choisissez dans la liste votre profil de connexion \:
-wao.ui.misc.N/A=non renseign\u00E9e
+wao.ui.misc.N/A=non renseign\u00e9e
+wao.ui.misc.accepted=Accept\u00e9
+wao.ui.misc.advancedSearch=Recherche avanc\u00e9e
wao.ui.misc.comment=Commentaire
-wao.ui.misc.companies=Soci\u00E9t\u00E9s
+wao.ui.misc.comments=Commentaires
+wao.ui.misc.companies=Soci\u00e9t\u00e9s
+wao.ui.misc.import-export=Import/export
wao.ui.misc.information=Informations
wao.ui.misc.logFile.description=Afficher le fichier de log de %s
+wao.ui.misc.no=Non
wao.ui.misc.noComment=aucun commentaire
+wao.ui.misc.notValidated=Non valid\u00e9
wao.ui.misc.observationReport=Compte-rendu d'observation
+wao.ui.misc.observations=Observations
+wao.ui.misc.observer=Observateur
wao.ui.misc.observers=Observateurs
+wao.ui.misc.refused=R\u00e9fus\u00e9
+wao.ui.misc.since=Depuis le
+wao.ui.misc.undefined=Non-d\u00e9fini
+wao.ui.misc.validated=Valid\u00e9
+wao.ui.misc.yes=Oui
wao.ui.page.Administration.title=Administration
wao.ui.page.Boats.title=Navires
wao.ui.page.Cartography.title=Cartography
wao.ui.page.Contacts.title=Contacts
wao.ui.page.Index.title=Accueil
-wao.ui.page.SamplingPlan.title=Plan d'\u00E9chantillonnage
-wao.ui.page.Synthesis.title=Synth\u00E8se
+wao.ui.page.SamplingPlan.title=Plan d'\u00e9chantillonnage
+wao.ui.page.Synthesis.title=Synth\u00e8se
wao.ui.page.UserProfileForm.title=Gestion du profil
+wao.ui.unavailableOperation=Op\u00e9ration non-disponible
wao.ui.userList=Liste des utilisateurs
wao.ui.validLogin=Identifiant valide
Modified: trunk/wao-ui/src/main/webapp/Contacts.tml
===================================================================
--- trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-10 09:21:32 UTC (rev 905)
+++ trunk/wao-ui/src/main/webapp/Contacts.tml 2011-01-10 14:57:08 UTC (rev 906)
@@ -32,26 +32,26 @@
<div id="so-contacts-search">
<form t:type="form" t:id="searchBoat">
<div>
- <t:label t:for="boatName" /><br />
- <input t:type="textfield" class="width200" t:id="boatName" value="contactFilter.boatName" t:mixins="Autocomplete"/>
- <input t:type="submit" class="ico search-32px" t:id="execSearchBoat" value="Search" title="Rechercher les contacts liés à ce navire" />
+ <label for="boatName">${message:wao.ui.entity.Boat}</label><br />
+ <input t:type="textfield" class="width200" t:id="boatName" value="contactFilter.boatName" t:mixins="Autocomplete" />
+ <input t:type="submit" class="ico search-32px" t:id="execSearchBoat" value="${message:wao.ui.action.runSearch}" />
</div>
</form>
<a t:type="actionlink" t:id="showFilters" t:zone="so-contacts-filters" class="display-form">
- recherche avancée
+ ${message:wao.ui.misc.advancedSearch}
</a>
<t:if t:test="canImportExport()">
<a t:type="actionlink" t:id="showImportExport" t:zone="so-contacts-importexport" class="display-form">
- import/export
+ ${message:wao.ui.misc.import-export}
</a>
</t:if>
<t:if t:test="user.admin">
<a t:type="actionlink" t:id="toggleDisplayMode" class="display-form">
<t:if t:test="fullView">
- réduire la vue
+ ${message:wao.ui.action.reduceView}
<p:else>
- agrandir la vue
+ ${message:wao.ui.action.enlargeView}
</p:else>
</t:if>
</a>
@@ -60,119 +60,118 @@
<!-- FILTRES -->
<div t:type="zone" class="so-filters" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-contacts-filters">
<fieldset>
- <legend>Recherche avancée</legend>
+ <legend>${message:wao.ui.misc.advancedSearch}</legend>
<div class="so-filters-form">
<form t:type="form" t:id="filtersForm" t:zone="so-contacts-filters">
<t:errors />
<div class="t-beaneditor">
<div>
- <t:label t:for="fromDate" />:
+ <label for="fromDate">${message:wao.ui.misc.since} :</label>
<input t:type="datefield" class="width70" t:id="fromDate" value="contactFilter.fromDate" />
- <t:label t:for="state" />:
+ <label for="state">${message:wao.ui.field.Contact.contactState} :</label>
<select t:type="select" t:id="state" value="contactFilter.state"/>
<t:if t:test="user.admin">
- <t:label t:for="company" />:
+ <label for="company">${message:wao.ui.entity.Company} :</label>
<input t:type="select" t:id="company" t:model="companySelectModel" value="companyId"/>
<input t:type="submit" class="ico22px refresh" t:id="refreshByCompany" value="Refresh"
title="Rafraîchir les filtres en fonction de la société sélectionnée"/>
</t:if>
- <t:label t:for="observer" />:
+ <label for="observer">${message:wao.ui.misc.observer} :</label>
<select t:type="select" t:id="observer" t:model="observerSelectModel" value="observerId" />
- </div><p> </p>
+ </div>
+ <p> </p>
<div>
- <label>Navire </label>
- <t:label t:for="boatImmatriculation" />:
+ <label>${message:wao.ui.entity.Boat} </label>
+ <label t:for="boatImmatriculation">${message:wao.ui.field.Boat.immatriculation} :</label>
<input t:type="textfield" t:id="boatImmatriculation" class="width50" t:value="contactFilter.boatImmatriculation" />
- <t:label t:for="boatDistrictCode" />:
+ <label t:for="boatDistrictCode">${message:wao.ui.field.Boat.districtCode} :</label>
<input t:type="textfield" t:id="boatDistrictCode" class="width50" t:value="contactFilter.boatDistrictCode" />
- <t:label t:for="facadeName" />:
+ <label t:for="facadeName">${message:wao.ui.field.FishingZone.facadeName} :</label>
<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"
- title="Rafraîchir les zones et les métiers en fonction de la façade sélectionnée"/>
- <t:label t:for="sectorName" />:
+ <input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="${message:wao.ui.action.refresh}" />
+ <label for="sectorName">${message:wao.ui.field.FishingZone.sectorName} :</label>
<select t:type="select" t:id="sectorName" t:model="sectorSelectModel" value="contactFilter.sectorName" />
<input t:type="submit" class="ico22px refresh" t:id="refreshBySector" value="Refresh"
title="Rafraîchir les métiers en fonction de la zone sélectionnée"/>
- <t:label t:for="sampleRow" />:
+ <label for="sampleRow">${message:wao.ui.field.SampleRow.code} :</label>
<input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" t:mixins="ck/onEvent" t:event="change" />
- </div><p> </p>
+ </div>
+ <p> </p>
<div>
- <label>Observations: </label>
- <input t:type="checkbox" t:id="mammalsObservation1" value="contactFilter.mammalsObservation" />
- <t:label t:for="mammalsObservation1">
- <img src="${asset:context:img/eye-22px.png}" alt="Observations" title="Observations" />
- </t:label>
- <label>Captures acc.: </label>
- <input t:type="checkbox" t:id="mammalsCapture1" value="contactFilter.mammalsCapture" />
- <t:label t:for="mammalsCapture1">
- <img src="${asset:context:img/fishing-net-22px.png}" alt="Captures" title="Captures" />
- </t:label>
- <label>Validation société: </label>
+ <label>${message:wao.ui.misc.observations} :</label>
+ <input t:type="checkbox" t:id="mammalsObservation" value="contactFilter.mammalsObservation" />
+ <label for="mammalsObservation">
+ <img src="${asset:context:img/eye-22px.png}" alt="${message:wao.ui.field.Contact.mammalsObservation}" />
+ </label>
+ <label>${message:wao.ui.field.Contact.mammalsCapture} :</label>
+ <input t:type="checkbox" t:id="mammalsCapture" value="contactFilter.mammalsCapture" />
+ <label for="mammalsCapture">
+ <img src="${asset:context:img/fishing-net-22px.png}" alt="${message:wao.ui.field.Contact.mammalsCapture}" />
+ </label>
+ <label>${message:wao.ui.field.Contact.validationCompany} :</label>
<input t:type="checkbox" t:id="companyAccepted" value="contactFilter.companyAccepted" />
- <t:label t:for="companyAccepted">
- <img src="${asset:context:img/true-22px.png}" title="Accepté par la société" />
- </t:label>
+ <label for="companyAccepted">
+ <img src="${asset:context:img/true-22px.png}" alt="${message:wao.ui.misc.accepted}" />
+ </label>
<input t:type="checkbox" t:id="companyRefused" value="contactFilter.companyRefused" />
- <t:label t:for="companyRefused">
- <img src="${asset:context:img/false-22px.png}" title="Refusé par la société" />
- </t:label>
+ <label t:for="companyRefused">
+ <img src="${asset:context:img/false-22px.png}" alt="${message:wao.ui.misc.refused}" />
+ </label>
<input t:type="checkbox" t:id="companyUndefined" value="contactFilter.companyUndefined" />
- <t:label t:for="companyUndefined">
- <img src="${asset:context:img/help-22px.png}" title="Non validé par la société" />
- </t:label>
- <label>Validation programme: </label>
+ <label t:for="companyUndefined">
+ <img src="${asset:context:img/help-22px.png}" alt="${message:wao.ui.misc.undefined}" />
+ </label>
+ <label>${message:wao.ui.field.Contact.validationProgram} :</label>
<input t:type="checkbox" t:id="programAccepted" value="contactFilter.programAccepted" />
- <t:label t:for="programAccepted">
- <img src="${asset:context:img/true-22px.png}" title="Accepté par le programme" />
- </t:label>
+ <label t:for="programAccepted">
+ <img src="${asset:context:img/true-22px.png}" alt="${message:wao.ui.misc.accepted}" />
+ </label>
<input t:type="checkbox" t:id="programRefused" value="contactFilter.programRefused" />
- <t:label t:for="programRefused">
- <img src="${asset:context:img/false-22px.png}" title="Refusé par le programme" />
- </t:label>
+ <label t:for="programRefused">
+ <img src="${asset:context:img/false-22px.png}" alt="${message:wao.ui.misc.refused}" />
+ </label>
<input t:type="checkbox" t:id="programUndefined" value="contactFilter.programUndefined" />
- <t:label t:for="programUndefined">
- <img src="${asset:context:img/help-22px.png}" title="Non validé par le programme" />
- </t:label>
+ <label t:for="programUndefined">
+ <img src="${asset:context:img/help-22px.png}" alt="${message:wao.ui.misc.undefined}" />
+ </label>
<t:unless t:test="user.observer">
- <t:label t:for="reliabilityFilter" />:
+ <label for="reliabilityFilter">${message:wao.ui.field.Contact.dataReliability} :</label>
<select t:type="select" t:id="reliabilityFilter" value="contactFilter.dataReliability"/>
</t:unless>
- <span>Commentaires : </span>
+ <span>${message:wao.ui.misc.comments} :</span>
<input t:type="checkbox" t:id="commentFilter" value="contactFilter.comment" />
- <label for="commentFilter">observateur</label>
- <t:if t:test="canFilterExtraComments()">
-
- <input t:type="checkbox" t:id="commentCompany" value="contactFilter.commentCompany" />
- <label for="commentCompany">société</label>
- <input t:type="checkbox" t:id="commentAdmin" value="contactFilter.commentAdmin" />
- <label for="commentAdmin">programme</label>
- </t:if>
+ <label for="commentFilter">${message:wao.ui.misc.observer}</label>
+ <input t:type="checkbox" t:id="commentCompany" value="contactFilter.commentCompany" />
+ <label for="commentCompany">${message:wao.ui.entity.Company}</label>
+ <input t:type="checkbox" t:id="commentAdmin" value="contactFilter.commentAdmin" />
+ <label for="commentAdmin">${message:wao.ui.form.program}</label>
</div>
<t:if t:test="showObsVente()">
- <label t:for="samplingStrategy">${message:wao.ui.field.SampleRow.samplingStrategy}</label>
+ <label 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>
+ <label 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 for="completeSampling">
+ <img src="${asset:context:img/true-22px.png}" alt="${message:wao.ui.misc.yes}" />
</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" />
+ <img src="${asset:context:img/false-22px.png}" alt="${message:wao.ui.misc.no}" />
</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é" />
+ <img src="${asset:context:img/help-22px.png}" alt="${message:wao.ui.misc.undefined}" />
</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" />
+ <input t:type="checkbox" t:id="sortedByBoardingDate" value="contactFilter.sortedByBoardingDate" />
+ <label for="sortedByBoardingDate">${message:wao.ui.form.sortByTideBegin}</label>
</div>
<div class="t-beaneditor-row aright">
- <input t:type="submit" class="ico search-32px" t:id="search" value="Search" title="Rechercher les contacts correspondants aux filtres saisies" />
- <input t:type="submit" class="ico undo" t:id="reset" value="Reset" title="Remettre les filtres par défaut" />
+ <input t:type="submit" class="ico search-32px" t:id="search" value="${message:wao.ui.action.runSearch}" title="${message:wao.ui.action.runSearch}" />
+ <input t:type="submit" class="ico undo" t:id="reset" value="${message:wao.ui.action.resetFields}" title="${message:wao.ui.action.resetFields}" />
</div>
</div>
</form>
@@ -182,29 +181,28 @@
<!-- IMPORT/EXPORT -->
<div t:type="zone" class="so-filters" t:id="importExportZone" t:update="show" t:visible="false" id="so-contacts-importexport">
<fieldset>
- <legend>Import/export CSV (UTF-8)</legend>
+ <legend>${message:wao.ui.import.longTitle}</legend>
<form t:type="form" t:id="importContacts">
<t:errors />
- <t:label for="contactsCsvFile" /> :
+ <label for="contactsCsvFile">${message:wao.ui.form.contactsFile} :</label>
<input t:type="upload" t:id="contactsCsvFile" t:validate="required" />
- <input t:type="submit" class="ico import" value="OK" title="Importer une liste de contacts (format CSV avec encodage UTF-8)" />
+ <input t:type="submit" class="ico import" value="${message:wao.ui.action.runImport}" title="${message:wao.ui.action.runImport}" />
<a t:type="actionlink" t:id="exportShowContacts">
- <img src="${asset:context:img/file-export-22px.png}" alt="Export"
- title="Exporter les ${contacts.availableRows} contacts trouvés ${tooltipExportFrom}" />
+ <img src="${asset:context:img/file-export-22px.png}" alt="${message:wao.ui.action.runExport}"
+ title="${message:wao.ui.action.runExport}" />
</a>
</form>
</fieldset>
</div>
<!-- CONTACT LIST -->
<p>
- <strong>${contacts.availableRows} contacts trouvés</strong>
+ <strong>${format:nContactsFound=contacts.availableRows}</strong>
<t:if t:test="contactFilter.fromDate">
- depuis le <t:output value="contactFilter.fromDate" format="dateFormat" />
+ ${message:wao.ui.misc.since} <t:output value="contactFilter.fromDate" format="dateFormat" />
</t:if>
</p>
<t:zone t:id="gridZone">
- <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">
+ <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">
@@ -242,26 +240,26 @@
</p:nbObservantsCell>
<p:mammalsCell>
<t:if t:test="contact.mammalsObservation">
- <img src="${asset:context:img/eye-22px.png}" alt="Observations" title="Observations" />
+ <img src="${asset:context:img/eye-22px.png}" alt="${message:wao.ui.field.Contact.mammalsObservation}" />
</t:if>
<t:if t:test="contact.mammalsCapture">
- <img src="${asset:context:img/fishing-net-22px.png}" alt="Captures" title="Captures" />
+ <img src="${asset:context:img/fishing-net-22px.png}" alt="${message:wao.ui.field.Contact.mammalsCapture}" />
</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:emptyTitle="${message:wao.ui.misc.notValidated}"
+ t:trueTitle="${message:wao.ui.misc.validated}" t:falseTitle="${message:wao.ui.misc.refused}"/>
<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"/>
+ t:emptyTitle="${message:wao.ui.misc.notValidated}"
+ t:trueTitle="${message:wao.ui.misc.validated}" t:falseTitle="${message:wao.ui.misc.refused}"/>
</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">
+ <span t:type="ck/Tooltip" title="${message:wao.ui.misc.comment}" t:value="${getCommentTooltip(contact.comment)}" t:effect="appear">
${getCommentDisplayText(contact.comment)}
</span>
</t:if>
@@ -275,14 +273,14 @@
</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">
+ <span t:type="ck/Tooltip" title="${message:wao.ui.field.Contact.commentCoordinator}" t:value="${getCommentTooltip(contact.commentCoordinator)}" t:effect="appear">
${getCommentDisplayText(contact.commentCoordinator)}
</span>
</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">
+ <span t:type="ck/Tooltip" title="${message:wao.ui.field.Contact.commentAdmin}" t:value="${getCommentTooltip(contact.commentAdmin)}" t:effect="appear">
${getCommentDisplayText(contact.commentAdmin)}
</span>
</t:if>
@@ -290,38 +288,38 @@
<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"/>
+ <img src="${asset:context:}/img/edit.png" alt="${message:wao.ui.action.modify}" title="${message:wao.ui.action.modify}" />
</a>
<p:else>
- <img src="${asset:context:img/edit-unavailable-22px.png}" alt="Edit unavailable" title="Modification du contact indisponible"/>
+ <img src="${asset:context:img/edit-unavailable-22px.png}" alt="${message:wao.ui.unavailableOperation}" />
</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 t:type="actionlink" t:id="deleteContact" t:context="contact.topiaId" t:mixins="nuiton/confirm" t:message="${message:wao.ui.action.deleteContact.confirm}">
+ <img src="${asset:context:img/delete2.png}" alt="${message:wao.ui.action.deleteContact}" />
</a>
<p:else>
- <img src="${asset:context:img/delete-unavailable-22px.png}" alt="Delete unavailable" title="Suppression du contact indisponible" />
+ <img src="${asset:context:img/delete-unavailable-22px.png}" alt="${message:wao.ui.unavailableOperation}" />
</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" />
+ <img src="${asset:context:img/accept-22px.png}" alt="${message:wao.ui.action.acceptContact}" title="${message:wao.ui.action.acceptContact}" />
</a>
<a t:type="actionlink" t:id="refuseContact" t:context="contact.topiaId">
- <img src="${asset:context:img/refuse-22px.png}" alt="Refuse contact" />
+ <img src="${asset:context:img/refuse-22px.png}" alt="${message:wao.ui.action.refuseContact}" title="${message:wao.ui.action.refuseContact}" />
</a>
<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"/>
+ <img src="${asset:context:img/accept-unavailable-22px.png}" alt="${message:wao.ui.unavailableOperation}" />
+ <img src="${asset:context:img/refuse-unavailable-22px.png}" alt="${message:wao.ui.unavailableOperation}" />
</t:unless>
</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" />
+ <img src="${asset:context:img/help-22px.png}" alt="${message:wao.ui.action.unvalidateContact}" />
</a>
</t:if>
</t:if>
1
0
[Suiviobsmer-commits] r905 - in trunk/wao-business/src/test/java/fr/ifremer/wao: entity service
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 09:21:32 +0000 (Mon, 10 Jan 2011)
New Revision: 905
Log:
fix tests after refactoring contact creation
Modified:
trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java
trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java
trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceContactInternalTest.java
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java 2011-01-10 08:46:21 UTC (rev 904)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/entity/BoatImplTest.java 2011-01-10 09:21:32 UTC (rev 905)
@@ -27,6 +27,7 @@
import fr.ifremer.wao.TestManager;
import fr.ifremer.wao.WaoDAOHelper;
import fr.ifremer.wao.bean.ContactState;
+import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.service.ServiceBoat;
import fr.ifremer.wao.service.ServiceContact;
import fr.ifremer.wao.service.ServiceSampling;
@@ -131,7 +132,7 @@
serviceSampling.createUpdateSampleRow(row, boats, new SampleRowLogImpl());
ServiceContact serviceContact = manager.getServiceContact();
- Contact contact1 = serviceContact.getNewContact(user, row, boat);
+ Contact contact1 = serviceContact.getNewContact(ObsProgram.OBSMER, user, row, boat);
contact1.setContactState(ContactState.CONTACT_START);
serviceContact.saveContact(contact1, false);
@@ -231,7 +232,7 @@
ServiceContact serviceContact = manager.getServiceContact();
// First contact : OK
- Contact contact1 = serviceContact.getNewContact(user, row, boat);
+ Contact contact1 = serviceContact.getNewContact(ObsProgram.OBSMER, user, row, boat);
contact1.setContactState(ContactState.BOARDING_DONE);
Date begin = DateUtil.createDate(3, 5, 2010);
contact1.setObservationBeginDate(begin);
@@ -244,7 +245,7 @@
int result = boat.getNbBoarding(fromDate);
Assert.assertEquals(1, result);
- Contact contact2 = serviceContact.getNewContact(user, row, boat);
+ Contact contact2 = serviceContact.getNewContact(ObsProgram.OBSMER, user, row, boat);
// Second contact with ValidationProgram = FALSE
contact2.setContactState(ContactState.BOARDING_DONE);
begin = DateUtil.createDate(3, 8, 2010);
@@ -256,7 +257,7 @@
result = boat.getNbBoarding(fromDate);
Assert.assertEquals(1, result);
- Contact contact3 = serviceContact.getNewContact(user, row, boat);
+ Contact contact3 = serviceContact.getNewContact(ObsProgram.OBSMER, user, row, boat);
// Third contact with tideBeginDate < fromDate
contact3.setContactState(ContactState.BOARDING_DONE);
begin = DateUtil.createDate(3, 3, 2010);
@@ -267,7 +268,7 @@
result = boat.getNbBoarding(fromDate);
Assert.assertEquals(1, result);
- Contact contact4 = serviceContact.getNewContact(user2, row2, boat);
+ Contact contact4 = serviceContact.getNewContact(ObsProgram.OBSMER, user2, row2, boat);
// Fourth contact : OK with an other company
contact4.setContactState(ContactState.BOARDING_DONE);
begin = DateUtil.createDate(3, 5, 2010);
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java 2011-01-10 08:46:21 UTC (rev 904)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceBoatImplTest.java 2011-01-10 09:21:32 UTC (rev 905)
@@ -297,7 +297,7 @@
transaction.closeContext();
ServiceContact serviceContact = manager.getServiceContact();
- Contact contact1 = serviceContact.getNewContact(user, row, boat);
+ Contact contact1 = serviceContact.getNewContact(ObsProgram.OBSMER, user, row, boat);
contact1.setContactState(ContactState.CONTACT_START);
serviceContact.saveContact(contact1, false);
Modified: trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceContactInternalTest.java
===================================================================
--- trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceContactInternalTest.java 2011-01-10 08:46:21 UTC (rev 904)
+++ trunk/wao-business/src/test/java/fr/ifremer/wao/service/ServiceContactInternalTest.java 2011-01-10 09:21:32 UTC (rev 905)
@@ -28,6 +28,7 @@
import fr.ifremer.wao.bean.ConnectedUser;
import fr.ifremer.wao.bean.ContactState;
import fr.ifremer.wao.bean.ContactStatus.NullSampleMonthException;
+import fr.ifremer.wao.bean.ObsProgram;
import fr.ifremer.wao.bean.SamplingStrategy;
import fr.ifremer.wao.entity.Boat;
import fr.ifremer.wao.entity.BoatDAO;
@@ -675,7 +676,7 @@
prepareData(true, true);
// Don't use a mock in this case
- Contact newContact = service.getNewContact(observer, sampleRow, boat);
+ Contact newContact = service.getNewContact(ObsProgram.OBSVENTE, observer, sampleRow, boat);
newContact.setTopiaCreateDate(DateUtil.createDate(2, 3, 2010));
/** EXEC METHOD **/
1
0
[Suiviobsmer-commits] r904 - trunk/wao-business/src/main/xmi
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:46:21 +0000 (Mon, 10 Jan 2011)
New Revision: 904
Log:
model style
Modified:
trunk/wao-business/src/main/xmi/wao.zargo
Modified: trunk/wao-business/src/main/xmi/wao.zargo
===================================================================
(Binary files differ)
1
0
[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