Author: bpoussin Date: 2012-08-12 13:39:19 +0200 (Sun, 12 Aug 2012) New Revision: 237 Url: http://chorem.org/repositories/revision/chorem/237 Log: - formatage des nombres pour l'edition - on laisse les % tel que l'utilisateur les ecrits (pas de conversion pour le stockage) Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdminAction.java trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java trunk/chorem-webmotion/src/main/webapp/css/chorem.less Modified: trunk/chorem-entities/src/main/xmi/chorem-model.properties =================================================================== --- trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-08 17:45:19 UTC (rev 236) +++ trunk/chorem-entities/src/main/xmi/chorem-model.properties 2012-08-12 11:39:19 UTC (rev 237) @@ -161,7 +161,7 @@ # # Quotation # -org.chorem.entities.Quotation.class.tagvalue.version=15.0 +org.chorem.entities.Quotation.class.tagvalue.version=16.0 org.chorem.entities.Quotation.class.tagvalue.preload=Quotation.project;Quotation.customer;Quotation.supplier;Quotation.category org.chorem.entities.Quotation.class.tagvalue.toString=%Interval.beginDate$tF-%Interval.endDate$tF %Quotation.reference|noref$s(%Quotation.category|noCategory$s) %Quotation.description|nodescription$s org.chorem.entities.Quotation.class.tagvalue.sortOrder=Interval.beginDate desc,Interval.endDate,Quotation.reference,Quotation.type,Quotation.description @@ -178,7 +178,7 @@ org.chorem.entities.Quotation.attribute.conversionHope.tagvalue.help=Pourcentage de r\u00e9ussite du projet org.chorem.entities.Quotation.attribute.conversionHope.tagvalue.subtype=percent org.chorem.entities.Quotation.attribute.conversionHope.tagvalue.min=0 -org.chorem.entities.Quotation.attribute.conversionHope.tagvalue.max=1 +org.chorem.entities.Quotation.attribute.conversionHope.tagvalue.max=100 org.chorem.entities.Quotation.attribute.status.tagvalue.help=\u00c9tat d'avancement de ce devis org.chorem.entities.Quotation.attribute.vrsPeriod.tagvalue.help=Nombre de jour de VSR (Validation en Service R\u00e9gulier) org.chorem.entities.Quotation.attribute.vrsPeriod.tagvalue.subtype=integer Modified: trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdminAction.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdminAction.java 2012-08-08 17:45:19 UTC (rev 236) +++ trunk/chorem-webmotion/src/main/java/org/chorem/webmotion/actions/AdminAction.java 2012-08-12 11:39:19 UTC (rev 237) @@ -23,6 +23,7 @@ package org.chorem.webmotion.actions; +import java.text.NumberFormat; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.ChoremClient; Modified: trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java 2012-08-08 17:45:19 UTC (rev 236) +++ trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyDisplay.java 2012-08-12 11:39:19 UTC (rev 237) @@ -225,7 +225,10 @@ if ("currency".equalsIgnoreCase(subtype)) { formatter = NumberFormat.getCurrencyInstance(); } else if ("percent".equalsIgnoreCase(subtype)) { - formatter = NumberFormat.getPercentInstance(); + // on utilise pas NumberFormat.getPercentInstance(); + // car il divise tout seul par 100, ce qu'on ne souhaite pas + // on veut affichage=stockage + formatter = new DecimalFormat("#,##0 '%'"); } else if ("integer".equalsIgnoreCase(subtype)) { formatter = NumberFormat.getIntegerInstance(); } else { Modified: trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java =================================================================== --- trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java 2012-08-08 17:45:19 UTC (rev 236) +++ trunk/chorem-webmotion/src/main/java/org/wikitty/web/jsptag/WikittyInput.java 2012-08-12 11:39:19 UTC (rev 237) @@ -40,6 +40,7 @@ import javax.servlet.jsp.tagext.SimpleTagSupport; import java.io.IOException; import java.math.BigDecimal; +import java.text.NumberFormat; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -207,7 +208,9 @@ Wikitty wikitty, FieldType field, String extName , String fieldName) throws JspException, IOException { BigDecimal value = wikitty.getFieldAsBigDecimal(extName, fieldName); - /*{<input type="text" name="<%=name%>" value="<%=value%>"<%=getDynamicAttribute()%>/>}*/ + NumberFormat formatter = NumberFormat.getNumberInstance(); + String formattedValue = formatter.format(value); + /*{<input type="text" name="<%=name%>" value="<%=formattedValue%>"<%=getDynamicAttribute()%>/>}*/ } protected void inputString(JspWriter output, String contextPath, String name, Modified: trunk/chorem-webmotion/src/main/webapp/css/chorem.less =================================================================== --- trunk/chorem-webmotion/src/main/webapp/css/chorem.less 2012-08-08 17:45:19 UTC (rev 236) +++ trunk/chorem-webmotion/src/main/webapp/css/chorem.less 2012-08-12 11:39:19 UTC (rev 237) @@ -13,6 +13,16 @@ padding: 0px; } +.ui-autocomplete { + max-height: 250px; + max-width: 500px; + overflow-y: auto; + /* prevent horizontal scrollbar */ + overflow-x: hidden; + /* add padding to account for vertical scrollbar */ + padding-right: 20px; +} + .ui-autocomplete-category { color: rgba(82, 168, 236, 0.796875); font-weight: bolder;