branch develop updated (0e7cf12 -> dfad235)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository wao. See http://git.codelutin.com/wao.git from 0e7cf12 Correction d'un WARN struts en ajoutant un champs manquant dans l'action new f01d75b On renomme un modèle CSV (plus de ObsDeb) new 36c1b90 Dans la liste déroulante, afficher la société avant le labo pour grouper new 85b06c7 Changer les intitulés pour « Laboratoire Ifremer », changer « Organisation » pour « Société / Laboratoire » new 7c33594 Dans la liste des utilisateurs, ajouter une colonne pour le labo ; dans la liste déroulante, afficher la société avant le labo pour grouper new 141f8e2 On garde un libellé « Société » pour obsmer et obsvente de le formulaire de modification d'une ligne du plan new dfad235 Corrections pour éviter la notion d'organisation (fixes #6295) The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit dfad2351a30af4b4aef2a0add3365bacf4e96c79 Merge: f01d75b 141f8e2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Dec 23 10:50:07 2014 +0100 Corrections pour éviter la notion d'organisation (fixes #6295) commit 141f8e230ea90d4a6fa8602a1b4bb7197a6b3e47 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Dec 23 10:46:45 2014 +0100 On garde un libellé « Société » pour obsmer et obsvente de le formulaire de modification d'une ligne du plan commit 7c3359487b0aa84d328639927371fa584b3f1ffa Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Dec 23 10:02:04 2014 +0100 Dans la liste des utilisateurs, ajouter une colonne pour le labo ; dans la liste déroulante, afficher la société avant le labo pour grouper commit 85b06c7c83051065930f2712b550b958b0a13141 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 17:37:49 2014 +0100 Changer les intitulés pour « Laboratoire Ifremer », changer « Organisation » pour « Société / Laboratoire » commit 36c1b90a89025996229d2b25d644f4ebe6b88c8c Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 17:26:58 2014 +0100 Dans la liste déroulante, afficher la société avant le labo pour grouper commit f01d75ba154f807d7f113eefd5ee0712b0171850 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 16:59:28 2014 +0100 On renomme un modèle CSV (plus de ObsDeb) Summary of changes: .../main/java/fr/ifremer/wao/entity/Companies.java | 2 +- .../java/fr/ifremer/wao/entity/LaboratoryImpl.java | 4 +- .../java/fr/ifremer/wao/entity/Organisations.java | 10 ++--- .../main/java/fr/ifremer/wao/entity/WaoUsers.java | 16 ++++++++ .../wao/services/service/SamplingPlanService.java | 6 +-- .../administration/OrganisationsService.java | 9 ++--- .../service/administration/WaoUsersList.java | 44 ++++++++++++++++++++++ .../service/administration/WaoUsersService.java | 19 +++++----- ...del.java => SamplingPlanImportExportModel.java} | 14 +++---- .../operations/OrganisationParserFormatter.java | 2 +- ...java => SamplingPlanImportExportModelTest.java} | 6 +-- .../web/action/administration/WaoUsersAction.java | 13 +++---- .../main/resources/i18n/wao-web_en_GB.properties | 1 + .../main/resources/i18n/wao-web_fr_FR.properties | 7 ++-- .../WEB-INF/content/administration/wao-users.jsp | 24 ++++++++++-- .../WEB-INF/content/edit-sample-row-input.jsp | 7 +++- 16 files changed, 132 insertions(+), 52 deletions(-) create mode 100644 wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersList.java rename wao-services/src/main/java/fr/ifremer/wao/services/service/csv/{ObsMerObsVenteSamplingPlanImportExportModel.java => SamplingPlanImportExportModel.java} (94%) rename wao-services/src/test/java/fr/ifremer/wao/services/service/csv/{ObsMerObsVenteSamplingPlanImportExportModelTest.java => SamplingPlanImportExportModelTest.java} (90%) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit f01d75ba154f807d7f113eefd5ee0712b0171850 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 16:59:28 2014 +0100 On renomme un modèle CSV (plus de ObsDeb) --- .../ifremer/wao/services/service/SamplingPlanService.java | 6 +++--- ...ExportModel.java => SamplingPlanImportExportModel.java} | 14 +++++++------- ...delTest.java => SamplingPlanImportExportModelTest.java} | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java index 87495c6..ce1e214 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/SamplingPlanService.java @@ -64,7 +64,7 @@ import fr.ifremer.wao.entity.TerrestrialLocationTopiaDao; import fr.ifremer.wao.services.AuthenticatedWaoUser; import fr.ifremer.wao.services.service.administration.ReferentialService; import fr.ifremer.wao.services.service.administration.UnknownBoatRegistrationCodesException; -import fr.ifremer.wao.services.service.csv.ObsMerObsVenteSamplingPlanImportExportModel; +import fr.ifremer.wao.services.service.csv.SamplingPlanImportExportModel; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.BooleanUtils; @@ -536,7 +536,7 @@ public class SamplingPlanService extends WaoServiceSupport { List<SampleRow> sampleRows = dao.findAll(filter); ExportModel<SampleRow> exportModel = - new ObsMerObsVenteSamplingPlanImportExportModel( + new SamplingPlanImportExportModel( getLocale(), filter.getPeriodFrom(), filter.getPeriodTo(), @@ -670,7 +670,7 @@ public class SamplingPlanService extends WaoServiceSupport { ReferentialService referentialService = getReferentialService(); ImportModel<SampleRow> samplingPlanImportModel = - new ObsMerObsVenteSamplingPlanImportExportModel(getLocale(), + new SamplingPlanImportExportModel(getLocale(), obsProgram, organisations, fishingZones, diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/SamplingPlanImportExportModel.java similarity index 94% rename from wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java rename to wao-services/src/main/java/fr/ifremer/wao/services/service/csv/SamplingPlanImportExportModel.java index 5723088..0c075e4 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModel.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/SamplingPlanImportExportModel.java @@ -69,7 +69,7 @@ import java.util.regex.Pattern; * Modèle d'import et d'export pour ObsMer et Obsvente. Un seul modèle car 80% * des colonnes sont identiques. */ -public class ObsMerObsVenteSamplingPlanImportExportModel implements ImportExportModel<SampleRow> { +public class SamplingPlanImportExportModel implements ImportExportModel<SampleRow> { /** * Pour un ligne du plan, définir l'effort d'observation pour un mois donné. @@ -109,7 +109,7 @@ public class ObsMerObsVenteSamplingPlanImportExportModel implements ImportExport } private static final Logger log = - LoggerFactory.getLogger(ObsMerObsVenteSamplingPlanImportExportModel.class); + LoggerFactory.getLogger(SamplingPlanImportExportModel.class); protected static final SimpleDateFormat MONTH_YEAR_FORMAT = new SimpleDateFormat("MM/yyyy"); @@ -132,17 +132,17 @@ public class ObsMerObsVenteSamplingPlanImportExportModel implements ImportExport protected PeriodDates periodDates; /** Pour l'export */ - public ObsMerObsVenteSamplingPlanImportExportModel(Locale locale, Date fromMonth, Date toMonth, ObsProgram obsProgram) { + public SamplingPlanImportExportModel(Locale locale, Date fromMonth, Date toMonth, ObsProgram obsProgram) { this.locale = locale; this.periodDates = new PeriodDates(fromMonth, toMonth); this.obsProgram = obsProgram; } /** Pour l'import */ - public ObsMerObsVenteSamplingPlanImportExportModel(Locale locale, ObsProgram obsProgram, - Set<Organisation> organisations, List<FishingZone> fishingZones, - List<TerrestrialLocation> terrestrialDistricts, - ReferentialService referentialService) { + public SamplingPlanImportExportModel(Locale locale, ObsProgram obsProgram, + Set<Organisation> organisations, List<FishingZone> fishingZones, + List<TerrestrialLocation> terrestrialDistricts, + ReferentialService referentialService) { this.locale = locale; this.obsProgram = obsProgram; this.organisations = organisations; diff --git a/wao-services/src/test/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModelTest.java b/wao-services/src/test/java/fr/ifremer/wao/services/service/csv/SamplingPlanImportExportModelTest.java similarity index 90% rename from wao-services/src/test/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModelTest.java rename to wao-services/src/test/java/fr/ifremer/wao/services/service/csv/SamplingPlanImportExportModelTest.java index 91795da..72e1bdf 100644 --- a/wao-services/src/test/java/fr/ifremer/wao/services/service/csv/ObsMerObsVenteSamplingPlanImportExportModelTest.java +++ b/wao-services/src/test/java/fr/ifremer/wao/services/service/csv/SamplingPlanImportExportModelTest.java @@ -32,7 +32,7 @@ import org.nuiton.util.PeriodDates; import java.util.Arrays; import java.util.List; -public class ObsMerObsVenteSamplingPlanImportExportModelTest { +public class SamplingPlanImportExportModelTest { /** * Vérifie la bonne détection de la période de temps (en mois) écrite @@ -44,8 +44,8 @@ public class ObsMerObsVenteSamplingPlanImportExportModelTest { List<String> headers = Arrays.asList("A", "B", "C", "03/2011", "04/2011", "05/2011", "06/2011", "D", "E", "F"); - ObsMerObsVenteSamplingPlanImportExportModel mock = - Mockito.mock(ObsMerObsVenteSamplingPlanImportExportModel.class); + SamplingPlanImportExportModel mock = + Mockito.mock(SamplingPlanImportExportModel.class); Mockito.when(mock.findMinMaxMonth(headers)).thenCallRealMethod(); PeriodDates actualPeriodDates = mock.findMinMaxMonth(headers); -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 36c1b90a89025996229d2b25d644f4ebe6b88c8c Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 17:26:58 2014 +0100 Dans la liste déroulante, afficher la société avant le labo pour grouper --- .../src/main/java/fr/ifremer/wao/entity/LaboratoryImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/LaboratoryImpl.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/LaboratoryImpl.java index 5afe788..eada015 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/LaboratoryImpl.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/LaboratoryImpl.java @@ -3,10 +3,10 @@ package fr.ifremer.wao.entity; public class LaboratoryImpl extends LaboratoryAbstract { - private static final long serialVersionUID = 3472901365946410034L; + private static final long serialVersionUID = 2L; @Override public String getFullName() { - return String.format("%s (%s)", getName(), getCompany().getName()); + return String.format("%s / %s", getCompany().getName(), getName()); } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 85b06c7c83051065930f2712b550b958b0a13141 Author: Brendan Le Ny <bleny@codelutin.com> Date: Mon Dec 22 17:37:49 2014 +0100 Changer les intitulés pour « Laboratoire Ifremer », changer « Organisation » pour « Société / Laboratoire » --- wao-web/src/main/resources/i18n/wao-web_fr_FR.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties index e7d66ba..0873629 100644 --- a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties +++ b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties @@ -168,7 +168,7 @@ wao.ui.entity.Boats=Navires wao.ui.entity.Company=Société wao.ui.entity.Contact=Contact wao.ui.entity.FishingZone=Zones de pêche -wao.ui.entity.Organisation=Organisation +wao.ui.entity.Organisation=Société / Laboratoire wao.ui.entity.SampleRow=Ligne du plan d'échantillonnage wao.ui.entity.SampleRow.day=Jour wao.ui.entity.TerrestrialLocation=Lieu @@ -261,7 +261,7 @@ wao.ui.field.SampleRow.nbObservants=Nombre d'observateurs wao.ui.field.SampleRow.observationType=Type d'observation wao.ui.field.SampleRow.observationUnit=Unité d'observation wao.ui.field.SampleRow.observers=Observateurs -wao.ui.field.SampleRow.organisation=Organisation +wao.ui.field.SampleRow.organisation=Société / Laboratoire wao.ui.field.SampleRow.other=Autre wao.ui.field.SampleRow.periodBegin=Début wao.ui.field.SampleRow.periodEnd=Fin @@ -510,7 +510,7 @@ wao.ui.page.SamplingPlan.title=Plan d'échantillonnage wao.ui.page.Synthesis.title=Synthèse wao.ui.page.UserProfileForm.title=Gestion du profil wao.ui.page.companies.title=Sociétés -wao.ui.page.laboratories.title=Laboratoires +wao.ui.page.laboratories.title=Laboratoires Ifremer wao.ui.page.waoUsers.title=Utilisateurs wao.ui.page.waoUsers.titleForCompany=Utilisateurs de la société %s wao.ui.periodToMustBeAfterPeriodFrom=La période de temps doit se terminer après avoir commencé -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 7c3359487b0aa84d328639927371fa584b3f1ffa Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Dec 23 10:02:04 2014 +0100 Dans la liste des utilisateurs, ajouter une colonne pour le labo ; dans la liste déroulante, afficher la société avant le labo pour grouper --- .../main/java/fr/ifremer/wao/entity/Companies.java | 2 +- .../java/fr/ifremer/wao/entity/Organisations.java | 10 ++--- .../main/java/fr/ifremer/wao/entity/WaoUsers.java | 16 ++++++++ .../administration/OrganisationsService.java | 9 ++--- .../service/administration/WaoUsersList.java | 44 ++++++++++++++++++++++ .../service/administration/WaoUsersService.java | 19 +++++----- .../operations/OrganisationParserFormatter.java | 2 +- .../web/action/administration/WaoUsersAction.java | 13 +++---- .../main/resources/i18n/wao-web_en_GB.properties | 1 + .../main/resources/i18n/wao-web_fr_FR.properties | 1 + .../WEB-INF/content/administration/wao-users.jsp | 24 ++++++++++-- 11 files changed, 108 insertions(+), 33 deletions(-) diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/Companies.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/Companies.java index 0b657ae..f8970fa 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/Companies.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/Companies.java @@ -26,7 +26,7 @@ import com.google.common.base.Function; public class Companies { public static Function<Company, String> getName() { - return Organisations.getName(); + return Organisations.getFullName(); } } diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/Organisations.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/Organisations.java index bdd649b..30efc81 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/Organisations.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/Organisations.java @@ -5,19 +5,19 @@ import com.google.common.collect.Ordering; public class Organisations { - public static <T extends Organisation> Function<T, String> getName() { - return new GetName<>(); + public static <T extends Organisation> Function<T, String> getFullName() { + return new GetFullName<>(); } public static Ordering<Organisation> comparator() { - return Ordering.natural().onResultOf(getName()); + return Ordering.natural().onResultOf(getFullName()); } - protected static class GetName<T extends Organisation> implements Function<T, String> { + protected static class GetFullName<T extends Organisation> implements Function<T, String> { @Override public String apply(T input) { - return input.getName(); + return input.getFullName(); } } } diff --git a/wao-persistence/src/main/java/fr/ifremer/wao/entity/WaoUsers.java b/wao-persistence/src/main/java/fr/ifremer/wao/entity/WaoUsers.java index cc4b615..d8b7680 100644 --- a/wao-persistence/src/main/java/fr/ifremer/wao/entity/WaoUsers.java +++ b/wao-persistence/src/main/java/fr/ifremer/wao/entity/WaoUsers.java @@ -40,6 +40,14 @@ public class WaoUsers { return new GetFullName(); } + public static Comparator<WaoUser> loginComparator() { + return Ordering.natural().onResultOf(getLogin()); + } + + public static Function<WaoUser, Organisation> getOrganisation() { + return new GetOrganisation(); + } + protected static class GetLogin implements Function<WaoUser, String> { @Override @@ -55,4 +63,12 @@ public class WaoUsers { return input.getFullName(); } } + + protected static class GetOrganisation implements Function<WaoUser, Organisation> { + + @Override + public Organisation apply(WaoUser input) { + return input.getOrganisation(); + } + } } diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/OrganisationsService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/OrganisationsService.java index 8e90623..0f531f8 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/OrganisationsService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/OrganisationsService.java @@ -1,7 +1,6 @@ package fr.ifremer.wao.services.service.administration; import com.google.common.collect.Iterables; -import fr.ifremer.wao.entity.Company; import fr.ifremer.wao.entity.Laboratory; import fr.ifremer.wao.entity.ObsProgram; import fr.ifremer.wao.entity.Organisation; @@ -20,13 +19,13 @@ import java.util.TreeSet; public class OrganisationsService extends WaoServiceSupport { - public List<Organisation> getAllOrganisations() { + public SortedSet<Organisation> getAllOrganisations() { - OrganisationTopiaDao dao = getPersistenceContext().getOrganisationDao(); + SortedSet<Organisation> allOrganisations = new TreeSet<>(Organisations.comparator()); - List<Organisation> organisations = dao.newQueryBuilder().setOrderByArguments(Company.PROPERTY_ACTIVE + " desc", Organisation.PROPERTY_NAME).findAll(); + allOrganisations.addAll(getOrganisationDao().findAll()); - return organisations; + return allOrganisations; } diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersList.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersList.java new file mode 100644 index 0000000..b53508a --- /dev/null +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersList.java @@ -0,0 +1,44 @@ +package fr.ifremer.wao.services.service.administration; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.Iterables; +import fr.ifremer.wao.entity.Organisation; +import fr.ifremer.wao.entity.WaoUser; +import fr.ifremer.wao.entity.WaoUsers; + +import java.util.Collection; + +/** + * La liste des utilisateurs appartenant à l'organisation {@link #organisation}. + * + * @since 3.0 + */ +public class WaoUsersList { + + protected Organisation organisation; + + protected ImmutableSortedSet<WaoUser> waoUsers; + + public WaoUsersList(Organisation organisation, Collection<WaoUser> waoUsers) { + this.organisation = organisation; + this.waoUsers = ImmutableSortedSet.orderedBy(WaoUsers.loginComparator()).addAll(waoUsers).build(); + } + + public Organisation getOrganisation() { + return organisation; + } + + public ImmutableSortedSet<WaoUser> getWaoUsers() { + return waoUsers; + } + + public boolean isMultipleOrganisations() { + Iterable<Organisation> companiesWaoUsersBelongsTo = Iterables.transform(waoUsers, WaoUsers.getOrganisation()); + Predicate<Organisation> organisationIsTheOrganisationAsked = Predicates.equalTo(organisation); + boolean multipleOrganisations = ! Iterables.all(companiesWaoUsersBelongsTo, organisationIsTheOrganisationAsked); + return multipleOrganisations; + } + +} diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersService.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersService.java index 10e29d5..4978185 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersService.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/administration/WaoUsersService.java @@ -27,7 +27,6 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Maps; import fr.ifremer.wao.entity.Boat; import fr.ifremer.wao.entity.Boats; -import fr.ifremer.wao.entity.Company; import fr.ifremer.wao.entity.ObsProgram; import fr.ifremer.wao.entity.Organisation; import fr.ifremer.wao.entity.UserProfile; @@ -56,21 +55,21 @@ public class WaoUsersService extends WaoServiceSupport { private static final Log log = LogFactory.getLog(WaoUsersService.class); - public List<WaoUser> getWaoUsers(Optional<String> optionalOrganisationId) { + public WaoUsersList getWaoUsers(Optional<String> optionalOrganisationId) { - WaoUserTopiaDao dao = getWaoUserDao(); - - TopiaQueryBuilderAddCriteriaOrRunQueryStep<WaoUser> query = dao.newQueryBuilder(); + TopiaQueryBuilderAddCriteriaOrRunQueryStep<WaoUser> query = getWaoUserDao().newQueryBuilder(); + Organisation organisation = null; if (optionalOrganisationId.isPresent()) { - query.addTopiaIdEquals(WaoUser.PROPERTY_ORGANISATION, optionalOrganisationId.get()); + // si l'organisation est une société, on veut aussi récupérer tous les utilisateurs indirectement liés + organisation = getOrganisationDao().forTopiaIdEquals(optionalOrganisationId.get()).findUnique(); + Set<Organisation> organisations = getOrganisationsService().getOrganisationsBelongingsTo(organisation); + query.addIn(WaoUser.PROPERTY_ORGANISATION, organisations); } - query.setOrderByArguments(WaoUser.PROPERTY_LOGIN); - List<WaoUser> waoUsers = query.findAll(); - - return waoUsers; + WaoUsersList waoUsersList = new WaoUsersList(organisation, waoUsers); + return waoUsersList; } diff --git a/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/OrganisationParserFormatter.java b/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/OrganisationParserFormatter.java index 472f0a2..58ac330 100644 --- a/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/OrganisationParserFormatter.java +++ b/wao-services/src/main/java/fr/ifremer/wao/services/service/csv/operations/OrganisationParserFormatter.java @@ -63,7 +63,7 @@ public class OrganisationParserFormatter implements ValueParserFormatter<Organis @Override public Organisation parse(String organisationName) throws ParseException { if (indexedOrganisations == null) { - indexedOrganisations = Maps.uniqueIndex(organisations, Organisations.getName()); + indexedOrganisations = Maps.uniqueIndex(organisations, Organisations.getFullName()); } Organisation organisation = null; if (StringUtils.isNotBlank(organisationName)) { diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/action/administration/WaoUsersAction.java b/wao-web/src/main/java/fr/ifremer/wao/web/action/administration/WaoUsersAction.java index df8f6b1..ece64b3 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/action/administration/WaoUsersAction.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/action/administration/WaoUsersAction.java @@ -25,12 +25,10 @@ import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import com.opensymphony.xwork2.Preparable; -import fr.ifremer.wao.entity.WaoUser; +import fr.ifremer.wao.services.service.administration.WaoUsersList; import fr.ifremer.wao.services.service.administration.WaoUsersService; import fr.ifremer.wao.web.WaoJspActionSupport; -import java.util.List; - public class WaoUsersAction extends WaoJspActionSupport implements Preparable { private static final long serialVersionUID = 1L; @@ -39,7 +37,7 @@ public class WaoUsersAction extends WaoJspActionSupport implements Preparable { protected Optional<String> optionalOrganisationId = Optional.absent(); - protected List<WaoUser> waoUsers; + protected WaoUsersList waoUsersList; public void setService(WaoUsersService service) { this.service = service; @@ -62,11 +60,12 @@ public class WaoUsersAction extends WaoJspActionSupport implements Preparable { optionalOrganisationId = Optional.of(getAuthenticatedWaoUser().getCompany().getTopiaId()); } - waoUsers = service.getWaoUsers(optionalOrganisationId); + waoUsersList = service.getWaoUsers(optionalOrganisationId); } - public List<WaoUser> getWaoUsers() { - return waoUsers; + public WaoUsersList getWaoUsersList() { + return waoUsersList; } + } diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties index b17a646..397b46f 100644 --- a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties +++ b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties @@ -291,6 +291,7 @@ wao.ui.field.WaoUser.fullName=Name wao.ui.field.WaoUser.lastName=Last name wao.ui.field.WaoUser.login=Login wao.ui.field.WaoUser.mammalsNotifications=Receive notifications about mammals captures +wao.ui.field.WaoUser.organisation=Company / Laboratory wao.ui.field.WaoUser.password=Password wao.ui.field.WaoUser.phoneNumber=Phone number wao.ui.filters.filters=Search filters diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties index 0873629..5ad3387 100644 --- a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties +++ b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties @@ -292,6 +292,7 @@ wao.ui.field.WaoUser.fullName=Nom wao.ui.field.WaoUser.lastName=Nom wao.ui.field.WaoUser.login=Identifiant wao.ui.field.WaoUser.mammalsNotifications=Recevoir les notifications de captures accidentelles +wao.ui.field.WaoUser.organisation=Société / Laboratoire wao.ui.field.WaoUser.password=Mot de passe wao.ui.field.WaoUser.phoneNumber=N° de téléphone wao.ui.filters.filters=Filtres de recherche diff --git a/wao-web/src/main/webapp/WEB-INF/content/administration/wao-users.jsp b/wao-web/src/main/webapp/WEB-INF/content/administration/wao-users.jsp index 3eaf84a..57028bd 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/administration/wao-users.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/administration/wao-users.jsp @@ -23,14 +23,20 @@ <html> - <head> + <s:if test="waoUsersList.organisation == null"> + <s:set name="title"><s:text name="wao.ui.page.waoUsers.title" /></s:set> + </s:if> + <s:else> + <s:set name="title"><s:text name="wao.ui.page.waoUsers.title" /> <s:property value="waoUsersList.organisation.fullName" /> </s:set> + </s:else> - <title><s:text name="wao.ui.page.waoUsers.title" /></title> + <head> + <title><s:property value="#title" /></title> <content tag="mainClass">form</content> </head> <div class="form-wrapper"> - <h1><s:text name="wao.ui.page.waoUsers.title" /></h1> + <h1><s:property value="#title" /></h1> <table class="table table-bordered"> <tr> @@ -40,6 +46,11 @@ <th> <s:text name="wao.ui.field.WaoUser.fullName" /> </th> + <s:if test="waoUsersList.multipleOrganisations"> + <th> + <s:text name="wao.ui.field.WaoUser.organisation" /> + </th> + </s:if> <th> <s:text name="wao.ui.field.WaoUser.active" /> </th> @@ -47,7 +58,7 @@ <s:text name="wao.ui.actions" /> </th> </tr> - <s:iterator value="waoUsers"> + <s:iterator value="waoUsersList.waoUsers"> <tr> <td<s:if test=" ! active"> class="inactive"</s:if>> <s:property value="login" /> @@ -55,6 +66,11 @@ <td> <s:property value="fullName" /> </td> + <s:if test="waoUsersList.multipleOrganisations"> + <td> + <s:property value="organisation.fullName" /> + </td> + </s:if> <td> <s:if test="active"> <s:text name="wao.ui.misc.yes" /> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit 141f8e230ea90d4a6fa8602a1b4bb7197a6b3e47 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Dec 23 10:46:45 2014 +0100 On garde un libellé « Société » pour obsmer et obsvente de le formulaire de modification d'une ligne du plan --- wao-web/src/main/webapp/WEB-INF/content/edit-sample-row-input.jsp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wao-web/src/main/webapp/WEB-INF/content/edit-sample-row-input.jsp b/wao-web/src/main/webapp/WEB-INF/content/edit-sample-row-input.jsp index 0b3bc70..31108ae 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/edit-sample-row-input.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/edit-sample-row-input.jsp @@ -260,8 +260,13 @@ cssClass="input-small" /> </s:if> + <s:set name="organisationLabel"><s:text name="wao.ui.field.SampleRow.organisation" /></s:set> + <s:if test="updateSampleRowCommand.sampleRow.obsProgram.obsMer || updateSampleRowCommand.sampleRow.obsProgram.obsVente"> + <s:set name="organisationLabel"><s:text name="wao.ui.entity.Company" /></s:set> + </s:if> + <s:select name="updateSampleRowCommand.organisationId" - label="%{getText('wao.ui.field.SampleRow.organisation')}" + label="%{#organisationLabel}" disabled="updateSampleRowCommand.observationAlreadyStarted" list="updateSampleRowCommand.allOrganisations" listValue="%{value.fullName}" -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit dfad2351a30af4b4aef2a0add3365bacf4e96c79 Merge: f01d75b 141f8e2 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Dec 23 10:50:07 2014 +0100 Corrections pour éviter la notion d'organisation (fixes #6295) .../main/java/fr/ifremer/wao/entity/Companies.java | 2 +- .../java/fr/ifremer/wao/entity/LaboratoryImpl.java | 4 +- .../java/fr/ifremer/wao/entity/Organisations.java | 10 ++--- .../main/java/fr/ifremer/wao/entity/WaoUsers.java | 16 ++++++++ .../administration/OrganisationsService.java | 9 ++--- .../service/administration/WaoUsersList.java | 44 ++++++++++++++++++++++ .../service/administration/WaoUsersService.java | 19 +++++----- .../operations/OrganisationParserFormatter.java | 2 +- .../web/action/administration/WaoUsersAction.java | 13 +++---- .../main/resources/i18n/wao-web_en_GB.properties | 1 + .../main/resources/i18n/wao-web_fr_FR.properties | 7 ++-- .../WEB-INF/content/administration/wao-users.jsp | 24 ++++++++++-- .../WEB-INF/content/edit-sample-row-input.jsp | 7 +++- 13 files changed, 119 insertions(+), 39 deletions(-) -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm