Author: jacopoc
Date: Fri Aug 7 12:12:31 2009 New Revision: 801963 URL: http://svn.apache.org/viewvc?rev=801963&view=rev Log: Added support for content management for Production Runs. Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy (with props) Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml ofbiz/trunk/applications/manufacturing/widget/manufacturing/Menus.xml Added: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy?rev=801963&view=auto ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy (added) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy Fri Aug 7 12:12:31 2009 @@ -0,0 +1,44 @@ +/* + * 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.content.content.ContentWorker; +import org.ofbiz.entity.util.EntityUtil; + +productionRunId = parameters.productionRunId ?: parameters.workEffortId; +context.productionRunId = productionRunId; + +delivGoodStandard = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findByAnd("WorkEffortGoodStandard", [workEffortId : productionRunId, workEffortGoodStdTypeId : "PRUN_PROD_DELIV"], ["-fromDate"]))); +if (delivGoodStandard) { + context.delivProductId = delivGoodStandard.productId; +} +if (context.delivProductId && (parameters.partyId || parameters.contentLocale)) { + delivProductContents = EntityUtil.filterByDate(delegator.findByAnd("ProductContentAndInfo", [productId : context.delivProductId], ["-fromDate"])); + context.delivProductContents = delivProductContents; + + Locale contentLocale = null; + if (parameters.contentLocale) { + contentLocale = new Locale(parameters.contentLocale); + } + delivProductContentsForLocaleAndUser = []; + delivProductContents.each { delivProductContent -> + GenericValue content = ContentWorker.findContentForRendering(delegator, delivProductContent.contentId, contentLocale, parameters.partyId, parameters.roleTypeId, true); + delivProductContentsForLocaleAndUser.add(EntityUtil.getFirst(delegator.findByAnd("ContentDataResourceView", [contentId : content.contentId]))); + } + context.delivProductContentsForLocaleAndUser = delivProductContentsForLocaleAndUser; +} Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml?rev=801963&r1=801962&r2=801963&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml Fri Aug 7 12:12:31 2009 @@ -63,6 +63,10 @@ </request-map> <!-- Lookup request mappings --> + <request-map uri="LookupCustomerName"> + <security auth="true" https="true"/> + <response name="success" type="view" value="LookupCustomerName"/> + </request-map> <request-map uri="LookupRouting"> <security https="true" auth="true"/> <response name="success" type="view" value="LookupRouting"/> @@ -564,6 +568,10 @@ <response name="success" type="view" value="ProductionRunActualComponents"/> <response name="error" type="view" value="ProductionRunActualComponents"/> </request-map> + <request-map uri="ProductionRunContent"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ProductionRunContent"/> + </request-map> <request-map uri="ProductionRunAssocs"> <security https="true" auth="true"/> <response name="success" type="view" value="ProductionRunAssocs"/> @@ -623,6 +631,18 @@ <response name="success" type="view" value="ProductionRunDeclaration"/> <response name="error" type="view" value="ProductionRunDeclaration"/> </request-map> + <request-map uri="createProductionRunContents"> + <security https="true" auth="true"/> + <event type="service-multi" invoke="createWorkEffortContent"/> + <response name="success" type="view" value="ProductionRunContent"/> + <response name="error" type="view" value="ProductionRunContent"/> + </request-map> + <request-map uri="deleteProductionRunContent"> + <security https="true" auth="true"/> + <event type="service" invoke="deleteWorkEffortContent"/> + <response name="success" type="view" value="ProductionRunContent"/> + <response name="error" type="view" value="ProductionRunContent"/> + </request-map> <request-map uri="quickRunProductionRunTask"> <security https="true" auth="true"/> <event type="service" invoke="quickRunProductionRunTask"/> @@ -763,6 +783,7 @@ <view-map name="EditRoutingProductLink" page="component://manufacturing/widget/manufacturing/RoutingScreens.xml#EditRoutingProductLink" type="screen"/> <view-map name="EditRoutingTaskFixedAssets" page="component://manufacturing/widget/manufacturing/RoutingScreens.xml#EditRoutingTaskFixedAssets" type="screen"/> <!-- Lookup view mappings --> + <view-map name="LookupCustomerName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupCustomerName"/> <view-map name="LookupProduct" page="component://product/widget/catalog/LookupScreens.xml#LookupProduct" type="screen"/> <view-map name="LookupVariantProduct" page="component://product/widget/catalog/LookupScreens.xml#LookupVariantProduct" type="screen"/> <view-map name="LookupVirtualProduct" page="component://product/widget/catalog/LookupScreens.xml#LookupVirtualProduct" type="screen"/> @@ -796,6 +817,7 @@ <view-map name="ProductionRunComponents" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunComponents" type="screen"/> <view-map name="ProductionRunActualComponents" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunActualComponents" type="screen"/> <view-map name="ProductionRunFixedAssets" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunFixedAssets" type="screen"/> + <view-map name="ProductionRunContent" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunContent" type="screen"/> <view-map name="ProductionRunAssocs" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#ProductionRunAssocs" type="screen"/> <view-map name="WorkWithShipmentPlans" page="component://manufacturing/widget/manufacturing/JobshopScreens.xml#WorkWithShipmentPlans" type="screen"/> Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml?rev=801963&r1=801962&r2=801963&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml Fri Aug 7 12:12:31 2009 @@ -527,6 +527,87 @@ </hyperlink> </field> </form> + <form name="FindDelivProductContent" type="single" target="ProductionRunContent"> + <field name="productionRunId"><hidden/></field> + <field name="productId" entry-name="delivProductId"> + <display/> + </field> + <field name="contentLocale"> + <text default-value="${locale}"/> + </field> + <field name="partyId"> + <lookup target-form-name="LookupCustomerName"/> + </field> + <field name="roleTypeId"> + <hidden value="CONTENT_USER"/> + </field> + <field name="submitButton" title="${uiLabelMap.CommonFind}"> + <submit button-type="button"/> + </field> + </form> + <form name="ListProductionRunContent" type="list" title="" list-name="productionRunContents"> + <actions> + <entity-and entity-name="WorkEffortContentAndInfo" list="productionRunContents"> + <field-map field-name="workEffortId" from-field="productionRunId"/> + </entity-and> + </actions> + <field name="workEffortId"><hidden/></field> + <field name="contentId"><display/></field> + <field name="drDataResourceId"><display/></field> + <field name="workEffortContentTypeId"><display-entity entity-name="WorkEffortContentType" description="${description}"/></field> + <field name="contentTypeId"><display-entity entity-name="ContentType" description="${description}"/></field> + <field name="contentName"><display/></field> + <field name="description"><display/></field> + <field name="localeString"><display/></field> + <field name="description"><display/></field> + <field name="drMimeTypeId"><display/></field> + <field name="drObjectInfo" title="${uiLabelMap.CommonContent}"> + <display description="default ${drObjectInfo}"/> + </field> + <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" use-when="${groovy: drDataResourceTypeId != null && (drDataResourceTypeId.contains("FILE") || drDataResourceTypeId.equals("IMAGE_OBJECT"))}"> + <hyperlink target="/content/control/ViewBinaryDataResource" target-type="content" target-window="productionRunContentWindow" description="${drObjectInfo}"> + <parameter param-name="dataResourceId" from-field="drDataResourceId"/> + </hyperlink> + </field> + <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" entry-name="drDataResourceId" encode-output="true" use-when="${groovy: drDataResourceTypeId != null && drDataResourceTypeId.equals("ELECTRONIC_TEXT")}"> + <display-entity entity-name="ElectronicText" key-field-name="dataResourceId" description="${textData}"></display-entity> + </field> + <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="smallSubmit"> + <hyperlink description="${uiLabelMap.CommonDelete}" also-hidden="false" target="deleteProductionRunContent"> + <parameter param-name="workEffortId"/> + <parameter param-name="workEffortContentTypeId"/> + <parameter param-name="contentId"/> + <parameter param-name="fromDate"/> + <parameter param-name="productionRunId" from-field="productionRunId"/> + </hyperlink> + </field> + </form> + <form name="ListDelivProductContent" type="multi" use-row-submit="true" target="createProductionRunContents?productionRunId=${productionRunId}" title="" list-name="delivProductContentsForLocaleAndUser"> + <field name="productionRunId"><hidden/></field> + <field name="workEffortId" entry-name="productionRunId"><hidden/></field> + <field name="contentId"><display/></field> + <field name="drDataResourceId"><display/></field> + <field name="contentTypeId"><display-entity entity-name="ContentType" description="${description}"/></field> + <field name="contentName"><display/></field> + <field name="description"><display/></field> + <field name="localeString"><display/></field> + <field name="description"><display/></field> + <field name="drMimeTypeId"><display/></field> + <field name="drObjectInfo" title="${uiLabelMap.CommonContent}"> + <display description="default ${drObjectInfo}"/> + </field> + <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" use-when="${groovy: drDataResourceTypeId != null && (drDataResourceTypeId.contains("FILE") || drDataResourceTypeId.equals("IMAGE_OBJECT"))}"> + <hyperlink target="/content/control/ViewBinaryDataResource" target-type="content" target-window="productionRunContentWindow" description="${drObjectInfo}"> + <parameter param-name="dataResourceId" from-field="drDataResourceId"/> + </hyperlink> + </field> + <field name="drObjectInfo" title="${uiLabelMap.CommonContent}" entry-name="drDataResourceId" encode-output="true" use-when="${groovy: drDataResourceTypeId != null && drDataResourceTypeId.equals("ELECTRONIC_TEXT")}"> + <display-entity entity-name="ElectronicText" key-field-name="dataResourceId" description="${textData}"></display-entity> + </field> + <field name="workEffortContentTypeId"><drop-down><entity-options description="${description}" entity-name="WorkEffortContentType"></entity-options></drop-down></field> + <field name="_rowSubmit" title="${uiLabelMap.CommonSelected}"><check/></field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}"><submit/></field> + </form> <form name="ProductionRunTaskFixedAssets" type="list" target="updateWorkEffortFixedAssetAssign" paginate-target="" title="" list-name="records" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <auto-fields-entity entity-name="WorkEffortFixedAssetAssign" default-field-type="edit"/> @@ -552,7 +633,7 @@ <parameter param-name="workEffortId"/> <parameter param-name="fixedAssetId"/> <parameter param-name="fromDate"/> - <parameter param-name="productionRunId" from-field="productionRunId}"/> + <parameter param-name="productionRunId" from-field="productionRunId"/> </hyperlink> </field> </form> Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml?rev=801963&r1=801962&r2=801963&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Fri Aug 7 12:12:31 2009 @@ -725,6 +725,47 @@ </widgets> </section> </screen> + <screen name="ProductionRunContent"> + <section> + <actions> + <set field="titleProperty" value="ManufacturingProductionRunContent"/> + <set field="tabButtonItem" value="content"/> + <set field="headerItem" value="jobshop"/> + + <set field="productionRunId" from-field="parameters.productionRunId"/> + <entity-one entity-name="WorkEffort" value-field="productionRun"> + <field-map field-name="workEffortId" from-field="productionRunId"/> + </entity-one> + <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunContent.groovy"/> + </actions> + <widgets> + <decorator-screen name="CommonJobshopDecorator" location="${parameters.commonJobshopDecorator}"> + <decorator-section name="body"> + <section> + <widgets> + <include-form name="ListProductionRunContent" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/> + <container style="screenlet"> + <container style="screenlet-title-bar"> + <container style="h3"> + <label text="Import Content From Product ${delivProductId}"/> + </container> + </container> + <container style="screenlet-body"> + <section> + <widgets> + <include-form name="FindDelivProductContent" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/> + <include-form name="ListDelivProductContent" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/> + </widgets> + </section> + </container> + </container> + </widgets> + </section> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> <screen name="FindProductionRun"> <section> <actions> Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/Menus.xml?rev=801963&r1=801962&r2=801963&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/Menus.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/Menus.xml Fri Aug 7 12:12:31 2009 @@ -170,6 +170,11 @@ <parameter param-name="productionRunId"/> </link> </menu-item> + <menu-item name="content" title="${uiLabelMap.CommonContent}"> + <link target="ProductionRunContent"> + <parameter param-name="productionRunId"/> + </link> + </menu-item> <menu-item name="costs" title="${uiLabelMap.ManufacturingActualCosts}"> <link target="ProductionRunCosts"> <parameter param-name="productionRunId"/> |
Free forum by Nabble | Edit this page |