Author: jacopoc
Date: Tue Oct 23 04:20:24 2007 New Revision: 587459 URL: http://svn.apache.org/viewvc?rev=587459&view=rev Log: Added new field (manualOnly = Y/N) to ProductStorePromoAppl entity to specify if the promotion will be used only when manually applied by the user. Implemented ui to manage the new field; in the process, completely refactored the product store promo screen: ftl/bsh-->widgets Removed: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePromos.bsh ofbiz/trunk/applications/product/webapp/catalog/store/EditProductStorePromos.ftl Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties ofbiz/trunk/applications/product/entitydef/entitymodel.xml ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?rev=587459&r1=587458&r2=587459&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Tue Oct 23 04:20:24 2007 @@ -289,7 +289,7 @@ ProductAddPromoRule=Add New Promo Rule ProductAddResultsTo=Add Results To ProductAddRouteSegmentInfo=Add Route Segment Info -ProductAddStorePromo=Add Store Promo (select Store, enter optional From Date) +ProductAddStorePromo=Add Store Promo ProductAddStorePromoOptionalDate=Add Store Promo (select Promo, enter optional From Date) ProductAddFeatureToCategory=new features to this category ProductAddFeature=Add Feature Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=587459&r1=587458&r2=587459&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Tue Oct 23 04:20:24 2007 @@ -3739,6 +3739,12 @@ <field name="fromDate" type="date-time"></field> <field name="thruDate" type="date-time"></field> <field name="sequenceNum" type="numeric"></field> + <field name="manualOnly" type="indicator"> + <description> + If set to Y then the promotion is not automatically evaluated, but only if it + is manually added to the cart. + </description> + </field> <prim-key field="productStoreId"/> <prim-key field="productPromoId"/> <prim-key field="fromDate"/> Modified: ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml?rev=587459&r1=587458&r2=587459&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml (original) +++ ofbiz/trunk/applications/product/webapp/catalog/store/ProductStoreForms.xml Tue Oct 23 04:20:24 2007 @@ -771,4 +771,40 @@ </field> <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> + + <form name="ListProductStorePromos" type="list" list-name="productStorePromoAndAppls" target="updateProductStorePromoAppl"> + <field name="productStoreId"><hidden/></field> + <field name="productPromoId" widget-style="buttontext"> + <hyperlink target="EditProductPromo?productPromoId=${productPromoId}" + description="${productPromoId}" also-hidden="true"/> + </field> + <field name="promoName"><display/></field> + <field name="fromDate"><display/></field> + <field name="thruDate"><date-time/></field> + <field name="sequenceNum"><text/></field> + <field name="manualOnly"> + <drop-down allow-empty="true"> + <option key="Y" description="${uiLabelMap.CommonY}"/> + <option key="N" description="${uiLabelMap.CommonN}"/> + </drop-down> + </field> + <field name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field> + </form> + <form name="CreateProductStorePromo" type="single" target="createProductStorePromoAppl"> + <field name="productStoreId"><hidden/></field> + <field name="productPromoId"> + <drop-down allow-empty="false"> + <entity-options entity-name="ProductPromo" description="[${productPromoId}] ${promoName}"/> + </drop-down> + </field> + <field name="fromDate" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><date-time/></field> + <field name="thruDate"><date-time/></field> + <field name="manualOnly"> + <drop-down> + <option key="N" description="${uiLabelMap.CommonN}"/> + <option key="Y" description="${uiLabelMap.CommonY}"/> + </drop-down> + </field> + <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> </forms> Modified: ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml?rev=587459&r1=587458&r2=587459&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/PromoScreens.xml Tue Oct 23 04:20:24 2007 @@ -88,7 +88,7 @@ <container> <label style="head3">${uiLabelMap.CommonView}</label> <link target="FindProductPromo" text="${uiLabelMap.CommonAll}" style="buttontext"/> - <link target="FindProductPromo?userEntered=Y" text="${uiLabelMap.ProductPromotionManual}" style="buttontext"/> + <link target="FindProductPromo?userEntered=Y" text="${uiLabelMap.CommonUserEnteredOnly}" style="buttontext"/> <link target="FindProductPromo?userEntered=N" text="${uiLabelMap.ProductPromotionImported}" style="buttontext"/> </container> <include-form name="GoToProductPromoCode" location="component://product/webapp/catalog/promo/PromoForms.xml"/> Modified: ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml?rev=587459&r1=587458&r2=587459&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/StoreScreens.xml Tue Oct 23 04:20:24 2007 @@ -100,14 +100,37 @@ <set field="productStoreId" from-field="parameters.productStoreId"/> <entity-one entity-name="ProductStore" value-name="productStore" auto-field-map="true"/> - <script location="component://product/webapp/catalog/WEB-INF/actions/store/EditProductStorePromos.bsh"/> + <set field="userEntered" from-field="parameters.userEntered"/> + <set field="activeOnly" from-field="parameters.activeOnly" default-value="true"/> + <entity-condition entity-name="ProductStorePromoAndAppl" list-name="productStorePromoAndAppls" filter-by-date="${activeOnly}"> + <condition-list combine="and"> + <condition-expr field-name="userEntered" env-name="userEntered" ignore-if-empty="true"/> + <condition-expr field-name="productStoreId" env-name="productStoreId"/> + </condition-list> + <order-by field-name="sequenceNum"/> + <order-by field-name="productPromoId"/> + </entity-condition> </actions> <widgets> <decorator-screen name="CommonProductStoreDecorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://product/webapp/catalog/store/EditProductStorePromos.ftl"/></html> - </platform-specific> + <container> + <label style="head3">${uiLabelMap.CommonView}</label> + <link target="EditProductStorePromos?productStoreId=${productStoreId}" text="${uiLabelMap.CommonAll}" style="buttontext"/> + <link target="EditProductStorePromos?productStoreId=${productStoreId}&userEntered=Y" text="${uiLabelMap.CommonUserEnteredOnly}" style="buttontext"/> + <link target="EditProductStorePromos?productStoreId=${productStoreId}&userEntered=N" text="${uiLabelMap.ProductPromotionImported}" style="buttontext"/> + </container> + <container> + <label style="head3">${uiLabelMap.CommonView} ${uiLabelMap.CommonActiveInactive}</label> + <link target="EditProductStorePromos?productStoreId=${productStoreId}&activeOnly=N" text="${uiLabelMap.CommonAll}" style="buttontext"/> + <link target="EditProductStorePromos?productStoreId=${productStoreId}&activeOnly=N&userEntered=Y" text="${uiLabelMap.CommonUserEnteredOnly}" style="buttontext"/> + <link target="EditProductStorePromos?productStoreId=${productStoreId}&activeOnly=N&userEntered=N" text="${uiLabelMap.ProductPromotionImported}" style="buttontext"/> + </container> + <include-form name="ListProductStorePromos" location="component://product/webapp/catalog/store/ProductStoreForms.xml"/> + <container> + <label style="head2">${uiLabelMap.ProductAddStorePromo}</label> + </container> + <include-form name="CreateProductStorePromo" location="component://product/webapp/catalog/store/ProductStoreForms.xml"/> </decorator-section> </decorator-screen> </widgets> |
Free forum by Nabble | Edit this page |