svn commit: r747025 - in /ofbiz/trunk/applications/product: entitydef/ webapp/catalog/WEB-INF/ webapp/catalog/config/ webapp/catalog/product/ widget/catalog/

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

svn commit: r747025 - in /ofbiz/trunk/applications/product: entitydef/ webapp/catalog/WEB-INF/ webapp/catalog/config/ webapp/catalog/product/ widget/catalog/

hansbak-2
Author: hansbak
Date: Mon Feb 23 14:11:53 2009
New Revision: 747025

URL: http://svn.apache.org/viewvc?rev=747025&view=rev
Log:
added a find option to product configuration items, and added the possibility to see in which product a configuration item is used.

Removed:
    ofbiz/trunk/applications/product/webapp/catalog/config/EditProductConfigOptions.ftl
Modified:
    ofbiz/trunk/applications/product/entitydef/entitymodel.xml
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/webapp/catalog/config/ConfigForms.xml
    ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
    ofbiz/trunk/applications/product/widget/catalog/ConfigScreens.xml
    ofbiz/trunk/applications/product/widget/catalog/Menus.xml

Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=747025&r1=747024&r2=747025&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Mon Feb 23 14:11:53 2009
@@ -4593,4 +4593,15 @@
     </view-link>
   </view-entity>
   
+  <view-entity entity-name="ProductConfigAndProduct"
+    package-name="org.ofbiz.product.product"
+    title="Product Config And Product  View Entity, to be able to see which products use a certain configuration item">
+    <member-entity entity-alias="PDC" entity-name="ProductConfig"/>
+    <member-entity entity-alias="PD" entity-name="Product"/>
+    <alias-all entity-alias="PDC"/>
+    <alias-all entity-alias="PD"/>
+    <view-link entity-alias="PDC" rel-entity-alias="PD">
+      <key-map field-name="productId"/>
+    </view-link>
+  </view-entity>
 </entitymodel>

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=747025&r1=747024&r2=747025&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Mon Feb 23 14:11:53 2009
@@ -2311,6 +2311,7 @@
 
     <!-- ================ Product Configuration Requests ================= -->
     <request-map uri="EditProductConfigs"><security https="true" auth="true"/><response name="success" type="view" value="EditProductConfigs"/></request-map>
+    <request-map uri="ProductConfigItemArticle"><security https="true" auth="true"/><response name="success" type="view" value="ProductConfigItemArticle"/></request-map>
     <request-map uri="createProductConfig">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="createProductConfig"/>
@@ -2561,6 +2562,7 @@
     <view-map name="EditProductContentContent" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductContentContent"/>
     <view-map name="EditSupplierProduct" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditSupplierProduct"/>
     <view-map name="EditProductConfigs" type="screen" page="component://product/widget/catalog/ProductScreens.xml#EditProductConfigs"/>
+    
 
     <view-map name="QuickAddVariants" type="screen" page="component://product/widget/catalog/ProductScreens.xml#QuickAddVariants"/>
     <view-map name="CreateVirtualWithVariantsForm" type="screen" page="component://product/widget/catalog/ProductScreens.xml#CreateVirtualWithVariantsForm"/>
@@ -2629,6 +2631,7 @@
     <view-map name="pendingReviews" type="screen" page="component://product/widget/catalog/ReviewScreens.xml#pendingReviews"/>
     
     <!-- Product Configuration views -->
+    <view-map name="ProductConfigItemArticle" type="screen" page="component://product/widget/catalog/ConfigScreens.xml#ProductConfigItemArticle"/>
     <view-map name="FindProductConfigItems" type="screen" page="component://product/widget/catalog/ConfigScreens.xml#FindProductConfigItems"/>
     <view-map name="EditProductConfigItem" type="screen" page="component://product/widget/catalog/ConfigScreens.xml#EditProductConfigItem"/>
     <view-map name="EditProductConfigOptions" type="screen" page="component://product/widget/catalog/ConfigScreens.xml#EditProductConfigOptions"/>

Modified: ofbiz/trunk/applications/product/webapp/catalog/config/ConfigForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/config/ConfigForms.xml?rev=747025&r1=747024&r2=747025&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/config/ConfigForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/config/ConfigForms.xml Mon Feb 23 14:11:53 2009
@@ -20,20 +20,36 @@
 
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
-    <form name="FindProductConfigItems" type="list" list-name="productConfigItems"
-        default-table-style="basic-table" odd-row-style="alternate-row" paginate-target="FindProductConfigItems">
+    <form name="FindProductConfigItems" type="list" list-name="listIt"
+        default-table-style="basic-table" odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
+        target="" header-row-style="header-row-2" paginate="true">
+        <actions>
+            <service service-name="performFind" result-map-list="listIt" result-map="performFindResult">
+                <field-map field-name="inputFields" from-field="parameters"/>
+                <field-map field-name="entityName" value="ProductConfigItem"/>
+            </service>
+        </actions>
         <row-actions>
             <set field="typeDescription" value="${bsh: return &quot;SINGLE&quot;.equals(configItemTypeId) ? uiLabelMap.get(&quot;ProductSingleChoice&quot;) : uiLabelMap.get(&quot;ProductMultiChoice&quot;)}"/>
         </row-actions>
-        <field name="configItemId" title="${uiLabelMap.CommonId}"><display/></field>
+        <field name="configItemId" title="${uiLabelMap.CommonId}" widget-style="buttontext"><hyperlink target="EditProductConfigItem?configItemId=${configItemId}" description="${configItemId}"/></field>
         <field name="configItemName" title="${uiLabelMap.CommonName}"><display/></field>
         <field name="typeDescription" title="${uiLabelMap.CommonType}">
             <display description="${typeDescription}"/>
         </field>
         <field name="description"><display/></field>
-        <field name="editLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
-            <hyperlink target="EditProductConfigItem?configItemId=${configItemId}" description="${uiLabelMap.CommonEdit}"/>
-        </field>
+    </form>
+    <form name="FindProductConfigItemsFrom" type="single" target="FindProductConfigItems"
+        default-map-name="productconfigitems"  header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-entity entity-name="ProductConfigItem" default-field-type="find"/>
+        <field name="configItemId"/>
+        <field name="configItemTypeId"><hidden/></field>
+        <field name="configItemName"/>
+        <field name="description"/>
+        <field name="longDescription"><hidden/></field>
+        <field name="imageUrl"><hidden/></field>
+        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
     <form name="EditProductConfigItem" type="single" target="updateProductConfigItem" title="" default-map-name="configItem"
         header-row-style="header-row" default-table-style="basic-table">
@@ -162,5 +178,50 @@
         <field use-when="contentId == null" name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
         <field use-when="contentId != null" name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
-
+    
+    <form name="ListProductConfigItem" type="list" list-name="productConfigs"
+        default-table-style="basic-table" odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
+        target="" header-row-style="header-row-2" paginate="true">
+        <actions>
+            <entity-condition entity-name="ProductConfigAndProduct" list="productConfigs" distinct="true">
+                <condition-list>
+                    <condition-expr field-name="configItemId" operator="equals" from-field="configItemId"/>
+                </condition-list>
+                <select-field field-name="productId"/>
+                <select-field field-name="configItemId"/>
+                <select-field field-name="productName"/>
+                <select-field field-name="piecesIncluded"/>
+            </entity-condition>
+        </actions>
+        <auto-fields-entity entity-name="ProductConfigAndProduct" default-field-type="hidden"/>
+        <field name="productId" widget-style="buttontext"  ><hyperlink target="EditProductConfigs?productId=${productId}" description="${productId}"/></field>
+        <field name="productName" ><display description="${productName}"/></field>
+        <field name="piecesIncluded" ><display description="${piecesIncluded}"/></field>
+    </form>
+    
+    <form name="ProductConfigOptionList" type="list" list-name="configOptionList"
+        default-table-style="basic-table" odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
+        target="" header-row-style="header-row-2" paginate="true">
+        <auto-fields-entity entity-name="ProductConfigOption" default-field-type="display" />
+        <field name="configItemId" widget-style="buttontext" title="${uiLabelMap.Name}" ><hyperlink target="EditProductConfigOptions?configItemId=${configItemId}&amp;configOptionId=${configOptionId}" description="${configOptionId} - ${configOptionName}"/></field>
+        <field name="configOptionId" ><hidden/></field>
+        <field name="configOptionName" ><hidden/></field>
+        <field name="remove" widget-style="buttontext" ><hyperlink target="deleteProductConfigOption?configItemId=${configItemId}&amp;configOptionId=${configOptionId}" description="${uiLabelMap.Remove}"/></field>
+    </form>
+    
+    <form name="ProductConfigList" type="list" list-name="configProducts"
+        default-table-style="basic-table" odd-row-style="alternate-row" paginate-target="FindProductConfigItems"
+        target="" header-row-style="header-row-2" paginate="true">
+        <row-actions>
+            <entity-one entity-name="Product" value-field="product">
+                <field-map field-name="productId"/>
+            </entity-one>
+        </row-actions>
+        <auto-fields-service service-name="createProductConfigProduct" default-field-type="display"/>
+        <field name="configItemId" ><hidden/></field>
+        <field name="configOptionId" ><hidden/></field>
+        <field name="productId" widget-style="buttontext" title="${uiLabelMap.Product}" ><hyperlink target="EditProductConfigOptions?configItemId=${configItemId}&amp;configOptionId=${configOptionId}&amp;productId=${product.productId}" description="${product.productId} - ${product.productName}"/></field>
+        <field name="remove" widget-style="buttontext" ><hyperlink target="deleteProductConfigProduct?configItemId=${configItemId}&amp;configOptionId=${configOptionId}&amp;productId=${product.productId}" description="${uiLabelMap.Remove}"/></field>
+    </form>
+    
 </forms>

Modified: ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml?rev=747025&r1=747024&r2=747025&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/ProductForms.xml Mon Feb 23 14:11:53 2009
@@ -886,7 +886,7 @@
         <!-- TODO: get descriptions from IDs <display description="${roleType.description}"/> -->
         <field name="sequenceNum"><display/></field>
         <field name="configItemId" title="${uiLabelMap.ProductConfigItem}">
-            <display-entity entity-name="ProductConfigItem" key-field-name="configItemId" description="${configItemName} [${configItemId}] (${description})"/>
+            <display-entity entity-name="ProductConfigItem" key-field-name="configItemId" description="${configItemName} : (${description})"><sub-hyperlink target="EditProductConfigItem?configItemId=${configItemId}" description="[ ${configItemId} ]"/></display-entity>
         </field>
         <field name="configTypeId">
             <drop-down allow-empty="false">

Modified: ofbiz/trunk/applications/product/widget/catalog/ConfigScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ConfigScreens.xml?rev=747025&r1=747024&r2=747025&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ConfigScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ConfigScreens.xml Mon Feb 23 14:11:53 2009
@@ -48,8 +48,9 @@
                                         </container>
                                     </widgets>
                                 </section>
-
-                                <decorator-section-include name="body"/>
+                                <container style="no-clear">
+                                    <decorator-section-include name="body"/>
+                                  </container>
                             </widgets>
                             <fail-widgets>
                                 <label style="h3">${uiLabelMap.ProductCatalogViewPermissionError}</label>
@@ -64,30 +65,18 @@
         <section>
             <actions>
                 <set field="titleProperty" value="PageTitleFindConfigItems"/>
-                <set field="headerItem" value="configs"/>
-                
-                <entity-condition list="productConfigItems" entity-name="ProductConfigItem">
-                    <order-by field-name="configItemId"/>
-                </entity-condition>
+                <set field="headerItem" value="configs"/>                
             </actions>
             <widgets>
                 <decorator-screen name="CommonConfigDecorator">
                     <decorator-section name="body">
-                        <container style="screenlet">
-                            <container style="screenlet-title-bar">
-                                <container style="h3">
-                                    <label text="${uiLabelMap.PageTitleFindConfigItems}"/>
-                                </container>
-                            </container>
-                            <container style="screenlet-body">
-                                <section>
-                                    <widgets>
-                                        <container><link target="EditProductConfigItem" text="${uiLabelMap.CommonCreateNew}" style="buttontext"/></container>
-                                        <include-form location="component://product/webapp/catalog/config/ConfigForms.xml" name="FindProductConfigItems"/>
-                                    </widgets>
-                                </section>
-                            </container>
-                        </container>
+                        <screenlet title="${uiLabelMap.PageTitleFindConfigItems} ${uiLabelMap.Option}">
+                            <link target="EditProductConfigItem" text="${uiLabelMap.CommonCreateNew}" style="buttontext"/>
+                            <include-form location="component://product/webapp/catalog/config/ConfigForms.xml" name="FindProductConfigItemsFrom"/>
+                        </screenlet>
+                        <screenlet title="${uiLabelMap.PageTitleFindConfigItems} ${uiLabelMap.Result}">
+                            <include-form location="component://product/webapp/catalog/config/ConfigForms.xml" name="FindProductConfigItems"/>
+                        </screenlet>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
@@ -136,10 +125,10 @@
                 
                 <set field="configItemId" from-field="parameters.configItemId"/>
                 <entity-one entity-name="ProductConfigItem" value-field="configItem" auto-field-map="true"/>
-
+                
                 <set field="configOptionId" from-field="parameters.configOptionId"/>
                 <entity-one entity-name="ProductConfigOption" value-field="configOption" auto-field-map="true"/>
-
+                
                 <set field="productId" from-field="parameters.productId"/>
                 <entity-one entity-name="ProductConfigProduct" value-field="productConfigProduct" auto-field-map="true"/>
                 <entity-condition entity-name="ProductConfigOption" list="configOptionList">
@@ -157,36 +146,68 @@
             <widgets>
                 <decorator-screen name="CommonConfigDecorator">
                     <decorator-section name="body">
-                        <container style="screenlet">
-                            <container style="screenlet-title-bar">
-                                <container style="h3">
-                                    <label text="${uiLabelMap.PageTitleEditConfigOptions}"/>
-                                </container>
-                            </container>
-                            <container style="screenlet-body">
-                                <section>
-                                    <widgets>
-                                        <platform-specific>
-                                            <html>
-                                                <html-template-decorator location="component://product/webapp/catalog/config/EditProductConfigOptions.ftl">
-                                                    <html-template-decorator-section name="CreateConfigOptionForm">
-                                                        <include-form name="CreateConfigOption" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
-                                                    </html-template-decorator-section>
-                                                    <html-template-decorator-section name="CreateConfigProductForm">
-                                                        <include-form name="CreateProductConfigProduct" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
-                                                    </html-template-decorator-section>
-                                                </html-template-decorator>
-                                            </html>
-                                        </platform-specific>
-                                    </widgets>
-                                </section>
-                            </container>
-                        </container>                        
+                        <include-screen name="configOptions"/>
+                        <include-screen name="configComponent"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
         </section>
     </screen>
+    <screen name="configOptions">
+        <section>
+            <widgets>
+                <screenlet title="${uiLabelMap.Config} ${uiLabelMap.Options}">
+                    <include-form name="ProductConfigOptionList" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                </screenlet>
+                <section>
+                    <condition><not><if-empty field="configOptionId"/></not></condition>
+                    <widgets>
+                        <screenlet title="${uiLabelMap.PageTitleEditConfigOptions}">
+                            <link style="buttontext" text="New Config Options" target="EditProductConfigOptions?configItemId=${configItemId}"/>
+                            <include-form name="CreateConfigOption" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.Create} ${uiLabelMap.New} ${uiLabelMap.Config} ${uiLabelMap.Options}">
+                            <include-form name="CreateConfigOption" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="configComponent">
+        <section>
+            <condition>
+                <not>
+                    <if-empty field="configOptionId"/>
+                </not>
+            </condition>
+            <widgets>
+                <screenlet title="${uiLabelMap.ProductComponents} - ${uiLabelMap.CommonId}: ${configOption.configOptionId} - ${configOption.description}">
+                    <include-form name="ProductConfigList" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                </screenlet>
+                <section>
+                    <condition>
+                        <not><if-empty field="productId"/></not>
+                    </condition>
+                    <widgets>
+                        <screenlet title="${uiLabelMap.CommonEdit} ${uiLabelMap.ProductConfigs}">
+                            <link style="buttontext" text="${uiLabelMap.CommonNew} ${uiLabelMap.ProductConfigs}" target="EditProductConfigOptions?configItemId=${configItemId}&amp;configOptionId=${configOptionId}"/>
+                            <include-form name="CreateProductConfigProduct" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                        </screenlet>
+                    </widgets>
+                    <fail-widgets>
+                        <screenlet title="${uiLabelMap.CommonAddA} ${uiLabelMap.ProductConfigs}">
+                            <link style="buttontext" text="${uiLabelMap.CommonNew} ${uiLabelMap.ProductConfigs}" target="EditProductConfigOptions?configItemId=${configItemId}&amp;configOptionId=${configOptionId}"/>
+                            <include-form name="CreateProductConfigProduct" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                        </screenlet>
+                    </fail-widgets>
+                </section>
+            </widgets>
+        </section>
+    </screen>
+    
     <screen name="EditProductConfigItemContent">
         <section>
             <actions>
@@ -237,4 +258,25 @@
             </widgets>
         </section>
     </screen>
+    <screen name="ProductConfigItemArticle">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditProductConfigItemContent"/>
+                <set field="headerItem" value="configs"/>
+                <set field="tabButtonItem" value="ProductConfigItemArticle"/>
+                <set field="labelTitleProperty" value=""/>
+                <set field="configItemId" from-field="parameters.configItemId"/>
+                <entity-one entity-name="ProductConfigItem" value-field="configItem" auto-field-map="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonConfigDecorator">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.Product} ${uiLabelMap.Lists}">
+                            <include-form name="ListProductConfigItem" location="component://product/webapp/catalog/config/ConfigForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/trunk/applications/product/widget/catalog/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/Menus.xml?rev=747025&r1=747024&r2=747025&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/Menus.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/Menus.xml Mon Feb 23 14:11:53 2009
@@ -279,5 +279,8 @@
         <menu-item name="EditProductConfigItemContent" title="${uiLabelMap.ProductContent}">
             <link target="EditProductConfigItemContent?configItemId=${configItemId}"/>
         </menu-item>
+        <menu-item name="ProductConfigItemArticle" title="${uiLabelMap.Product}">
+            <link target="ProductConfigItemArticle?configItemId=${configItemId}"/>
+        </menu-item>
     </menu>
 </menus>
\ No newline at end of file