svn commit: r703046 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml widget/ProjectScreens.xml

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

svn commit: r703046 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml widget/ProjectScreens.xml

hansbak-2
Author: hansbak
Date: Wed Oct  8 19:29:28 2008
New Revision: 703046

URL: http://svn.apache.org/viewvc?rev=703046&view=rev
Log:
fix the resources list on a project overview

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.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=703046&r1=703045&r2=703046&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Wed Oct  8 19:29:28 2008
@@ -661,6 +661,68 @@
         </if-not-empty>
     </simple-method>
     
+    <simple-method method-name="getPartiesByProject" short-description="get Project information" login-required="true">
+        <entity-condition entity-name="ProjectAndPhaseAndTaskParty" list-name="tasks">
+            <condition-list combine="and">
+                <condition-expr field-name="projectId" operator="equals" env-name="parameters.projectId" ignore-if-empty="true"/>
+                <condition-expr field-name="partyId" operator="equals" env-name="parameters.partyId" ignore-if-empty="true"/>
+            </condition-list>
+            <order-by field-name="projectId"/>
+            <order-by field-name="partyId"/>
+        </entity-condition>
+        <entity-condition entity-name="WorkEffortPartyAssignView" list-name="resources">
+            <condition-expr field-name="workEffortId" operator="equals" env-name="parameters.projectId"/>
+            <order-by field-name="roleTypeId"/>
+        </entity-condition>
+        <if-not-empty field="resources">
+            <if-not-empty field="tasks">
+                <iterate entry-name="resource" list-name="resources">
+                    <iterate entry-name="task" list-name="tasks">
+                        <if>
+                            <condition>
+                                <and>
+                                    <not><if-empty field="projectParty"/></not>
+                                    <if-compare-field field="resource.partyId" to-field="projectParty.partyId" operator="not-equals"/>
+                                </and>
+                            </condition>
+                            <then>
+                                <field-to-list field-name="projectParty" list-name="projectParties"/>
+                                <clear-field field-name="projectParty"/>
+                                <clear-field field-name="highInfo"/>
+                            </then>
+                        </if>
+                        <if-empty field="projectParty">
+                            <set field="projectParty.partyId" from-field="resource.partyId"/>
+                            <entity-one entity-name="PartyNameView" value-name="partyNameView">
+                                <field-map field-name="partyId" env-name="resource.partyId"/>
+                            </entity-one>
+                            <if-not-empty field="partyNameView">
+                                <set field="projectParty.partyName" value="${partyNameView.lastName},${partyNameView.firstName}${partyNameView.groupName}"/>
+                            </if-not-empty>
+                            <set field="projectParty.roleTypeId" from-field="resource.roleTypeId"/>
+                            <set field="projectParty.fromDate" from-field="resource.fromDate"/>
+                            <set field="projectParty.thruDate" from-field="resource.thruDate"/>
+                        </if-empty>
+                        <if-compare-field field="task.partyId" operator="equals" to-field="resource.partyId">
+                            <!-- get the planned/actual hours -->
+                            <set field="lowInfo" from-field="task"/>
+                            <set field="parameters.hoursPartyId" from-field="task.partyId"/>
+                            <call-simple-method method-name="getHours"/>
+                            <set field="projectParty.plannedHours" from-field="highInfo.plannedHours"/>                    
+                            <set field="projectParty.actualHours" from-field="highInfo.actualHours"/>                    
+                        </if-compare-field>
+                    </iterate>
+                </iterate>
+                <if-not-empty field="projectParty">
+                    <field-to-list field-name="projectParty" list-name="projectParties"/>
+                </if-not-empty>
+                <if-not-empty field="projectParties">
+                    <field-to-result field-name="projectParties"/>                                                                                      
+                </if-not-empty>
+            </if-not-empty>
+        </if-not-empty>
+    </simple-method>
+    
     <simple-method method-name="getTasksByParties" short-description="get task information by party member" login-required="true">
         <!-- get the list of tasks optionaly selected for a party -->
         <if-empty field="parameters.partyId">

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=703046&r1=703045&r2=703046&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Wed Oct  8 19:29:28 2008
@@ -204,6 +204,15 @@
         <attribute name="projectParties" type="List" mode="OUT" optional="true"/>
     </service>
     
+    <service name="getPartiesByProject" engine="simple"
+        location="org/ofbiz/project/ProjectServices.xml" invoke="getPartiesByProject">
+        <description>Get project information</description>
+        <permission-service service-name="projectMgrPermission" main-action="VIEW"/>        
+        <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
+        <attribute name="partyId" type="String" mode="INOUT" optional="true"/>
+        <attribute name="projectParties" type="List" mode="OUT" optional="true"/>
+    </service>
+    
     <service name="getTasksByParties" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="getTasksByParties">
         <description>Get project information by party</description>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=703046&r1=703045&r2=703046&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml Wed Oct  8 19:29:28 2008
@@ -596,7 +596,7 @@
     <screen name="PartiesInfo">
         <section>
             <actions>
-                <service service-name="getProjectsByParties" result-map-name="result">
+                <service service-name="getPartiesByProject" result-map-name="result">
                     <field-map field-name="projectId" env-name="projectId"/>
                 </service>
                 <set field="parties" from-field="result.projectParties"/>