svn commit: r789037 - in /ofbiz/trunk: applications/commonext/script/org/ofbiz/SystemInfoServices.xml specialpurpose/projectmgr/data/ProjectMgrDemoData.xml specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml

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

svn commit: r789037 - in /ofbiz/trunk: applications/commonext/script/org/ofbiz/SystemInfoServices.xml specialpurpose/projectmgr/data/ProjectMgrDemoData.xml specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml

hansbak-2
Author: hansbak
Date: Sun Jun 28 03:00:53 2009
New Revision: 789037

URL: http://svn.apache.org/viewvc?rev=789037&view=rev
Log:
Improve the systeminfo note on a task assignement

Modified:
    ofbiz/trunk/applications/commonext/script/org/ofbiz/SystemInfoServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml

Modified: ofbiz/trunk/applications/commonext/script/org/ofbiz/SystemInfoServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/script/org/ofbiz/SystemInfoServices.xml?rev=789037&r1=789036&r2=789037&view=diff
==============================================================================
--- ofbiz/trunk/applications/commonext/script/org/ofbiz/SystemInfoServices.xml (original)
+++ ofbiz/trunk/applications/commonext/script/org/ofbiz/SystemInfoServices.xml Sun Jun 28 03:00:53 2009
@@ -75,29 +75,35 @@
                 </iterate>
             </if-not-empty>
         </if-compare>
+        
         <!-- new task assignments for the logged on user -->
         <if-compare field="parameters.entityName" value="WorkEffortPartyAssignment" operator="equals">
-            <call-simple-method method-name="getPortletAttributeMap"/>
-            <if-compare field="haveUserLogin" value="true" operator="equals">
-                <if-compare field="attributeMap.taskAssignment" value="Y" operator="not-equals">
-                    <entity-and entity-name="WorkEffortPartyAssignment" list="assigns" filter-by-date="true">
-                        <field-map field-name="workEffortId" from-field="parameters.entityNameId"/>
-                        <order-by field-name="-fromDate"/>
-                    </entity-and>
-                    <first-from-list entry="assign" list="assigns"/>
-                    <get-related-one value-field="assign" relation-name="WorkEffort" to-value-field="workEffort"/>
-                    <make-value value-field="noteData" entity-name="NoteData"/>
-                    <now-timestamp field="noteData.noteDateTime"/>
-                    <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
-                    <set field="noteData.noteParty" from-field="assign.partyId"/>
-                    <set field="noteData.noteName" value="SYSTEMNOTE"/>
-                    <set field="noteData.noteInfo" value="New task assignment '${workEffort.workEffortName}' [${workEffort.workEffortId}]"/>
-                    <set field="noteData.moreInfoPortletId" value="ViewProjectTask"/>
-                    <set field="noteData.moreInfoItemId" from-field="workEffort.workEffortId"/>
-                    <create-value value-field="noteData"/>
+            <entity-one entity-name="WorkEffort" value-field="workEffort">
+                <field-map field-name="workEffortId" from-field="parameters.entityNameId"/>
+            </entity-one>
+            <if-compare field="workEffort.workEffortTypeId" value="TASK" operator="equals">
+                <call-simple-method method-name="getPortletAttributeMap"/>
+                <if-compare field="haveUserLogin" value="true" operator="equals">
+                    <if-compare field="attributeMap.taskAssignment" value="Y" operator="not-equals">
+                        <entity-and entity-name="WorkEffortPartyAssignment" list="assigns" filter-by-date="true">
+                            <field-map field-name="workEffortId" from-field="parameters.entityNameId"/>
+                            <order-by field-name="-fromDate"/>
+                        </entity-and>
+                        <first-from-list entry="assign" list="assigns"/>
+                        <make-value value-field="noteData" entity-name="NoteData"/>
+                        <now-timestamp field="noteData.noteDateTime"/>
+                        <sequenced-id sequence-name="NoteData" field="noteData.noteId"/>
+                        <set field="noteData.noteParty" from-field="assign.partyId"/>
+                        <set field="noteData.noteName" value="SYSTEMNOTE"/>
+                        <set field="noteData.noteInfo" value="New task assignment '${workEffort.workEffortName}' [${workEffort.workEffortId}]"/>
+                        <set field="noteData.moreInfoPortletId" value="ViewProjectTask"/>
+                        <set field="noteData.moreInfoItemId" from-field="workEffort.workEffortId"/>
+                        <create-value value-field="noteData"/>
+                    </if-compare>
                 </if-compare>
             </if-compare>
         </if-compare>
+        
         <!-- Create a system info note to all customer request participants if a note was added to the customer request
             the originator of the customer request will get already a email so does not need to be notified-->
         <if-compare field="parameters.entityName" value="CustRequestItemNote" operator="equals">

Modified: ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml?rev=789037&r1=789036&r2=789037&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml Sun Jun 28 03:00:53 2009
@@ -112,6 +112,7 @@
     <WorkEffort workEffortId="9002" workEffortTypeId="TASK" currentStatusId="PTS_CREATED" lastStatusUpdate="2007-12-14 16:45:21.831" workEffortParentId="9001" scopeEnumId="WES_PRIVATE" 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"/>
     <WorkEffort workEffortId="9003" workEffortTypeId="TASK" currentStatusId="PTS_CREATED" lastStatusUpdate="2007-12-14 16:45:29.453" workEffortParentId="9001" scopeEnumId="WES_PRIVATE" workEffortName="task2" estimatedStartDate="2007-12-05 00:00:00.0" estimatedCompletionDate="2007-12-16 00:00:00.0" revisionNumber="1"/>
+    <WorkEffortPartyAssignment  workEffortId="9002" partyId="admin" statusId="PAS_ASSIGNED" roleTypeId="PROVIDER_MANAGER" fromDate="2007-12-14 16:45:21.831"/>
     <WorkEffortSkillStandard workEffortId="9003" skillTypeId="9000" estimatedDuration="24.0"/>
     <WorkEffort workEffortId="9004" workEffortTypeId="PHASE" currentStatusId="_NA_" lastStatusUpdate="2007-12-14 16:45:35.939" workEffortParentId="9000" workEffortName="phase2" revisionNumber="1"/>
     <WorkEffort workEffortId="9005" workEffortTypeId="TASK" currentStatusId="PTS_CREATED" lastStatusUpdate="2007-12-14 16:45:50.84" workEffortParentId="9004" scopeEnumId="WES_PRIVATE" workEffortName="task3" estimatedStartDate="2007-12-16 00:00:00.0" estimatedCompletionDate="2007-12-17 00:00:00.0" revisionNumber="1"/>

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=789037&r1=789036&r2=789037&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Sun Jun 28 03:00:53 2009
@@ -479,7 +479,7 @@
                 <return/>
             </if-empty>
         </if-empty>
-        <if-not-empty field="parameters.taskId">
+        <if-not-empty field="parameters.taskId"><!-- taskId is provided -->
             <entity-one entity-name="WorkEffort" value-field="task">
                 <field-map field-name="workEffortId" from-field="parameters.taskId"/>
             </entity-one>
@@ -489,19 +489,22 @@
                     <return/>
                 </else>
             </if-not-empty>
-            <else>
+            <else><!-- phaseId is provided -->
                 <entity-one entity-name="WorkEffort" value-field="phase">
                     <field-map field-name="workEffortId" from-field="parameters.phaseId"/>
                 </entity-one>
             </else>
         </if-not-empty>
-        <get-related-one value-field="phase" relation-name="ParentWorkEffort" to-value-field="project"/>
-        <field-to-result field="project.workEffortId" result-name="projectId"/>
-        <field-to-result field="project.workEffortName" result-name="projectName"/>
-        <field-to-result field="phase.workEffortId" result-name="phaseId"/>
-        <field-to-result field="phase.workEffortName" result-name="phaseName"/>
-        <field-to-result field="task.workEffortId" result-name="taskId"/>
-        <field-to-result field="task.workEffortName" result-name="taskName"/>
+        <!-- get project info -->
+        <if-not-empty field="phase">
+            <get-related-one value-field="phase" relation-name="ParentWorkEffort" to-value-field="project"/>
+            <field-to-result field="project.workEffortId" result-name="projectId"/>
+            <field-to-result field="project.workEffortName" result-name="projectName"/>
+            <field-to-result field="phase.workEffortId" result-name="phaseId"/>
+            <field-to-result field="phase.workEffortName" result-name="phaseName"/>
+            <field-to-result field="task.workEffortId" result-name="taskId"/>
+            <field-to-result field="task.workEffortName" result-name="taskName"/>
+        </if-not-empty>
     </simple-method>
 
     <simple-method method-name="copyProjectToTemplate" short-description="copy a project to a workeffortType starting with 'template'">