Author: hansbak
Date: Sun May 29 04:53:15 2011 New Revision: 1128820 URL: http://svn.apache.org/viewvc?rev=1128820&view=rev Log: replace product links with menu widget and show buttons only when applicable Modified: ofbiz/trunk/applications/product/widget/catalog/CatalogMenus.xml ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Modified: ofbiz/trunk/applications/product/widget/catalog/CatalogMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CatalogMenus.xml?rev=1128820&r1=1128819&r2=1128820&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/CatalogMenus.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/CatalogMenus.xml Sun May 29 04:53:15 2011 @@ -478,6 +478,54 @@ under the License. </menu-item> </menu> + <menu name="ProductSubTabBar" menu-container-style="button-bar button-style-2" default-selected-style="selected"> + <menu-item name="EditProduct" title="${uiLabelMap.ProductNewProduct}" widget-style="buttontext create"> + <link target="EditProduct"/> + </menu-item> + <menu-item name="CreateVirtualWithVariantsForm" title="${uiLabelMap.ProductNewVirtualProduct}" widget-style="buttontext create"> + <condition> + <not><if-empty field="product"/></not> + </condition> + <link target="CreateVirtualWithVariantsForm"> + <parameter param-name="product_id" from-field="productId"/> + </link> + </menu-item> + <menu-item name="ProductProductPage" title="${uiLabelMap.ProductProductPage}"> + <condition> + <not><if-empty field="product"/></not> + </condition> + <link target="/ecommerce/control/product" url-mode="inter-app"> + <parameter param-name="product_id" from-field="productId"/> + </link> + </menu-item> + <menu-item name="ProductBarCode" title="${uiLabelMap.ProductProductPage}"> + <condition> + <not><if-empty field="product"/></not> + </condition> + <link target="ProductBarCode.pdf" target-window="_blank"> + <parameter param-name="productId"/> + </link> + </menu-item> + <menu-item name="ExpandAll" title="${uiLabelMap.CommonExpandAll}" widget-style="buttontext expand-all"> + <condition> + <and> + <not><if-empty field="product"/></not> + <if-compare operator="equals" value="EditProduct" field="tabButtonItem"/> + </and> + </condition> + <link target="javascript:expandAll(true);" url-mode="plain"/> + </menu-item> + <menu-item name="CollapseAll" title="${uiLabelMap.CommonCollapseAll}" widget-style="buttontext collapse-all"> + <condition> + <and> + <not><if-empty field="product"/></not> + <if-compare operator="equals" value="EditProduct" field="tabButtonItem"/> + </and> + </condition> + <link target="javascript:expandAll(false);" url-mode="plain"/> + </menu-item> + </menu> + <menu name="ConfigItemTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> <menu-item name="EditProductConfigItem" title="${uiLabelMap.ProductConfigItem}"> <link target="EditProductConfigItem"> Modified: ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml?rev=1128820&r1=1128819&r2=1128820&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml Sun May 29 04:53:15 2011 @@ -80,9 +80,7 @@ under the License. <widgets> <include-menu name="CatalogTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/> <include-menu name="CatalogSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/> - <container> - <label style="h1">${uiLabelMap.ProductCatalog} ${uiLabelMap.CommonFor} "${prodCatalog.catalogName}" [${prodCatalogId}]</label> - </container> + <label style="h1">${uiLabelMap.ProductCatalog} ${uiLabelMap.CommonFor} "${prodCatalog.catalogName}" [${prodCatalogId}]</label> </widgets> <fail-widgets> <section> Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=1128820&r1=1128819&r2=1128820&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Sun May 29 04:53:15 2011 @@ -34,76 +34,49 @@ under the License. </actions> <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="pre-body"> - <section> - <condition> - <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"/> - </widgets> - </section> - </decorator-section> <decorator-section name="left-column"> <include-screen name="leftbar" location="component://product/widget/catalog/CommonScreens.xml"/> </decorator-section> <decorator-section name="body"> <section> - <!-- do check for CATALOG, _VIEW permission --> <condition> - <if-has-permission permission="CATALOG" action="_VIEW"/> + <or> + <if-has-permission permission="CATALOG" action="_ADMIN"/> + <if-has-permission permission="CATALOG" action="_CREATE"/> + <if-has-permission permission="CATALOG" action="_UPDATE"/> + <if-has-permission permission="CATALOG" action="_VIEW"/> + </or> </condition> + <actions> + <set field="productId" from-field="parameters.productId"/> + <entity-one entity-name="Product" value-field="product"/> + </actions> <widgets> <section> <condition> <or> - <not><if-empty field="parameters.bypassIfNoProduct"/></not> - <not><if-empty field="product"/></not> - </or> - </condition> - <widgets> - <container> - <label style="h1">${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}: ${product.internalName} [${uiLabelMap.CommonId}:${productId}] ${${extraFunctionName}}</label> - <image src="${product.smallImageUrl}" height="40" width="40" url-mode="content" alt="${product.internalName}"/> - </container> - - <!-- add Create Product and View Product (in ecommerce) links --> - <container style="button-bar"> - <link target="EditProduct" text="${uiLabelMap.ProductNewProduct}" style="buttontext create"/> - <link target="CreateVirtualWithVariantsForm" text="${uiLabelMap.ProductNewVirtualProduct}" style="buttontext create"/> - <link target="/ecommerce/control/product" url-mode="inter-app" text="${uiLabelMap.ProductProductPage}" style="buttontext"> - <parameter param-name="product_id" from-field="productId"/> - </link> - <link target="ProductBarCode.pdf" target-window="_blank" text="${uiLabelMap.ProductBarcode}" style="buttontext"> - <parameter param-name="productId"/> - </link> - - <link target="javascript:expandAll(true);" text="${uiLabelMap.CommonExpandAll}" style="buttontext expand-all" url-mode="plain"/> - <link target="javascript:expandAll(false);" text="${uiLabelMap.CommonCollapseAll}" style="buttontext collapse-all" url-mode="plain"/> - </container> - </widgets> - </section> - <section> - <condition> - <or> <not><if-empty field="product"/></not> <not><if-empty field="parameters.bypassIfNoProduct"/></not> - <if-empty field="productId"/> </or> </condition> <widgets> - <decorator-section-include name="body"/> + <include-menu name="ProductTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/> + <include-menu name="ProductSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/> + <image src="${product.smallImageUrl}" height="40" width="40" url-mode="content" alt="${product.internalName}"/> + <label style="h1">${uiLabelMap[labelTitleProperty]} ${uiLabelMap.CommonFor}: ${product.internalName} [${uiLabelMap.CommonId}:${productId}] ${${extraFunctionName}}</label> </widgets> <fail-widgets> - <label style="h3">${uiLabelMap.ProductNoExistingProductsFound}</label> + <section> + <condition> + <if-compare operator="not-equals" value="EditProduct" field="tabButtonItem"/> + </condition> + <widgets> + <include-menu name="ProductSubTabBar" location="component://product/widget/catalog/CatalogMenus.xml"/> + </widgets> + </section> </fail-widgets> </section> + <decorator-section-include name="body"/> </widgets> <fail-widgets> <label style="h3">${uiLabelMap.ProductCatalogViewPermissionError}</label> @@ -129,11 +102,6 @@ under the License. </condition> <widgets> <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml"> - <decorator-section name="menu-bar"> - <container style="button-bar"> - <link target="EditProduct" text="${uiLabelMap.ProductNewProduct}" style="buttontext create"/> - </container> - </decorator-section> <decorator-section name="search-options"> <include-form name="FindProduct" location="component://product/widget/catalog/ProductForms.xml"/> </decorator-section> |
Free forum by Nabble | Edit this page |