Author: hansbak
Date: Mon Jan 5 22:07:46 2009 New Revision: 731841 URL: http://svn.apache.org/viewvc?rev=731841&view=rev Log: improove the bomlist find screen Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy (with props) Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/BomForms.xml ofbiz/trunk/applications/manufacturing/widget/manufacturing/BomScreens.xml ofbiz/trunk/applications/product/entitydef/entitymodel.xml Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy?rev=731841&view=auto ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy (added) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy Mon Jan 5 22:07:46 2009 @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.util.*; +import org.ofbiz.entity.condition.*; +import javolution.util.FastList; +import javolution.util.FastSet; +import javolution.util.FastMap; + +if (!parameters.productId && !parameters.productIdTo && !parameters.productAssocTypeId) { + cond = EntityCondition.makeCondition([EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "ENGINEER_COMPONENT"), + EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "MANUF_COMPONENT") + ], EntityOperator.OR); + findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); + fieldToSelect = UtilMisc.toSet("productId","internalName","productAssocTypeId"); + bomListIterator = delegator.find("ProductAndAssoc", cond, null, fieldToSelect, null, findOpts); +} else { + condList = []; + if (parameters.productId) { + cond = EntityCondition.makeCondition("productId", EntityOperator.EQUALS, parameters.productId); + condList.add(cond); + } + if (parameters.productIdTo) { + cond = EntityCondition.makeCondition("productIdTo", EntityOperator.EQUALS, parameters.productIdTo); + condList.add(cond); + } + if (parameters.productAssocTypeId) { + cond = EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, parameters.productAssocTypeId); + condList.add(cond); + }else { + cond = EntityCondition.makeCondition([EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "ENGINEER_COMPONENT"), + EntityCondition.makeCondition("productAssocTypeId", EntityOperator.EQUALS, "MANUF_COMPONENT") + ], EntityOperator.OR); + condList.add(cond); + } + cond = EntityCondition.makeCondition(condList, EntityOperator.AND); + findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); + fieldToSelect = UtilMisc.toSet("productId","internalName","productAssocTypeId"); + bomListIterator = delegator.find("ProductAndAssoc", cond, null, fieldToSelect, null, findOpts); +} +context.ListProductBom = bomListIterator; \ No newline at end of file Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/BomForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/BomForms.xml?rev=731841&r1=731840&r2=731841&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/BomForms.xml (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/bom/BomForms.xml Mon Jan 5 22:07:46 2009 @@ -132,29 +132,18 @@ <option key="ENGINEER_COMPONENT" description="Engineering Bill of Materials"/> </drop-down> </field> - <field name="fromDate"><date-find/></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="submit" title="${uiLabelMap.CommonFind}"><submit/></field> </form> - <form name="ListBom" type="list" list-name="listIt" odd-row-style="alternate-row" default-table-style="basic-table hover-bar" paginate-target="FindBom"> - <actions> - <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> - <field-map field-name="inputFields" env-name="parameters"/> - <field-map field-name="entityName" value="ProductAssoc"/> - <field-map field-name="orderBy" value="productId"/> - </service> - </actions> - <field name="productId" title="${uiLabelMap.ProductProductId}"> + <form name="ListBom" type="list" list-name="ListProductBom" odd-row-style="alternate-row" + default-table-style="basic-table hover-bar" paginate-target="FindBom"> + <field name="productId" title="${uiLabelMap.ProductProductId}" use-when=""> <hyperlink target="EditProductBom?productId=${productId}&productAssocTypeId=${productAssocTypeId}" description="${productId}"/> </field> - <field name="productIdTo" title="${uiLabelMap.ProductProductIdTo}"> - <hyperlink target="EditProductBom?productId=${productIdTo}&productAssocTypeId=${productAssocTypeId}" description="${productIdTo}"/> - </field> + <field name="internalName" title="${uiLabelMap.ProductProductName}"><display/></field> <field name="productAssocTypeId" title="${uiLabelMap.ManufacturingBomType}"> <display-entity entity-name="ProductAssocType" key-field-name="productAssocTypeId" description="${description}"/> </field> - <field name="quantity" title="${uiLabelMap.CommonQuantity}"><display/></field> - <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display type="date"/></field> </form> <form name="CreateProductBom" target="createProductBom" title="" type="single" header-row-style="header-row" default-table-style="basic-table"> Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/BomScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/BomScreens.xml?rev=731841&r1=731840&r2=731841&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/BomScreens.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/BomScreens.xml Mon Jan 5 22:07:46 2009 @@ -151,6 +151,7 @@ <set field="tabButtonItem" value="findBom"/> <set field="labelTitleProperty" value="findBom"/> <set field="headerItem" value="bom"/> + <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/bom/FindProductBom.groovy"/> </actions> <widgets> <decorator-screen name="CommonBomDecorator"> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?rev=731841&r1=731840&r2=731841&view=diff ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Mon Jan 5 22:07:46 2009 @@ -2591,6 +2591,21 @@ <key-map field-name="recurrenceInfoId"/> </relation> </entity> + <view-entity entity-name="ProductAndAssoc" + package-name="org.ofbiz.product.product" + title="Product and ProductAssoc View Entity"> + <member-entity entity-alias="PD" entity-name="Product"/> + <member-entity entity-alias="PDA" entity-name="ProductAssoc"/> + <alias name="productId" entity-alias="PD" field="productId"/> + <alias name="internalName" entity-alias="PD" field="internalName"/> + <alias name="productIdTo" entity-alias="PDA" field="productIdTo"/> + <alias name="productAssocTypeId" entity-alias="PDA" field="productAssocTypeId"/> + <alias name="quantity" entity-alias="PDA" field="quantity"/> + <alias name="fromDate" entity-alias="PDA" field="fromDate"/> + <view-link entity-alias="PD" rel-entity-alias="PDA"> + <key-map field-name="productId"/> + </view-link> + </view-entity> <entity entity-name="ProductAssocType" package-name="org.ofbiz.product.product" default-resource-name="ProductEntityLabels" |
Free forum by Nabble | Edit this page |