[Suiviobsmer-commits] r741 - in trunk: wao-business/src/main/filters wao-business/src/main/java/fr/ifremer/wao wao-business/src/main/java/fr/ifremer/wao/bean wao-business/src/main/xmi wao-ui/src/main/webapp
Author: bleny Date: 2010-11-05 12:04:34 +0000 (Fri, 05 Nov 2010) New Revision: 741 Log: add configuration option to hide indicators or not in Wao.properties Modified: trunk/wao-business/src/main/filters/Wao.properties trunk/wao-business/src/main/java/fr/ifremer/wao/WaoProperty.java trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ConnectedUserImpl.java trunk/wao-business/src/main/xmi/wao.zargo trunk/wao-ui/src/main/webapp/Administration.tml trunk/wao-ui/src/main/webapp/Synthesis.tml Modified: trunk/wao-business/src/main/filters/Wao.properties =================================================================== --- trunk/wao-business/src/main/filters/Wao.properties 2010-11-04 22:57:53 UTC (rev 740) +++ trunk/wao-business/src/main/filters/Wao.properties 2010-11-05 12:04:34 UTC (rev 741) @@ -56,3 +56,9 @@ ## Server path for chart generation chart.server.path= + +###### Since 1.6 + +# By default make indicators not visible +wao.indicators.show=false + Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/WaoProperty.java =================================================================== --- trunk/wao-business/src/main/java/fr/ifremer/wao/WaoProperty.java 2010-11-04 22:57:53 UTC (rev 740) +++ trunk/wao-business/src/main/java/fr/ifremer/wao/WaoProperty.java 2010-11-05 12:04:34 UTC (rev 741) @@ -51,7 +51,9 @@ /** Path for Eastwood */ CHART_SERVER_PATH("chart.server.path"), /** Email address to use when contact is done */ - CONTACT_DONE_EMAIL("wao.contactDone.email"); + CONTACT_DONE_EMAIL("wao.contactDone.email"), + /** Will indicators be shown in UI or not */ + SHOW_INDICATORS("wao.indicators.show"); private String key; Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ConnectedUserImpl.java =================================================================== --- trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ConnectedUserImpl.java 2010-11-04 22:57:53 UTC (rev 740) +++ trunk/wao-business/src/main/java/fr/ifremer/wao/bean/ConnectedUserImpl.java 2010-11-05 12:04:34 UTC (rev 741) @@ -20,6 +20,7 @@ */ package fr.ifremer.wao.bean; +import fr.ifremer.wao.WaoProperty; import fr.ifremer.wao.entity.Company; /** @@ -68,4 +69,10 @@ public Company getCompany() { return user.getCompany(); } + + @Override + public boolean isIndicatorsViewer() { + Boolean test = Boolean.parseBoolean(WaoProperty.SHOW_INDICATORS.getValue()); + return test; + } } Modified: trunk/wao-business/src/main/xmi/wao.zargo =================================================================== (Binary files differ) Modified: trunk/wao-ui/src/main/webapp/Administration.tml =================================================================== --- trunk/wao-ui/src/main/webapp/Administration.tml 2010-11-04 22:57:53 UTC (rev 740) +++ trunk/wao-ui/src/main/webapp/Administration.tml 2010-11-05 12:04:34 UTC (rev 741) @@ -172,61 +172,65 @@ <div class="mtop10" /> - <t:if t:test="currentUser.admin"> <!-- read only ????--> + <t:if test="user.indicatorsViewer"> - <t:zone t:id="synthesisParametersFormZone" t:update="show"> - <h2>Indicateurs qualités prestataires</h2> + <t:if t:test="currentUser.admin"> <!-- read only ????--> - <form t:type="form" t:id="synthesisParametersForm" t:zone="synthesisParametersFormZone"> + <t:zone t:id="synthesisParametersFormZone" t:update="show"> + <h2>Indicateurs qualités prestataires</h2> - <t:errors t:banner="message:errors-banner" /> + <form t:type="form" t:id="synthesisParametersForm" t:zone="synthesisParametersFormZone"> - <!-- ALL ACTUAL VALUES FOR INDICATORS OF GLOBAL SYNTHESIS --> - <t:loop t:source="globalSynthesisParameters.parameters" t:value="indicator" t:volatile="true"> - <t:indicatorLevels t:indicator="indicator" editable="true" /> - </t:loop> + <t:errors t:banner="message:errors-banner" /> - <table class="indicatorLevels"> - <tr> - <th>Total coefficients : </th> - <td>${globalSynthesisParameters.totalCoefficients}</td> - </tr> - </table> + <!-- ALL ACTUAL VALUES FOR INDICATORS OF GLOBAL SYNTHESIS --> + <t:loop t:source="globalSynthesisParameters.parameters" t:value="indicator" t:volatile="true"> + <t:indicatorLevels t:indicator="indicator" editable="true" /> + </t:loop> - <table class="indicatorLevels"> - <tr> - <td t:type="loop" t:source="globalSynthesisParameters.globalIndicator.indicatorLevel" t:value="indicatorLevel" t:volatile="true"> - ${globalIndicatorValue.label} - </td> - </tr> - <tr> - <td t:type="loop" t:source="globalSynthesisParameters.globalIndicator.indicatorLevel" t:value="indicatorLevel" volatile="true"> - [ <input type="text" size="3" value="${indicatorLevel.lowerBound}" disabled="disabled" /> ; - <input t:type="textfield" value="indicatorLevel.upperBound" size="3" /> - <t:if test="indicatorLevel.upperBoundIncluded"> - ] - <p:else> - [ - </p:else> - </t:if> - </td> - </tr> - </table> + <table class="indicatorLevels"> + <tr> + <th>Total coefficients : </th> + <td>${globalSynthesisParameters.totalCoefficients}</td> + </tr> + </table> - <div> - <p><label>Commentaire sur la modification* :</label></p> - <p><input t:type="textarea" t:id="comment" cols="50" rows="5" value="comment"/></p> - </div> + <table class="indicatorLevels"> + <tr> + <td t:type="loop" t:source="globalSynthesisParameters.globalIndicator.indicatorLevel" t:value="indicatorLevel" t:volatile="true"> + ${globalIndicatorValue.label} + </td> + </tr> + <tr> + <td t:type="loop" t:source="globalSynthesisParameters.globalIndicator.indicatorLevel" t:value="indicatorLevel" volatile="true"> + [ <input type="text" size="3" value="${indicatorLevel.lowerBound}" disabled="disabled" /> ; + <input t:type="textfield" value="indicatorLevel.upperBound" size="3" /> + <t:if test="indicatorLevel.upperBoundIncluded"> + ] + <p:else> + [ + </p:else> + </t:if> + </td> + </tr> + </table> - <div class="fright"> - <a t:type="pagelink" page="IndicatorsHistory"> - <img src="${asset:context:/img/clock.png}" alt="Historique" title="Voir l'historique des modifications des indicateurs" /> - </a> - <input t:type="submit" t:id="saveData" class="ico save" value="Save" title="Enregistrer les modifications" /> - <input type="reset" class="ico undo" value="Annuler les modificationss" title="Annuler les modifications" /> - </div> - </form> - </t:zone> + <div> + <p><label>Commentaire sur la modification* :</label></p> + <p><input t:type="textarea" t:id="comment" cols="50" rows="5" value="comment"/></p> + </div> + + <div class="fright"> + <a t:type="pagelink" page="IndicatorsHistory"> + <img src="${asset:context:/img/clock.png}" alt="Historique" title="Voir l'historique des modifications des indicateurs" /> + </a> + <input t:type="submit" t:id="saveData" class="ico save" value="Save" title="Enregistrer les modifications" /> + <input type="reset" class="ico undo" value="Annuler les modificationss" title="Annuler les modifications" /> + </div> + </form> + </t:zone> + </t:if> + </t:if> </t:layout> Modified: trunk/wao-ui/src/main/webapp/Synthesis.tml =================================================================== --- trunk/wao-ui/src/main/webapp/Synthesis.tml 2010-11-04 22:57:53 UTC (rev 740) +++ trunk/wao-ui/src/main/webapp/Synthesis.tml 2010-11-05 12:04:34 UTC (rev 741) @@ -128,12 +128,14 @@ title="Indicateur de la qualité des données" /> </a> </li> - <li> - <a t:type="actionlink" t:context="[actionShowGlobalSynthesis,'']" t:zone="so-synthesis-main"> - <img src="${asset:context:}/img/synthesis-global-synthesis.png" alt="Synthèse globale des indicateurs" - title="Synthèse globale des indicateurs" /> - </a> - </li> + <t:if test="user.indicatorsViewer"> + <li> + <a t:type="actionlink" t:context="[actionShowGlobalSynthesis,'']" t:zone="so-synthesis-main"> + <img src="${asset:context:}/img/synthesis-global-synthesis.png" alt="Synthèse globale des indicateurs" + title="Synthèse globale des indicateurs" /> + </a> + </li> + </t:if> </ul> </div> <div t:type="zone" t:id="delegator" class="fleft" t:update="show" id="so-synthesis-main"> @@ -160,9 +162,11 @@ <t:chart t:width="600" t:height="400" t:chart="dataSamplingChart" /> <!--</t:zone>--> - <!-- now render a table with position on global synthesis --> - <br /> - <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + <t:if test="user.indicatorsViewer"> + <!-- now render a table with position on global synthesis --> + <br /> + <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + </t:if> </div> </t:block> <!-- GRAPH2 : BOARDING_BOAT --> @@ -180,9 +184,11 @@ </p> </t:if> - <!-- now render a table with position on global synthesis --> - <br /> - <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + <t:if test="user.indicatorsViewer"> + <!-- now render a table with position on global synthesis --> + <br /> + <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + </t:if> </div> </t:block> <!-- IND1 : COMPLIANCE_BOARDING --> @@ -228,9 +234,11 @@ </t:if> </div> - <!-- now render a table with position on global synthesis --> - <br /> - <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + <t:if test="user.indicatorsViewer"> + <!-- now render a table with position on global synthesis --> + <br /> + <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + </t:if> </t:block> <!-- IND2 : CONTACT_STATE --> <t:block t:id="ind3"> @@ -310,9 +318,11 @@ </p:else> </t:if> - <!-- now render a table with position on global synthesis --> - <br /> - <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + <t:if test="user.indicatorsViewer"> + <!-- now render a table with position on global synthesis --> + <br /> + <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + </t:if> </div> </t:block> <!-- IND5 : DATA_RELIABILITY --> @@ -348,40 +358,43 @@ </p:else> </t:if> - <!-- now render a table with position on global synthesis --> - <br /> - <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + <t:if test="user.indicatorsViewer"> + <!-- now render a table with position on global synthesis --> + <br /> + <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" withLegend="true" /> + </t:if> </div> </t:block> <!-- GLOBAL SYNTHESIS --> <t:block t:id="globalSynthesis"> - <div class="print"> - <h2>Synthèse globale</h2> - <br /> + <t:if test="user.indicatorsViewer"> + <div class="print"> + <h2>Synthèse globale</h2> + <br /> - <t:loop t:source="globalSynthesisParameters.parameters" t:value="activeIndicator"> - <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" /> - </t:loop> + <t:loop t:source="globalSynthesisParameters.parameters" t:value="activeIndicator"> + <t:indicatorLevels t:indicator="activeIndicator" t:highlightLevel="activeIndicatorLevel" /> + </t:loop> - <table class="indicatorLevels"> - <tbody> - <tr> - <t:loop t:source="globalLevels" t:value="globalLevel"> - <t:if test="highlightGlobalLevel()"> - <td class="highlight selected"> - ${globalLevel.label} - </td> - <p:else> - <td> + <table class="indicatorLevels"> + <tbody> + <tr> + <t:loop t:source="globalLevels" t:value="globalLevel"> + <t:if test="highlightGlobalLevel()"> + <td class="highlight selected"> ${globalLevel.label} </td> - </p:else> - </t:if> - </t:loop> - </tr> - </tbody> - </table> - - </div> + <p:else> + <td> + ${globalLevel.label} + </td> + </p:else> + </t:if> + </t:loop> + </tr> + </tbody> + </table> + </div> + </t:if> </t:block> </t:layout>
participants (1)
-
bleny@users.labs.libre-entreprise.org