svn commit: r1069957 - /ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

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

svn commit: r1069957 - /ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

jleroux@apache.org
Author: jleroux
Date: Fri Feb 11 21:25:41 2011
New Revision: 1069957

URL: http://svn.apache.org/viewvc?rev=1069957&view=rev
Log:
Fix "Be able to create a product from quick dropdown (Product Jump)" reported by BJ on dev ML at https://issues.apache.org/jira/browse/OFBIZ-4177 - OFBIZ-4177

BJ: The behavior was if you put in a productID that did not exist, and did a
jump to product, instead of a message No existing Products found, the
/catalog/control/EditProduct enter the ID.
then all you had to do was do an update to create the new product.
Is there a reason this functionality was removed?

JLR: It was leading to a bug for any other screen (but EditProductQuickAdmin and I just found that) than product creation, since there
was no related productId (try prices screen in stable demo for instance). It could be arranged for the product creation screen.

This patch gives this functionality back while keeping out the bug.
I have also removed redundant test on productId (since if there are no product I don't see the point to check for productId)


Modified:
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=1069957&r1=1069956&r2=1069957&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Fri Feb 11 21:25:41 2011
@@ -39,10 +39,13 @@ under the License.
                     <decorator-section name="pre-body">
                         <section>
                             <condition>
-                                <and>
-                                    <if-has-permission permission="CATALOG" action="_VIEW"/>
-                                    <not><if-empty field="product"/></not>
-                                </and>
+                                    <and>
+                                        <if-has-permission permission="CATALOG" action="_VIEW"/>
+                                        <or>
+                                            <not><if-empty field="parameters.bypassIfNoProduct"/></not>
+                                            <not><if-empty field="product"/></not>
+                                        </or>
+                                    </and>
                             </condition>
                             <widgets>
                                 <include-menu name="ProductTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/>
@@ -61,7 +64,10 @@ under the License.
                             <widgets>
                                 <section>
                                     <condition>
-                                        <not><if-empty field="product"/></not>
+                                        <or>
+                                            <not><if-empty field="parameters.bypassIfNoProduct"/></not>
+                                            <not><if-empty field="product"/></not>
+                                        </or>
                                     </condition>
                                     <widgets>
                                         <container>
@@ -90,12 +96,12 @@ under the License.
                                     <condition>
                                         <or>
                                             <not><if-empty field="product"/></not>
-                                            <if-empty field="productId"/>
+                                            <not><if-empty field="parameters.bypassIfNoProduct"/></not>
                                         </or>
                                     </condition>
                                     <widgets>
-                                <decorator-section-include name="body"/>
-                            </widgets>
+                                        <decorator-section-include name="body"/>
+                                    </widgets>
                             <fail-widgets>
                                         <label style="h3">${uiLabelMap.ProductNoExistingProductsFound}</label>
                                     </fail-widgets>
@@ -156,6 +162,7 @@ under the License.
 
                 <set field="productId" from-field="parameters.productId"/>
                 <entity-one entity-name="Product" value-field="product"/>
+                <set field="parameters.bypassIfNoProduct" value="true"/>
             </actions>
             <widgets>
                 <decorator-screen name="CommonProductDecorator" location="${parameters.productDecoratorLocation}">
@@ -166,10 +173,7 @@ under the License.
 
                         <section>
                             <condition>
-                                <and>
-                                    <not><if-empty field="productId"/></not>
-                                    <not><if-empty field="product"/></not>
-                                </and>
+                                <not><if-empty field="product"/></not>
                             </condition>
                             <widgets>
                                 <screenlet title="${uiLabelMap.ProductDuplicateProduct}">
@@ -179,10 +183,7 @@ under the License.
                         </section>
                         <section>
                             <condition>
-                                <and>
-                                    <not><if-empty field="productId"/></not>
-                                    <not><if-empty field="product"/></not>
-                                </and>
+                                <not><if-empty field="product"/></not>
                             </condition>
                             <widgets>
                                 <section>
@@ -797,10 +798,7 @@ under the License.
                         <screenlet title="${uiLabelMap.PageTitleEditProductGlAccounts}">
                             <section>
                                 <condition>
-                                    <and>
-                                        <not><if-empty field="productId"/></not>
-                                        <not><if-empty field="product"/></not>
-                                    </and>
+                                    <not><if-empty field="product"/></not>
                                 </condition>
                                 <widgets>
                                     <include-form name="ListProductGlAccounts" location="component://product/widget/catalog/ProductForms.xml"/>
@@ -810,10 +808,7 @@ under the License.
                         <screenlet title="${uiLabelMap.ProductAddGlAccount}">
                             <section>
                                 <condition>
-                                    <and>
-                                        <not><if-empty field="productId"/></not>
-                                        <not><if-empty field="product"/></not>
-                                    </and>
+                                    <not><if-empty field="product"/></not>
                                 </condition>
                                 <widgets>
                                     <include-form name="AddProductGlAccount" location="component://product/widget/catalog/ProductForms.xml"/>