Author: bleny Date: 2010-11-05 13:56:46 +0000 (Fri, 05 Nov 2010) New Revision: 744 Log: add an icons for modified lines in sampling plan Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java trunk/wao-ui/src/main/webapp/SamplingPlan.tml Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-11-05 12:46:28 UTC (rev 743) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-11-05 13:56:46 UTC (rev 744) @@ -129,7 +129,6 @@ // * Fichier CSV contenant un plan d'échantillonnage // */ // @Property -// private UploadedFile samplingPlanCsvFile; // // public boolean canImportSamplingPlan() { // return user.isAdmin() && !user.isReadOnly(); @@ -683,5 +682,12 @@ // Test if the row isFinished with a gap of 1 month (today - 1 month) return !row.isFinished(-1); } + + public boolean isRowModified() { + // XXX bleny 20101105 this is a dirty hack. Actually, we should test + // CollectionUtils.isEmpty(row.getSampleRowLog()) + // but it's not initialized by hibernate + return row.getTopiaVersion() > 1; + } } Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml =================================================================== --- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-11-05 12:46:28 UTC (rev 743) +++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-11-05 13:56:46 UTC (rev 744) @@ -232,6 +232,13 @@ title="Changer les dates de la période par rapport à celles de la ligne"> ${row.code} </a> + <t:if t:test="canEditSampleRow()"> + <t:if test="rowModified"> + <a t:type="pagelink" t:page="sampleRowHistoric" t:context="row.code"> + <img src="${asset:context:}/img/edit.png" class="fright" alt=" * " title="Cette ligne a été modifiée (voir l'historique)"/> + </a> + </t:if> + </t:if> </td> <td class="width150">${row.programName}</td> <t:if t:test="fullView">