Author: tchemit Date: 2014-03-25 16:41:42 +0100 (Tue, 25 Mar 2014) New Revision: 1747 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1747 Log: refs-30 #4483 (begin of ui) Modified: trunk/ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.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/sampling-plan.jsp Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - *.idea *.iml target + *.idea *.iml target atlassian-ide-plugin.xml Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java 2014-03-25 14:26:47 UTC (rev 1746) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/service/ObsMerSamplingPlan.java 2014-03-25 15:41:42 UTC (rev 1747) @@ -21,6 +21,7 @@ * #L% */ +import fr.ifremer.wao.entity.FishingZone; import fr.ifremer.wao.entity.SampleMonth; import fr.ifremer.wao.entity.SampleRow; @@ -341,6 +342,14 @@ return result; } + public String getFishingZones() { + String result = ""; + for (FishingZone zone : sampleRow.getFishingZone()) { + result += zone.getDistrictCode() + ", "; + } + return result.substring(0, result.length() - 2); + } + public Double getObservationTimesInDaysExpected() { return observationTimesInDaysExpected; } 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-03-25 14:26:47 UTC (rev 1746) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java 2014-03-25 15:41:42 UTC (rev 1747) @@ -24,6 +24,8 @@ import fr.ifremer.wao.entity.ObsProgram; import fr.ifremer.wao.services.AuthenticatedWaoUser; +import java.util.Date; + public class WaoJspActionSupport extends WaoActionSupport { protected WaoSession getSession() { @@ -58,4 +60,8 @@ return getText(enumeration.getClass().getSimpleName() + "." + enumeration.name()); } + public String formatMonth(Date date) { + return t("wao.ui.misc.month", date); + } + } Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java 2014-03-25 14:26:47 UTC (rev 1746) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java 2014-03-25 15:41:42 UTC (rev 1747) @@ -47,13 +47,17 @@ samplingPlan = service.getSamplingPlan(filter); return SUCCESS; + } + public ObsMerSamplingPlan getSamplingPlan() { + return samplingPlan; } - public List<SampleRow> getSamplingPlan() { + public List<SampleRow> getSamplingPlanRows() { return samplingPlan.getRows(); } + public String getSampleRowToHighlightId() { return getSession().getSampleRowToHighlightId(); } 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-03-25 14:26:47 UTC (rev 1746) +++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-03-25 15:41:42 UTC (rev 1747) @@ -338,6 +338,7 @@ wao.ui.misc.information=Information wao.ui.misc.infosAbout=Infos about %s wao.ui.misc.logFile.description=Show log file for %s +wao.ui.misc.month=%1$tm-%1$tY wao.ui.misc.no=no wao.ui.misc.noComment=no comment wao.ui.misc.notValidated=Not validated 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-03-25 14:26:47 UTC (rev 1746) +++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-03-25 15:41:42 UTC (rev 1747) @@ -338,6 +338,7 @@ wao.ui.misc.information=Informations wao.ui.misc.infosAbout=Informations sur %s wao.ui.misc.logFile.description=Afficher le fichier de log de %s +wao.ui.misc.month=%1$tm/%1$tY wao.ui.misc.no=Non wao.ui.misc.noComment=aucun commentaire wao.ui.misc.notValidated=Non validé 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-03-25 14:26:47 UTC (rev 1746) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-03-25 15:41:42 UTC (rev 1747) @@ -45,85 +45,236 @@ </s:a> </s:if> +<s:set var="estimatedTides" value="true"/> +<s:set var="fullView" value="true"/> +<s:set var="displayTidesReal" value="true"/> + +<s:set var="nbColumnsForProfession" value="%{#fullView ? 13 : 5}"/> +<s:set var="nbColumnsForMonths" value="%{samplingPlan.months.size() + 1}"/> +<s:set var="nbColumnsForOther" value="6"/> +<s:set var="nbColumnsTotal" value="%{#nbColumnsForProfession + #nbColumnsForMonths + #nbColumnsForOther}"/> + <table class="large-table table-hover"> <thead> - <th> - <s:text name="wao.ui.field.SampleRow.code" /> + <tr> + <th colspan="${nbColumnsForProfession}"> <s:text name="wao.ui.samplingPlan.sampledProfessions" /></th> + <th colspan="${nbColumnsForMonths}"> + <s:text name="wao.ui.samplingPlan.effort" /> + + [ <s:text name="wao.ui.samplingPlan.expected"/> <em> + ( <s:text name="wao.ui.samplingPlan.actual" /> + <s:if test="estimatedTides"> + <s:text name="wao.ui.samplingPlan.estimated" /> </s:if>)</em> ] </th> + <th colspan="${nbColumnsForOther}"><s:text name="wao.ui.misc.others" /></th> + </tr> + <tr> + <!-- Profession columns --> + <td><s:text name="wao.ui.field.SampleRow.code"/></td> + <td><s:text name="wao.ui.samplingPlan.program"/></td> +<s:if test="fullView"> + <td><s:text name="wao.ui.entity.Company"/></td> +</s:if> + <td><s:text name="wao.ui.entity.FishingZone"/></td> +<s:if test="fullView"> + <td><s:text name="wao.ui.samplingPlan.fishingZoneInfo"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.dCF5Code"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.meshSize"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.size"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.other"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.libelle"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.species"/></td> + <td><s:text name="wao.ui.field.SampleRow.periodBegin"/></td> + <td><s:text name="wao.ui.field.SampleRow.periodEnd"/></td> +</s:if> +<s:else> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.dCF5Code"/></td> + <td><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.libelle"/></td> +</s:else> + + <!-- Months columns --> + <s:iterator value="samplingPlan.months" var="month"> + <td><s:property value="%{formatMonth(#month)}"/></td> + </s:iterator> + <td><s:text name="wao.ui.misc.total"/></td> + <!-- Other columns --> + <td> + <s:text name="wao.ui.samplingPlan.observationTimesInDays"/> + [ <s:text name="wao.ui.samplingPlan.expected"/><em>(<s:text name="wao.ui.samplingPlan.actual"/><s:if test="estimatedTides"> + <s:text name="wao.ui.samplingPlan.estimated"/></s:if>)</em> ] + </td> + <td><s:text name="wao.ui.samplingPlan.averageTideTime"/></td> + <td><s:text name="wao.ui.samplingPlan.nbObservants"/></td> + <td><s:text name="wao.ui.field.SampleRow.appliedCoverageRate"/></td> + <td><s:text name="wao.ui.misc.comment"/></td> + <td><s:text name="wao.ui.samplingPlan.actions"/></td> + </tr> + </thead> + <tbody> + + <s:if test="fullView"> + </s:if> + <s:else> + </s:else> + +<%--Iterate on Facades--%> +<s:iterator value="samplingPlan" var="samplingPlanFacade"> + <tr> + <td colspan="${nbColumnsTotal}">FACADE <s:property value="%{#samplingPlanFacade.facade}"/></td> + </tr> +<%--Iterate on Sectors --%> +<s:iterator value="samplingPlanFacade" var="samplingPlanSector"> + <tr> + <td colspan="${nbColumnsTotal}">SECTOR <s:property value="%{#samplingPlanSector.sectors}"/></td> + </tr> +<%--Iterate on SampleRows --%> +<s:iterator value="samplingPlanSector" var="samplingPlanRow"> +<s:set var="sampleRow" value="%{#samplingPlanRow.sampleRow}"/> + <tr<s:if test="sampleRowToHighlightId.equals(#sampleRow.topiaId)"> class="highlight"</s:if>> <th> - <s:text name="wao.ui.actions" /> + <s:url action="edit-sample-row!input" id="changePeriodUrl"> + <s:param name="sampleRowId" value="sampleRow.topiaId" /> + </s:url> + <s:a class="btn" href="%{changePeriodUrl}" title="Changer les dates de la période par rapport à celles de la ligne"> + <s:property value="#sampleRow.code" /> + </s:a> </th> - </thead> - <tbody> - <s:iterator value="samplingPlan" var="sampleRow"> - <tr<s:if test="sampleRowToHighlightId.equals(topiaId)"> class="highlight"</s:if>> - <th> - <s:property value="code" /> - </th> - <td class="actions"> - <div class="dropdown"> - <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> - <s:text name="wao.ui.actions" /> - <b class="caret"></b> - </a> - <ul class="dropdown-menu"> - <s:if test="authenticatedWaoUser.authorizedToEditSamplingPlan"> - <li> - <s:url action="edit-sample-row!input" id="editSampleRowUrl"> - <s:param name="sampleRowId" value="topiaId" /> - </s:url> - <s:a href="%{editSampleRowUrl}"> - <i class="icon-edit"></i> <s:text name="wao.ui.action.edit" /> - </s:a> - </li> - <li> - <s:url action="delete-sample-row" id="deleteSampleRowUrl"> - <s:param name="companyId" value="topiaId" /> - </s:url> - <s:a href="%{deleteSampleRowUrl}"> - <i class="icon-trash"></i> <s:text name="wao.ui.action.delete" /> - </s:a> - </li> - </s:if> - <li> - <s:url action="sample-row-log" id="sampleRowLogUrl"> - <s:param name="sampleRowId" value="topiaId" /> - </s:url> - <s:a href="%{sampleRowLogUrl}"> - <i class="icon-time"></i> <s:text name="wao.ui.action.viewSampleRowLog" /> - </s:a> - </li> - <li> - <s:url action="boats" id="viewElligibleBoatsUrl"> - <s:param name="sampleRowIds" value="topiaId" /> - </s:url> - <s:a href="%{viewElligibleBoatsUrl}"> - <s:text name="wao.ui.action.viewElligibleBoats" /> - </s:a> - </li> - <li> - <s:url action="contacts" id="viewAssociatedContactsUrl"> - <s:param name="sampleRowIds" value="topiaId" /> - </s:url> - <s:a href="%{viewAssociatedContactsUrl}"> - <s:text name="wao.ui.action.viewAssociatedContacts" /> - </s:a> - </li> - <s:if test="authenticatedWaoUser.authorizedToCreateContact"> - <li> - <s:url action="contacts" id="createAssociatedContactUrl"> - <s:param name="sampleRowIds" value="topiaId" /> - </s:url> - <s:a href="%{createAssociatedContactUrl}"> - <i class="icon-add"></i> <s:text name="wao.ui.action.createAssociatedContact" /> - </s:a> - </li> - </s:if> - </ul> - </div> - </td> - </tr> - </s:iterator> + <td><s:property value="#sampleRow.programName" /></td> +<s:if test="fullView"> + <td>CompanyName</td> + <td><s:property value="#samplingPlanRow.fishingZones" /></td> + <td><s:property value="#sampleRow.fishingZonesInfos" /></td> + <td> + <s:iterator value="sampleRow.dcf5code" var="dcf5code"> + <span> + <s:property /> + </span> + </s:iterator> + </td> + <td><s:property value="#sampleRow.profession.meshSize" /></td> + <td><s:property value="#sampleRow.profession.size" /></td> + <td><s:property value="#sampleRow.profession.other" /></td> + <td><s:property value="#sampleRow.profession.libelle" /></td> + <td><s:property value="#sampleRow.profession.species" /></td> + <td><s:property value="%{formatMonth(#sampleRow.periodBegin)}" /></td> + <td><s:property value="%{formatMonth(#sampleRow.periodEnd)}" /></td> +</s:if> +<s:else> + <td>FishingZones</td> + <td> + <s:iterator value="sampleRow.dcf5code" var="dcf5code"> + <span> + <s:property /> + </span> + </s:iterator> + <s:property value="#sampleRow.professionDescriptionWithoutDCF5" /> + </td> +</s:else> + <!-- Months columns --> +<s:iterator value="samplingPlan.months" var="month"> + <td> + <s:property value="%{#samplingPlanRow.getNbTidesExpected(#month)}"/> + <s:if test="displayTidesReal"> + <span> + <em>(<s:property value="%{#samplingPlanRow.getNbTidesReal(#month)}"/>) + </em> + </span> + </s:if> + </td> +</s:iterator> + <td> + <span> + <s:property value="#sampleRow.totalTidesExpected" /> + <s:if test="!authenticatedWaoUser.guest"> + <em>(<s:property value="#sampleRow.totalTidesReal" />)</em> + <br/> + <strong><s:property value="#samplingPlanRow.totalPercentage" /></strong> + </s:if> + </span> + </td> + <td> + <s:property value="#samplingPlanRow.observationTimesInDaysExpected" /> j. + <span> + <em>(<s:property value="#samplingPlanRow.observationTimesInDaysReal" /> j.)</em> + </span> + </td> + <td><s:property value="#sampleRow.averageTideTime" /></td> + <td><s:property value="#sampleRow.nbObservants" /></td> + <td> + <s:if test="sampleRow.appliedCoverageRate"> + <s:property value="#sampleRow.appliedCoverageRate" /> % + </s:if> + </td> + <td><s:property value="#sampleRow.comment" /></td> + + <td class="actions"> + <div class="dropdown"> + <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> + <s:text name="wao.ui.actions" /> + <b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <s:if test="authenticatedWaoUser.authorizedToEditSamplingPlan"> + <li> + <s:url action="edit-sample-row!input" id="editSampleRowUrl"> + <s:param name="sampleRowId" value="sampleRow.topiaId" /> + </s:url> + <s:a href="%{editSampleRowUrl}"> + <i class="icon-edit"></i> <s:text name="wao.ui.action.edit" /> + </s:a> + </li> + <li> + <s:url action="delete-sample-row" id="deleteSampleRowUrl"> + <s:param name="companyId" value="sampleRow.topiaId" /> + </s:url> + <s:a href="%{deleteSampleRowUrl}"> + <i class="icon-trash"></i> <s:text name="wao.ui.action.delete" /> + </s:a> + </li> + </s:if> + <li> + <s:url action="sample-row-log" id="sampleRowLogUrl"> + <s:param name="sampleRowId" value="sampleRow.topiaId" /> + </s:url> + <s:a href="%{sampleRowLogUrl}"> + <i class="icon-time"></i> <s:text name="wao.ui.action.viewSampleRowLog" /> + </s:a> + </li> + <li> + <s:url action="boats" id="viewElligibleBoatsUrl"> + <s:param name="sampleRowIds" value="sampleRow.topiaId" /> + </s:url> + <s:a href="%{viewElligibleBoatsUrl}"> + <s:text name="wao.ui.action.viewElligibleBoats" /> + </s:a> + </li> + <li> + <s:url action="contacts" id="viewAssociatedContactsUrl"> + <s:param name="sampleRowIds" value="sampleRow.topiaId" /> + </s:url> + <s:a href="%{viewAssociatedContactsUrl}"> + <s:text name="wao.ui.action.viewAssociatedContacts" /> + </s:a> + </li> + <s:if test="authenticatedWaoUser.authorizedToCreateContact"> + <li> + <s:url action="contacts" id="createAssociatedContactUrl"> + <s:param name="sampleRowIds" value="sampleRow.topiaId" /> + </s:url> + <s:a href="%{createAssociatedContactUrl}"> + <i class="icon-add"></i> <s:text name="wao.ui.action.createAssociatedContact" /> + </s:a> + </li> + </s:if> + </ul> + </div> + </td> + </tr> +<%--Iterate on SampleRows --%> +</s:iterator> +<%--Iterate on Sectors --%> +</s:iterator> +<%--Iterate on Facades--%> +</s:iterator> + </todby> <tfoot>
participants (1)
-
tchemit@users.forge.codelutin.com