Author: hansbak
Date: Sat Nov 8 14:18:54 2008 New Revision: 712441 URL: http://svn.apache.org/viewvc?rev=712441&view=rev Log: enable the editing of content on a customer request in order and projectmanagent Added: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml (with props) Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml Added: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml?rev=712441&view=auto ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml (added) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml Sat Nov 8 14:18:54 2008 @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. + --> + +<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> + <simple-method method-name="createCustRequestContent" + short-description="Create Customer Request Content" login-required="false"> + <call-class-method class-name="org.ofbiz.content.layout.LayoutWorker" + method-name="uploadImageAndParameters" ret-field-name="formInput"> + <field field-name="request" type="javax.servlet.http.HttpServletRequest"/> + <string value="dataResourceName"/> + </call-class-method> + + <!-- Check input parameters --> + <if> + <condition> + <and> + <if-empty field="formInput.formInput.contentId"/> + <if-empty field="formInput.imageFileName"/> + </and> + </condition> + <then> + <add-error> + <fail-message message="Content Id or Upload file is missing."/> + </add-error> + </then> + </if> + <check-errors/> + + <!-- Create content from Existing content or new upload file --> + <if-empty field="formInput.formInput.contentId"> + <set-service-fields service-name="createContentFromUploadedFile" + map-name="formInput.formInput" to-map-name="inMap"/> + <set field="inMap._uploadedFile_fileName" from-field="formInput.imageFileName"/> + <set field="inMap.uploadedFile" from-field="formInput.imageData"/> + <set field="inMap._uploadedFile_contentType" from-field="formInput.formInput.mimeTypeId"/> + <call-service service-name="createContentFromUploadedFile" in-map-name="inMap"> + <result-to-field result-name="contentId" field-name="context.contentId"/> + </call-service> + <else> + <set field="context.contentId" from-field="formInput.formInput.contentId"/> + </else> + </if-empty> + <set field="context.custRequestId" from-field="formInput.formInput.custRequestId"/> + + <call-map-processor in-map-name="context" out-map-name="custRequestContext"> + <simple-map-processor name="newCustRequestContent"> + <process field="contentId"> + <copy to-field="contentId"/> + </process> + <process field="custRequestId"> + <copy to-field="custRequestId"/> + </process> + <process field="fromDate"> + <copy to-field="fromDate"/> + </process> + </simple-map-processor> + </call-map-processor> + + <!-- Create CustRequestContent --> + <call-service service-name="createCustRequestContent" in-map-name="custRequestContext"> + <result-to-field result-name="contentId" field-name="contentId"/> + </call-service> + </simple-method> +</simple-methods> Propchange: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestEvents.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Sat Nov 8 14:18:54 2008 @@ -460,14 +460,17 @@ <field-to-result field-name="parameters.custRequestId" result-name="custRequestId"/> </simple-method> - <!-- Create/Delete CustRequest Content--> - <simple-method method-name="createCustRequestContent" short-description="Create Customer Request Content"> + <!-- Create/Delete CustRequest Content --> + <simple-method method-name="createCustRequestContent" short-description="Create Work Effort Content"> <make-value entity-name="CustRequestContent" value-name="newEntity"/> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> <set-pk-fields map-name="parameters" value-name="newEntity"/> + <if-empty field="newEntity.fromDate"> - <now-timestamp-to-env env-name="newEntity.fromDate"/> + <now-timestamp-to-env env-name="nowTimestamp"/> + <set field="newEntity.fromDate" from-field="nowTimestamp"/> </if-empty> + <create-value value-name="newEntity"/> </simple-method> <simple-method method-name="deleteCustRequestContent" short-description="Remove a Customer Request Content"> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Sat Nov 8 14:18:54 2008 @@ -1106,14 +1106,14 @@ <request-map uri="createCustRequestContent"> <security auth="true" https="true"/> - <event invoke="createCustRequestContent" path="" type="service"/> + <event path="org/ofbiz/order/request/CustRequestEvents.xml" type="simple" invoke="createCustRequestContent"/> <response name="success" type="request-redirect" value="EditCustRequestContent"/> <response name="error" type="view" value="EditCustRequestContent"/> </request-map> <request-map uri="deleteCustRequestContent"> <security auth="true" https="true"/> - <event invoke="deleteCustRequestContent" path="" type="service"/> + <event invoke="deleteCustRequestContent" type="service"/> <response name="success" type="request-redirect" value="EditCustRequestContent"/> <response name="error" type="view" value="EditCustRequestContent"/> </request-map> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/request/RequestForms.xml Sat Nov 8 14:18:54 2008 @@ -481,26 +481,77 @@ </form> <!--Customer Request Content--> - <form name="AddCustRequestContent" target="createCustRequestContent" title="" type="single" default-map-name="dummy" - header-row-style="header-row" default-table-style="basic-table"> - <auto-fields-service service-name="createCustRequestContent"/> - <field name="custRequestId"><hidden value="${parameters.custRequestId}"/></field> + <form name="AddCustRequestContent" type="upload" default-map-name="content" + focus-field-name="contentId" header-row-style="header-row" default-table-style="basic-table" target="createCustRequestContent?custRequestId=${parameters.custRequestId}"> + <actions> + <set field="custRequestId" from-field="parameters.custRequestId"/> + <entity-one entity-name="StatusItem" value-name="currentStatus" auto-field-map="false"> + <field-map field-name="statusId" env-name="content.statusId"/> + </entity-one> + <entity-one entity-name="DataResource" value-name="dataResource" auto-field-map="false"> + <field-map field-name="dataResourceId" env-name="content.dataResourceId"/> + </entity-one> + </actions> + <field name="custRequestId" map-name="parameters"><hidden/></field> <field name="contentId"> <lookup target-form-name="LookupContent"/> </field> - <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> + <field name="contentTypeId"> + <drop-down allow-empty="false" no-current-selected-key="DOCUMENT"> + <entity-options description="${description}" entity-name="ContentType"/> + </drop-down> + </field> + <field name="statusId" use-when="content==null"> + <drop-down allow-empty="false" no-current-selected-key="CTNT_AVAILABLE"> + <entity-options description="${description}" entity-name="StatusItem" key-field-name="statusId"> + <entity-constraint name="statusTypeId" value="CONTENT_STATUS"/> + <entity-order-by field-name="sequenceId"/> + </entity-options> + </drop-down> + </field> + <field name="statusId" use-when="content!=null"> + <drop-down allow-empty="false" current-description="${currentStatus.description}" no-current-selected-key="CTNT_AVAILABLE"> + <entity-options entity-name="StatusValidChangeToDetail" key-field-name="statusIdTo" description="${transitionName} (${description})"> + <entity-constraint name="statusId" value="${content.statusId}"/> + <entity-order-by field-name="sequenceId"/> + </entity-options> + </drop-down> + </field> + <field name="mimeTypeId" > + <drop-down allow-empty="false"> + <entity-options description="${description}" entity-name="MimeType" key-field-name="mimeTypeId"/> + </drop-down> + </field> + <field name="dataResourceName" title="${uiLabelMap.CommonUpload}*"><file/></field> + <field name="dataCategoryId" use-when="dataResource==null"> + <drop-down allow-empty="false"> + <entity-options description="${categoryName}" entity-name="DataCategory" key-field-name="dataCategoryId"/> + </drop-down> + </field> + <field name="dataCategoryId" use-when="dataResource!=null" parameter-name="dataCategoryId"> + <drop-down allow-empty="false"> + <entity-options description="${categoryName}" entity-name="DataCategory"> + <entity-constraint name="dataCategoryId" value="${dataResource.dataCategoryId}"/> + <entity-order-by field-name="categoryName"/> + </entity-options> + <entity-options description="${categoryName}" entity-name="DataCategory" key-field-name="dataCategoryId"/> + </drop-down> + </field> + <field name="createButton"><submit button-type="button"/></field> </form> - <form name="ListCustRequestContent" type="list" target="updateCustRequestContent" list-name="custRequestContents" paginate-target="EditCustRequestContent" - odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> + <form name="ListCustRequestContent" type="list" list-name="custRequestContents" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <alt-target use-when="tabButtonItem.equals("EditCustRequestContent")" target="EditCustRequestContent"/> + <alt-target use-when="tabButtonItem.equals("ViewRequest")" target="ViewRequest"/> <field name="thruDate"><hidden/></field> <field name="custRequestId"><hidden/></field> <field name="contentId"> <display-entity entity-name="Content" key-field-name="contentId" description="${contentName}" also-hidden="true"> - <sub-hyperlink target="/content/control/editContent?contentId=${contentId}" description="[${contentId}]" link-style="buttontext" target-type="inter-app"/> + <sub-hyperlink target="/content/control/ViewSimpleContent?contentId=${contentId}" description="[${contentId}]" link-style="buttontext" target-type="inter-app"/> </display-entity> </field> <field name="fromDate"><display/></field> - <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> + <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext" use-when="tabButtonItem.equals("EditCustRequestContent")"> <hyperlink also-hidden="false" description="${uiLabelMap.CommonDelete}" target="deleteCustRequestContent?custRequestId=${custRequestId}&contentId=${contentId}&fromDate=${fromDate}"/> </field> </form> Modified: ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml (original) +++ ofbiz/trunk/applications/order/widget/ordermgr/RequestScreens.xml Sat Nov 8 14:18:54 2008 @@ -71,6 +71,9 @@ <field-map field-name="custRequestId" env-name="parameters.custRequestId"/> <order-by field-name="custRequestItemSeqId"/> </entity-and> + <entity-and entity-name="CustRequestContent" list-name="custRequestContents" filter-by-date="true"> + <field-map field-name="custRequestId" env-name="custRequestId"/> + </entity-and> </actions> <widgets> <decorator-screen name="CommonRequestDecorator" location="${parameters.mainDecoratorLocation}"> @@ -97,8 +100,11 @@ <include-form name="ViewRequestCommunicationEvents" location="component://order/webapp/ordermgr/request/RequestForms.xml"/> </screenlet> <screenlet title="${uiLabelMap.WorkEffortWorkEfforts}" navigation-form-name="ViewRequestWorkEfforts"> - <include-form name="ViewRequestWorkEfforts" location="component://mypage/widget/MyPageForms.xml"/> + <include-form name="ViewRequestWorkEfforts" location="component://order/webapp/ordermgr/request/RequestForms.xml"/> </screenlet> + <screenlet title="${uiLabelMap.CommonContent}" navigation-form-name="ListCustRequestContent"> + <include-form name="ListCustRequestContent" location="component://order/webapp/ordermgr/request/RequestForms.xml"/> + </screenlet> </container> </decorator-section> </decorator-screen> @@ -471,6 +477,7 @@ <set field="tabButtonItem" value="custRequestContent"/> <set field="headerItem" value="request"/> <set field="custRequestId" from-field="parameters.custRequestId"/> + <entity-one entity-name="CustRequest" value-name="custRequest"/> <entity-and entity-name="CustRequestContent" list-name="custRequestContents" filter-by-date="true"> <field-map field-name="custRequestId" env-name="custRequestId"/> </entity-and> Modified: ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/controller.xml Sat Nov 8 14:18:54 2008 @@ -269,6 +269,26 @@ <response name="success" type="view" value="EditCommunicationEvent"/> </request-map> + <!-- CustRequest Content --> + <request-map uri="EditCustRequestContent"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditCustRequestContent"/> + </request-map> + + <request-map uri="createCustRequestContent"> + <security auth="true" https="true"/> + <event path="org/ofbiz/order/request/CustRequestEvents.xml" type="simple" invoke="createCustRequestContent"/> + <response name="success" type="request-redirect" value="EditCustRequestContent"/> + <response name="error" type="view" value="EditCustRequestContent"/> + </request-map> + + <request-map uri="deleteCustRequestContent"> + <security auth="true" https="true"/> + <event invoke="deleteCustRequestContent" type="service"/> + <response name="success" type="request-redirect" value="EditCustRequestContent"/> + <response name="error" type="view" value="EditCustRequestContent"/> + </request-map> + <view-map name="main" type="screen" page="component://mypage/widget/CommonScreens.xml#main"/> <view-map name="preferences" type="screen" page="component://mypage/widget/CommonScreens.xml#preferences"/> <view-map name="myTasks" type="screen" page="component://mypage/widget/CommonScreens.xml#MyTasks"/> @@ -285,4 +305,6 @@ <view-map name="custPreferences" type="screen" page="component://mypage/widget/CommonScreens.xml#custPreferences"/> <view-map name="EditCommunicationEvent" type="screen" page="component://mypage/widget/MyPageScreens.xml#EditCommunicationEvent"/> <view-map name="addAttachmentEmail" type="screen" page="component://mypage/widget/MyPageScreens.xml#addAttachmentEmail"/> + <view-map name="EditCustRequestContent" type="screen" page="component://order/widget/ordermgr/RequestScreens.xml#EditCustRequestContent"/> + </site-conf> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml Sat Nov 8 14:18:54 2008 @@ -374,6 +374,9 @@ </condition> <link target="setTaskStatus?workEffortId=${workEffortId}&currentStatusId=PTS_CANCELLED"/> </menu-item> + <menu-item name="custRequestContent" title="Content"> + <link target="EditCustRequestContent?custRequestId=${custRequest.custRequestId}"/> + </menu-item> </menu> <menu name="TimesheetTabBar" menu-container-style="button-bar tab-bar" default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem"> <menu-item name="findtimesheet" title="${uiLabelMap.CommonFind}"> @@ -454,6 +457,16 @@ </condition> <link target="EditRequest?custRequestId=${parameters.custRequestId}"/> </menu-item> + <menu-item name="custRequestContent" title="Content"> + <condition> + <and> + <not><if-empty field-name="custRequest"/></not> + <if-compare field-name="custRequest.statusId" operator="not-equals" value="CRQ_CANCELLED"/> + <if-compare field-name="custRequest.statusId" operator="not-equals" value="CRQ_COMPLETED"/> + </and> + </condition> + <link target="EditCustRequestContent?custRequestId=${custRequest.custRequestId}"/> + </menu-item> </menu> <menu name="TimesheetBar"> <menu-item name="setToComplete" title="${uiLabelMap.CommonStatustoComplete}"> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml?rev=712441&r1=712440&r2=712441&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml Sat Nov 8 14:18:54 2008 @@ -99,6 +99,9 @@ <field-map field-name="custRequestId" env-name="parameters.custRequestId"/> <order-by field-name="custRequestItemSeqId"/> </entity-and> + <entity-and entity-name="CustRequestContent" list-name="custRequestContents" filter-by-date="true"> + <field-map field-name="custRequestId" env-name="custRequestId"/> + </entity-and> </actions> <widgets> <decorator-screen name="CommonRequestDecorator" location="${parameters.mainDecoratorLocation}"> @@ -127,6 +130,9 @@ <screenlet title="${uiLabelMap.WorkEffortWorkEfforts}" navigation-form-name="ViewRequestWorkEfforts"> <include-form name="ViewRequestWorkEfforts" location="component://projectmgr/widget/forms/RequestForms.xml"/> </screenlet> + <screenlet title="${uiLabelMap.CommonContent}" navigation-form-name="ListCustRequestContent"> + <include-form name="ListCustRequestContent" location="component://order/webapp/ordermgr/request/RequestForms.xml"/> + </screenlet> </container> </decorator-section> </decorator-screen> |
Free forum by Nabble | Edit this page |