svn commit: r606697 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/secas.xml servicedef/services.xml widget/TaskScreens.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: r606697 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/secas.xml servicedef/services.xml widget/TaskScreens.xml widget/forms/TaskForms.xml

hansbak-2
Author: hansbak
Date: Mon Dec 24 04:48:07 2007
New Revision: 606697

URL: http://svn.apache.org/viewvc?rev=606697&view=rev
Log:
update task status by seca if all assignments complete and some fault fixing...status on phase and project still not ok...

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.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=606697&r1=606696&r2=606697&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Mon Dec 24 04:48:07 2007
@@ -18,10 +18,27 @@
     under the License.
 -->
 
-<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<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="" short-description=""></simple-method>
+    <simple-method method-name="updateTaskStatus"
+        short-description="Check partyassignements on a task, if all completes set task status to completed and set actual completiondate to now">
+        <entity-and entity-name="WorkEffortPartyAssignment" list-name="assignments" filter-by-date="true">
+            <field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
+        </entity-and>
+        <!-- check if all open assignments were completed -->
+        <iterate entry-name="assignment" list-name="assignments">
+            <if-compare field-name="assignment.statusId" value="PAS_COMPLETED" operator="not-equals">
+                <set field="status" value="notcomplete"/>
+            </if-compare>
+        </iterate>
+        <if-empty field-name="status">
+            <set field="inMap.workEffortId" from-field="parameters.workEffortId"/>
+            <set field="inMap.currentStatusId" value="PTS_COMPLETED"/>
+            <now-timestamp-to-env env-name="inMap.actualCompletionDate"/>
+            <call-service service-name="updateWorkEffort" in-map-name="inMap"/>
+        </if-empty>
+    </simple-method>
     
     <simple-method method-name="scheduleProject" short-description="Project Scheduler sets the planningdates according task requirements and available resources">
         <!--
@@ -792,14 +809,23 @@
         </if-not-empty>
     </simple-method>
     
-    <simple-method method-name="updateMyTaskAssigment" short-description="Update the workEffortPartyAssigment, if required create a new one by re-assigment">
+    <simple-method method-name="updateMyTaskAssigment"
+        short-description="Update my workEffortPartyAssigment, if required create a new one by re-assigment">
         <if-compare-field field-name="parameters.partyId" to-field-name="userLogin.partyId" operator="equals">
-            <if-compare field-name="parameters.statusId" value="PAS_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"/>
+            <!-- check if roleType changed if yes delete old and create new assign-->
+            <if-compare-field field-name="parameters.roleTypeId" operator="not-equals" to-field-name="parameters.oldRoleTypeId">
+                <set-service-fields service-name="deletePartyToWorkEffortAssignment" map-name="parameters" to-map-name="upd"/>
+                <set field="upd.roleTypeId" from-field="parameters.oldRoleTypeId"/>
+                <call-service service-name="deletePartyToWorkEffortAssignment" in-map-name="upd"/>
+                <set-service-fields service-name="assignPartyToWorkEffort" map-name="parameters" to-map-name="upd"/>
+                <clear-field field-name="upd.fromDate"/>
+                <call-service service-name="assignPartyToWorkEffort" in-map-name="upd"/>
+                <else>
+                    <!-- simply update status -->
+                    <set-service-fields service-name="updatePartyToWorkEffortAssignment" map-name="parameters" to-map-name="upd"/>
+                    <call-service service-name="updatePartyToWorkEffortAssignment" in-map-name="upd"/>
+                </else>
+            </if-compare-field>
             <else>
                 <!-- reassignment to other person -->
                 <!-- check if new person is part of the project -->

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/secas.xml?rev=606697&r1=606696&r2=606697&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/secas.xml Mon Dec 24 04:48:07 2007
@@ -20,5 +20,11 @@
 
 <service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
-  
+        
+        <!-- update task status, actual completion date when all assignments complete -->
+        <eca service="updatePartyToWorkEffortAssignment" event="commit">
+                <condition field-name="statusId" operator="equals" value="PAS_COMPLETED"/>
+                <action service="updateTaskStatus" mode="sync"/>
+        </eca>    
+        
 </service-eca>

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=606697&r1=606696&r2=606697&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Mon Dec 24 04:48:07 2007
@@ -22,6 +22,12 @@
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
     <description>Project Manager service definitions.</description>
 
+    <service name="updateTaskStatus" engine="simple"
+        location="org/ofbiz/project/ProjectServices.xml" invoke="updateTaskStatus">
+        <description>Update task status if required</description>
+        <attribute name="workEffortId" type="String" mode="IN"/>
+    </service>
+
     <service name="updateTimeEntryByWorkeffort" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="updateTimeEntryByWorkeffort">
         <description>Update workeffort by workeffort and timesheetId </description>
@@ -135,7 +141,7 @@
         <auto-attributes mode="IN" include="nonpk" optional="true">
             <exclude field-name="statusDateTime"/>
         </auto-attributes>
-        <attribute name="newRoleTypeId" type="String" mode="IN"/>
+        <attribute name="oldRoleTypeId" type="String" mode="IN"/>
     </service>
     
 </services>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml?rev=606697&r1=606696&r2=606697&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml Mon Dec 24 04:48:07 2007
@@ -91,10 +91,15 @@
                 <set field="titleProperty" value="PageTitleMyTask"/>
                 <set field="headerItem" value="mytasks"/>
                 <set field="labelTitleProperty" value="ProjectMgrMyTasks"/>
-                <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>
+                <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"/>
+                    <field-map field-name="statusId" value="PAS_ASSIGNED"/>
+                </entity-and>
+                <entity-and entity-name="WorkEffortAndPartyAssign" list-name="projects" filter-by-date="true">
+                    <field-map field-name="partyId" env-name="userLogin.partyId"/>
+                    <field-map field-name="workEffortTypeId" value="PROJECT"/>
+                </entity-and>
                 <entity-one entity-name="WorkEffort" value-name="task">
                     <field-map field-name="workEffortId" value="dummy"/>
                 </entity-one>
@@ -104,15 +109,30 @@
                 <decorator-screen name="CommonMyTaskDecorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">                                                                                                                
                         <section>                                                        
-                            <widgets>
-                                <container style="screenlet">
-                                    <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleTaskAssignedToMe}</label></container>                                
-                                    <container style="screenlet-body">
-                                        <include-form name="MyTasks" location="component://projectmgr/widget/forms/TaskForms.xml"/>
-                                    </container>
-                                </container>
+                            <widgets>
+                                <container style="screenlet">
+                                    <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleTaskAssignedToMe}</label></container>                                
+                                    <container style="screenlet-body">
+                                        <section>
+                                            <condition>
+                                                <not><if-empty field-name="tasks"/></not>                                        
+                                            </condition>
+                                            <widgets>
+                                                <include-form name="MyTasks" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                            </widgets>
+                                            <fail-widgets>
+                                                <label style="head3" text="Currently no 'open' tasks are assigned to you.&lt;br/&gt; Add an existing or a new task to a project you are member of."></label>
+                                            </fail-widgets>
+                                        </section>
+                                    </container>
+                                </container>
+                                <!--container style="screenlet">
+                                    <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleMemberOfProjects}</label></container>                                
+                                    <container style="screenlet-body">
+                                        <include-form name="ListProjects" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
+                                    </container>
+                                </container-->
                                 <container style="lefthalf">
-                                    
                                 <container style="screenlet">
                                     <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.ProjectMgrAssignATaskToMe}</label></container>                                
                                     <container style="screenlet-body">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=606697&r1=606696&r2=606697&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Mon Dec 24 04:48:07 2007
@@ -212,7 +212,8 @@
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${workEffortName} [${workEffortId}]" target="taskView?workEffortId=${workEffortId}"/>
         </field>
-        <field name="projectName"><display/></field>
+        <field name="projectName" title="${uiLabelMap.CommonStatus}"><display/></field>
+        <field name="currentStatusId" ><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
         <field name="priority"><display/></field>
         <field name="estimatedStartDate" title="${uiLabelMap.WorkEffortEstimatedStartDate}"><display type="date"/></field>
         <field name="estimatedCompletionDate" title="${uiLabelMap.WorkEffortEstimatedCompletionDate}" red-when="before-now"><display type="date"/></field>
@@ -220,10 +221,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"><hidden/></field>
-        <field name="newRoleTypeId" title="${uiLabelMap.PartyRole}">
+        <field name="oldRoleTypeId"><hidden value="${roleTypeId}"/></field>
+        <field name="roleTypeId" title="${uiLabelMap.PartyRole}">
             <drop-down>
-                <entity-options entity-name="RoleType" description="${description}" key-field-name="roleTypeId">
+                <entity-options entity-name="RoleType" description="${description}">
                     <entity-constraint name="parentTypeId" value="PROJECT_TEAM"/>
                     <entity-order-by field-name="description"/>
                 </entity-options>        
@@ -250,12 +251,13 @@
     </form>
     <form name="AddMyTask" type="single" target="addMyTask">
         <field name="partyId"><hidden value="${userLogin.partyId}"/></field>
-        <field name="statusId"><hidden value="PTS_CREATED"/></field>
+        <field name="statusId"><hidden value="PAS_ASSIGNED"/></field>
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}">
             <drop-down>
                 <entity-options entity-name="ProjectPartyAndPhaseAndTask" description="${workEffortName} (${phaseName}-${projectName})">
                     <entity-constraint name="partyId" env-name="userLogin.partyId"/>
-                    <entity-constraint name="workEffortTypeId" value="TASK"/>
+                    <entity-constraint name="workEffortTypeId" value="TASK"/>
+                    <entity-constraint name="currentStatusId" operator="equals" value="PTS_CREATED"/>
                 </entity-options>                
             </drop-down>
         </field>