Author: tchemit Date: 2014-04-09 18:42:24 +0200 (Wed, 09 Apr 2014) New Revision: 1876 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1876 Log: refs #4487 continue contacts page - add date formatter Added: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/AbstractDateConverter.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateConverter.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateTimeConverter.java trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/Contact-conversion.properties trunk/wao-web/src/main/webapp/img/ trunk/wao-web/src/main/webapp/img/eye-22px.png trunk/wao-web/src/main/webapp/img/false-22px.png trunk/wao-web/src/main/webapp/img/fishing-net-22px.png trunk/wao-web/src/main/webapp/img/help-22px.png trunk/wao-web/src/main/webapp/img/true-22px.png Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java =================================================================== --- trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -94,11 +94,23 @@ } public static Date parseMonth(Locale locale, String monthYear) throws ParseException { - String pattern = I18n.l(locale, "wao.month.pattern"); + String pattern = I18n.l(locale, "wao.month.parser"); DateFormat dateFormat = new SimpleDateFormat(pattern); return dateFormat.parse(monthYear); } + public static Date parseDate(Locale locale, String monthYear) throws ParseException { + String pattern = I18n.l(locale, "wao.date.parser"); + DateFormat dateFormat = new SimpleDateFormat(pattern); + return dateFormat.parse(monthYear); + } + + public static Date parseDateTime(Locale locale, String monthYear) throws ParseException { + String pattern = I18n.l(locale, "wao.datetime.parser"); + DateFormat dateFormat = new SimpleDateFormat(pattern); + return dateFormat.parse(monthYear); + } + public static String l(Locale locale, I18nAble i18nAble) { return I18n.l(locale, i18nAble.getI18nKey()); } Modified: trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties =================================================================== --- trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties 2014-04-09 16:42:24 UTC (rev 1876) @@ -139,7 +139,9 @@ fr.ifremer.wao.entity.TerrestrialLocation=Terrestrial locations wao.business.other= wao.date.formatter=%1$td-%1$tm-%1$tY +wao.date.parser=dd-MM-yyyy wao.datetime.formatter=%1$td-%1$tm-%1$tY %1$tH\:%1$tM +wao.datetime.parser=dd-MM-yyyy HH\:mm wao.month.formatter=%1$tm-%1$tY -wao.month.pattern=MM-yyyy +wao.month.parser=MM-yyyy wao.time.formatter=%1$tH\:%1$tM Modified: trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties =================================================================== --- trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties 2014-04-09 16:42:24 UTC (rev 1876) @@ -138,7 +138,10 @@ fr.ifremer.wao.entity.TerrestrialLocation=Lieux terrestres wao.business.other= wao.date.formatter=%1$td/%1$tm/%1$tY +wao.date.parser=dd/MM/yyyy wao.datetime.formatter=%1$td/%1$tm/%1$tY %1$tH\:%1$tM +wao.datetime.parser=dd/MM/yyyy HH\:mm wao.month.formatter=%1$tm/%1$tY +wao.month.parser=MM/yyyy wao.month.pattern=MM/yyyy wao.time.formatter=%1$tH\:%1$tM Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoInterceptor.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -88,7 +88,7 @@ admin.sizeCanReadBoats(); admin.getCompany().getTopiaId(); UserProfile userProfile = new UserProfileImpl(); - userProfile.setUserRole(UserRole.COORDINATOR); + userProfile.setUserRole(UserRole.ADMIN); userProfile.setObsProgram(ObsProgram.OBSMER); userProfile.setCanWrite(true); AuthenticatedWaoUser authenticatedWaoUser = new AuthenticatedWaoUser(admin, userProfile); Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -25,6 +25,7 @@ import fr.ifremer.wao.ContactsFilter; import fr.ifremer.wao.entity.Boat; import fr.ifremer.wao.entity.Contact; +import fr.ifremer.wao.entity.ContactState; import fr.ifremer.wao.entity.FishingZone; import fr.ifremer.wao.entity.ObsProgram; import fr.ifremer.wao.entity.Profession; @@ -117,12 +118,12 @@ protected Date now = new Date(); public String getFilterPeriodFromPlaceholder() { - String placeholder = formatMonth(DateUtils.addMonths(now, 1)); + String placeholder = formatDateTime(DateUtils.addMonths(now, 1)); return placeholder; } public String getFilterPeriodToPlaceholder() { - String placeholder = formatMonth(DateUtils.addYears(now, 1)); + String placeholder = formatDateTime(DateUtils.addYears(now, 1)); return placeholder; } @@ -135,6 +136,10 @@ return escapeForToolTip(contact.getMammalsInfo()); } + public boolean isBoardingDone(Contact contact) { + return ContactState.OBSERVATION_DONE == contact.getContactState(); + } + //FIXME Use ellipse public String getCommentDisplayText(String comment) { if (comment != null && comment.length() > 20) { Copied: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/AbstractDateConverter.java (from rev 1875, trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java) =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/AbstractDateConverter.java (rev 0) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/AbstractDateConverter.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -0,0 +1,138 @@ +package fr.ifremer.wao.web.converter; + +/* + * #%L + * Wao :: Web + * %% + * Copyright (C) 2009 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import com.google.common.base.Preconditions; +import com.opensymphony.xwork2.ActionContext; +import com.opensymphony.xwork2.conversion.TypeConversionException; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.struts2.util.StrutsTypeConverter; + +import java.text.ParseException; +import java.util.Arrays; +import java.util.Date; +import java.util.Locale; +import java.util.Map; + + +/** + * To convert a date as a month. + * <p/> + * FIXME-tchemit 2014-04-06 When user change his locale, we could have in parameters some date formatted with the previous + * FIXME-tchemit 2014-04-06 locale, we need then to try with previous locale date pattern. + * + * @since 4.0 + */ +public abstract class AbstractDateConverter extends StrutsTypeConverter { + + /** Logger. */ + private static final Log log = LogFactory.getLog(AbstractDateConverter.class); + + protected abstract Date parse(Locale locale, String string) throws ParseException; + + protected abstract String format(Locale locale, Date date); + + @Override + public Date convertFromString(Map map, String[] strings, Class aClass) { + + if (strings.length == 1) { + + String string = strings[0]; + + Date parsedValue; + + if (StringUtils.isEmpty(string)) { + + parsedValue = null; + + } else { + + Locale locale = (Locale) map.get(ActionContext.LOCALE); + Preconditions.checkNotNull(locale, "No locale found in ActionContext"); + + parsedValue = parseDate(locale, string, strings, true); + + if (parsedValue == null) { + + //FIXME If action is changing language, then date are not in good format + //FIXME Let's try why other locale... + if (Locale.FRENCH.equals(locale)) { + locale = Locale.ENGLISH; + } else { + locale = Locale.FRENCH; + } + parsedValue = parseDate(locale, string, strings, false); + } + } + + return parsedValue; + + } else { + throw new TypeConversionException("strings=" + Arrays.toString(strings)); + } + } + + protected Date parseDate(Locale locale, String string, String[] strings, boolean swallonError) { + Preconditions.checkNotNull(locale); + try { + return parse(locale, string); + } catch (ParseException e) { + if (swallonError) { + return null; + } + //FIXME See why we don't see the error + if (log.isErrorEnabled()) { + log.error("Could not format parse date " + string, e); + } + throw new TypeConversionException("strings=" + Arrays.toString(strings)); + } + } + + @Override + public String convertToString(Map map, Object o) { + + String str; + + if (o == null) { + + str = StringUtils.EMPTY; + + } else { + + if (o instanceof Date) { + + Date date = (Date) o; + + Locale locale = (Locale) map.get(ActionContext.LOCALE); + Preconditions.checkNotNull(locale, "No locale found in ActionContext"); + str = format(locale, date); + } else { + throw new UnsupportedOperationException("cannot convert to month " + o); + } + } + + return str; + + } +} Added: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateConverter.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateConverter.java (rev 0) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateConverter.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -0,0 +1,50 @@ +package fr.ifremer.wao.web.converter; + +/* + * #%L + * Wao :: Web + * %% + * Copyright (C) 2009 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.wao.WaoUtils; + +import java.text.ParseException; +import java.util.Date; +import java.util.Locale; + +/** + * To convert date to string. + * <p/> + * Created on 4/9/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @see WaoUtils#parseDate(Locale, String) + * @see WaoUtils#formatDate(Locale, Date) + * @since 4.0 + */ +public class DateConverter extends AbstractDateConverter { + @Override + protected Date parse(Locale locale, String string) throws ParseException { + return WaoUtils.parseDate(locale, string); + } + + @Override + protected String format(Locale locale, Date date) { + return WaoUtils.formatDate(locale, date); + } +} Property changes on: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateConverter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateTimeConverter.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateTimeConverter.java (rev 0) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateTimeConverter.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -0,0 +1,50 @@ +package fr.ifremer.wao.web.converter; + +/* + * #%L + * Wao :: Web + * %% + * Copyright (C) 2009 - 2014 Ifremer + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ + +import fr.ifremer.wao.WaoUtils; + +import java.text.ParseException; +import java.util.Date; +import java.util.Locale; + +/** + * To convert date time to string. + * <p/> + * Created on 4/9/14. + * + * @author Tony Chemit <chemit@codelutin.com> + * @see WaoUtils#parseDateTime(Locale, String) + * @see WaoUtils#formatDateTime(Locale, Date) + * @since 4.0 + */ +public class DateTimeConverter extends AbstractDateConverter { + @Override + protected Date parse(Locale locale, String string) throws ParseException { + return WaoUtils.parseDateTime(locale, string); + } + + @Override + protected String format(Locale locale, Date date) { + return WaoUtils.formatDateTime(locale, date); + } +} Property changes on: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/DateTimeConverter.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/converter/MonthConverter.java 2014-04-09 16:42:24 UTC (rev 1876) @@ -21,115 +21,29 @@ * #L% */ -import com.google.common.base.Preconditions; -import com.opensymphony.xwork2.ActionContext; -import com.opensymphony.xwork2.conversion.TypeConversionException; import fr.ifremer.wao.WaoUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.struts2.util.StrutsTypeConverter; import java.text.ParseException; -import java.util.Arrays; import java.util.Date; import java.util.Locale; -import java.util.Map; /** * To convert a date as a month. * - * FIXME-tchemit 2014-04-06 When user change his locale, we could have in parameters some date formatted with the previous - * FIXME-tchemit 2014-04-06 locale, we need then to try with previous locale date pattern. - * + * @see WaoUtils#parseMonth(Locale, String) + * @see WaoUtils#formatMonth(Locale, Date) * @since 4.0 */ -public class MonthConverter extends StrutsTypeConverter { +public class MonthConverter extends AbstractDateConverter { - /** Logger. */ - private static final Log log = LogFactory.getLog(MonthConverter.class); - @Override - public Date convertFromString(Map map, String[] strings, Class aClass) { - - if (strings.length == 1) { - - String string = strings[0]; - - Date parsedValue; - - if (StringUtils.isEmpty(string)) { - - parsedValue = null; - - } else { - - Locale locale = (Locale) map.get(ActionContext.LOCALE); - Preconditions.checkNotNull(locale, "No locale found in ActionContext"); - - parsedValue = parseDate(locale, string, strings, true); - - if (parsedValue == null) { - - //FIXME If action is changing language, then date are not in good format - //FIXME Let's try why other locale... - if (Locale.FRENCH.equals(locale)) { - locale = Locale.ENGLISH; - } else { - locale = Locale.FRENCH; - } - parsedValue = parseDate(locale, string, strings, false); - } - } - - return parsedValue; - - } else { - throw new TypeConversionException("strings=" + Arrays.toString(strings)); - } + protected Date parse(Locale locale, String string) throws ParseException { + return WaoUtils.parseMonth(locale, string); } - protected Date parseDate(Locale locale, String string, String[] strings, boolean swallonError) { - Preconditions.checkNotNull(locale); - try { - return WaoUtils.parseMonth(locale, string); - } catch (ParseException e) { - if (swallonError) { - return null; - } - //FIXME See why we don't see the error - if (log.isErrorEnabled()) { - log.error("Could not format parse date " + string, e); - } - throw new TypeConversionException("strings=" + Arrays.toString(strings)); - } - } - @Override - public String convertToString(Map map, Object o) { - - String str; - - if (o == null) { - - str = StringUtils.EMPTY; - - } else { - - if (o instanceof Date) { - - Date date = (Date) o; - - Locale locale = (Locale) map.get(ActionContext.LOCALE); - Preconditions.checkNotNull(locale, "No locale found in ActionContext"); - str = WaoUtils.formatMonth(locale, date); - } else { - throw new UnsupportedOperationException("cannot convert to month " + o); - } - } - - return str; - + protected String format(Locale locale, Date date) { + return WaoUtils.formatMonth(locale, date); } } Modified: trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties =================================================================== --- trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/resources/fr/ifremer/wao/ContactsFilter-conversion.properties 2014-04-09 16:42:24 UTC (rev 1876) @@ -18,5 +18,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # #L% ### +periodFrom=fr.ifremer.wao.web.converter.DateConverter +periodTo=fr.ifremer.wao.web.converter.DateConverter companyAcceptations=fr.ifremer.wao.web.converter.BooleanSetConverter programAcceptations=fr.ifremer.wao.web.converter.BooleanSetConverter \ No newline at end of file Added: trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/Contact-conversion.properties =================================================================== --- trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/Contact-conversion.properties (rev 0) +++ trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/Contact-conversion.properties 2014-04-09 16:42:24 UTC (rev 1876) @@ -0,0 +1,25 @@ +### +# #%L +# Wao :: Web +# %% +# Copyright (C) 2009 - 2014 Ifremer +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# #L% +### +observationBeginDate=fr.ifremer.wao.web.converter.DateTimeConverter +observationEndDate=fr.ifremer.wao.web.converter.DateTimeConverter +creationDate=fr.ifremer.wao.web.converter.DateConverter +dataInputDate=fr.ifremer.wao.web.converter.DateConverter +restitution=fr.ifremer.wao.web.converter.DateConverter \ No newline at end of file Property changes on: trunk/wao-web/src/main/resources/fr/ifremer/wao/entity/Contact-conversion.properties ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties =================================================================== --- trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-09 16:42:24 UTC (rev 1876) @@ -116,7 +116,7 @@ wao.ui.chart.numberOfBoatsWithBoardings=Number of boats with x observations wao.ui.chooseUserProfile=Choose your user profile wao.ui.contact.creation=Creation of a contact -wao.ui.contact.edition=Edtion of contact +wao.ui.contact.edition=Edition of contact wao.ui.contact.lastContact=Last observation with this boat for your company wao.ui.contacts.FishingZone.facadeName=Fishing zone Facade wao.ui.contacts.FishingZone.sectorName=Fishing zone Sector @@ -467,7 +467,7 @@ wao.ui.publishedByProgram=Pusblished by program wao.ui.publishedByYourCompany=Published by company wao.ui.sampleRow.creation=Creation of a sample row -wao.ui.sampleRow.edition=Edtion of line %s +wao.ui.sampleRow.edition=Edition of line %s wao.ui.sampleRowLog.title=%s line historic wao.ui.samplingPlan.Actual=Actual wao.ui.samplingPlan.actions=Actions @@ -525,11 +525,11 @@ wao.ui.synthesis.observationHours.description=Number of observations according to the time of the day (based on the observation begin date) wao.ui.synthesis.observationHours.title=Observation hours wao.ui.tip.boatDetails.elligibleForSampleRowsEmpty=The boat is not associated to any sample row +wao.ui.tip.boatSelectionForSampleRowStarted=You are selecting a boat for sample row %s to create a contact. Sample row profession is %s. wao.ui.tip.contactAlreadyExists=You can't create a new contact since another already exists wao.ui.tip.inactiveBoat=You can't create a new contact with a inactive boat wao.ui.tip.useBoatSelectionForSampleRow=To create a contact for a sample-row for which the boat is not declared as eligible, you may create the contact from the sampling plan wao.ui.tip.youMustChooseBoat=You must choose a boat in the list -wao.ui.tip.boatSelectionForSampleRowStarted=You are selecting a boat for sample row %s to create a contact. Sample row profession is %s. wao.ui.unavailableOperation=Unavailable operation wao.ui.unit.days=day(s) wao.ui.unit.observers=observer(s) Modified: trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties =================================================================== --- trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-09 16:42:24 UTC (rev 1876) @@ -525,11 +525,11 @@ wao.ui.synthesis.observationHours.description=Nombre d'observations effectuée selon l'heure d'arrivée wao.ui.synthesis.observationHours.title=Distribution des périodes d'observation wao.ui.tip.boatDetails.elligibleForSampleRowsEmpty=Le navire n'est éligible pour aucune ligne du plan +wao.ui.tip.boatSelectionForSampleRowStarted=Vous êtes en mode de sélection d'un navire pour la ligne %s afin de créer un contact. Le métier de la ligne est %s. wao.ui.tip.contactAlreadyExists=Il existe déjà un contact en cours pour ce navire wao.ui.tip.inactiveBoat=On ne peut pas créer un contact avec un navire inactif wao.ui.tip.useBoatSelectionForSampleRow=Pour créer un contact avec ce navire et pour une autre ligne que celles retenues comme éligibles, vous devez vous rendre dans le plan, et pour la ligne en question, sélectionner « Créer un contact ». wao.ui.tip.youMustChooseBoat=Vous devez sélectionner un navire dans la liste en cliquant sur son immatriculation pour afficher les détails ici. -wao.ui.tip.boatSelectionForSampleRowStarted=Vous êtes en mode de sélection d'un navire pour la ligne %s afin de créer un contact. Le métier de la ligne est %s. wao.ui.unavailableOperation=Opération non-disponible wao.ui.unit.days=jour(s) wao.ui.unit.observers=observateur(s) Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp 2014-04-09 16:42:24 UTC (rev 1876) @@ -373,7 +373,7 @@ <s:iterator value="contacts" var="contact"> <tr class="contact-row <s:if test="topiaId.equals(contactToHighlightId)"> highlight</s:if>"> <td> - <s:property value="%{formatDate(creationDate)}"/> + <s:property value="creationDate"/> </td> <td> <s:if test="secondaryObserversEmpty"> @@ -439,12 +439,12 @@ </td> <td> <s:if test="observationBeginDate"> - <s:property value="%{formatDateTime(observationBeginDate)}"/> + <s:property value="observationBeginDate"/> </s:if> </td> <td> <s:if test="observationEndDate"> - <s:property value="%{formatDateTime(observationEndDate)}"/> + <s:property value="observationEndDate"/> </s:if> </td> <td> @@ -457,25 +457,25 @@ </s:if> <s:if test="mammalsCapture"> <s:if test="mammalsInfo"> - <img src="<s:url value="fishing-net-22px.png"/>" + <img src="<s:url value="/img/fishing-net-22px.png"/>" alt="<s:text name="wao.ui.field.Contact.mammalsCapture"/>"/> <%--TODO<s:text name="wao.ui.field.Contact.mammalsInfo"><s:param value="%{getMammalsInfo(#contact)}"/></s:text>--%> </s:if> <s:else> - <img src="<s:url value="fishing-net-22px.png"/>" + <img src="<s:url value="/img/fishing-net-22px.png"/>" alt="<s:text name="wao.ui.field.Contact.mammalsCapture"/>"/> </s:else> </s:if> </td> <td> - <s:if test="comment"> - <s:property value="%{getCommentDisplayText(comment)}"/> + <s:if test="!comment.empty"> + <s:property value="comment"/> <%--TODO<s:text name="wao.ui.misc.comment"><s:param value="%{getTooltipText(comment)}"/></s:text>--%> </s:if> </td> <td> <s:if test="dataInputDate"> - <s:property value="%{formatDate(dataInputDate)}"/> + <s:property value="dataInputDate"/> </s:if> </td> <td> @@ -485,33 +485,50 @@ </td> <td> <s:if test="restitution"> - <s:property value="%{formatDate(restitution)}"/> + <s:property value="restitution"/> </s:if> </td> <td> - Validation - <s:property value=""/> - <%--<t:booleanImage t:value="contact.validationCompany" t:empty="isEmpty(contact.validationCompany)"--%> - <%--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="${message:wao.ui.misc.notValidated}"--%> - <%--t:trueTitle="${message:wao.ui.misc.validated}" t:falseTitle="${message:wao.ui.misc.refused}"/>--%> + <s:if test="validationCompany == null"> + <img src="<s:url value="/img/help-22px.png"/>" + alt="<s:text name="wao.ui.misc.notValidated"/>"/> + </s:if> + <s:elseif test="validationCompany"> + <img src="<s:url value="/img/true-22px.png"/>" + alt="<s:text name="wao.ui.misc.validated"/>"/> + </s:elseif> + <s:else> + <img src="<s:url value="/img/false-22px.png"/>" + alt="<s:text name="wao.ui.misc.refused"/>"/> + </s:else> + <s:if test="validationProgram == null"> + <img src="<s:url value="/img/help-22px.png"/>" + alt="<s:text name="wao.ui.misc.notValidated"/>"/> + </s:if> + <s:elseif test="validationProgram"> + <img src="<s:url value="/img/true-22px.png"/>" + alt="<s:text name="wao.ui.misc.validated"/>"/> + </s:elseif> + <s:else> + <img src="<s:url value="/img/false-22px.png"/>" + alt="<s:text name="wao.ui.misc.refused"/>"/> + </s:else> </td> <td> - <s:if test="commentCoordinator"> - <s:property value="%{getCommentDisplayText(commentCoordinator)}"/> + <s:if test="!commentCoordinator.empty"> + <s:property value="commentCoordinator"/> <%--TODO<s:text name="wao.ui.field.Contact.commentCoordinator"><s:param value="%{getTooltipText(commentCoordinator)}"/></s:text>--%> </s:if> </td> <td> - <s:if test="commentAdmin"> - <s:property value="%{getCommentDisplayText(commentAdmin)}"/> + <s:if test="!commentAdmin.empty"> + <s:property value="commentAdmin"/> + <%--<s:property value="%{getCommentDisplayText(commentAdmin)}"/>--%> <%--TODO<s:text name="wao.ui.field.Contact.commentAdmin"><s:param value="%{getTooltipText(commentAdmin)}"/></s:text>--%> </s:if> </td> <td> - <s:if test="boardingDone"> + <s:if test="isBoardingDone(#contact)"> <s:if test="validationCompany"> <s:text name="%{dataReliability.i18nKey}"/> </s:if> Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp 2014-04-09 14:04:51 UTC (rev 1875) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-contact-input.jsp 2014-04-09 16:42:24 UTC (rev 1876) @@ -98,8 +98,8 @@ <s:textfield name="updateContactCommand.contact.creationDate" label="%{getText('wao.ui.field.Contact.creationDate')}" - value="%{formatDate(updateContactCommand.contact.creationDate)}" disabled="true"/> + <%--value="%{formatDate(updateContactCommand.contact.creationDate)}"--%> </fieldset> <fieldset> @@ -135,13 +135,11 @@ <s:textfield name="updateContactCommand.contact.observationBeginDate" label="%{getText('wao.ui.field.Contact.beginDate')}" - value="%{formatDateTime(updateContactCommand.contact.observationBeginDate)}" placeholder="%{getDateTimePlaceholder()}" disabled="%{!#editObservationReport}"/> <s:textfield name="updateContactCommand.contact.observationEndDate" label="%{getText('wao.ui.field.Contact.endDate')}" - value="%{formatDateTime(updateContactCommand.contact.observationEndDate)}" placeholder="%{getDateTimePlaceholder()}" disabled="%{!#editObservationReport}"/> @@ -177,7 +175,6 @@ <s:textfield name="updateContactCommand.contact.dataInputDate" label="%{getText('wao.ui.field.Contact.dataInputDate')}" - value="%{formatDate(updateContactCommand.contact.dataInputDate)}" placeholder="%{getDatePlaceholder()}" disabled="%{!#editObservationReport}"/> @@ -189,16 +186,17 @@ <s:textfield name="updateContactCommand.contact.restitution" label="%{getText('wao.ui.field.Contact.restitution')}" - value="%{formatDate(updateContactCommand.contact.restitution)}" placeholder="%{getDatePlaceholder()}" disabled="%{!#editObservationReport}"/> <s:textarea name="updateContactCommand.contact.comment" label="%{getText('wao.ui.field.Contact.comment')}" + placeholder="%{getText('wao.ui.misc.noComment')}" disabled="%{!#editObservationReport || !authenticatedWaoUser.coordinatorOrObserver}"/> <s:textarea name="updateContactCommand.contact.commentCoordinator" label="%{getText('wao.ui.field.Contact.commentCoordinator')}" + placeholder="%{getText('wao.ui.misc.noComment')}" disabled="%{!#editObservationReport || !authenticatedWaoUser.coordinator}"/> </fieldset> @@ -217,7 +215,8 @@ <s:textarea name="updateContactCommand.contact.commentAdmin" label="%{getText('wao.ui.field.Contact.commentAdmin')}" - readonly="%{!authenticatedWaoUser.admin}"/> + placeholder="%{getText('wao.ui.misc.noComment')}" + disabled="%{!authenticatedWaoUser.admin}"/> </fieldset> <div class="form-actions"> Copied: trunk/wao-web/src/main/webapp/img/eye-22px.png (from rev 1734, tags/wao-3.4.1/wao-ui/src/main/webapp/img/eye-22px.png) =================================================================== (Binary files differ) Copied: trunk/wao-web/src/main/webapp/img/false-22px.png (from rev 1734, tags/wao-3.4.1/wao-ui/src/main/webapp/img/false-22px.png) =================================================================== (Binary files differ) Copied: trunk/wao-web/src/main/webapp/img/fishing-net-22px.png (from rev 1734, tags/wao-3.4.1/wao-ui/src/main/webapp/img/fishing-net-22px.png) =================================================================== (Binary files differ) Copied: trunk/wao-web/src/main/webapp/img/help-22px.png (from rev 1734, tags/wao-3.4.1/wao-ui/src/main/webapp/img/help-22px.png) =================================================================== (Binary files differ) Copied: trunk/wao-web/src/main/webapp/img/true-22px.png (from rev 1734, tags/wao-3.4.1/wao-ui/src/main/webapp/img/true-22px.png) =================================================================== (Binary files differ)