svn commit: r706853 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.xml script/org/ofbiz/project/ProjectSimpleEvents.xml webapp/projectmgr/WEB-INF/controller.xml widget/forms/TaskForms.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r706853 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ProjectMgrUiLabels.xml script/org/ofbiz/project/ProjectSimpleEvents.xml webapp/projectmgr/WEB-INF/controller.xml widget/forms/TaskForms.xml

hansbak-2
Author: hansbak
Date: Tue Oct 21 21:00:51 2008
New Revision: 706853

URL: http://svn.apache.org/viewvc?rev=706853&view=rev
Log:
make the add request to existing task function working

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml?rev=706853&r1=706852&r2=706853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.xml Tue Oct 21 21:00:51 2008
@@ -789,6 +789,18 @@
         <value xml:lang="fr">Total réel</value>
     <value xml:lang="zh">实际总时间</value>
     </property>
+    <property key="ProjectMgrErrorRequestNotFound">
+        <value xml:lang="en">Customer Request: ${parameters.custRequestId} not found</value>
+    </property>
+    <property key="ProjectMgrErrorRequestStatusWrong">
+        <value xml:lang="en">Customer Request: ${parameters.custRequestId} has the wrong status, should be 'Accepted' but it is ${status.description}</value>
+    </property>
+    <property key="ProjectMgrErrorTaskNotFound">
+        <value xml:lang="en">Task: ${parameters.workEffortId} not found</value>
+    </property>
+    <property key="ProjectMgrErrorTaskStatusWrong">
+        <value xml:lang="en">Task: ${parameters.workEffortId} is not in progress, no request can be added"</value>
+    </property>
     <property key="ProjectMgrPlanHours">
         <value xml:lang="en">Plan Hours</value>
         <value xml:lang="fr">Heures planifiées</value>

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml?rev=706853&r1=706852&r2=706853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml Tue Oct 21 21:00:51 2008
@@ -42,5 +42,30 @@
                 <call-service service-name="assignPartyToWorkEffort" in-map-name="assignParty" />
             </if-not-empty>
         </if-not-empty>    
-    </simple-method>    
+    </simple-method>
+    <simple-method method-name="acceptRequestAndConnectToTask" short-description="Accept a customer request and connect to an existing task">
+        <entity-one entity-name="WorkEffort" value-name="workEffort"/>
+        <if-empty field="workEffort">
+            <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskNotFound"/></add-error>
+        </if-empty>
+        <if-compare field="workEffort.currentStatusId" value="PTS_CREATED" operator="not-equals">
+            <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorTaskStatusWrong"/></add-error>
+        </if-compare>
+        <entity-one entity-name="CustRequest" value-name="custRequest"/>
+        <if-empty field="custRequest">
+            <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorRequestNotFound"/></add-error>
+        </if-empty>
+        <if-compare field="custRequest.statusId" value="CRQ_ACCEPTED" operator="not-equals">
+            <entity-one entity-name="StatusItem" value-name="status">
+                <field-map field-name="statusId" value="custRequest.statusId"/>
+            </entity-one>
+            <add-error><fail-property resource="uiLabelMap" property="ProjectMgrErrorRequestStatusWrong"/></add-error>
+        </if-compare>
+        <check-errors/>
+        <set field="updCust.statusId" value="CRQ_REVIEWED"/>
+        <set field="updCust.custRequestId" from-field="parameters.custRequestId"/>
+        <call-service service-name="updateCustRequest" in-map-name="updCust"/>
+        <set-service-fields service-name="createWorkEffortRequest" map-name="parameters" to-map-name="connectMap"/>
+        <call-service service-name="createWorkEffortRequest" in-map-name="connectMap"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml?rev=706853&r1=706852&r2=706853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Tue Oct 21 21:00:51 2008
@@ -563,6 +563,12 @@
         <response name="success" type="request" value="taskView"/>
         <response name="error" type="view" value="EditTaskFromRequest"/>
     </request-map>
+    <request-map uri="acceptRequestAndConnectToTask">
+        <security https="true" auth="true"/>
+        <event type="simple" invoke="acceptRequestAndConnectToTask" path="org/ofbiz/project/ProjectSimpleEvents.xml"/>
+        <response name="success" type="request" value="taskView"/>
+        <response name="error" type="view" value="EditTaskFromRequest"/>
+    </request-map>
     <request-map uri="newrequest">
         <security https="true" auth="true"/>
         <response name="success" type="view" value="EditRequest"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=706853&r1=706852&r2=706853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Tue Oct 21 21:00:51 2008
@@ -665,12 +665,13 @@
         <field name="estimatedCompletionDate" title="${uiLabelMap.FormFieldTitle_estimatedCompletionDate}"><date-time type="date"/></field>
         <field name="save" title="${uiLabelMap.CommonSave}"><submit/></field>
     </form>                            
-    <form name="CreateCustRequestWorkEffortByExistingTaskForm" type="single" target="createTaskListForms">
-        <field name="custRequestId"><hidden/></field>
+    <form name="CreateCustRequestWorkEffortByExistingTaskForm" type="single" target="acceptRequestAndConnectToTask">
+        <field name="custRequestId"><hidden value="${parameters.custRequestId}"/></field>
         <field name="statusId"><hidden value="CRQ_ACCEPTED"/></field>
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}">
             <drop-down allow-empty="false">
                 <entity-options entity-name="ProjectAndPhaseAndTask" description="${projectName}-${phaseName}-${workEffortName}">
+                    <entity-constraint name="currentStatusId" value="PTS_CREATED"/>
                     <entity-order-by field-name="projectName"/>
                     <entity-order-by field-name="phaseName"/>
                     <entity-order-by field-name="workEffortName"/>