svn commit: r613773 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml webapp/projectmgr/WEB-INF/actions/FindProject.bsh

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

svn commit: r613773 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml webapp/projectmgr/WEB-INF/actions/FindProject.bsh

hansbak-2
Author: hansbak
Date: Sun Jan 20 22:34:24 2008
New Revision: 613773

URL: http://svn.apache.org/viewvc?rev=613773&view=rev
Log:
fix copyproject to work with new security

Modified:
    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/actions/FindProject.bsh

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=613773&r1=613772&r2=613773&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Sun Jan 20 22:34:24 2008
@@ -336,25 +336,27 @@
             </else>
         </if-not-empty>
         <if-not-empty field-name="toTemplate">
-            <set field="newProject.workEffortTypeId" value="PROJECT_TEMPLATE"/>
+            <set field="parameters.workEffortTypeId" value="PROJECT_TEMPLATE"/>
             <else>
-                <set field="newProject.workEffortTypeId" value="PROJECT"/>
+                <set field="parameters.workEffortTypeId" value="PROJECT"/>
             </else>            
         </if-not-empty>
-        <set field="newProject.currentStatusId" value="_NA_"/>            
-        <call-service service-name="createWorkEffort" in-map-name="newProject">
-            <result-to-field result-name="workEffortId" field-name="newProjectId"/>
-        </call-service>
+        <set field="parameters.currentStatusId" value="_NA_"/>
+        <clear-field field-name="parameters.workEffortId"/>
+        <set field="parameters.workEffortName" from-field="project.workEffortName"/>
+        <set field="parameters.currentStatusId" value="_NA_"/>            
+        <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
+        <set field="newProjectId" from-field="newEntity.workEffortId"/>
         
         <!-- copy assigned parties -->
         <get-related value-name="project" relation-name="WorkEffortPartyAssignment" list-name="parties"/>
         <if-not-empty field-name="parties">
             <iterate entry-name="party" list-name="parties">
-                <set field="pa.workEffortId" from-field="newProjectId"/>            
-                <set field="pa.partyId" from-field="party.partyId"/>
-                <set field="pa.roleTypeId" from-field="party.roleTypeId"/>
-                <set field="pa.statusId" value="PAS_ASSIGNED"/>            
-                <call-service service-name="assignPartyToWorkEffort" in-map-name="pa"/>
+                <set field="parameters.workEffortId" from-field="newProjectId"/>            
+                <set field="parameters.partyId" from-field="party.partyId"/>
+                <set field="parameters.roleTypeId" from-field="party.roleTypeId"/>
+                <set field="parameters.statusId" value="PAS_ASSIGNED"/>            
+                <call-simple-method method-name="assignPartyToWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
             </iterate>
         </if-not-empty>
         
@@ -363,17 +365,17 @@
             <iterate entry-name="phase" list-name="phases">
                 <clear-field field-name="newPhase"/>
                 <if-not-empty field-name="toTemplate">
-                    <set field="newPhase.workEffortTypeId" value="PHASE_TEMPLATE"/>
+                    <set field="parameters.workEffortTypeId" value="PHASE_TEMPLATE"/>
                     <else>
-                        <set field="newPhase.workEffortTypeId" value="PHASE"/>
+                        <set field="parameters.workEffortTypeId" value="PHASE"/>
                     </else>            
                 </if-not-empty>
-                <set field="newPhase.workEffortName" from-field="phase.workEffortName"/>
-                <set field="newPhase.workEffortParentId" from-field="newProjectId"/>
-                <set field="newPhase.currentStatusId" value="_NA_"/>            
-                <call-service service-name="createWorkEffort" in-map-name="newPhase">
-                    <result-to-field result-name="workEffortId" field-name="newPhaseId"/>
-                </call-service>
+                <set field="parameters.workEffortName" from-field="phase.workEffortName"/>
+                <set field="parameters.workEffortParentId" from-field="newProjectId"/>
+                <set field="parameters.currentStatusId" value="_NA_"/>            
+                <clear-field field-name="parameters.workEffortId"/>
+                <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
+                <set field="newPhaseId" from-field="newEntity.workEffortId"/>
                 
                 <get-related value-name="phase" relation-name="ChildWorkEffort" list-name="tasks"/>
                 <if-not-empty field-name="tasks">
@@ -385,11 +387,12 @@
                                 <set field="newTask.workEffortTypeId" value="TASK"/>
                             </else>            
                         </if-not-empty>
-                        <set field="newTask.workEffortName" from-field="task.workEffortName"/>
-                        <set field="newTask.priority" from-field="task.priority"/>
-                        <set field="newTask.workEffortParentId" from-field="newPhaseId"/>
-                        <set field="newTask.currentStatusId" value="PTS_CREATED"/>            
-                        <call-service service-name="createWorkEffort" in-map-name="newTask"/>
+                        <set field="parameters.workEffortName" from-field="task.workEffortName"/>
+                        <set field="parameters.priority" from-field="task.priority"/>
+                        <set field="parameters.workEffortParentId" from-field="newPhaseId"/>
+                        <set field="parameters.currentStatusId" value="PTS_CREATED"/>            
+                        <clear-field field-name="parameters.workEffortId"/>
+                        <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
                     </iterate>
                 </if-not-empty>
             </iterate>

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=613773&r1=613772&r2=613773&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Sun Jan 20 22:34:24 2008
@@ -122,6 +122,8 @@
         <description>Copy a project planning data but ignore the actual data.</description>
         <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="false"/>
+        <attribute name="fromDate" type="Timestamp" mode="OUT" optional="true"/>
+        <attribute name="workEffortId" type="String" mode="OUT" optional="true"/>
     </service>
     
     <service name="copyProjectToTemplate" engine="simple"
@@ -129,6 +131,8 @@
         <description>Copy a project planning data to a template project.</description>
         <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="false"/>
+        <attribute name="fromDate" type="Timestamp" mode="OUT" optional="true"/>
+        <attribute name="workEffortId" type="String" mode="OUT" optional="true"/>
     </service>
     
     <service name="scheduleProject" engine="simple"

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh?rev=613773&r1=613772&r2=613773&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/FindProject.bsh Sun Jan 20 22:34:24 2008
@@ -46,8 +46,12 @@
 // entry conditions    
 entryCondition = new LinkedList();    
 if (UtilValidate.isNotEmpty(fromDate)) {
-    entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0"));
+ if (fromDate.toString().length() == 10)
+     entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate + " 00:00:00.0"));
+    else
+     entryCondition.add(new EntityExpr("createdDate", EntityOperator.GREATER_THAN, fromDate));
 }    
+
 if (UtilValidate.isNotEmpty(workEffortName)) {
     entryCondition.add(new EntityExpr("workEffortName", EntityOperator.LIKE, "%" + workEffortName + "%"));
 }