svn commit: r608487 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectPermissionServices.xml script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml

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

svn commit: r608487 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectPermissionServices.xml script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml

hansbak-2
Author: hansbak
Date: Thu Jan  3 05:45:33 2008
New Revision: 608487

URL: http://svn.apache.org/viewvc?rev=608487&view=rev
Log:
some more changes to get security in the timesheet update service

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml?rev=608487&r1=608486&r2=608487&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml Thu Jan  3 05:45:33 2008
@@ -28,18 +28,17 @@
             <field-to-result field-name="hasPermission"/>
             <return/>
         </if-has-permission>
-        
         <!-- find object -->
-        <if-compare field-name="resourceDescription" value="Timesheet" operator="contains">
+        <if-compare field-name="parameters.resourceDescription" value="Timesheet" operator="contains">
             <set field="sec_object" value="TIMESHEET"/>
             <else>
-                <if-compare field-name="resourceDescription" value="Project" operator="contains">
+                <if-compare field-name="parameters.resourceDescription" value="Project" operator="contains">
                     <set field="sec_object" value="PROJECT"/>
                     <else>
-                        <if-compare field-name="resourceDescription" value="Phase" operator="contains">
+                        <if-compare field-name="parameters.resourceDescription" value="Phase" operator="contains">
                             <set field="sec_object" value="PHASE"/>
                             <else>
-                                <if-compare field-name="resourceDescription" value="Task" operator="contains">
+                                <if-compare field-name="parameters.resourceDescription" value="Task" operator="contains">
                                     <set field="sec_object" value="TASK"/>
                                 </if-compare>
                             </else>
@@ -48,7 +47,11 @@
                 </if-compare>
             </else>
         </if-compare>      
-<log level="always" message="==============security: object: ${sec_object} action: ${mainAction}"></log>
+        <log level="always" message="==============security: object: ${sec_object} action: ${parameters.mainAction}"></log>
+
+        <field-to-result field-name="hasPermission"/>
+        <return/><!-- temporary disable -->
+        
         <if-compare field-name="sec_object" value="TIMESHEET" operator="equals">
             <if-compare field-name="mainAction" value="CREATE" operator="equals">
                 <field-to-result field-name="hasPermission"/>

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=608487&r1=608486&r2=608487&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Thu Jan  3 05:45:33 2008
@@ -216,18 +216,18 @@
         </entity-and>
         <if-empty field-name="assigns">
             <first-from-list entry-name="projectAssign" list-name="projectAssigns"/>
-            <set field="addAssign.workEffortId" from-field="project.workEffortId"/>
-            <set field="addAssign.partyId" from-field="timesheet.partyId"/>
-            <set field="addAssign.roleTypeId" from-field="projectAssign.roleTypeId"/>
-            <set field="addAssign.statusId" value="PAS_ASSIGNED" />
-            <call-service service-name="assignPartyToWorkEffort" in-map-name="addAssign"/>
+            <set field="parameters.partyId" from-field="timesheet.partyId"/>
+            <set field="parameters.roleTypeId" from-field="projectAssign.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"/>
+            
         </if-empty>
         
         <!-- check if the actual start date is set, when not set it to todays date -->
         <if-empty field-name="project.actualStartDate">
-            <now-date-to-env env-name="updTask.actualStartDate"/>
-            <set field="updTask.workEffortId" from-field="parameters.workEffortId"/>
-            <call-service service-name="updateWorkEffort" in-map-name="updTask"/>
+            <entity-one entity-name="WorkEffort" value-name="workEffort"/>
+            <now-timestamp-to-env env-name="workEffort.actualStartDate"/>
+            <store-value value-name="workEffort"/>
         </if-empty>
         
         <get-related value-name="timesheet" relation-name="TimeEntry" list-name="timeEntries"/>
@@ -239,8 +239,7 @@
                 <if-compare-field field-name="timeEntry.workEffortId" operator="equals" to-field-name="parameters.workEffortId">
                     <!-- check if the entry does not contain any hours, then delete -->
                     <if-empty field-name="timeEntry.hours">
-                        <set  from-field="timeEntry.timeEntryId" field="teDelMap.timeEntryId"/>
-                        <call-service service-name="deleteTimeEntry" in-map-name="teDelMap"/>
+                        <remove-value value-name="timeEntry"/>
                         <else>
                             <!-- translate the date into the daynumber -->
                             <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="getIntervalInDays" ret-field-name="dayNumber">

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=608487&r1=608486&r2=608487&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Thu Jan  3 05:45:33 2008
@@ -55,6 +55,7 @@
         <permission-service service-name="projectMgrPermission" main-action="UPDATE"/>
         <attribute name="timesheetId" type="String" mode="IN" optional="false"/>
         <attribute name="workEffortId" type="String" mode="IN" optional="true"/><!-- when empty will be ignored -->
+        <attribute name="fromDate" type="Timestamp" mode="OUT" optional="true"/>
         <attribute name="hoursDay0" type="Double" mode="IN" optional="true"/>
         <attribute name="hoursDay1" type="Double" mode="IN" optional="true"/>
         <attribute name="hoursDay2" type="Double" mode="IN" optional="true"/>