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
April 2014
- 5 participants
- 162 discussions
r1824 - in trunk/wao-web/src/main: java/fr/ifremer/wao/web/action/obsmer webapp webapp/WEB-INF/content/obsmer
by bleny@users.forge.codelutin.com 03 Apr '14
by bleny@users.forge.codelutin.com 03 Apr '14
03 Apr '14
Author: bleny
Date: 2014-04-03 17:51:24 +0200 (Thu, 03 Apr 2014)
New Revision: 1824
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1824
Log:
refs 4490 layout for boats page and style
Modified:
trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
trunk/wao-web/src/main/webapp/wao.css
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java 2014-04-03 15:24:32 UTC (rev 1823)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/BoatsAction.java 2014-04-03 15:51:24 UTC (rev 1824)
@@ -45,7 +45,7 @@
public TopiaPagerBean getPager() {
if (pager == null) {
- pager = service.newBoatsPager(50);
+ pager = service.newBoatsPager(25);
}
return pager;
}
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 15:24:32 UTC (rev 1823)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 15:51:24 UTC (rev 1824)
@@ -58,203 +58,207 @@
<content tag="mainClass">large</content>
-<s:form method="GET" id="boats-filters-form" cssClass="filters-form">
+<div id="boats-filters-list-details-layout">
- <fieldset>
+ <div>
+ <s:form method="GET" id="boats-filters-form" cssClass="filters-form">
- <s:select name="filter.elligibleBoatsFilter.fishingZoneFacadeNames"
- label="%{getText('wao.ui.field.FishingZone.facadeName')}"
- list="filterValues.elligibleBoatsFilterValues.fishingZoneFacadeNames"
- listKey="value"
- listValue="label"
- multiple="true"
- dataBinding="elligibleBoatsFilterValues.fishingZoneFacadeNames"/>
+ <s:select name="filter.elligibleBoatsFilter.fishingZoneFacadeNames"
+ label="%{getText('wao.ui.field.FishingZone.facadeName')}"
+ list="filterValues.elligibleBoatsFilterValues.fishingZoneFacadeNames"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="elligibleBoatsFilterValues.fishingZoneFacadeNames"/>
- <s:select name="filter.elligibleBoatsFilter.fishingZoneSectorNames"
- label="%{getText('wao.ui.field.FishingZone.sectorName')}"
- list="filterValues.elligibleBoatsFilterValues.fishingZoneSectorNames"
- listKey="value"
- listValue="label"
- multiple="true"
- dataBinding="elligibleBoatsFilterValues.fishingZoneSectorNames"/>
+ <s:select name="filter.elligibleBoatsFilter.fishingZoneSectorNames"
+ label="%{getText('wao.ui.field.FishingZone.sectorName')}"
+ list="filterValues.elligibleBoatsFilterValues.fishingZoneSectorNames"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="elligibleBoatsFilterValues.fishingZoneSectorNames"/>
- <s:select name="filter.elligibleBoatsFilter.sampleRowCodes"
- label="%{getText('wao.ui.field.SampleRow.code')}"
- list="filterValues.elligibleBoatsFilterValues.sampleRowCodes"
- listKey="value"
- listValue="label"
- multiple="true"
- dataBinding="elligibleBoatsFilterValues.sampleRowCodes"/>
+ <s:select name="filter.elligibleBoatsFilter.sampleRowCodes"
+ label="%{getText('wao.ui.field.SampleRow.code')}"
+ list="filterValues.elligibleBoatsFilterValues.sampleRowCodes"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="elligibleBoatsFilterValues.sampleRowCodes"/>
- </fieldset>
+ <s:textfield name="filter.boatName"
+ label="%{getText('wao.ui.form.Boat.name')}"
+ placeholder="%{getText('wao.ui.form.boatName.placeholder')}"
+ cssClass=""/>
- <fieldset>
+ <s:textfield name="filter.registrationCode"
+ label="%{getText('wao.ui.form.Boat.registrationCode')}"
+ placeholder="%{getText('wao.ui.form.registrationCode.placeholder')}"
+ cssClass=""/>
- <s:textfield name="filter.boatName"
- label="%{getText('wao.ui.form.Boat.name')}"
- placeholder="%{getText('wao.ui.form.boatName.placeholder')}"
- cssClass=""/>
+ <s:select name="filter.districtIds"
+ label="%{getText('wao.ui.field.Boat.district')}"
+ list="filterValues.districts"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="districts"/>
- <s:textfield name="filter.registrationCode"
- label="%{getText('wao.ui.form.Boat.registrationCode')}"
- placeholder="%{getText('wao.ui.form.registrationCode.placeholder')}"
- cssClass=""/>
+ <s:select name="filter.shipOwnerIds"
+ label="%{getText('wao.ui.field.Boat.shipOwner')}"
+ list="filterValues.shipOwners"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="shipOwners"/>
- </fieldset>
+ <s:select name="filter.portOfRegistryIds"
+ label="%{getText('wao.ui.field.Boat.portOfRegistry')}"
+ list="filterValues.portsOfRegistry"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="portsOfRegistry"/>
- <fieldset>
+ <div class="form-actions">
- <s:select name="filter.districtIds"
- label="%{getText('wao.ui.field.Boat.district')}"
- list="filterValues.districts"
- listKey="value"
- listValue="label"
- multiple="true"
- dataBinding="districts"/>
+ <button type="button" id="reset-filters" class="btn">
+ <i class="icon-reset"></i> <s:text name="wao.ui.action.reset" />
+ </button>
- <s:select name="filter.shipOwnerIds"
- label="%{getText('wao.ui.field.Boat.shipOwner')}"
- list="filterValues.shipOwners"
- listKey="value"
- listValue="label"
- multiple="true"
- dataBinding="shipOwners"/>
+ <s:submit type="button" cssClass="btn">
+ <i class="icon-filter"></i> <s:text name="wao.ui.action.filter"/>
+ </s:submit>
- <s:select name="filter.portOfRegistryIds"
- label="%{getText('wao.ui.field.Boat.portOfRegistry')}"
- list="filterValues.portsOfRegistry"
- listKey="value"
- listValue="label"
- multiple="true"
- dataBinding="portsOfRegistry"/>
- </fieldset>
+ <s:submit action="export-boats" type="button" cssClass="btn">
+ <i class="icon-download"></i> <s:text name="wao.ui.action.csvExport"/>
+ </s:submit>
- <div class="form-actions">
+ </div>
- <button type="button" id="reset-filters" class="btn">
- <i class="icon-reset"></i> <s:text name="wao.ui.action.reset" />
- </button>
+ </s:form>
- <s:submit type="button" cssClass="btn">
- <i class="icon-filter"></i> <s:text name="wao.ui.action.filter"/>
- </s:submit>
+ </div>
- <s:submit action="export-boats" type="button" cssClass="btn">
- <i class="icon-download"></i> <s:text name="wao.ui.action.csvExport"/>
- </s:submit>
+ <div>
- </div>
+ <table id="boats-list" class="table-condensed table-striped table-hover">
+ <caption>
+ <s:text name="wao.ui.boats.title">
+ <s:param value="%{pagination.nbRecords}"/>
+ </s:text>
+ </caption>
+ <thead>
+ <tr>
+ <th>
+ <s:text name="wao.ui.boats.registrationCode"/>
+ </th>
+ <th>
+ <s:text name="wao.ui.boats.boatName"/>
+ </th>
+ <th>
+ <s:text name="wao.ui.boats.boatLength"/> (m)
+ </th>
+ <th>
+ <s:text name="wao.ui.boats.buildYear"/>
+ </th>
+ <th>
+ <s:text name="wao.ui.boats.district"/>
+ </th>
+ <th>
+ <span data-original-title="<s:text name="wao.ui.boats.portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom">
+ <s:text name="wao.ui.boats.portOfRegistry"/>
+ </span>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <s:iterator value="boats" var="boat">
+ <tr class="boat-row<s:if test="!active"> inactive</s:if>">
+ <td id="<s:property value="topiaId"/>">
+ <s:if test="authenticatedWaoUser.authorizedToViewBoatDetails">
+ <s:url action="boat-details" id="boatDetailsUrl">
+ <s:param name="companyId" value="authenticatedWaoUser.waoUser.company.topiaId" />
+ <s:param name="boatId" value="topiaId" />
+ <s:param name="fragment" value="true" />
+ </s:url>
+ <s:a href="%{boatDetailsUrl}" cssClass="boat-details-action">
+ <s:property value="%{'' + immatriculation}"/>
+ </s:a>
+ </s:if>
+ <s:else>
+ <s:property value="%{'' + immatriculation}"/>
+ </s:else>
+ </td>
+ <td><s:property value="name"/></td>
+ <td><s:property value="boatLength"/></td>
+ <td><s:property value="%{'' + buildYear}"/></td>
+ <td><s:property value="district.districtCode"/></td>
+ <td>
+ <s:if test="portOfRegistry != null">
+ <span data-original-title="<s:property value="portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom">
+ <s:property value="portOfRegistry.portCode"/>
+ </span>
+ </s:if>
+ </td>
+ </tr>
+ </s:iterator>
+ </todby>
+ </table>
-</s:form>
+ <%-- Pagination --%>
+ <div class="pagination">
+ <ul>
+ <s:url var="fullUrl" includeParams="get"/>
+ <s:set var="paginationUrl" value="%{getPaginationUrl(#fullUrl)}"/>
+ <s:if test="pagination.firstPageIndex > 2">
+ <li>
+ <a href="${paginationUrl}1">1</a>
+ </li>
+ <li>
+ <a href="${paginationUrl}2">2</a>
+ </li>
+ <li>
+ <span>...</span>
+ </li>
+ </s:if>
-<h3>
- <s:text name="wao.ui.boats.title">
- <s:param value="%{pagination.nbRecords}"/>
- </s:text>
-</h3>
+ <s:iterator var="currentPageIndex" begin="pagination.firstPage" end="pagination.lastPage">
+ <li class="<s:if test="#currentPageIndex == pagination.currentPage">active</s:if>">
+ <a href="${paginationUrl}${currentPageIndex}">
+ <s:property/>
+ </a>
+ </li>
+ </s:iterator>
-<%-- Pagination --%>
-<div class="pagination">
- <ul>
- <s:url var="fullUrl" includeParams="get"/>
- <s:set var="paginationUrl" value="%{getPaginationUrl(#fullUrl)}"/>
- <s:if test="pagination.firstPageIndex > 2">
- <li>
- <a href="${paginationUrl}1">1</a>
- </li>
- <li>
- <a href="${paginationUrl}2">2</a>
- </li>
- <li>
- <span>...</span>
- </li>
- </s:if>
+ <s:if test="pagination.lastPage < pagination.nbPages - 1">
+ <li>
+ <span>...</span>
+ </li>
+ <li>
+ <a href="${paginationUrl}${pagination.nbPages - 1}">
+ <s:property value="pagination.nbPages - 1"/>
+ </a>
+ </li>
+ <li>
+ <a href="${paginationUrl}${pagination.nbPages}">
+ <s:property value="pagination.nbPages"/>
+ </a>
+ </li>
+ </s:if>
+ </ul>
+ </div>
+ </div>
- <s:iterator var="currentPageIndex" begin="pagination.firstPage" end="pagination.lastPage">
- <li class="<s:if test="#currentPageIndex == pagination.currentPage">active</s:if>">
- <a href="${paginationUrl}${currentPageIndex}">
- <s:property/>
- </a>
- </li>
- </s:iterator>
+ <s:if test="authenticatedWaoUser.authorizedToViewBoatDetails">
+ <div id="boat-details">
+ <div class="alert alert-info">
+ Vous devez sélectionner un navire dans la liste en cliquant sur son immatriculation pour afficher les détails ici.
+ </div>
+ </div>
+ </s:if>
- <s:if test="pagination.lastPage < pagination.nbPages - 1">
- <li>
- <span>...</span>
- </li>
- <li>
- <a href="${paginationUrl}${pagination.nbPages - 1}">
- <s:property value="pagination.nbPages - 1"/>
- </a>
- </li>
- <li>
- <a href="${paginationUrl}${pagination.nbPages}">
- <s:property value="pagination.nbPages"/>
- </a>
- </li>
- </s:if>
- </ul>
</div>
-<table id="boats-list" class="table-condensed table-striped table-hover">
- <thead>
- <tr>
- <th>
- <s:text name="wao.ui.boats.registrationCode"/>
- </th>
- <th>
- <s:text name="wao.ui.boats.boatName"/>
- </th>
- <th>
- <s:text name="wao.ui.boats.boatLength"/> (m)
- </th>
- <th>
- <s:text name="wao.ui.boats.buildYear"/>
- </th>
- <th>
- <s:text name="wao.ui.boats.district"/>
- </th>
- <th>
- <span data-original-title="<s:text name="wao.ui.boats.portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom">
- <s:text name="wao.ui.boats.portOfRegistry"/>
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- <s:iterator value="boats" var="boat">
- <tr class="boat-row<s:if test="!active"> inactive</s:if>">
- <td id="<s:property value="topiaId"/>">
- <s:if test="authenticatedWaoUser.authorizedToViewBoatDetails">
- <s:url action="boat-details" id="boatDetailsUrl">
- <s:param name="companyId" value="authenticatedWaoUser.waoUser.company.topiaId" />
- <s:param name="boatId" value="topiaId" />
- <s:param name="fragment" value="true" />
- </s:url>
- <s:a href="%{boatDetailsUrl}" cssClass="boat-details-action">
- <s:property value="%{'' + immatriculation}"/>
- </s:a>
- </s:if>
- <s:else>
- <s:property value="%{'' + immatriculation}"/>
- </s:else>
- </td>
- <td><s:property value="name"/></td>
- <td><s:property value="boatLength"/></td>
- <td><s:property value="%{'' + buildYear}"/></td>
- <td><s:property value="district.districtCode"/></td>
- <td>
- <s:if test="portOfRegistry != null">
- <span data-original-title="<s:property value="portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom">
- <s:property value="portOfRegistry.portCode"/>
- </span>
- </s:if>
- </td>
- </tr>
- </s:iterator>
- </todby>
-</table>
-
-<div id="boat-details"></div>
-
</html>
Modified: trunk/wao-web/src/main/webapp/wao.css
===================================================================
--- trunk/wao-web/src/main/webapp/wao.css 2014-04-03 15:24:32 UTC (rev 1823)
+++ trunk/wao-web/src/main/webapp/wao.css 2014-04-03 15:51:24 UTC (rev 1824)
@@ -263,10 +263,6 @@
width: 450px;
}
-#boats-list, #boat-details {
- float: left;
-}
-
#boats-list th, #boats-list td {
text-align: right;
width: 30px;
@@ -277,3 +273,24 @@
text-align: left;
width: 200px;
}
+
+#boats-filters-form .control-group {
+ clear: left;
+}
+
+#boats-filters-form button {
+ margin-top: 5px;
+ clear: left;
+ float: left;
+}
+
+#boats-filters-list-details-layout {
+ display: flex;
+ justify-content: space-around;
+ align-items: stretch;
+ align-items: center;
+}
+
+#boats-filters-list-details-layout > div:nth-child(3) {
+ max-width: 35%;
+}
1
0
Author: tchemit
Date: 2014-04-03 17:24:32 +0200 (Thu, 03 Apr 2014)
New Revision: 1823
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1823
Log:
add i18nInterceptor before our interceptor
Modified:
trunk/wao-web/src/main/resources/struts.xml
Modified: trunk/wao-web/src/main/resources/struts.xml
===================================================================
--- trunk/wao-web/src/main/resources/struts.xml 2014-04-03 14:59:23 UTC (rev 1822)
+++ trunk/wao-web/src/main/resources/struts.xml 2014-04-03 15:24:32 UTC (rev 1823)
@@ -74,6 +74,7 @@
<interceptor name="waoInterceptor" class="fr.ifremer.wao.web.WaoInterceptor"/>
<interceptor-stack name="waoStack">
+ <interceptor-ref name="i18n"/>
<interceptor-ref name="waoInterceptor"/>
<interceptor-ref name="paramsPrepareParamsStack"/>
</interceptor-stack>
1
0
r1822 - in trunk: wao-persistence/src/main/resources/i18n wao-services/src/main/java/fr/ifremer/wao/services wao-web/src/main/resources/i18n wao-web/src/main/webapp wao-web/src/main/webapp/WEB-INF/content/obsmer
by bleny@users.forge.codelutin.com 03 Apr '14
by bleny@users.forge.codelutin.com 03 Apr '14
03 Apr '14
Author: bleny
Date: 2014-04-03 16:59:23 +0200 (Thu, 03 Apr 2014)
New Revision: 1822
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1822
Log:
refs #4490 some style for boat-list
Modified:
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-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java
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/boats.jsp
trunk/wao-web/src/main/webapp/wao.css
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-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties 2014-04-03 14:59:23 UTC (rev 1822)
@@ -138,8 +138,8 @@
fr.ifremer.wao.entity.TerrestrialDivision=Terrestrial divisions
fr.ifremer.wao.entity.TerrestrialLocation=Terrestrial locations
wao.business.other=
-wao.time.formatter=%1$tH:%1$tM
-wao.datetime.formatter=%1$td-%1$tm/%1$tY %1$tH:%1$tM
wao.date.formatter=%1$td-%1$tm/%1$tY
+wao.datetime.formatter=%1$td-%1$tm/%1$tY %1$tH\:%1$tM
wao.month.formatter=%1$tm-%1$tY
wao.month.pattern=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-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties 2014-04-03 14:59:23 UTC (rev 1822)
@@ -137,8 +137,8 @@
fr.ifremer.wao.entity.TerrestrialDivision=Stratification géographique
fr.ifremer.wao.entity.TerrestrialLocation=Lieux terrestres
wao.business.other=
-wao.time.formatter=%1$tH:%1$tM
-wao.datetime.formatter=%1$td/%1$tm/%1$tY %1$tH:%1$tM
wao.date.formatter=%1$td/%1$tm/%1$tY
+wao.datetime.formatter=%1$td/%1$tm/%1$tY %1$tH\:%1$tM
wao.month.formatter=%1$tm/%1$tY
wao.month.pattern=MM/yyyy
+wao.time.formatter=%1$tH\:%1$tM
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java 2014-04-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java 2014-04-03 14:59:23 UTC (rev 1822)
@@ -200,9 +200,16 @@
return ! userProfile.isCoordinatorOrObserver();
}
+ public boolean isAuthorizedToViewBoatDetails() {
+ boolean authorizedToViewBoatDetails = userProfile.isAdmin()
+ || userProfile.isCoordinatorOrObserver();
+ return authorizedToViewBoatDetails;
+ }
+
public boolean isAuthorizedToViewBoatDetails(String companyId) {
boolean authorizedToViewBoatDetails = userProfile.isAdmin()
|| userProfile.isCoordinatorOrObserver() && waoUser.getCompany().getTopiaId().equals(companyId);
return authorizedToViewBoatDetails;
}
+
}
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-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-03 14:59:23 UTC (rev 1822)
@@ -32,6 +32,7 @@
wao.ui.action.createSampleRow=Add a sample row to the plan
wao.ui.action.createWaoUser=Create a user
wao.ui.action.csvExport=Export as CSV
+wao.ui.action.csvImport=Import
wao.ui.action.delete=Delete
wao.ui.action.deleteCompany=Delete company
wao.ui.action.deleteCompany.confirm=Are you sure you want to delete this company ?
@@ -113,6 +114,7 @@
wao.ui.contacts.createFromBoat=Create a new contact for this boat and this sample row
wao.ui.contacts.createFromBoat.fail=Contact creation failed
wao.ui.contacts.createFromBoat.warn=Warning \:this sample-row is out of date, are your sure you want to create a new contact ?
+wao.ui.contacts.title=%s contacts trouvés
wao.ui.disclaimer=The website "SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER" is declared to the CNIL with the number \: 1414476
wao.ui.disclaimer.boats=Data your provide remains property of your company.Outside your company, only an administrator may access to your data for maintenance purpose. The administrator is someone from Ifremer.
wao.ui.email=e-mail address
@@ -149,6 +151,7 @@
wao.ui.field.Contact.beginDate=Observation start
wao.ui.field.Contact.comment=Observer comment
wao.ui.field.Contact.commentAdmin=Program comment
+wao.ui.field.Contact.commentCompany=Company Comment
wao.ui.field.Contact.commentCoordinator=Coordinator comment
wao.ui.field.Contact.completeSampling=Complete sampling
wao.ui.field.Contact.contactState=Contact state
@@ -395,7 +398,6 @@
wao.ui.page.Index.title=Home
wao.ui.page.ReferentialManagement.title=Referentials management
wao.ui.page.SamplingPlan.title=Sampling plan
-wao.ui.field.Contact.commentCompany=Company Comment
wao.ui.page.Synthesis.title=Synthesis
wao.ui.page.UserProfileForm.title=Profile management
wao.ui.page.companies.title=Companies
@@ -468,5 +470,3 @@
wao.ui.userList=Users list
wao.ui.userMustAcceptCgu=You must accept the terms of use
wao.ui.validLogin=Valid identifier
-wao.ui.action.csvImport=Import
-wao.ui.contacts.title=%s contacts trouvé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-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-03 14:59:23 UTC (rev 1822)
@@ -32,6 +32,7 @@
wao.ui.action.createSampleRow=Ajouter une ligne au plan
wao.ui.action.createWaoUser=Créer un utilisateur
wao.ui.action.csvExport=Exporter au format CSV
+wao.ui.action.csvImport=Import
wao.ui.action.delete=Supprimer
wao.ui.action.deleteCompany=Supprimer la société
wao.ui.action.deleteCompany.confirm=Êtes-vous sûr de vouloir supprimer la société ?
@@ -92,7 +93,7 @@
wao.ui.boats.boatLength=Longueur
wao.ui.boats.boatName=Nom
wao.ui.boats.buildYear=Année de construction
-wao.ui.boats.district=Quatier maritime
+wao.ui.boats.district=Quartier maritime
wao.ui.boats.nbObservations=%s observation(s) dont %s avec votre société
wao.ui.boats.portOfRegistry=Port
wao.ui.boats.portOfRegistry.description=Il s'agit du port d'exploitation principal du navire
@@ -113,6 +114,7 @@
wao.ui.contacts.createFromBoat=Créer un nouveau contact pour ce navire et cette ligne du plan
wao.ui.contacts.createFromBoat.fail=Création d'un nouveau contact impossible
wao.ui.contacts.createFromBoat.warn=Attention \: cette ligne du plan est arrivée à échéance, êtes-vous sûr de vouloir créer un nouveau contact ?
+wao.ui.contacts.title=%s contacts trouvés
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éclaration à la CNIL sous le numéro suivant \: 1414476
wao.ui.disclaimer.boats=Les données saisies dans cette page sont la propriété exclusive de la société. En dehors de la société, 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
@@ -468,5 +470,3 @@
wao.ui.userList=Liste des utilisateurs
wao.ui.userMustAcceptCgu=Vous devez accepter les conditions d'utilisation pour utiliser Wao
wao.ui.validLogin=Identifiant valide
-wao.ui.action.csvImport=Import
-wao.ui.contacts.title=%s contacts trouvés
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 14:59:23 UTC (rev 1822)
@@ -40,6 +40,8 @@
var url = $(this).prop('href');
var successCallback = function (data) {
$('#boat-details').html(data);
+ $('tr.boat-row').removeClass('highlight');
+ $('#').addClass('highlight');
}
WAO.get(url, {}, successCallback);
});
@@ -193,17 +195,17 @@
</s:if>
</ul>
</div>
-<table id="boats-list" class="large-table boats-list">
+<table id="boats-list" class="table-condensed table-striped table-hover">
<thead>
<tr>
<th>
- <s:text name="wao.ui.boats.boatName"/>
+ <s:text name="wao.ui.boats.registrationCode"/>
</th>
<th>
- <s:text name="wao.ui.boats.registrationCode"/>
+ <s:text name="wao.ui.boats.boatName"/>
</th>
<th>
- <s:text name="wao.ui.boats.boatLength"/>
+ <s:text name="wao.ui.boats.boatLength"/> (m)
</th>
<th>
<s:text name="wao.ui.boats.buildYear"/>
@@ -212,7 +214,9 @@
<s:text name="wao.ui.boats.district"/>
</th>
<th>
- <s:text name="wao.ui.boats.portOfRegistry"/>(<s:text name="wao.ui.boats.portOfRegistry.description"/>)
+ <span data-original-title="<s:text name="wao.ui.boats.portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom">
+ <s:text name="wao.ui.boats.portOfRegistry"/>
+ </span>
</th>
</tr>
</thead>
@@ -220,24 +224,30 @@
<s:iterator value="boats" var="boat">
<tr class="boat-row<s:if test="!active"> inactive</s:if>">
- <td>
- <s:url action="boat-details" id="boatDetailsUrl">
- <s:param name="companyId" value="authenticatedWaoUser.waoUser.company.topiaId" />
- <s:param name="boatId" value="topiaId" />
- <s:param name="fragment" value="true" />
- </s:url>
- <s:a href="%{boatDetailsUrl}" cssClass="boat-details-action">
- <s:property value="name"/>
- </s:a>
+ <td id="<s:property value="topiaId"/>">
+ <s:if test="authenticatedWaoUser.authorizedToViewBoatDetails">
+ <s:url action="boat-details" id="boatDetailsUrl">
+ <s:param name="companyId" value="authenticatedWaoUser.waoUser.company.topiaId" />
+ <s:param name="boatId" value="topiaId" />
+ <s:param name="fragment" value="true" />
+ </s:url>
+ <s:a href="%{boatDetailsUrl}" cssClass="boat-details-action">
+ <s:property value="%{'' + immatriculation}"/>
+ </s:a>
+ </s:if>
+ <s:else>
+ <s:property value="%{'' + immatriculation}"/>
+ </s:else>
</td>
- <td><s:property value="%{'' + immatriculation}"/></td>
- <td><s:property value="boatLength"/> m</td>
+ <td><s:property value="name"/></td>
+ <td><s:property value="boatLength"/></td>
<td><s:property value="%{'' + buildYear}"/></td>
<td><s:property value="district.districtCode"/></td>
<td>
<s:if test="portOfRegistry != null">
- <s:property value="portOfRegistry.portCode"/>
- (<s:property value="portOfRegistry.description"/>)
+ <span data-original-title="<s:property value="portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom">
+ <s:property value="portOfRegistry.portCode"/>
+ </span>
</s:if>
</td>
</tr>
Modified: trunk/wao-web/src/main/webapp/wao.css
===================================================================
--- trunk/wao-web/src/main/webapp/wao.css 2014-04-03 14:29:21 UTC (rev 1821)
+++ trunk/wao-web/src/main/webapp/wao.css 2014-04-03 14:59:23 UTC (rev 1822)
@@ -267,3 +267,13 @@
float: left;
}
+#boats-list th, #boats-list td {
+ text-align: right;
+ width: 30px;
+}
+
+/** La colonne pour le nom de navire peut être plus large ques les autres */
+#boats-list th:nth-child(2), #boats-list td:nth-child(2) {
+ text-align: left;
+ width: 200px;
+}
1
0
Author: bleny
Date: 2014-04-03 16:29:21 +0200 (Thu, 03 Apr 2014)
New Revision: 1821
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1821
Log:
user select2 everywhere for demo, change filters MVC to support it (blur is ok but i can't deal with the onleave)
Added:
trunk/wao-web/src/main/webapp/wao-screen.css
Modified:
trunk/wao-web/src/main/webapp/wao.js
Added: trunk/wao-web/src/main/webapp/wao-screen.css
===================================================================
Modified: trunk/wao-web/src/main/webapp/wao.js
===================================================================
--- trunk/wao-web/src/main/webapp/wao.js 2014-04-03 13:18:50 UTC (rev 1820)
+++ trunk/wao-web/src/main/webapp/wao.js 2014-04-03 14:29:21 UTC (rev 1821)
@@ -47,7 +47,7 @@
this.model = sampleRowsFilterModel;
this.$filtersForm = $filtersForm;
this.$selects = $filtersForm.find('select');
- this.$inputs = $filtersForm.find('input[type="text"]');
+ this.$inputs = $filtersForm.find('input');
this.getFilter = function () {
var filter = {};
@@ -141,6 +141,7 @@
this.view.$inputs.change(markChange);
this.view.$selects.blur(updateFilterValuesIfValueChanged);
+ this.view.$selects.on('select2-blur', updateFilterValuesIfValueChanged);
this.view.$inputs.blur(updateFilterValuesIfValueChanged);
this.view.$selects.mouseleave(updateFilterValuesIfValueChanged);
this.view.$inputs.mouseleave(updateFilterValuesIfValueChanged);
@@ -232,6 +233,8 @@
// $('a[data-toggle="popover"]').popover();
$('span[data-toggle="tooltip"]').tooltip();
+ $('select').addClass('input-xlarge').select2();
+
WAO = new Wao();
});
\ No newline at end of file
1
0
r1820 - trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer
by bleny@users.forge.codelutin.com 03 Apr '14
by bleny@users.forge.codelutin.com 03 Apr '14
03 Apr '14
Author: bleny
Date: 2014-04-03 15:18:50 +0200 (Thu, 03 Apr 2014)
New Revision: 1820
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1820
Log:
refs #4483 show sample row deletion button on only if it's not a creation
Modified:
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-sample-row-input.jsp
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-sample-row-input.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-sample-row-input.jsp 2014-04-03 13:17:54 UTC (rev 1819)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/edit-sample-row-input.jsp 2014-04-03 13:18:50 UTC (rev 1820)
@@ -244,16 +244,17 @@
<s:a href="%{samplingPlanUrl}" cssClass="btn">
<i class="icon-chevron-left"></i> <s:text name="wao.ui.action.cancel" />
</s:a>
-
<s:submit type="button" cssClass="btn">
<i class="icon-hdd"></i> <s:text name="wao.ui.action.save" />
</s:submit>
- <s:url action="delete-sample-row" id="deleteSampleRowUrl">
- <s:param name="sampleRowId" value="sampleRowId" />
- </s:url>
- <s:a href="%{deleteSampleRowUrl}" cssClass="btn pull-right">
- <i class="icon-trash"></i> <s:text name="wao.ui.action.deleteSampleRow" />
- </s:a>
+ <s:if test=" ! updateSampleRowCommand.creation">
+ <s:url action="delete-sample-row" id="deleteSampleRowUrl">
+ <s:param name="sampleRowId" value="sampleRowId" />
+ </s:url>
+ <s:a href="%{deleteSampleRowUrl}" cssClass="btn pull-right">
+ <i class="icon-trash"></i> <s:text name="wao.ui.action.deleteSampleRow" />
+ </s:a>
+ </s:if>
</div>
</s:form>
1
0
Author: bleny
Date: 2014-04-03 15:17:54 +0200 (Thu, 03 Apr 2014)
New Revision: 1819
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1819
Log:
refs #4483 fix position of actions menu
Modified:
trunk/wao-web/src/main/webapp/wao.css
Modified: trunk/wao-web/src/main/webapp/wao.css
===================================================================
--- trunk/wao-web/src/main/webapp/wao.css 2014-04-03 12:05:18 UTC (rev 1818)
+++ trunk/wao-web/src/main/webapp/wao.css 2014-04-03 13:17:54 UTC (rev 1819)
@@ -259,7 +259,8 @@
}
table.sampling-plan .actions .dropdown-menu {
- left: -200px
+ left: -367px;
+ width: 450px;
}
#boats-list, #boat-details {
1
0
r1818 - in trunk/wao-web/src/main/webapp: . WEB-INF/content/obsmer
by bleny@users.forge.codelutin.com 03 Apr '14
by bleny@users.forge.codelutin.com 03 Apr '14
03 Apr '14
Author: bleny
Date: 2014-04-03 14:05:18 +0200 (Thu, 03 Apr 2014)
New Revision: 1818
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1818
Log:
refs #4483 use tooltips in compact view
Modified:
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp
trunk/wao-web/src/main/webapp/wao.css
trunk/wao-web/src/main/webapp/wao.js
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-04-03 11:28:50 UTC (rev 1817)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-04-03 12:05:18 UTC (rev 1818)
@@ -317,10 +317,14 @@
</s:if>
<td class="only-in-full-view"><s:property value="fishingZones" /></td>
<td class="only-in-compact-view">
- <s:property value="fishingZones" />
- <s:if test=" fishingZonesInfos != null">
- (<s:property value="fishingZonesInfos" />)
+ <s:if test="fishingZonesInfos == null">
+ <s:property value="fishingZones"/>
</s:if>
+ <s:else>
+ <span data-original-title="<s:property value="fishingZonesInfos"/>" data-toggle="tooltip" data-placement="left">
+ <s:property value="fishingZones"/>
+ </span>
+ </s:else>
</td>
<td class="only-in-full-view">
<s:property value="fishingZonesInfos" />
@@ -344,7 +348,14 @@
<s:property value="professionDescriptionWithoutDCF5" />
</td>
<td class="only-in-compact-view">
- <s:property value="professionLibelle" /> (<s:property value="professionSpecies" />)
+ <s:if test="professionSpecies == null">
+ <s:property value="professionLibelle"/>
+ </s:if>
+ <s:else>
+ <span data-original-title="<s:property value="professionSpecies"/>" data-toggle="tooltip" data-placement="left">
+ <s:property value="professionLibelle"/>
+ </span>
+ </s:else>
</td>
<!-- Months columns -->
<s:iterator value="samplingPlan.months" var="month">
@@ -410,8 +421,12 @@
<s:property value="appliedCoverageRate" />%
</s:if>
</td>
- <td class="ellipsis">
- <s:property value="comment"/>
+ <td>
+ <s:if test=" ! comment.empty">
+ <span data-original-title="<s:property value="comment"/>" data-toggle="tooltip" data-placement="left">
+ <i class="icon-comment"></i>
+ </span>
+ </s:if>
</td>
<td class="actions">
Modified: trunk/wao-web/src/main/webapp/wao.css
===================================================================
--- trunk/wao-web/src/main/webapp/wao.css 2014-04-03 11:28:50 UTC (rev 1817)
+++ trunk/wao-web/src/main/webapp/wao.css 2014-04-03 12:05:18 UTC (rev 1818)
@@ -32,6 +32,11 @@
margin-top: 0px;
}
+/** Comme ça on peut faire des tooltips avec des <span> plutôt que des <a> et avec cette règle le tooltip s'affiche même si le curseur ne survole pas exactement un caractère */
+span[data-toggle="tooltip"] {
+ display: inline-block;
+}
+
/******************************************************************************
* Des classes à usage transverse
*****************************************************************************/
@@ -65,22 +70,13 @@
}
-td.ellipsis {
- max-width: 100px;
-}
-
.ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
+ max-width: 100px;
}
-td.ellipsis:hover {
- overflow: visible;
- white-space: normal;
- text-overflow: initial;
-}
-
.compact-view .only-in-full-view,
.full-view .only-in-compact-view,
.show-estimated .real,
Modified: trunk/wao-web/src/main/webapp/wao.js
===================================================================
--- trunk/wao-web/src/main/webapp/wao.js 2014-04-03 11:28:50 UTC (rev 1817)
+++ trunk/wao-web/src/main/webapp/wao.js 2014-04-03 12:05:18 UTC (rev 1818)
@@ -230,6 +230,7 @@
// $('select').select2();
// $('a[data-toggle="popover"]').popover();
+ $('span[data-toggle="tooltip"]').tooltip();
WAO = new Wao();
1
0
03 Apr '14
Author: tchemit
Date: 2014-04-03 13:28:50 +0200 (Thu, 03 Apr 2014)
New Revision: 1817
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1817
Log:
refs-30 #4487
Added:
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java
trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.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/action/obsmer/ContactsFilterValuesJsonAction.java
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp
Modified:
trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java
trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.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-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties
trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties
trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java
trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java
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/enpoints-js.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-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/WaoUtils.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -39,35 +39,56 @@
public class WaoUtils {
+ @Deprecated
protected static final String MONTH_PATTERN = "MM/yyyy";
+ @Deprecated
protected static final String DATE_PATTERN = "dd/MM/yyyy";
+ @Deprecated
protected static final String DATE_TIME_PATTERN = "dd/MM/yyyy HH:mm";
+ @Deprecated
protected static final String TIME_PATTERN = "HH:mm";
+ @Deprecated
public static String formatMonth(Date date) {
return formatDate(date, MONTH_PATTERN);
}
+ @Deprecated
public static String formatDate(Date date) {
return formatDate(date, DATE_PATTERN);
}
+ @Deprecated
public static String formatDateTime(Date date) {
return formatDate(date, DATE_TIME_PATTERN);
}
+ @Deprecated
public static String formatTime(Date date) {
return formatDate(date, TIME_PATTERN);
}
+ @Deprecated
protected static String formatDate(Date date, String pattern) {
DateFormat dateFormat = new SimpleDateFormat(pattern);
return dateFormat.format(date);
}
+ public static String formatTime(Locale locale, Date date) {
+ return l(locale, "wao.time.formatter", date);
+ }
+
+ public static String formatDateTime(Locale locale, Date date) {
+ return l(locale, "wao.datetime.formatter", date);
+ }
+
+ public static String formatDate(Locale locale, Date date) {
+ return l(locale, "wao.date.formatter", date);
+ }
+
public static String formatMonth(Locale locale, Date date) {
return l(locale, "wao.month.formatter", date);
}
Modified: trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java
===================================================================
--- trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-persistence/src/main/java/fr/ifremer/wao/entity/ContactTopiaDao.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -9,6 +9,8 @@
import org.apache.commons.logging.LogFactory;
import org.nuiton.topia.persistence.HqlAndParametersBuilder;
import org.nuiton.topia.persistence.TopiaEntity;
+import org.nuiton.topia.persistence.pager.TopiaPagerBean;
+import org.nuiton.util.PagerBeanUtil;
import org.nuiton.topia.persistence.TopiaQueryBuilderAddCriteriaOrRunQueryStep;
import java.util.Collection;
@@ -34,6 +36,30 @@
}
+ public List<Contact> find(ContactsFilter filter, TopiaPagerBean pager) {
+
+ HqlAndParametersBuilder<Contact> query = toSampleRowHqlAndParametersBuilder(filter);
+
+ List<Contact> boats = find(query.getHql(), query.getHqlParameters(), pager);
+ return boats;
+ }
+
+ public TopiaPagerBean newPager(ContactsFilter filter,
+ int pageSize,
+ int pageIndex,
+ String sortProperty,
+ boolean sortAscendant) {
+
+ HqlAndParametersBuilder<Contact> query = toSampleRowHqlAndParametersBuilder(filter);
+
+ TopiaPagerBean pager = newPager(query.getHql(), query.getHqlParameters(), pageSize);
+ pager.setPageIndex(pageIndex);
+ PagerBeanUtil.computeRecordIndexesAndPagesNumber(pager);
+ pager.setSortColumn(sortProperty);
+ pager.setSortAscendant(sortAscendant);
+ return pager;
+ }
+
protected HqlAndParametersBuilder<Contact> toSampleRowHqlAndParametersBuilder(ContactsFilter filter) {
HqlAndParametersBuilder<Contact> query = newHqlAndParametersBuilder();
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-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties 2014-04-03 11:28:50 UTC (rev 1817)
@@ -138,5 +138,8 @@
fr.ifremer.wao.entity.TerrestrialDivision=Terrestrial divisions
fr.ifremer.wao.entity.TerrestrialLocation=Terrestrial locations
wao.business.other=
+wao.time.formatter=%1$tH:%1$tM
+wao.datetime.formatter=%1$td-%1$tm/%1$tY %1$tH:%1$tM
+wao.date.formatter=%1$td-%1$tm/%1$tY
wao.month.formatter=%1$tm-%1$tY
wao.month.pattern=MM-yyyy
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-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties 2014-04-03 11:28:50 UTC (rev 1817)
@@ -137,5 +137,8 @@
fr.ifremer.wao.entity.TerrestrialDivision=Stratification géographique
fr.ifremer.wao.entity.TerrestrialLocation=Lieux terrestres
wao.business.other=
+wao.time.formatter=%1$tH:%1$tM
+wao.datetime.formatter=%1$td/%1$tm/%1$tY %1$tH:%1$tM
+wao.date.formatter=%1$td/%1$tm/%1$tY
wao.month.formatter=%1$tm/%1$tY
wao.month.pattern=MM/yyyy
Added: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java (rev 0)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -0,0 +1,200 @@
+package fr.ifremer.wao.services.service;
+
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.ContactState;
+import fr.ifremer.wao.entity.ContactStateMotif;
+import fr.ifremer.wao.entity.DataReliability;
+import fr.ifremer.wao.entity.ObservationType;
+import fr.ifremer.wao.entity.ObservedDataControl;
+import fr.ifremer.wao.entity.SampleRow;
+import fr.ifremer.wao.entity.SamplingStrategy;
+import fr.ifremer.wao.entity.TerrestrialLocation;
+import fr.ifremer.wao.entity.WaoUser;
+import org.apache.commons.collections4.CollectionUtils;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Locale;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import static org.nuiton.i18n.I18n.l;
+
+/**
+ * Created on 4/3/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class ContactsFilterValues implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Locale locale;
+
+ protected BoatsFilterValues boatsFilterValues;
+
+ protected SampleRowsFilterValues sampleRowsFilterValues;
+
+ protected SortedSet<FilterOption> boatNames = new TreeSet<>();
+
+ protected SortedSet<FilterOption> boatRegistrationCodes = new TreeSet<>();
+
+ protected SortedSet<FilterOption> contactStates = new TreeSet<>();
+
+ protected SortedSet<FilterOption> dataReliabilities = new TreeSet<>();
+
+ protected SortedSet<FilterOption> actualSamplingStrategies = new TreeSet<>();
+
+ protected SortedSet<FilterOption> observationTypes = new TreeSet<>();
+
+ protected SortedSet<FilterOption> observedDataControls = new TreeSet<>();
+
+ protected SortedSet<FilterOption> observers = new TreeSet<>();
+
+ protected SortedSet<FilterOption> terrestrialLocations = new TreeSet<>();
+
+ protected SortedSet<FilterOption> contactStateMotives = new TreeSet<>();
+
+ protected SortedSet<FilterOption> companyAcceptations = new TreeSet<>();
+
+ protected SortedSet<FilterOption> programAcceptations = new TreeSet<>();
+
+ //FIXME What to do with this ?
+ protected SortedSet<FilterOption> completeSamplings = new TreeSet<>();
+
+ public ContactsFilterValues(Locale locale) {
+ this(locale, new BoatsFilterValues(locale));
+ }
+
+ public ContactsFilterValues(Locale locale, BoatsFilterValues boatsFilterValues) {
+ this.locale = locale;
+ this.boatsFilterValues = boatsFilterValues;
+ }
+
+ public void addContact(Contact contact) {
+
+ Boat boat = contact.getBoat();
+ boatsFilterValues.addBoat(boat);
+ boatNames.add(FilterOption.forValueAndLabel(boat.getTopiaId(), boat.getDescription()));
+ boatRegistrationCodes.add(FilterOption.forValueAndLabel(boat.getTopiaId(), String.valueOf(boat.getImmatriculation())));
+
+ SampleRow sampleRow = contact.getSampleRow();
+ sampleRowsFilterValues.addSampleRow(sampleRow);
+
+ ContactState contactState = contact.getContactState();
+ contactStates.add(FilterOption.forEnum(contactState));
+
+ DataReliability dataReliability = contact.getDataReliability();
+ dataReliabilities.add(FilterOption.forEnum(dataReliability));
+
+ SamplingStrategy samplingStrategy = contact.getSamplingStrategy();
+ actualSamplingStrategies.add(FilterOption.forEnum(samplingStrategy));
+
+ ObservationType observationType = contact.getObservationType();
+ observationTypes.add(FilterOption.forEnum(observationType));
+
+ ObservedDataControl observedDataControl = contact.getObservedDataControl();
+ observedDataControls.add(FilterOption.forEnum(observedDataControl));
+
+ List<WaoUser> allObservers = contact.getAllObservers();
+ if (CollectionUtils.isNotEmpty(allObservers)) {
+ for (WaoUser observer : allObservers) {
+ observers.add(FilterOption.forValueAndLabel(observer.getTopiaId(), observer.getFullName()));
+ }
+ }
+ TerrestrialLocation terrestrialLocation = contact.getTerrestrialLocation();
+ terrestrialLocations.add(FilterOption.forValueAndLabel(terrestrialLocation.getTopiaId(), terrestrialLocation.getDescription()));
+
+ //FIXME ?
+ ContactStateMotif contactStateMotif = contact.getContactStateMotif();
+ contactStateMotives.add(FilterOption.forValueAndLabel(contactStateMotif.getTopiaId(), contactStateMotif.getCode()));
+
+ Boolean validationCompany = contact.getValidationCompany();
+ addValidationFilterOption(companyAcceptations, validationCompany);
+
+ Boolean validationProgram = contact.getValidationProgram();
+ addValidationFilterOption(programAcceptations, validationProgram);
+
+ //FIXME ?
+ Boolean completeSampling = contact.getCompleteSampling();
+ }
+
+ public BoatsFilterValues getBoatsFilterValues() {
+ return boatsFilterValues;
+ }
+
+ public SampleRowsFilterValues getSampleRowsFilterValues() {
+ return sampleRowsFilterValues;
+ }
+
+ public SortedSet<FilterOption> getBoatNames() {
+ return boatNames;
+ }
+
+ public SortedSet<FilterOption> getBoatRegistrationCodes() {
+ return boatRegistrationCodes;
+ }
+
+ public SortedSet<FilterOption> getContactStates() {
+ return contactStates;
+ }
+
+ public SortedSet<FilterOption> getDataReliabilities() {
+ return dataReliabilities;
+ }
+
+ public SortedSet<FilterOption> getActualSamplingStrategies() {
+ return actualSamplingStrategies;
+ }
+
+ public SortedSet<FilterOption> getObservationTypes() {
+ return observationTypes;
+ }
+
+ public SortedSet<FilterOption> getObservedDataControls() {
+ return observedDataControls;
+ }
+
+ public SortedSet<FilterOption> getObservers() {
+ return observers;
+ }
+
+ public SortedSet<FilterOption> getTerrestrialLocations() {
+ return terrestrialLocations;
+ }
+
+ public SortedSet<FilterOption> getContactStateMotives() {
+ return contactStateMotives;
+ }
+
+ public SortedSet<FilterOption> getCompanyAcceptations() {
+ return companyAcceptations;
+ }
+
+ public SortedSet<FilterOption> getProgramAcceptations() {
+ return programAcceptations;
+ }
+
+ public SortedSet<FilterOption> getCompleteSamplings() {
+ return completeSamplings;
+ }
+
+ protected void addValidationFilterOption(SortedSet<FilterOption> options, Boolean validationState) {
+ String value;
+ String label;
+ if (validationState == null) {
+ value = null;
+ label = l(locale, "wao.business.validationState.standby");
+ } else if (validationState) {
+ value = validationState.toString();
+ label = l(locale, "wao.business.validationState.validated");
+ } else {
+ value = validationState.toString();
+ label = l(locale, "wao.business.validationState.refused");
+ }
+ options.add(FilterOption.forValueAndLabel(value, label));
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ContactsFilterValues.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java (rev 0)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -0,0 +1,47 @@
+package fr.ifremer.wao.services.service;
+
+import fr.ifremer.wao.entity.Contact;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created on 4/3/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class ObsMerContactsList implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected PaginationBean pagination;
+
+ protected List<Contact> contacts;
+
+ protected ContactsFilterValues filterValues;
+
+ public PaginationBean getPagination() {
+ return pagination;
+ }
+
+ public void setPagination(PaginationBean pagination) {
+ this.pagination = pagination;
+ }
+
+ public List<Contact> getContacts() {
+ return contacts;
+ }
+
+ public void setContacts(List<Contact> contacts) {
+ this.contacts = contacts;
+ }
+
+ public ContactsFilterValues getFilterValues() {
+ return filterValues;
+ }
+
+ public void setFilterValues(ContactsFilterValues filterValues) {
+ this.filterValues = filterValues;
+ }
+}
\ No newline at end of file
Property changes on: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsList.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java
===================================================================
--- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerContactsService.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -3,11 +3,13 @@
import com.google.common.collect.ImmutableSet;
import fr.ifremer.wao.ContactsFilter;
import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.ContactTopiaDao;
import fr.ifremer.wao.services.AuthenticatedWaoUser;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.nuiton.topia.persistence.pager.TopiaPagerBean;
import java.util.Calendar;
import java.util.Collection;
@@ -19,14 +21,51 @@
private static final Log log = LogFactory.getLog(ObsMerContactsService.class);
- public List<Contact> findAll(ContactsFilter filter) {
+ public ContactsFilterValues getContactsFilterValues(ContactsFilter filter) {
- List<Contact> all = getContactDao().findAll(filter);
+ ContactTopiaDao dao = getContactDao();
+ List<Contact> contacts = dao.findAll(filter);
- return all;
+ ContactsFilterValues contactsFilterValues = new ContactsFilterValues(serviceContext.getLocale());
+ for (Contact contact : contacts) {
+ contactsFilterValues.addContact(contact);
+ }
+
+ return contactsFilterValues;
}
+ public ObsMerContactsList getContactsList(ContactsFilter filter,
+ TopiaPagerBean queryPager) {
+
+ ContactTopiaDao dao = getContactDao();
+
+ TopiaPagerBean pager = dao.newPager(filter,
+ queryPager.getPageSize(),
+ queryPager.getPageIndex(),
+ queryPager.getSortColumn(),
+ queryPager.isSortAscendant());
+
+ List<Contact> contacts = dao.find(filter, pager);
+
+ PaginationBean paginationBean = new PaginationBean(pager, 10);
+
+ ContactsFilterValues boatsFilterValues = getContactsFilterValues(filter);
+
+ ObsMerContactsList contactsList = new ObsMerContactsList();
+ contactsList.setContacts(contacts);
+ contactsList.setPagination(paginationBean);
+ contactsList.setFilterValues(boatsFilterValues);
+ return contactsList;
+ }
+
+ public TopiaPagerBean newContactsPager(int pageSize) {
+ TopiaPagerBean queryPager = new TopiaPagerBean();
+ queryPager.setPageSize(pageSize);
+ queryPager.setPageIndex(1);
+ return queryPager;
+ }
+
public ContactsFilter newContactFilter(AuthenticatedWaoUser authenticatedWaoUser) {
ContactsFilter newContactsFilter = new ContactsFilter();
Modified: trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties
===================================================================
--- trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-services/src/main/resources/i18n/wao-services_en_GB.properties 2014-04-03 11:28:50 UTC (rev 1817)
@@ -27,6 +27,9 @@
wao.business.mammalsCapture.mail.subject=Obsmer WAO\: Information about an accidental capture
wao.business.other=Other
wao.business.readOnly=(read-only)
+wao.business.validationState.refused=Refused
+wao.business.validationState.standby=Stand by
+wao.business.validationState.validated=validate
wao.export.ical.desc=wtih %s
wao.export.ical.title=ObsDeb Observation
wao.import.contact.failure.boatMissing=You need to precise the plate number of the boat associated to the contact
Modified: trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties
===================================================================
--- trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-services/src/main/resources/i18n/wao-services_fr_FR.properties 2014-04-03 11:28:50 UTC (rev 1817)
@@ -25,8 +25,10 @@
wao.business.entity.UserProfile.description=%s sur %s%s
wao.business.mammalsCapture.mail.message=Bonjour,\n\nUn observateur du programme Obsmer a renseigné dans WAO l'information suivante \:\n\nMarée \: %s\nMétier \: %s\n\nCapture accidentelle \:\n%s\n\nCordialement,\n\nLe programme Obsmer\nhttp\://www.ifremer.fr/wao
wao.business.mammalsCapture.mail.subject=Obsmer WAO\: Information sur capture accidentelle
-wao.business.other=Autre
wao.business.readOnly=(lecture seule)
+wao.business.validationState.refused=Réfusé
+wao.business.validationState.standby=En attente
+wao.business.validationState.validated=Validé
wao.export.ical.desc=avec %s
wao.export.ical.title=Observation ObsDeb
wao.import.contact.failure.boatMissing=Il faut préciser l'immatriculation du navire associé au contact
Modified: trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java
===================================================================
--- trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-services/src/test/java/fr/ifremer/wao/services/service/ObsMerContactsServiceTest.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -5,6 +5,7 @@
import fr.ifremer.wao.services.ObsMerFixtures;
import org.junit.Before;
import org.junit.Test;
+import org.nuiton.topia.persistence.pager.TopiaPagerBean;
public class ObsMerContactsServiceTest extends AbstractWaoServiceTest {
@@ -23,12 +24,21 @@
}
@Test
- public void testFindAll() {
+ public void testGetBoatsFilterValues() {
ContactsFilter filter = service.newContactFilter(fixtures.admin());
- service.findAll(filter);
+ ContactsFilterValues filterValues = service.getContactsFilterValues(filter);
+ }
+ @Test
+ public void testGetBoatsList() {
+
+ ContactsFilter filter = service.newContactFilter(fixtures.admin());
+
+ TopiaPagerBean pager = service.newContactsPager(50);
+
+ ObsMerContactsList contactsList = service.getContactsList(filter, pager);
}
}
Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -67,6 +67,14 @@
return WaoUtils.formatMonth(getLocale(), date);
}
+ public String formatDate(Date date) {
+ return WaoUtils.formatDate(getLocale(), date);
+ }
+
+ public String formatDateTime(Date date) {
+ return WaoUtils.formatDateTime(getLocale(), date);
+ }
+
public boolean isGoogleAnalyticsEnabled() {
return applicationConfig.isGoogleAnalyticsEnabled();
}
Added: 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 (rev 0)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -0,0 +1,215 @@
+package fr.ifremer.wao.web.action.obsmer;
+
+import com.opensymphony.xwork2.Preparable;
+import fr.ifremer.wao.ContactsFilter;
+import fr.ifremer.wao.WaoUtils;
+import fr.ifremer.wao.entity.Boat;
+import fr.ifremer.wao.entity.Contact;
+import fr.ifremer.wao.entity.FishingZone;
+import fr.ifremer.wao.entity.ObsProgram;
+import fr.ifremer.wao.entity.Profession;
+import fr.ifremer.wao.entity.SampleRow;
+import fr.ifremer.wao.services.service.ContactsFilterValues;
+import fr.ifremer.wao.services.service.ObsMerContactsList;
+import fr.ifremer.wao.services.service.ObsMerContactsService;
+import fr.ifremer.wao.services.service.PaginationBean;
+import fr.ifremer.wao.web.WaoJspActionSupport;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.time.DateUtils;
+import org.nuiton.topia.persistence.pager.TopiaPagerBean;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Created on 4/3/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class ContactsAction extends WaoJspActionSupport implements Preparable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected transient ObsMerContactsService service;
+
+ /**
+ * Input pager.
+ */
+ protected TopiaPagerBean pager;
+
+ /**
+ * Contacts filter.
+ */
+ protected ContactsFilter filter;
+
+ /**
+ * List of contacts according to the input pager and filter.
+ */
+ protected ObsMerContactsList contactsList;
+
+ public void setService(ObsMerContactsService service) {
+ this.service = service;
+ }
+
+ public TopiaPagerBean getPager() {
+ if (pager == null) {
+ pager = service.newContactsPager(50);
+ }
+ return pager;
+ }
+
+ public ContactsFilter getFilter() {
+ if (filter == null) {
+ prepare();
+ }
+ return filter;
+ }
+
+ public List<Contact> getContacts() {
+ return contactsList.getContacts();
+ }
+
+ public ContactsFilterValues getFilterValues() {
+ return contactsList.getFilterValues();
+ }
+
+ public PaginationBean getPagination() {
+ return contactsList.getPagination();
+ }
+
+ @Override
+ public void prepare() {
+
+ filter = service.newContactFilter(getAuthenticatedWaoUser());
+ }
+
+ @Override
+ public String execute() {
+
+ contactsList = service.getContactsList(filter, getPager());
+
+ return SUCCESS;
+ }
+
+ public String getPaginationUrl(String fullUrl) {
+ // remove pageIndex parameter
+ String paginationUrl = fullUrl.replaceAll("pager\\.pageIndex=([^&])+[&]", "");
+ // clean &
+ paginationUrl = paginationUrl.replaceAll("&&", "&");
+ // add [?|&]pageIndex=
+ if (!paginationUrl.contains("?")) {
+ paginationUrl += "?";
+ } else if (!paginationUrl.endsWith("?")) {
+ paginationUrl += "&";
+ }
+ paginationUrl += "pager\\.pageIndex=";
+ return paginationUrl;
+ }
+
+ private Date now;
+
+ public String getFilterPeriodFromPlaceholder() {
+ String placeholder = formatMonth(DateUtils.addMonths(now, 1));
+ return placeholder;
+ }
+
+ public String getFilterPeriodToPlaceholder() {
+ String placeholder = formatMonth(DateUtils.addYears(now, 1));
+ return placeholder;
+ }
+
+ public String getMammalsInfo(Contact contact) {
+ return escapeForToolTip(contact.getMammalsInfo());
+ }
+
+ //FIXME Use ellipse
+ public String getCommentDisplayText(String comment) {
+ if (comment != null && comment.length() > 20) {
+ return comment.substring(0, 20) + "...";
+ }
+ return comment;
+ }
+
+ public String getTooltipBoat(Boat boat) {
+ StringBuilder result = new StringBuilder("<strong>").
+ append(boat.getImmatriculation()).append("</strong>").
+ append("\n<strong>Quartier : </strong>").
+ append(boat.getDistrictCode()).
+ append("\n<strong>Longueur : </strong>").
+ append(boat.getBoatLength()).append(" m").
+ append("\n<strong>Année de construction : </strong>").
+ append(boat.getBuildYear());
+ return getTooltipText(result.toString());
+ }
+
+ //FIXME
+ public String getTooltipSampleRow(SampleRow row) {
+ StringBuilder result = new StringBuilder();
+ DateFormat dateFormat;
+ if (row.getObsProgram() == ObsProgram.OBSDEB) {
+ if (row.isFieldWorkObservation()) {
+ dateFormat = new SimpleDateFormat("dd/MM/yyyy");
+ result.append(row.getObservationUnit().getDescription());
+ } else {
+ dateFormat = new SimpleDateFormat("'semaine' w (yyyy)");
+ result.append(row.getBoat().getName());
+ }
+ result.append("\n")
+ .append(dateFormat.format(row.getExpectedDate()));
+ } else {
+ dateFormat = new SimpleDateFormat("MM/yyyy");
+ Profession profession = row.getProfession();
+ result.append("<strong>Métier : </strong>").
+ append(row.getProfessionDescription());
+ result.append(" - ").append(profession.getLibelle());
+ if (!StringUtils.isEmpty(profession.getSpecies())) {
+ result.append("\n<strong>Espèces cibles : </strong>").
+ append(profession.getSpecies());
+ }
+ result.append("\n<strong>Programme : </strong>").
+ append(row.getProgramName()).
+ append("\n<strong>Période : </strong> du ").
+ append(dateFormat.format(row.getPeriodBegin())).append(" au ").
+ append(dateFormat.format(row.getPeriodEnd()));
+
+ for (FishingZone zone : row.getFishingZone()) {
+ result.append("\n<strong>Zone de pêche : </strong>").
+ append(zone.getCode());
+ }
+ }
+ return getTooltipText(result.toString());
+ }
+
+ public String getDivision(SampleRow sampleRow) {
+ String result = "";
+ for (FishingZone zone : sampleRow.getFishingZone()) {
+ result += zone.getDistrictCode() + " ";
+ }
+ return result;
+ }
+
+ //FIXME
+ public String getTooltipText(String input) {
+ if (input != null) {
+ return input.replaceAll("\n", "<br />").replaceAll("\r", "");
+ }
+ return "";
+ }
+
+ /**
+ * Devrait résoudre un problème que pose le composant ck/tooltip.
+ *
+ * Voir ANO#606
+ */
+ public static String escapeForToolTip(String str) {
+ String result = str.replaceAll("\r\n", "\n");
+ result = result.replaceAll("\n", "<br />");
+ result = result.replaceAll("'", "’");
+ result = result.replaceAll("\"", """);
+ result = result.replaceAll("%", "%");
+ return result;
+ }
+}
\ No newline at end of file
Property changes on: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsAction.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java
===================================================================
--- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java (rev 0)
+++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java 2014-04-03 11:28:50 UTC (rev 1817)
@@ -0,0 +1,54 @@
+package fr.ifremer.wao.web.action.obsmer;
+
+import com.opensymphony.xwork2.Preparable;
+import fr.ifremer.wao.ContactsFilter;
+import fr.ifremer.wao.services.service.ContactsFilterValues;
+import fr.ifremer.wao.services.service.ObsMerContactsService;
+import fr.ifremer.wao.web.WaoJsonActionSupport;
+
+/**
+ * Created on 4/3/14.
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com>
+ * @since 4.0
+ */
+public class ContactsFilterValuesJsonAction extends WaoJsonActionSupport implements Preparable {
+
+ private static final long serialVersionUID = 1L;
+
+ protected transient ObsMerContactsService service;
+
+ protected ContactsFilter filter;
+
+ protected ContactsFilterValues filterValues;
+
+ public void setService(ObsMerContactsService service) {
+ this.service = service;
+ }
+
+
+ public ContactsFilter getFilter() {
+ if (filter == null) {
+ prepare();
+ }
+ return filter;
+ }
+
+ public ContactsFilterValues getFilterValues() {
+ return filterValues;
+ }
+
+ @Override
+ public void prepare() {
+
+ filter = service.newContactFilter(session.getAuthenticatedWaoUser());
+ }
+
+ @Override
+ public String execute() {
+
+ filterValues = service.getContactsFilterValues(filter);
+ return SUCCESS;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/ContactsFilterValuesJsonAction.java
___________________________________________________________________
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-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-03 11:28:50 UTC (rev 1817)
@@ -395,6 +395,7 @@
wao.ui.page.Index.title=Home
wao.ui.page.ReferentialManagement.title=Referentials management
wao.ui.page.SamplingPlan.title=Sampling plan
+wao.ui.field.Contact.commentCompany=Company Comment
wao.ui.page.Synthesis.title=Synthesis
wao.ui.page.UserProfileForm.title=Profile management
wao.ui.page.companies.title=Companies
@@ -467,3 +468,5 @@
wao.ui.userList=Users list
wao.ui.userMustAcceptCgu=You must accept the terms of use
wao.ui.validLogin=Valid identifier
+wao.ui.action.csvImport=Import
+wao.ui.contacts.title=%s contacts trouvé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-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-03 11:28:50 UTC (rev 1817)
@@ -149,6 +149,7 @@
wao.ui.field.Contact.beginDate=Début d'observation
wao.ui.field.Contact.comment=Commentaire observateur
wao.ui.field.Contact.commentAdmin=Commentaire programme
+wao.ui.field.Contact.commentCompany=Commentaire société
wao.ui.field.Contact.commentCoordinator=Commentaire coordinateur
wao.ui.field.Contact.completeSampling=Échantillonnage complet
wao.ui.field.Contact.contactState=État du contact
@@ -467,3 +468,5 @@
wao.ui.userList=Liste des utilisateurs
wao.ui.userMustAcceptCgu=Vous devez accepter les conditions d'utilisation pour utiliser Wao
wao.ui.validLogin=Identifiant valide
+wao.ui.action.csvImport=Import
+wao.ui.contacts.title=%s contacts trouvés
Added: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp (rev 0)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp 2014-04-03 11:28:50 UTC (rev 1817)
@@ -0,0 +1,569 @@
+<%--
+ #%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%
+ --%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
+<%@taglib uri="/struts-tags" prefix="s" %>
+
+<html>
+
+<head>
+ <title>
+ <s:text name="wao.ui.page.Contacts.title"/>
+ </title>
+
+ <script>
+
+ $(document).ready(function () {
+
+ var contactsFilterController = new FilterController(WAO.OBSMER_CONTACTS_FILTER_VALUES_JSON_URL, $('#contacts-filters-form'));
+ contactsFilterController.init();
+
+ $('#reset-filters').click(function () {
+ contactsFilterController.reset();
+ });
+
+ });
+
+ </script>
+
+</head>
+
+<content tag="mainClass">large</content>
+
+<s:form method="GET" id="contacts-filters-form" cssClass="filters-form">
+
+<fieldset>
+
+ <s:textfield name="filter.periodFrom"
+ label="%{getText('wao.ui.form.periodFrom')}"
+ placeholder="%{getFilterPeriodFromPlaceholder()}"
+ cssClass="input-small"/>
+
+ <s:textfield name="filter.periodTo"
+ label="%{getText('wao.ui.form.period.to')}"
+ placeholder="%{getFilterPeriodToPlaceholder()}"
+ cssClass="input-small"/>
+
+</fieldset>
+
+<fieldset>
+
+ <s:select name="filter.boatsFilter.boatIds"
+ label="%{getText('wao.ui.field.Boat.name')}"
+ list="filterValues.boats"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="boats"/>
+
+ <s:select name="filter.boatsFilter.registrationCode"
+ label="%{getText('wao.ui.field.Boat.immatriculation')}"
+ list="filterValues.boatRegistrationCodes"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="boatRegistrationCodes"/>
+
+</fieldset>
+
+<fieldset>
+
+ <s:if test="authenticatedWaoUser.authorizedToViewOtherCompanies">
+
+ <s:select name="filter.companyIds"
+ label="%{getText('wao.ui.entity.Company')}"
+ list="filterValues.companies"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="companies"/>
+
+ </s:if>
+
+ <s:select name="filter.sampleRowFilter.sampleRowCodes"
+ label="%{getText('wao.ui.field.SampleRow.code')}"
+ list="filterValues.sampleRowsFilterValues.sampleRowCodes"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="sampleRowsFilterValues.sampleRowCodes"/>
+
+ <s:select name="filter.sampleRowFilter.programNames"
+ label="%{getText('wao.ui.field.SampleRow.code')}"
+ list="filterValues.sampleRowsFilterValues.programNames"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="programNames"/>
+
+</fieldset>
+
+<fieldset>
+
+ <s:select name="filter.boatFilter.fishingZoneFacadeNames"
+ label="%{getText('wao.ui.field.FishingZone.facadeName')}"
+ list="filterValues.boatsFilterValues.fishingZoneFacadeNames"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="boatsFilterValues.fishingZoneFacadeNames"/>
+
+ <s:select name="filter.boatFilter.fishingZoneSectorNames"
+ label="%{getText('wao.ui.field.FishingZone.sectorName')}"
+ list="filterValues.boatsFilterValues.fishingZoneSectorNames"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="boatsFilterValues.fishingZoneSectorNames"/>
+
+ <%-- FIXME Is it boatFilter.districtIds ?--%>
+ <s:select name="filter.terrestrialLocationIds"
+ label="%{getText('wao.ui.field.Boat.district')}"
+ list="filterValues.terrestrialLocations"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="terrestrialLocations"/>
+
+</fieldset>
+
+<fieldset>
+
+ <s:select name="filter.observerIds"
+ label="%{getText('wao.ui.misc.observer')}"
+ list="filterValues.observers"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="observers"/>
+
+ <s:select name="filter.contactStates"
+ label="%{getText('wao.ui.field.Contact.contactState')}"
+ list="filterValues.contactStates"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="contactStates"/>
+
+ <s:select name="filter.observedDataControls"
+ label="%{getText('wao.ui.field.Contact.observedDataControl')}"
+ list="filterValues.observedDataControls"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="observedDataControls"/>
+
+ <s:select name="filter.dataReliabilities"
+ label="%{getText('wao.ui.field.Contact.dataReliability')}"
+ list="filterValues.dataReliabilities"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="dataReliabilities"/>
+</fieldset>
+
+<fieldset>
+
+ <s:select name="filter.companyAcceptations"
+ label="%{getText('wao.ui.field.Contact.validationCompany')}"
+ list="filterValues.companyAcceptations"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="companyAcceptations"/>
+
+ <s:select name="filter.programAcceptations"
+ label="%{getText('wao.ui.field.Contact.validationProgram')}"
+ list="filterValues.programAcceptations"
+ listKey="value"
+ listValue="label"
+ multiple="true"
+ dataBinding="programAcceptations"/>
+
+</fieldset>
+
+<fieldset>
+
+ <s:checkbox name="filter.mammalsObservationOnly"
+ label="%{getText('wao.ui.misc.observations')}"/>
+
+ <s:checkbox name="filter.mammalsCaptureOnly"
+ label="%{getText('wao.ui.field.Contact.mammalsCapture')}"/>
+
+ <br/>
+ <s:checkbox name="filter.commentDefinedOnly"
+ label="%{getText('wao.ui.field.Contact.comment')}"/>
+
+ <s:checkbox name="filter.commentCompanyDefinedOnly"
+ label="%{getText('wao.ui.field.Contact.commentCompany')}"/>
+
+ <s:checkbox name="filter.commentAdminDefinedOnly"
+ label="%{getText('wao.ui.field.Contact.commentAdmin')}"/>
+</fieldset>
+
+<fieldset>
+
+ <s:checkbox name="filter.sortedByBoardingDate"
+ label="%{getText('wao.ui.form.sortByTideBegin')}"/>
+
+ <s:checkbox name="filter.filterOnObservationBeginDate"
+ label="%{getText('wao.ui.form.filterOnObservationBeginDate')}"/>
+
+</fieldset>
+
+<div class="form-actions">
+
+ <button type="button" id="reset-filters" class="btn">
+ <i class="icon-reset"></i> <s:text name="wao.ui.action.reset"/>
+ </button>
+
+ <s:submit type="button" cssClass="btn">
+ <i class="icon-filter"></i> <s:text name="wao.ui.action.filter"/>
+ </s:submit>
+
+ <s:submit action="import-contacts" type="button" cssClass="btn">
+ <i class="icon-download"></i> <s:text name="wao.ui.action.csvImport"/>
+ </s:submit>
+
+ <s:submit action="export-contacts" type="button" cssClass="btn">
+ <i class="icon-download"></i> <s:text name="wao.ui.action.csvExport"/>
+ </s:submit>
+
+</div>
+
+</s:form>
+
+<h3>
+ <s:text name="wao.ui.contacts.title">
+ <s:param value="%{pagination.nbRecords}"/>
+ </s:text>
+</h3>
+
+<%-- Pagination --%>
+<div class="pagination">
+ <ul>
+ <s:url var="fullUrl" includeParams="get"/>
+ <s:set var="paginationUrl" value="%{getPaginationUrl(#fullUrl)}"/>
+ <s:if test="pagination.firstPageIndex > 2">
+ <li>
+ <a href="${paginationUrl}1">1</a>
+ </li>
+ <li>
+ <a href="${paginationUrl}2">2</a>
+ </li>
+ <li>
+ <span>...</span>
+ </li>
+ </s:if>
+
+ <s:iterator var="currentPageIndex" begin="pagination.firstPage" end="pagination.lastPage">
+ <li class="<s:if test="#currentPageIndex == pagination.currentPage">active</s:if>">
+ <a href="${paginationUrl}${currentPageIndex}">
+ <s:property/>
+ </a>
+ </li>
+ </s:iterator>
+
+ <s:if test="pagination.lastPage < pagination.nbPages - 1">
+ <li>
+ <span>...</span>
+ </li>
+ <li>
+ <a href="${paginationUrl}${pagination.nbPages - 1}">
+ <s:property value="pagination.nbPages - 1"/>
+ </a>
+ </li>
+ <li>
+ <a href="${paginationUrl}${pagination.nbPages}">
+ <s:property value="pagination.nbPages"/>
+ </a>
+ </li>
+ </s:if>
+ </ul>
+</div>
+<table id="contacts-list" class="large-table contacts-list">
+<thead>
+<tr>
+ <th>
+ Création
+ </th>
+ <th>
+ Observateurs
+ </th>
+ <th>
+ Société
+ </th>
+ <th>
+ Ligne du plan
+ </th>
+ <th>
+ Programme
+ </th>
+ <th>
+ Code métier
+ </th>
+ <th>
+ Libellé métier
+ </th>
+ <th>
+ Espèces cibles
+ </th>
+ <th>
+ Façade
+ </th>
+ <th>
+ Zone
+ </th>
+ <th>
+ Division
+ </th>
+ <th>
+ Navire
+ </th>
+ <th>
+ N°
+ </th>
+ <th>
+ CQ
+ </th>
+ <th>
+ Etat
+ </th>
+ <th>
+ Motif de refus
+ </th>
+ <th>
+ Début de l'observation
+ </th>
+ <th>
+ Fin de l'observation
+ </th>
+ <th>
+ Nb obs.
+ </th>
+ <th>
+ Observations et captures accidentelles
+ </th>
+ <th>
+ Commentaire observateur
+ </th>
+ <th>
+ Saisie des données observées
+ </th>
+ <th>
+ Contrôle des données observées
+ </th>
+ <th>
+ Transmission de la restitution
+ </th>
+ <th>
+ Validation
+ </th>
+ <th>
+ Commentaire société
+ </th>
+ <th>
+ Commentaire programme
+ </th>
+ <th>
+ Qualité de la donnée
+ </th>
+ <th>
+ Actions
+ </th>
+</tr>
+</thead>
+<tbody>
+
+<s:iterator value="contacts" var="contact">
+<tr class="contact-row">
+ <td>
+ <s:property value="%{formatDate(creationDate)}"/>
+ </td>
+ <td>
+ <s:if test="secondaryObserversEmpty">
+ <s:property value="mainObserver.fullName"/>
+ </s:if>
+ <s:else>
+ <s:property value="mainObserver.fullName"/>...
+ (
+ <s:text name="wao.ui.field.Contact.secondaryObservers">
+ <s:param value="secondaryObservers"/>
+ </s:text>
+ )
+ </s:else>
+
+ </td>
+ <td>
+ <s:property value="sampleRow.company.name"/>
+ </td>
+ <td>
+ <s:property value="sampleRow.code"/>
+ (
+ <s:property value="%{getTooltipSampleRow(sampleRow)}"/>
+ )
+ </td>
+ <td>
+ <s:property value="sampleRow.programName"/>
+ </td>
+ <td>
+ <s:property value="sampleRow.professionDescription"/>
+ </td>
+ <td>
+ <s:property value="sampleRow.profession.libelle"/>
+ </td>
+ <td>
+ <s:property value="sampleRow.profession.species"/>
+ </td>
+ <td>
+ <s:property value="sampleRow.facade"/>
+ </td>
+ <td>
+ <s:property value="sampleRow.sectors"/>
+ </td>
+ <td>
+ <s:property value="%{getDivision(sampleRow)}"/>
+ </td>
+ <td>
+ <s:property value="boat.name"/> (<s:property value="%{getTooltipBoat(boat)}"/>)
+ </td>
+ <td>
+ <s:property value="%{'' + boat.immatriculation}"/>
+ </td>
+ <td>
+ <s:property value="boat.districtCode"/>
+ </td>
+ <td>
+ <s:if test="contactStateMotif != null">
+ <s:text name="%{contactState.i18nKey}"/>
+ (
+ <s:text name="wao.ui.field.Contact.contactStateMotif">
+ <s:param value="%{contactStateMotif.name}"/>
+ </s:text>
+ )
+ </s:if>
+ <s:else>
+ <s:text name="%{contactState.i18nKey}"/>
+ </s:else>
+ </td>
+ <td>
+ <s:if test="contactStateMotif != null">
+ <s:property value="contactStateMotif.name"/>
+ </s:if>
+ </td>
+ <td>
+ <s:property value="%{formatDateTime(observationBeginDate)}"/>
+ </td>
+ <td>
+ <s:property value="%{formatDateTime(observationEndDate)}"/>
+ </td>
+ <td>
+ <s:property value="nbObservants"/>
+ </td>
+ <td>
+ <s:if test="mammalsObservation">
+ <img src="<s:url value="/img/eye-22px.png"/>"
+ alt="<s:text name="wao.ui.field.Contact.mammalsObservation"/>"/>
+ </s:if>
+ <s:if test="mammalsCapture">
+ <s:if test="mammalsInfo">
+ <img src="<s:url value="fishing-net-22px.png"/>"
+ alt="<s:text name="wao.ui.field.Contact.mammalsCapture"/>"/>
+ (
+ <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"/>"
+ 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:text name="wao.ui.misc.comment">
+ <s:param value="%{getTooltipText(comment)}"/>
+ </s:text>
+ )
+ </s:if>
+ </td>
+ <td>
+ <s:property value="%{formatDate(dataInputDate)}"/>
+ </td>
+ <td>
+ <s:if test="observedDataControl">
+ <s:text name="%{observedDataControl.i18nKey}"/>
+ </s:if>
+ </td>
+ <td>
+ <s:if test="restitution">
+ <s:property value="%{formatDate(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}"/>--%>
+ </td>
+ <td>
+ <s:if test="commentCoordinator">
+ <s:property value="%{getCommentDisplayText(commentCoordinator)}"/>
+ (
+ <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: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="validationCompany">
+ <s:text name="%{dataReliability.i18nKey}"/>
+ </s:if>
+ </s:if>
+ </td>
+ <td>
+ Actions
+ </td>
+</tr>
+</s:iterator>
+</todby>
+</table>
+
+</html>
Property changes on: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/contacts.jsp
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/wao-web/src/main/webapp/enpoints-js.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/enpoints-js.jsp 2014-04-03 09:51:44 UTC (rev 1816)
+++ trunk/wao-web/src/main/webapp/enpoints-js.jsp 2014-04-03 11:28:50 UTC (rev 1817)
@@ -8,6 +8,7 @@
WAO.OBSMER_SAMPLE_ROWS_FILTER_VALUES_JSON_URL = '<s:url namespace="/obsmer" action="sample-rows-filter-values-json"/>';
WAO.OBSMER_BOATS_FILTER_VALUES_JSON_URL = '<s:url namespace="/obsmer" action="boats-filter-values-json"/>';
+ WAO.OBSMER_CONTACTS_FILTER_VALUES_JSON_URL = '<s:url namespace="/obsmer" action="contacts-filter-values-json"/>';
});
1
0
r1816 - in trunk/wao-web/src/main/webapp: . WEB-INF/content/obsmer
by bleny@users.forge.codelutin.com 03 Apr '14
by bleny@users.forge.codelutin.com 03 Apr '14
03 Apr '14
Author: bleny
Date: 2014-04-03 11:51:44 +0200 (Thu, 03 Apr 2014)
New Revision: 1816
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1816
Log:
remove useless empty div
Modified:
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
trunk/wao-web/src/main/webapp/wao.css
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 09:33:46 UTC (rev 1815)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 09:51:44 UTC (rev 1816)
@@ -247,6 +247,4 @@
<div id="boat-details"></div>
-<div style="clear: both;"/>
-
</html>
Modified: trunk/wao-web/src/main/webapp/wao.css
===================================================================
--- trunk/wao-web/src/main/webapp/wao.css 2014-04-03 09:33:46 UTC (rev 1815)
+++ trunk/wao-web/src/main/webapp/wao.css 2014-04-03 09:51:44 UTC (rev 1816)
@@ -107,8 +107,10 @@
footer {
text-align: center;
+ margin-top: 25px;
margin-left: auto;
margin-right: auto;
+ clear: both;
}
footer ul {
1
0
r1815 - in trunk/wao-web/src/main/webapp: . WEB-INF/content/obsmer
by bleny@users.forge.codelutin.com 03 Apr '14
by bleny@users.forge.codelutin.com 03 Apr '14
03 Apr '14
Author: bleny
Date: 2014-04-03 11:33:46 +0200 (Thu, 03 Apr 2014)
New Revision: 1815
Url: http://forge.codelutin.com/projects/wao/repository/revisions/1815
Log:
implements client-side reset for filters
Modified:
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp
trunk/wao-web/src/main/webapp/wao.js
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 09:12:52 UTC (rev 1814)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 09:33:46 UTC (rev 1815)
@@ -44,6 +44,10 @@
WAO.get(url, {}, successCallback);
});
+ $('#reset-filters').click(function () {
+ boatsFilterController.reset();
+ });
+
});
</script>
@@ -125,10 +129,9 @@
<div class="form-actions">
- <s:url action="boats" id="boatsUrl"/>
- <s:a href="%{boatsUrl}" cssClass="btn">
- <i class="icon-reset"></i> <s:text name="wao.ui.action.reset"/>
- </s:a>
+ <button type="button" id="reset-filters" class="btn">
+ <i class="icon-reset"></i> <s:text name="wao.ui.action.reset" />
+ </button>
<s:submit type="button" cssClass="btn">
<i class="icon-filter"></i> <s:text name="wao.ui.action.filter"/>
Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp
===================================================================
--- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-04-03 09:12:52 UTC (rev 1814)
+++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-04-03 09:33:46 UTC (rev 1815)
@@ -46,6 +46,10 @@
$('table.sampling-plan').toggleClass('full-view').toggleClass('compact-view');
});
+ $('#reset-filters').click(function () {
+ sampleRowsFilterController.reset();
+ });
+
});
</script>
@@ -140,10 +144,9 @@
<div class="form-actions">
- <s:url action="sampling-plan" id="samplingPlanUrl" />
- <s:a href="%{samplingPlanUrl}" cssClass="btn">
+ <button type="button" id="reset-filters" class="btn">
<i class="icon-reset"></i> <s:text name="wao.ui.action.reset" />
- </s:a>
+ </button>
<s:submit type="button" cssClass="btn">
<i class="icon-filter"></i> <s:text name="wao.ui.action.filter" />
Modified: trunk/wao-web/src/main/webapp/wao.js
===================================================================
--- trunk/wao-web/src/main/webapp/wao.js 2014-04-03 09:12:52 UTC (rev 1814)
+++ trunk/wao-web/src/main/webapp/wao.js 2014-04-03 09:33:46 UTC (rev 1815)
@@ -69,13 +69,13 @@
return filter;
};
+ /* On va regarder les filterValues dans le modèle et ajouter toutes les options nécessaires */
this.refreshFilterValues = function() {
// store options selected by user to re-select them after update
var filter = this.getFilter();
var filterValues = this.model.filterValues;
this.$selects.each(function (index, select) {
var $select = $(select).empty();
- var name = $select.prop('name');
// FIXME brendan 26/03/14 should be data-binding but freemarker break the template :-(
var binding = $select.attr('databinding');
var options = WAO.getData(binding, filterValues);
@@ -83,13 +83,29 @@
var optionHtml = '<option value="' + option.value + '">' + option.label + '</option>';
$select.append(optionHtml);
});
+ });
+ this.selectOptions(filter);
+ this.$filtersForm.effect('highlight', 'slow');
+ };
+
+ /* On prend un filter en paramètre et on va sélectionner les options correspondantes */
+ this.selectOptions = function (filter) {
+ this.$selects.each(function (index, select) {
+ var $select = $(select);
+ $select.find('option:selected').prop('selected', false);
+ var name = $select.prop('name');
var selectedOptions = filter[name];
$.each(selectedOptions, function (index, selectedOption) {
$select.find('option[value="' + selectedOption + '"]').prop('selected', 'selected');
});
});
- this.$filtersForm.effect('highlight', 'slow');
- };
+ this.$inputs.each(function (index, input) {
+ var $input = $(input);
+ var parameterName = $input.prop('name');
+ var parameterValue = filter[parameterName];
+ var parameterValue = $input.prop('value', parameterValue);
+ });
+ }
$(this.model).on('updated', function () {
self.refreshFilterValues();
@@ -129,8 +145,14 @@
this.view.$selects.mouseleave(updateFilterValuesIfValueChanged);
this.view.$inputs.mouseleave(updateFilterValuesIfValueChanged);
+ this.initialFilter = this.view.getFilter();
}
+ this.reset = function () {
+ this.view.selectOptions(this.initialFilter);
+ this.updateFilterValues();
+ }
+
};
var Notifications = function () {
1
0