Author: hansbak
Date: Thu Jun 25 02:33:19 2009 New Revision: 788242 URL: http://svn.apache.org/viewvc?rev=788242&view=rev Log: in request to project assignment use data from last request as default Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy (with props) Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy?rev=788242&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy (added) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy Thu Jun 25 02:33:19 2009 @@ -0,0 +1,39 @@ +/* +/* + * 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.*; + +// get last request from this user and use that project/task assignment as default on the screen + +custRequestList = delegator.findByAnd("CustRequest", ["fromPartyId" : fromPartyId], ["-createdDate"]); +if (custRequestList) { + custReqTaskList = custRequestList.get(0).getRelated("CustRequestWorkEffort"); + if (custReqTaskList) { + custReqTask = custReqTaskList.get(0).getRelatedOne("WorkEffort"); // phase + projectChildWorkEffort = custReqTask.getRelatedOne("ParentWorkEffort"); // phase name + if (projectChildWorkEffort) { + partyList = custReqTask.getRelated("WorkEffortPartyAssignment"); + if (partyList) { + context.childWorkEffortId = projectChildWorkEffort.workEffortId; + context.partyId= partyList.get(0).partyId; + } + } + } +} \ No newline at end of file Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml?rev=788242&r1=788241&r2=788242&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/RequestScreens.xml Thu Jun 25 02:33:19 2009 @@ -60,6 +60,7 @@ <set field="fromPartyId" from-field="communicationEvent.partyIdFrom"/> <set field="statusId" from-field="custRequest.statusId"/> <entity-one entity-name="StatusItem" value-field="currentStatus"/> + <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/getLastRequestAssignment.groovy"/> </actions> <widgets> <decorator-screen name="CommonRequestDecorator" location="${parameters.mainDecoratorLocation}"> |
Free forum by Nabble | Edit this page |