svn commit: r605812 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ data/ script/org/ofbiz/project/ servicedef/ webapp/projectmgr/WEB-INF/ widget/ widget/forms/

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

svn commit: r605812 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ data/ script/org/ofbiz/project/ servicedef/ webapp/projectmgr/WEB-INF/ widget/ widget/forms/

hansbak-2
Author: hansbak
Date: Wed Dec 19 21:55:37 2007
New Revision: 605812

URL: http://svn.apache.org/viewvc?rev=605812&view=rev
Log:
implemented task (re) assignment functions,(OFBIZ-1515 and added some seed/demo data

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
    ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml
    ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrTypeData.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Wed Dec 19 21:55:37 2007
@@ -57,7 +57,7 @@
 PageTitleProjectInformation=Project Information
 PageTitleRequestList=Request List
 PageTitleTasksAfter=Tasks to be executed after the current task
-PageTitleTaskAssignedToMe=Tasks Assigned to me.
+PageTitleTaskAssignedToMe=Open Tasks Assigned to me.
 PageTitleTasksBefore=Tasks to be executed before the current task
 PageTitleTaskInformation=Task information
 PageTitleUnassignedTask=Unassigned Task

Modified: ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml Wed Dec 19 21:55:37 2007
@@ -24,11 +24,10 @@
     <PartyRole partyId="DemoCustomer" roleTypeId="PROJECT_TEAM"/>
     <PartyRole partyId="admin" roleTypeId="PROJECT_TEAM"/>
 
-    <!-- some skills required. -->
-    <SkillType skillTypeId="9000" description="Computer language Java"/>
     <!-- Demo project, phases and tasks with estimated time-->
     <WorkEffort workEffortId="9000" workEffortTypeId="PROJECT" currentStatusId="CAL_ACCEPTED" lastStatusUpdate="2007-12-14 15:07:52.901" scopeEnumId="WES_PUBLIC" workEffortName="Demo Project" revisionNumber="1"/>
-    <WorkEffortPartyAssignment  workEffortId="9000" partyId="admin" roleTypeId="PROVIDER_MANAGER" fromDate="2007-12-14 16:45:21.831"/>
+    <WorkEffortPartyAssignment  workEffortId="9000" partyId="admin" statusId="PRTYASGN_ASSIGNED" roleTypeId="PROVIDER_MANAGER" fromDate="2007-12-14 16:45:21.831"/>
+    <WorkEffortPartyAssignment  workEffortId="9000" partyId="DemoCustomer" statusId="PRTYASGN_ASSIGNED" roleTypeId="CLIENT_MANAGER" fromDate="2007-12-14 16:45:21.831"/>
     <WorkEffort workEffortId="9001" workEffortTypeId="PHASE" currentStatusId="CAL_ACCEPTED" lastStatusUpdate="2007-12-14 16:45:14.226" workEffortParentId="9000" workEffortName="phase1" revisionNumber="1" />
     <WorkEffort workEffortId="9002" workEffortTypeId="TASK" currentStatusId="CAL_ACCEPTED" lastStatusUpdate="2007-12-14 16:45:21.831" workEffortParentId="9001" scopeEnumId="WES_PUBLIC" workEffortName="task1" estimatedStartDate="2007-12-03 00:00:00.0" estimatedCompletionDate="2007-12-05 00:00:00.0" revisionNumber="1" />
     <WorkEffortSkillStandard workEffortId="9002" skillTypeId="9000" estimatedDuration="16.0"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrTypeData.xml?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrTypeData.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrTypeData.xml Wed Dec 19 21:55:37 2007
@@ -34,4 +34,14 @@
     <WorkEffortType workEffortTypeId="PROJECT_TEMPLATE" parentTypeId="TEMPLATE" description="Project Template"/>
     <WorkEffortType workEffortTypeId="PHASE_TEMPLATE" parentTypeId="TEMPLATE" description="Project Phase Template"/>
     <WorkEffortType workEffortTypeId="TASK_TEMPLATE" parentTypeId="TEMPLATE" description="Project Task Template"/>
+    
+    <!-- some skills required. -->
+    <SkillType skillTypeId="9000" description="Java/BSH"/>
+    <SkillType skillTypeId="9001" description="Mini Language"/>
+    <SkillType skillTypeId="9002" description="HTML/FTL"/>
+    <SkillType skillTypeId="9003" description="Javascript/Dojo"/>
+    <SkillType skillTypeId="9004" description="Screens/forms"/>
+    <SkillType skillTypeId="9005" description="OFBiz Installation"/>
+    <SkillType skillTypeId="_NA_" description="Not Applicable"/>
+    
 </entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Wed Dec 19 21:55:37 2007
@@ -759,5 +759,52 @@
             </else>            
         </if-not-empty>
     </simple-method>
+    <simple-method method-name="updateMyTaskAssigment" short-description="Update the workEffortPartyAssigment, if required create a new one by re-assigment">
+        <log level="always" message="==========party:${parameters.partyId} userloginparty:${userLogin.partyId}"></log>
+        <if-compare-field field-name="parameters.partyId" to-field-name="userLogin.partyId" operator="equals">
+            <if-compare field-name="parameters.statusId" value="CAL_COMPLETED" operator="equals">
+                <now-timestamp-to-env env-name="upd.thruDate"/>
+            </if-compare>
+            <set-service-fields service-name="updatePartyToWorkEffortAssignment" map-name="parameters" to-map-name="upd"/>
+            <set field="upd.roleTypeId" from-field="parameters.newRoleTypeId"/>
+            <call-service service-name="updatePartyToWorkEffortAssignment" in-map-name="upd"/>
+            <else>
+                <!-- reassignment to other person -->
+                <!-- check if new person is part of the project -->
+                <set field="getProjectId.taskId" from-field="parameters.workEffortId"/>
+                <call-service service-name="getProjectIdAndName" in-map-name="getProjectId">
+                    <result-to-field result-name="projectId" field-name="findAssign.workEffortId"/>
+                </call-service>
+                <set field="findAssign.partyId" from-field="parameters.partyId"/>
+                <log level="always" message="====== find new Party:${findAssign}"></log>
+                <find-by-and entity-name="WorkEffortPartyAssignment" map-name="findAssign" list-name="assignments"/>
+                <filter-list-by-date list-name="assignments" to-list-name="validAssignments"/>
+                <set field="findValidAssign.partyId" from-field="parameters.partyId"/>
+                <filter-list-by-and list-name="validAssignments" map-name="findValidAssign" to-list-name="isValid"/>
+                <if-not-empty field-name="isValid">
+                    <!-- person is valid.
+                        so end old entry and .....-->
+                    <set-service-fields service-name="updatePartyToWorkEffortAssignment" map-name="parameters" to-map-name="endAssign"/>
+                    <set field="endAssign.partyId" from-field="userLogin.partyId"/>
+                    <now-timestamp-to-env env-name="endAssign.thruDate"/>
+                    <log level="always" message="==========endAssign, workEffort:${endAssign.workEffortId} "></log>
+                    <call-service service-name="updatePartyToWorkEffortAssignment" in-map-name="endAssign"/>
+                    <!-- ...create new one  -->
+                    <set-service-fields service-name="assignPartyToWorkEffort" map-name="parameters" to-map-name="createAssign"/>
+                    <now-timestamp-to-env env-name="createAssign.fromDate"/>
+                    <set field="createAssign.roleTypeId" from-field="parameters.newRoleTypeId"/>
+                    <set field="statusId" value="PRTYASGN_ASSIGNED"/>
+                    <call-service service-name="assignPartyToWorkEffort" in-map-name="createAssign"/>
+                    <else>
+                        <!-- person Id not valid, issue error and exit -->
+                        <add-error><fail-message message="New party not member of this project"/></add-error>
+                        <return response-code="error"/>
+                    </else>
+                </if-not-empty>
+                
+            </else>
+        </if-compare-field>
+    </simple-method>
+    
 
 </simple-methods>

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Wed Dec 19 21:55:37 2007
@@ -126,5 +126,16 @@
         <attribute name="partyId" type="String" mode="INOUT" optional="true"/>
         <attribute name="taskParties" type="List" mode="OUT" optional="true"/>
     </service>
+
+    <service name="updateMyTaskAssigment" default-entity-name="WorkEffortPartyAssignment" engine="simple"
+        location="org/ofbiz/project/ProjectServices.xml" invoke="updateMyTaskAssigment">
+        <description>Update a WorkEffortPartyAssignment Entity</description>
+        <permission-service service-name="workEffortGenericPermission" main-action="UPDATE"/>
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true">
+            <exclude field-name="statusDateTime"/>
+        </auto-attributes>
+        <attribute name="newRoleTypeId" type="String" mode="IN"/>
+    </service>
     
 </services>

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=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Wed Dec 19 21:55:37 2007
@@ -163,7 +163,7 @@
     </request-map>
     <request-map uri="updateMyTasks">
         <security https="true" auth="true"/>
-        <event type="service" invoke="updatePartyToWorkEffortAssignment"/>
+        <event type="service" invoke="updateMyTaskAssigment"/>
         <response name="success" type="view" value="MyTasks"/>
         <response name="error" type="view" value="MyTasks"/>
     </request-map>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml Wed Dec 19 21:55:37 2007
@@ -90,7 +90,7 @@
                 <set field="titleProperty" value="PageTitleMyTask"/>
                 <set field="headerItem" value="mytasks"/>
                 <set field="labelTitleProperty" value="ProjectMgrMyTasks"/>
-                <entity-and entity-name="WorkEffortAndPartyAssign" list-name="tasks">
+                <entity-and entity-name="WorkEffortAndPartyAssign" list-name="tasks" filter-by-date="true">
                     <field-map field-name="partyId" env-name="userLogin.partyId"/>
                     <field-map field-name="workEffortTypeId" value="TASK"/>
                 </entity-and>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=605812&r1=605811&r2=605812&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Wed Dec 19 21:55:37 2007
@@ -212,9 +212,10 @@
         <field name="actualCompletionDate" title="${uiLabelMap.WorkEffortActualCompletionDate}" red-when="before-now"><display type="date"/></field>
         <field name="plannedHours"><display/></field>
         <field name="actualHours"><display/></field>
-        <field name="roleTypeId">
+        <field name="roleTypeId"><hidden/></field>
+        <field name="newRoleTypeId" title="${uiLabelMap.PartyRole}">
             <drop-down>
-                <entity-options entity-name="RoleType" description="${description}">
+                <entity-options entity-name="RoleType" description="${description}" key-field-name="roleTypeId">
                     <entity-constraint name="parentTypeId" value="PROJECT_TEAM"/>
                     <entity-order-by field-name="description"/>
                 </entity-options>