Author: jleroux
Date: Fri Sep 17 20:33:40 2010
New Revision: 998305

URL: http://svn.apache.org/viewvc?rev=998305&view=rev
Log:
This introduces changes that will be used soon (after some client tests) to 
refactor the Price Rules UI. They introduces any functional changes yet, all 
new things are optional.

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    
ofbiz/trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml
    ofbiz/trunk/applications/product/servicedef/services_pricepromo.xml
    ofbiz/trunk/framework/common/config/CommonUiLabels.xml
    ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=998305&r1=998304&r2=998305&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Fri Sep 17 
20:33:40 2010
@@ -6591,6 +6591,17 @@
         <value xml:lang="th">บัญชี</value>
         <value xml:lang="zh">账户</value>
     </property>
+    <property key="ProductActionType">
+        <value xml:lang="de">Aktionstyp</value>
+        <value xml:lang="en">Action Type</value>
+        <value xml:lang="es">Tipo de Acción</value>
+        <value xml:lang="fr">Type d'action</value>
+        <value xml:lang="it">Tipo Azione</value>
+        <value xml:lang="ro">Tip Actiune</value>
+        <value xml:lang="ru">Тип действия</value>
+        <value 
xml:lang="th">จำนวนประเภทการทำงาน</value>
+        <value xml:lang="zh">操作类型</value>
+    </property>
     <property key="ProductActionTypeAmount">
         <value xml:lang="de">Aktionstyp Betrag</value>
         <value xml:lang="en">Action Type Amount</value>
@@ -8952,6 +8963,10 @@
         <value xml:lang="th">เงื่อนไข</value>
         <value xml:lang="zh">条件</value>
     </property>
+    <property key="ProductConditionsThenActions">         
+        <value xml:lang="en">If all conditions are true, then actions will be 
executed (logical conjunction, ie conditions are 'ANDED' between them, so are 
actions))</value>
+        <value xml:lang="fr">Si toutes les conditions sont vérifiées, alors 
les actions seront exécutées (conjonction, autrement dit ET logique entre 
conditions, de même pour les actions)</value>
+    </property>    
     <property key="ProductConfigItem">
         <value xml:lang="de">Konfigurationsposition</value>
         <value xml:lang="en">Config Item</value>
@@ -12104,6 +12119,17 @@
         <value 
xml:lang="th">สถานะรายการสินค้าคงเหลือเบื้องต้น</value>
         <value xml:lang="zh">初始库存明细状态</value>
     </property>
+    <property key="ProductInput">
+        <value xml:lang="de">Eingang</value>
+        <value xml:lang="en">Input</value>
+        <value xml:lang="es">Entrada</value>
+        <value xml:lang="fr">Donnée</value>
+        <value xml:lang="it">Input</value>
+        <value xml:lang="ro">Input</value>
+        <value xml:lang="ru">Исход. параметр</value>
+        <value xml:lang="th">ข้อมูล</value>
+        <value xml:lang="zh">数据</value>
+    </property>
     <property key="ProductInputOperatorValue">
         <value xml:lang="de">Eingang, Operator, Wert</value>
         <value xml:lang="en">Input, Operator Value</value>
@@ -12115,6 +12141,28 @@
         <value xml:lang="th">ใส่, ผู้ควบคุม และ 
ค่า</value>
         <value xml:lang="zh">输入、操作符和数值</value>
     </property>
+    <property key="ProductOperator">
+        <value xml:lang="de">Operator</value>
+        <value xml:lang="en">Operator</value>
+        <value xml:lang="es">Operador</value>
+        <value xml:lang="fr">Opérateur</value>
+        <value xml:lang="it">Operatore</value>
+        <value xml:lang="ro">Operator si Valoare</value>
+        <value xml:lang="ru">оператор</value>
+        <value xml:lang="th">ผู้ประกอบการ</value>
+        <value xml:lang="zh">值</value>
+    </property>
+    <property key="ProductValue">
+        <value xml:lang="de">Wert</value>
+        <value xml:lang="en">Value</value>
+        <value xml:lang="es">Valor</value>
+        <value xml:lang="fr">Valeur</value>
+        <value xml:lang="it">Valore</value>
+        <value xml:lang="ro">Valoare</value>
+        <value xml:lang="ru">значение</value>
+        <value xml:lang="th">มูลค่า</value>
+        <value xml:lang="zh">算子</value>
+    </property>
     <property key="ProductInsertDefaultImageUrl">
         <value xml:lang="de">Standart Bild URL einfügen</value>
         <value xml:lang="en">Insert Default Image URL</value>
@@ -15929,6 +15977,18 @@
         <value 
xml:lang="th">คุณไม่มีการอนุญาตถึงข้อมูลราคาที่รักษาไว้.
 ("CATALOG_PRICE_MAINT" ต้องการ)</value>
         <value xml:lang="zh">你没有权限维护价格信息。 
(需要"CATALOG_PRICE_MAINT")</value>
     </property>
+    <property key="ProductPriceRuleId">
+        <value xml:lang="de">Preisregel [ID]</value>
+        <value xml:lang="en">Edit Price Rule [ID]</value>
+        <value xml:lang="es">Regla de precio [CÓDIGO]</value>
+        <value xml:lang="fr">Modifier la règle de prix [Réf.]</value>
+        <value xml:lang="it">Regola Prezzo [Codice]</value>
+        <value xml:lang="nl">Prijsregel [ID]</value>    
+        <value xml:lang="ro">Regula Pret [Cod]</value>
+        <value xml:lang="ru">правила ценообразования 
[Код]</value>
+        <value xml:lang="th">ชื่อข้อกำหนดราคา 
[รหัส]</value>
+        <value xml:lang="zh">价格规则[参考。]</value>
+    </property>
     <property key="ProductPriceRuleNameId">
         <value xml:lang="de">Preisregel Name [ID]</value>
         <value xml:lang="en">Price Rule Name [ID]</value>
@@ -15953,6 +16013,14 @@
         <value xml:lang="th">ข้อกำหนดราคา</value>
         <value xml:lang="zh">价格规则</value>
     </property>
+    <property key="ProductPriceRulesNewAction">
+        <value xml:lang="en">Add a New Action</value>
+        <value xml:lang="fr">Ajout d'une action</value>
+    </property>
+    <property key="ProductPriceRulesNewCond">
+        <value xml:lang="en">Add a New Condition</value>
+        <value xml:lang="fr">Ajout d'une condition</value>
+    </property>
     <property key="ProductPriceTitle1">
         <value xml:lang="en">Price charge</value>
         <value xml:lang="fr">Frais lié au prix</value>

Modified: 
ofbiz/trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml?rev=998305&r1=998304&r2=998305&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml
 (original)
+++ 
ofbiz/trunk/applications/product/script/org/ofbiz/product/price/PriceServices.xml
 Fri Sep 17 20:33:40 2010
@@ -178,6 +178,9 @@ under the License.
         <check-permission permission="CATALOG_PRICE_MAINT"><fail-property 
resource="ProductUiLabels" 
property="ProductPriceMaintPermissionError"/></check-permission>
         <check-errors/>
 
+        <if-not-empty field="parameters.condValueInput">
+            <set field="parameters.condValue" 
from-field="parameters.condValueInput"/>
+        </if-not-empty>
         <make-value value-field="newEntity" entity-name="ProductPriceCond"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>
         <set-pk-fields map="parameters" value-field="newEntity"/>
@@ -191,6 +194,9 @@ under the License.
         <check-permission permission="CATALOG_PRICE_MAINT"><fail-property 
resource="ProductUiLabels" 
property="ProductPriceMaintPermissionError"/></check-permission>
         <check-errors/>
 
+        <if-not-empty field="parameters.condValueInput">
+            <set field="parameters.condValue" 
from-field="parameters.condValueInput"/>
+        </if-not-empty>
         <make-value entity-name="ProductPriceCond" value-field="lookupPKMap"/>
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key entity-name="ProductPriceCond" map="lookupPKMap" 
value-field="lookedUpValue"/>

Modified: ofbiz/trunk/applications/product/servicedef/services_pricepromo.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_pricepromo.xml?rev=998305&r1=998304&r2=998305&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_pricepromo.xml 
(original)
+++ ofbiz/trunk/applications/product/servicedef/services_pricepromo.xml Fri Sep 
17 20:33:40 2010
@@ -89,6 +89,7 @@ under the License.
         <description>Create an ProductPriceCond</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="condValueInput" type="String" mode="IN" 
optional="true"></attribute>
         <override name="productPriceCondSeqId" mode="OUT"/>
     </service>
     <service name="updateProductPriceCond" 
default-entity-name="ProductPriceCond" engine="simple"
@@ -96,6 +97,7 @@ under the License.
         <description>Update an ProductPriceCond</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="condValueInput" type="String" mode="IN" 
optional="true"></attribute>
     </service>
     <service name="deleteProductPriceCond" 
default-entity-name="ProductPriceCond" engine="simple"
                 
location="component://product/script/org/ofbiz/product/price/PriceServices.xml" 
invoke="deleteProductPriceCond" auth="true">

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.xml?rev=998305&r1=998304&r2=998305&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.xml (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.xml Fri Sep 17 20:33:40 
2010
@@ -4599,6 +4599,10 @@
         <value 
xml:lang="th">ไม่มีรหัสไปรษณีย์</value>
         <value xml:lang="zh">没有邮政地址</value>
     </property>
+    <property key="CommonNoOptions">
+        <value xml:lang="en">No options: _NA_</value>
+        <value xml:lang="fr">Aucun option: _NA_</value>
+    </property>
     <property key="CommonNoStatesProvinces">            
         <value xml:lang="en">No States/Provinces exist: _NA_</value>
         <value xml:lang="fr">Aucun état ou province: _NA_</value>

Modified: 
ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js?rev=998305&r1=998304&r2=998305&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js 
(original)
+++ ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js 
Fri Sep 17 20:33:40 2010
@@ -27,10 +27,12 @@
 // descName     = name of the dependent dropdown description
 // selected     = optional name of a selected option
 // callback     = optional javascript function called at end
-function getDependentDropdownValues(request, paramKey, paramField, 
targetField, responseName, keyName, descName, selected, callback) {
+// inputField   = optional name of an input field to use instead of a dropdown 
(this will be extended later to use an of autocompleted dropdown, instead of 
dropdown or a lookup, when there are too much values to populate)   
+// hide         = optional argument, if true the dependend dropdown field 
(targetField) will be hidden when no options are available else only disabled. 
False by default.
+function getDependentDropdownValues(request, paramKey, paramField, 
targetField, responseName, keyName, descName, selected, callback, hide) {
        // parameters
        var params = new Array();
-       params[paramKey] = $F(paramField);                      
+       params[paramKey] = $F(paramField);
        
     var optionList = [];
     var requestToSend = request;
@@ -40,6 +42,17 @@ function getDependentDropdownValues(requ
         onSuccess: function(transport) {
             var data = transport.responseText.evalJSON(true);                  
   
             list = data[responseName];
+            // this is to handle a specific case where an input field is 
needed, uses inputField for the field name
+            if (!list) {
+                               $(targetField).hide();
+                               $(targetField).insert({after: new 
Element('input', {name : inputField, id : targetField + '_input', size : 3})}); 
+               return;
+            } else { 
+               if ($(targetField + '_input')) { 
+                       $(targetField + '_input').remove();                     
+                                       $(targetField).show();
+               }
+            }
             list.each(function(value) {
                if (typeof value == 'string') {                 
                        values = value.split(': ');
@@ -57,14 +70,20 @@ function getDependentDropdownValues(requ
                }
             });
             $(targetField).update(optionList);
-            if ((list.size() < 1) || ((list.size() == 1) && 
list[0].indexOf("_NA_") >=0)) {                
-                if ($(targetField).visible()) {
-                    Effect.Fade(targetField, {duration: 1.5});
-                }
+            if ((list.size() < 1) || ((list.size() == 1) && 
list[0].indexOf("_NA_") >=0)) {
+               Form.Element.disable(targetField);
+               if (hide) {
+                                       if ($(targetField).visible()) {
+                                               Effect.Fade(targetField, 
{duration: 1.5});
+                                       }
+                               }
             } else {
-                if (!$(targetField).visible()) {
-                    Effect.Appear(targetField, {duration: 0.0});
-                }
+               Form.Element.enable(targetField);
+               if (hide) {
+                       if (!$(targetField).visible()) {
+                           Effect.Appear(targetField, {duration: 0.0});
+                       }
+               }
             }
             if (callback != null)
                eval(callback);


Reply via email to