svn commit: r1801281 - in /ofbiz/ofbiz-framework/trunk: applications/product/config/ applications/product/groovyScripts/facility/shipment/ applications/product/template/shipment/ framework/common/config/ framework/webtools/src/main/java/org/apache/ofbi...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1801281 - in /ofbiz/ofbiz-framework/trunk: applications/product/config/ applications/product/groovyScripts/facility/shipment/ applications/product/template/shipment/ framework/common/config/ framework/webtools/src/main/java/org/apache/ofbi...

Deepak Dixit-5
Author: deepak
Date: Sat Jul  8 11:36:50 2017
New Revision: 1801281

URL: http://svn.apache.org/viewvc?rev=1801281&view=rev
Log:
Improved: Following uiLabels should move from ProductUiLabels.xml to CommonEntityLabels.xml. (OFBIZ-9408)
    ProductShipmentUomAbbreviation_LEN_in
    ProductShipmentUomAbbreviation_WT_g
    ProductShipmentUomAbbreviation_WT_kg
    ProductShipmentUomAbbreviation_WT_lb
    These labels should be written in similer pattern as other labels of "Uom" entity are written in CommonEntityLabels.xml, for example :
    ProductShipmentUomAbbreviation_LEN_in will be written as
    Uom.abbreviation.LEN_in
    <entityName>.<fieldName>.<PrimaryKey>

Thanks Renuka for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/PackOrder.groovy
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/WeightPackage.groovy
    ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/PackOrder.ftl
    ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/WeightPackage.ftl
    ofbiz/ofbiz-framework/trunk/framework/common/config/CommonEntityLabels.xml
    ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java

Modified: ofbiz/ofbiz-framework/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/config/ProductUiLabels.xml?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/config/ProductUiLabels.xml Sat Jul  8 11:36:50 2017
@@ -29387,36 +29387,6 @@
         <value xml:lang="zh">货运类型标识</value>
         <value xml:lang="zh-TW">貨運類型識別</value>
     </property>
-    <property key="ProductShipmentUomAbbreviation_LEN_in">
-        <value xml:lang="en">in</value>
-        <value xml:lang="it">in</value>
-        <value xml:lang="ja">インチ</value>
-        <value xml:lang="vi">trong</value>
-        <value xml:lang="zh">英寸</value>
-        <value xml:lang="zh-TW">英寸</value>
-    </property>
-    <property key="ProductShipmentUomAbbreviation_WT_g">
-        <value xml:lang="en">g</value>
-    </property>
-    <property key="ProductShipmentUomAbbreviation_WT_kg">
-        <value xml:lang="en">kg</value>
-        <value xml:lang="ru">кг</value>
-        <value xml:lang="th">กิโลกรัม</value>
-        <value xml:lang="vi">cân</value>
-        <value xml:lang="zh">公斤</value>
-        <value xml:lang="zh-TW">公斤</value>
-    </property>
-    <property key="ProductShipmentUomAbbreviation_WT_lb">
-        <value xml:lang="de">Pfund (Gewicht)</value>
-        <value xml:lang="en">lbs</value>
-        <value xml:lang="es">libras</value>
-        <value xml:lang="fr">livres</value>
-        <value xml:lang="it">libre</value>
-        <value xml:lang="ja">ポンド</value>
-        <value xml:lang="ru">фнт</value>
-        <value xml:lang="zh">磅</value>
-        <value xml:lang="zh-TW">磅</value>
-    </property>
     <property key="ProductShipmentUpsResidential">
         <value xml:lang="de">Auslieferung Wohnhaus</value>
         <value xml:lang="en">Residential Delivery</value>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/PackOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/PackOrder.groovy?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/PackOrder.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/PackOrder.groovy Sat Jul  8 11:36:50 2017
@@ -180,4 +180,5 @@ if (facility) {
 if (!defaultWeightUomId) {
     defaultWeightUomId = EntityUtilProperties.getPropertyValue("shipment", "shipment.default.weight.uom", "WT_kg", delegator)
 }
+context.defaultWeightUom = from("Uom").where("uomId", defaultWeightUomId).cache().queryOne();;
 context.defaultWeightUomId = defaultWeightUomId

Modified: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/WeightPackage.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/WeightPackage.groovy?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/WeightPackage.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/WeightPackage.groovy Sat Jul  8 11:36:50 2017
@@ -192,6 +192,7 @@ if (facility) {
 if (!defaultDimensionUomId) {
     defaultDimensionUomId = EntityUtilProperties.getPropertyValue("shipment", "shipment.default.dimension.uom", "LEN_in", delegator)
 }
+context.defaultDimensionUom = from("Uom").where("uomId", defaultDimensionUomId).cache().queryOne();;
 context.defaultDimensionUomId = defaultDimensionUomId
 
 defaultWeightUomId = null
@@ -201,4 +202,6 @@ if (facility) {
 if (!defaultWeightUomId) {
     defaultWeightUomId = EntityUtilProperties.getPropertyValue("shipment", "shipment.default.weight.uom", "WT_kg", delegator)
 }
+
+context.defaultWeightUom = from("Uom").where("uomId", defaultWeightUomId).cache().queryOne();;
 context.defaultWeightUomId = defaultWeightUomId

Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/PackOrder.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/PackOrder.ftl?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/PackOrder.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/PackOrder.ftl Sat Jul  8 11:36:50 2017
@@ -265,7 +265,7 @@ under the License.
                       <td align="right">${uiLabelMap.ProductPackedQty}</td>
                       <td>&nbsp;</td>
                       <td align="center">${uiLabelMap.ProductPackQty}</td>
-                      <td align="center">${uiLabelMap.ProductPackedWeight}&nbsp;(${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval})</td>
+                      <td align="center">${uiLabelMap.ProductPackedWeight}&nbsp;<#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if></td>
                       <td align="center">${uiLabelMap.ProductPackage}</td>
                       <td align="right">&nbsp;<b>*</b>&nbsp;${uiLabelMap.ProductPackages}</td>
                     </tr>
@@ -358,7 +358,7 @@ under the License.
                         <#assign packageSeqIds = packingSession.getPackageSeqIds()/>
                         <#if packageSeqIds?has_content>
                             <td>
-                                <span class="label">${uiLabelMap.ProductPackedWeight} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval}):</span>
+                                <span class="label">${uiLabelMap.ProductPackedWeight} <#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if>:</span>
                                 <br />
                                 <#list packageSeqIds as packageSeqId>
                                     ${uiLabelMap.ProductPackage} ${packageSeqId}
@@ -448,7 +448,7 @@ under the License.
                     <td>${uiLabelMap.ProductProductDescription}</td>
                     <td>${uiLabelMap.ProductInventoryItem} ${uiLabelMap.CommonNbr}</td>
                     <td align="right">${uiLabelMap.ProductPackedQty}</td>
-                    <td align="right">${uiLabelMap.ProductPackedWeight}&nbsp;(${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval})&nbsp;(${uiLabelMap.ProductPackage})</td>
+                    <td align="right">${uiLabelMap.ProductPackedWeight}&nbsp;<#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if>&nbsp;(${uiLabelMap.ProductPackage})</td>
                     <td align="right">${uiLabelMap.ProductPackage} ${uiLabelMap.CommonNbr}</td>
                     <td>&nbsp;</td>
                   </tr>
@@ -492,7 +492,7 @@ under the License.
                   <td>${uiLabelMap.ProductProductDescription}</td>
                   <td>${uiLabelMap.ProductInventoryItem} ${uiLabelMap.CommonNbr}</td>
                   <td align="right">${uiLabelMap.ProductPackedQty}</td>
-                  <td align="right">${uiLabelMap.ProductPackedWeight}&nbsp;(${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval})&nbsp;(${uiLabelMap.ProductPackage})</td>
+                  <td align="right">${uiLabelMap.ProductPackedWeight}&nbsp;<#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if>&nbsp;(${uiLabelMap.ProductPackage})</td>
                   <td align="right">${uiLabelMap.ProductPackage} ${uiLabelMap.CommonNbr}</td>
                   <td>&nbsp;</td>
               </tr>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/WeightPackage.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/WeightPackage.ftl?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/WeightPackage.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/template/shipment/WeightPackage.ftl Sat Jul  8 11:36:50 2017
@@ -114,10 +114,10 @@ under the License.
               <table class="basic-table" cellpadding="2" cellspacing='0'>
                 <tr>
                   <th>
-                    ${uiLabelMap.ProductPackedWeight} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval}):
+                    ${uiLabelMap.ProductPackedWeight} <#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if>:
                   </th>
                   <th>
-                    ${uiLabelMap.CommonDimension} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultDimensionUomId)?eval}):
+                    ${uiLabelMap.CommonDimension} <#if defaultDimensionUom?has_content>(${defaultDimensionUom.get("abbreviation",locale)!})</#if>:
                   </th>
                   <th>
                     ${uiLabelMap.ProductPackageInputBox}:
@@ -189,14 +189,14 @@ under the License.
                 </#if>
                 <tr>
                   <td>
-                    <span class="label">${uiLabelMap.ProductPackedWeight} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval}):
+                    <span class="label">${uiLabelMap.ProductPackedWeight} <#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if>:
                       <br />
                       ${uiLabelMap.ProductPackage}
                       <input type="text" size="7" name="packageWeight" value=""/>
                     </span>
                   </td>
                   <td>
-                    <span class="label">${uiLabelMap.CommonDimension} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultDimensionUomId)?eval}):</span>
+                    <span class="label">${uiLabelMap.CommonDimension} <#if defaultDimensionUom?has_content>(${defaultDimensionUom.get("abbreviation",locale)!})</#if>:</span>
                     <br />
                     <span class="label">${uiLabelMap.CommonLength}<input type="text" name="packageLength" value="" size="5"/></span>
                     <span class="label">${uiLabelMap.ProductWidth}<input type="text" name="packageWidth" value="" size="5"/></span>
@@ -223,10 +223,10 @@ under the License.
             <table class="basic-table" cellpadding="2" cellspacing='0'>
              <tr>
                 <th>
-                 ${uiLabelMap.ProductPackedWeight} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval}):
+                 ${uiLabelMap.ProductPackedWeight} <#if defaultWeightUom?has_content>(${defaultWeightUom.get("abbreviation",locale)!})</#if>:
                 </th>
                  <th>
-                  ${uiLabelMap.CommonDimension} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultDimensionUomId)?eval}):
+                  ${uiLabelMap.CommonDimension} <#if defaultDimensionUom?has_content>(${defaultDimensionUom.get("abbreviation",locale)!})</#if>:
                 </th>
                 <th>
                   ${uiLabelMap.ProductPackageInputBox}:

Modified: ofbiz/ofbiz-framework/trunk/framework/common/config/CommonEntityLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/common/config/CommonEntityLabels.xml?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/common/config/CommonEntityLabels.xml (original)
+++ ofbiz/ofbiz-framework/trunk/framework/common/config/CommonEntityLabels.xml Sat Jul  8 11:36:50 2017
@@ -17258,6 +17258,36 @@
         <value xml:lang="zh">取消暂停</value>
         <value xml:lang="zh-TW">取消暫停</value>
     </property>
+    <property key="Uom.abbreviation.LEN_in">
+        <value xml:lang="en">in</value>
+        <value xml:lang="it">in</value>
+        <value xml:lang="ja">インチ</value>
+        <value xml:lang="vi">trong</value>
+        <value xml:lang="zh">英寸</value>
+        <value xml:lang="zh-TW">英寸</value>
+    </property>
+    <property key="Uom.abbreviation.WT_g">
+        <value xml:lang="en">g</value>
+    </property>
+    <property key="Uom.abbreviation.WT_kg">
+        <value xml:lang="en">kg</value>
+        <value xml:lang="ru">кг</value>
+        <value xml:lang="th">กิโลกรัม</value>
+        <value xml:lang="vi">cân</value>
+        <value xml:lang="zh">公斤</value>
+        <value xml:lang="zh-TW">公斤</value>
+    </property>
+    <property key="Uom.abbreviation.WT_lb">
+        <value xml:lang="de">Pfund (Gewicht)</value>
+        <value xml:lang="en">lbs</value>
+        <value xml:lang="es">libras</value>
+        <value xml:lang="fr">livres</value>
+        <value xml:lang="it">libre</value>
+        <value xml:lang="ja">ポンド</value>
+        <value xml:lang="ru">фнт</value>
+        <value xml:lang="zh">磅</value>
+        <value xml:lang="zh-TW">磅</value>
+        </property>
     <property key="Uom.description.AED">
         <value xml:lang="ar">درهم أماراتي</value>
         <value xml:lang="cs">Emirátský dirham</value>

Modified: ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java?rev=1801281&r1=1801280&r2=1801281&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/webtools/src/main/java/org/apache/ofbiz/webtools/labelmanager/LabelManagerFactory.java Sat Jul  8 11:36:50 2017
@@ -131,7 +131,6 @@ public class LabelManagerFactory {
                                     || labelKey.contains(".geoName.")
                                     || labelKey.contains(".categoryName.")
                                     || labelKey.contains("FieldDescription.")
-                                    || labelKey.contains("ProductShipmentUomAbbreviation_")
                                     || labelKey.contains("TemporalExpression_")
                                     || labelKey.contains(".portalPageName.")
                                     || labelKey.contains("ProductStoreGroup.productStoreGroupName.NA")