svn commit: r607817 - in /ofbiz/trunk/specialpurpose/projectmgr: ./ data/ script/org/ofbiz/project/ servicedef/ webapp/projectmgr/WEB-INF/ widget/ widget/forms/

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

svn commit: r607817 - in /ofbiz/trunk/specialpurpose/projectmgr: ./ data/ script/org/ofbiz/project/ servicedef/ webapp/projectmgr/WEB-INF/ widget/ widget/forms/

hansbak-2
Author: hansbak
Date: Tue Jan  1 00:45:58 2008
New Revision: 607817

URL: http://svn.apache.org/viewvc?rev=607817&view=rev
Log:
next step in implementing security, overruling the workeffort security, added demo data

Added:
    ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoPasswordData.xml
Modified:
    ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml
    ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrSecurityData.xml
    ofbiz/trunk/specialpurpose/projectmgr/ofbiz-component.xml
    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
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoData.xml Tue Jan  1 00:45:58 2008
@@ -5,7 +5,7 @@
     <!-- Demo Employee1 -->
     <Party partyId="DemoEmployee1" partyTypeId="PERSON" statusId="PARTY_ENABLED" />
     <Person partyId="DemoEmployee1" firstName="Peter" lastName="Manager" />
-    <UserLogin userLoginId="DemoEmployee1" partyId="DemoEmployee1" currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" enabled="Y" hasLoggedOut="Y"/>
+    <UserLogin userLoginId="DemoEmployee1" partyId="DemoEmployee1" enabled="Y" hasLoggedOut="Y"/>
     <PartyRole partyId="DemoEmployee1" roleTypeId="EMPLOYEE"/>
     <PartyContactMech partyId="DemoEmployee1" contactMechId="9020" fromDate="2000-01-01 10:01:48.933" roleTypeId="EMPLOYEE" />
     <PartyContactMech partyId="DemoEmployee1" contactMechId="9001" fromDate="2000-01-01 10:01:48.933" roleTypeId="EMPLOYEE" />
@@ -15,7 +15,7 @@
     <!-- Demo Employee2 -->
     <Party partyId="DemoEmployee2" partyTypeId="PERSON" statusId="PARTY_ENABLED" />
     <Person partyId="DemoEmployee2" firstName="Jo" lastName="Analist" />
-    <UserLogin userLoginId="DemoEmployee2"  partyId="DemoEmployee2" currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" enabled="Y" hasLoggedOut="Y"/>
+    <UserLogin userLoginId="DemoEmployee2"  partyId="DemoEmployee2" enabled="Y" hasLoggedOut="Y"/>
     <PartyRole partyId="DemoEmployee2" roleTypeId="EMPLOYEE"/>
     <PartyContactMech partyId="DemoEmployee2" contactMechId="9020" fromDate="2000-01-01 10:01:48.933" roleTypeId="EMPLOYEE" />
     <PartyContactMech partyId="DemoEmployee2" contactMechId="9001" fromDate="2000-01-01 10:01:48.933" roleTypeId="EMPLOYEE" />
@@ -25,7 +25,7 @@
     <!-- Demo Customer1 -->
     <Party partyId="DemoCustomer1" partyTypeId="PERSON" statusId="PARTY_ENABLED" />
     <Person partyId="DemoCustomer1" firstName="Sam" lastName="Customer 1" />
-    <UserLogin userLoginId="DemoCustomer1"  partyId="DemoCustomer1" currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" enabled="Y" hasLoggedOut="Y"/>
+    <UserLogin userLoginId="DemoCustomer1"  partyId="DemoCustomer1" enabled="Y" hasLoggedOut="Y"/>
     <PartyRole partyId="DemoCustomer1" roleTypeId="CUSTOMER"/>
     <PartyContactMech partyId="DemoCustomer1" contactMechId="9020" fromDate="2000-01-01 10:01:48.933" roleTypeId="CUSTOMER" />
     <PartyContactMech partyId="DemoCustomer1" contactMechId="9001" fromDate="2000-01-01 10:01:48.933" roleTypeId="CUSTOMER" />
@@ -35,7 +35,7 @@
     <!-- Demo Customer2 -->
     <Party partyId="DemoCustomer2" partyTypeId="PERSON" statusId="PARTY_ENABLED" />
     <Person partyId="DemoCustomer2" firstName="John" lastName="Customer 2"/>
-    <UserLogin userLoginId="DemoCustomer2"  partyId="DemoCustomer2" currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" enabled="Y" hasLoggedOut="Y"/>
+    <UserLogin userLoginId="DemoCustomer2"  partyId="DemoCustomer2" enabled="Y" hasLoggedOut="Y"/>
     <PartyRole partyId="DemoCustomer2" roleTypeId="CUSTOMER"/>
     <PartyContactMech partyId="DemoCustomer2" contactMechId="9020" fromDate="2000-01-01 10:01:48.933" roleTypeId="CUSTOMER" />
     <PartyContactMech partyId="DemoCustomer2" contactMechId="9001" fromDate="2000-01-01 10:01:48.933" roleTypeId="CUSTOMER" />
@@ -53,7 +53,7 @@
     
     <UserLoginAndSecurityGroup groupId="PROJECTUSER" userLoginId="DemoCustomer1" fromDate="2000-01-01 00:00:00.0"/>
     <UserLoginAndSecurityGroup groupId="PROJECTUSER" userLoginId="DemoCustomer2" fromDate="2000-01-01 00:00:00.0"/>
-    <UserLoginAndSecurityGroup groupId="PROJECTUSER" userLoginId="DemoEmployee1" fromDate="2000-01-01 00:00:00.0"/>
+    <UserLoginAndSecurityGroup groupId="PROJECTADMIN" userLoginId="DemoEmployee1" fromDate="2000-01-01 00:00:00.0"/>
     <UserLoginAndSecurityGroup groupId="PROJECTUSER" userLoginId="DemoEmployee2" fromDate="2000-01-01 00:00:00.0"/>
     
     <!-- First Demo project from customer 1, phases and tasks with estimated time-->

Added: ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoPasswordData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoPasswordData.xml?rev=607817&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoPasswordData.xml (added)
+++ ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrDemoPasswordData.xml Tue Jan  1 00:45:58 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-engine-xml>
+    <UserLogin userLoginId="DemoEmployee1"  currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" passwordHint=""/>
+    <UserLogin userLoginId="DemoEmployee2"  currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" passwordHint=""/>
+    <UserLogin userLoginId="DemoCustomer1"  currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" passwordHint=""/>
+    <UserLogin userLoginId="DemoCustomer2"  currentPassword="47ca69ebb4bdc9ae0adec130880165d2cc05db1a" passwordHint=""/>
+</entity-engine-xml>
\ No newline at end of file

Modified: ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrSecurityData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrSecurityData.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrSecurityData.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/data/ProjectMgrSecurityData.xml Tue Jan  1 00:45:58 2008
@@ -21,14 +21,27 @@
 <entity-engine-xml>
     <!-- Project Manager security -->
     <SecurityPermission description="ALL operations in the Project Manager." permissionId="PROJECTMGR_ADMIN"/>
-    <SecurityPermission description="ALL operations in the project the user is member of" permissionId="PROJECTMGR_USER"/>
-    <SecurityPermission description="View operations in the Project Manager." permissionId="PROJECTMGR_VIEW"/>
-
-    <!-- the system makes heavily use of the workeffort component, but NOT its security, in the workeffort component
-        work is going on to move the security from the service program to the service definition level -->
+    <SecurityPermission description="Limited admin operations in the Project Manager for a project the user is member of." permissionId="PROJECTMGR_ROLE_ADMIN"/>
+    <SecurityPermission description="Limited view operations in the Project Manager (own data/projects only)." permissionId="PROJECTMGR_ROLE_VIEW"/>
+    <SecurityPermission description="Limited update operations in the Project Manager.(own data/projects only)" permissionId="PROJECTMGR_ROLE_UPDATE"/>
+    <SecurityPermission description="ALL View operations in the Project Manager." permissionId="PROJECTMGR_VIEW"/>
+    <SecurityPermission description="Be able to create a project." permissionId="PROJECTMGR_PROJECT_CREATE"/>
+    <SecurityPermission description="Be able to create a task." permissionId="PROJECTMGR_TASK_CREATE"/>
+    <SecurityPermission description="Be able to create a timesheet." permissionId="PROJECTMGR_TIMESHEET_CREATE"/>
+    
+    <SecurityGroup description="Project User group, has only access to own projects." groupId="PROJECTADMIN"/>
+    <SecurityGroupPermission groupId="PROJECTADMIN" permissionId="PROJECTMGR_ROLE_ADMIN"/>
+    <SecurityGroupPermission groupId="PROJECTADMIN" permissionId="PROJECTMGR_VIEW"/>
+    <SecurityGroupPermission groupId="PROJECTADMIN" permissionId="PROJECTMGR_PROJECT_CREATE"/>
+    <SecurityGroupPermission groupId="PROJECTADMIN" permissionId="PROJECTMGR_TASK_CREATE"/>
+    <SecurityGroupPermission groupId="PROJECTADMIN" permissionId="PROJECTMGR_TIMESHEET_CREATE"/>
+    
     <SecurityGroup description="Project User group, has only access to own projects." groupId="PROJECTUSER"/>
-    <SecurityGroupPermission groupId="PROJECTUSER" permissionId="PROJECTMGR_USER"/>
+    <SecurityGroupPermission groupId="PROJECTUSER" permissionId="PROJECTMGR_ROLE_VIEW"/>
+    <SecurityGroupPermission groupId="PROJECTUSER" permissionId="PROJECTMGR_ROLE_UPDATE"/>
     <SecurityGroupPermission groupId="PROJECTUSER" permissionId="PROJECTMGR_VIEW"/>
+    <SecurityGroupPermission groupId="PROJECTUSER" permissionId="PROJECTMGR_TASK_CREATE"/>
+    <SecurityGroupPermission groupId="PROJECTUSER" permissionId="PROJECTMGR_TIMESHEET_CREATE"/>
     
     <!-- allow the userlogin 'admin' full access -->
     <SecurityGroupPermission groupId="FULLADMIN" permissionId="PROJECTMGR_ADMIN"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/ofbiz-component.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/ofbiz-component.xml Tue Jan  1 00:45:58 2008
@@ -30,7 +30,8 @@
     <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/ProjectMgrTypeData.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/ProjectMgrSecurityData.xml"/>
-    <entity-resource type="data" reader-name="demo" loader="main" location="data/ProjectMgrDemoData.xml"/>
+    <entity-resource type="data" reader-name="demo" loader="main" location="data/ProjectMgrDemoData.xml"/>
+    <entity-resource type="data" reader-name="demo" loader="main" location="data/ProjectMgrDemoPasswordData.xml"/>
     
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>
     <service-resource type="eca" loader="main" location="servicedef/secas.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=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectPermissionServices.xml Tue Jan  1 00:45:58 2008
@@ -1,58 +1,61 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
 -->
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
-
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+    
     <simple-method method-name="projectMgrPermission" short-description="general service to check access to the project component">
         <set field="primaryPermission" value="PROJECTMGR"/>
         <set field="hasPermission" value="true" type="Boolean"/>
         <if-has-permission permission="PROJECTMGR" action="_ADMIN">
             <field-to-result field-name="hasPermission"/>
             <return/>
+        </if-has-permission>
+        
+        <!-- find object -->
+        <if-compare field-name="resourceDescription" value="Timesheet" operator="contains">
+            <set field="sec_object" value="TIMESHEET"/>
             <else>
-                <if-has-permission permission="PROJECTMGR" action="_VIEW">
-                    <if-has-permission permission="PROJECTMGR" action="_USER">
-                        <!-- object dependent checks here -->
-                        <if-compare field-name="sec_object" value="PROJECT" operator="not-equals">
-                            <!-- if not project check if member of task, when not get the projectId -->
-                            <if-compare field-name="sec_object" value="TASK" operator="equals">
-                                <!-- check if login party member of the task -->
-                                <set field="findRel.workEffortId" from-field="sec_id"/>
-                                <set field="findRel.partyId" from-field="userLogin.partyId"/>
-                                <find-by-and entity-name="WorkEffortPartyAssignment" map-name="findRel" list-name="assigns"/>
-                                <filter-list-by-date list-name="assigns" to-list-name="assignsFilt"/>
-                                <if-not-empty field-name="assignsFilt">
-                                    <field-to-result field-name="hasPermission"/>
-                                    <return/>
-                                </if-not-empty>
-                                <set field="getProj.workEffortId" from-field="sec_id"/>
-                                <else>
-                                    <set field="getProj.phaseId" from-field="sec_id"/>
-                                </else>
-                            </if-compare>
-                            <call-service service-name="getProjectIdAndName" in-map-name="getProj">
-                                <result-to-field result-name="projectId"/>
-                            </call-service>
+                <if-compare field-name="resourceDescription" value="Project" operator="contains">
+                    <set field="sec_object" value="PROJECT"/>
+                    <else>
+                        <if-compare field-name="resourceDescription" value="Phase" operator="contains">
+                            <set field="sec_object" value="PHASE"/>
+                            <else>
+                                <if-compare field-name="resourceDescription" value="Task" operator="contains">
+                                    <set field="sec_object" value="TASK"/>
+                                </if-compare>
+                            </else>
                         </if-compare>
-                        <!-- see if login party member of the project -->
+                    </else>
+                </if-compare>
+            </else>
+        </if-compare>      
+        
+        <if-has-permission permission="PROJECTMGR" action="_VIEW">
+            <if-has-permission permission="PROJECTMGR" action="_ROLE_">
+                <!-- object dependent checks here -->
+                <if-compare field-name="sec_object" value="PROJECT" operator="not-equals">
+                    <!-- if not project check if member of task, when not get the projectId -->
+                    <if-compare field-name="sec_object" value="TASK" operator="equals">
+                        <!-- check if login party member of the task -->
                         <set field="findRel.workEffortId" from-field="sec_id"/>
                         <set field="findRel.partyId" from-field="userLogin.partyId"/>
                         <find-by-and entity-name="WorkEffortPartyAssignment" map-name="findRel" list-name="assigns"/>
@@ -61,16 +64,32 @@
                             <field-to-result field-name="hasPermission"/>
                             <return/>
                         </if-not-empty>
+                        <set field="getProj.workEffortId" from-field="sec_id"/>
                         <else>
-                            <if-compare field-name="sec_action" value="WRITE" operator="equals">
-                                <add-error>
-                                    <fail-property resource="ProjectMgrUiLabels" property="noAccess:NeedWriteOrUserAccess"/>
-                                </add-error>
-                            </if-compare>
-                        </else>    
-                    </if-has-permission>
-                </if-has-permission>
-            </else>
+                            <set field="getProj.phaseId" from-field="sec_id"/>
+                        </else>
+                    </if-compare>
+                    <call-service service-name="getProjectIdAndName" in-map-name="getProj">
+                        <result-to-field result-name="projectId"/>
+                    </call-service>
+                </if-compare>
+                <!-- see if login party member of the project -->
+                <set field="findRel.workEffortId" from-field="sec_id"/>
+                <set field="findRel.partyId" from-field="userLogin.partyId"/>
+                <find-by-and entity-name="WorkEffortPartyAssignment" map-name="findRel" list-name="assigns"/>
+                <filter-list-by-date list-name="assigns" to-list-name="assignsFilt"/>
+                <if-not-empty field-name="assignsFilt">
+                    <field-to-result field-name="hasPermission"/>
+                    <return/>
+                </if-not-empty>
+                <else>
+                    <if-compare field-name="sec_action" value="WRITE" operator="equals">
+                        <add-error>
+                            <fail-property resource="ProjectMgrUiLabels" property="noAccess:NeedWriteOrUserAccess"/>
+                        </add-error>
+                    </if-compare>
+                </else>    
+            </if-has-permission>
         </if-has-permission>
         <check-errors/>  
         <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=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Tue Jan  1 00:45:58 2008
@@ -21,6 +21,23 @@
 <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="createProject" short-description="Create a project">
+        <if-not-empty field-name="parameters.templateId">
+            <set field="parameters.projectId" from-field="parameters.templateId"/>
+            <call-simple-method method-name="copyProject"/>
+            <else>
+                <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
+            </else>
+        </if-not-empty>
+    </simple-method>
+    
+    <simple-method method-name="createProjectTask" short-description="Create a project task and optionally assign">
+        <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/>
+        <if-not-empty field-name="parameters.partyId">
+            <call-simple-method method-name="addTaskAssignment"/>
+        </if-not-empty>
+    </simple-method>
+    
     <simple-method method-name="updateTaskAssigment"
         short-description="Update task to resource assignment, if required create a new one by re-assigment">
         <field-to-result map-name="parameters" field-name="workEffortId"/>
@@ -43,13 +60,17 @@
             </condition>
             <then>
                 <!-- roleType and/or partyId changed: end old and create new assign-->
-                <set-service-fields service-name="deletePartyToWorkEffortAssignment" map-name="parameters" to-map-name="del"/>
-                <call-service service-name="deletePartyToWorkEffortAssignment" in-map-name="del"/>
+                <entity-one entity-name="WorkEffortPartyAssignment" value-name="workEffortPartyAssignment"/>
+                <now-date-to-env env-name="workEffortPartyAssignment.thruDate"/>
+                <store-value value-name="workEffortPartyAssignment"/>
+                <!-- create a new one -->
+                <make-value value-name="newAssign" entity-name="WorkEffortPartyAssignment"/>
                 <set field="newAssign.workEffortId" from-field="parameters.workEffortId"/>
                 <set field="newAssign.partyId" from-field="parameters.newPartyId"/>
                 <set field="newAssign.roleTypeId" from-field="parameters.newRoleTypeId"/>
+                <now-date-to-env env-name="newAssign.fromDate"/>
                 <set field="newAssign.statusId" value="PAS_ASSIGNED"/>
-                <call-service service-name="assignPartyToWorkEffort" in-map-name="newAssign"/>
+                <create-value value-name="newAssign"/>
             </then>
             <else>
                 <!-- status changed or assignment ended -->
@@ -61,15 +82,19 @@
                 </if-compare>
                 <set-nonpk-fields value-name="assignment" map-name="parameters"/>
                 <store-value value-name="assignment"/>
-                <call-simple-method method-name="updateTaskStatus"/>
+                <if-compare field-name="assignment.statusId" value="PAS_COMPLETED" operator="equals">
+                    <call-simple-method method-name="updateTaskStatus"/>
+                </if-compare>
             </else>
         </if>
     </simple-method>
     
     <simple-method method-name="addTaskAssigment" short-description="assign a party to a task">
-        <set-service-fields service-name="assignPartyToWorkEffort" map-name="parameters" to-map-name="add"/>
-        <set field="add.statusId" value="PAS_ASSIGNED"/>
-        <call-service service-name="assignPartyToWorkEffort" in-map-name="add"/>
+        <make-value value-name="newAssign" entity-name="WorkEffortPartyAssignment"/>
+        <set-pk-fields value-name="newAssign" map-name="parameters"/>
+        <now-timestamp-to-env env-name="newAssign.fromDate"/>
+        <set field="newAssign.statusId" value="PAS_ASSIGNED"/>
+        <create-value value-name="newAssign"/>
     </simple-method>
         
     <simple-method method-name="updateTaskStatus"
@@ -277,19 +302,6 @@
         <field-to-result field-name="project.workEffortName" result-name="projectName"/>
         <field-to-result field-name="phase.workEffortId" result-name="phaseId"/>
         <field-to-result field-name="phase.workEffortName" result-name="phaseName"/>
-    </simple-method>
-    
-    <simple-method method-name="createProject" short-description="if templateId is present copy a project from a template">
-        <if-not-empty field-name="parameters.templateId">
-            <set field="parameters.projectId" from-field="parameters.templateId"/>
-            <call-simple-method method-name="copyProject"/>
-            <else>
-                <set-service-fields service-name="createWorkEffort" map-name="parameters" to-map-name="parm"/>
-                <call-service service-name="createWorkEffort" in-map-name="parm">
-                    <result-to-result result-name="workEffortId"/>
-                </call-service>
-            </else>
-        </if-not-empty>
     </simple-method>
     
     <simple-method method-name="copyProjectToTemplate" short-description="copy a project to a workeffortType starting with 'template'">

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Tue Jan  1 00:45:58 2008
@@ -22,6 +22,18 @@
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
     <description>Project Manager service definitions.</description>
 
+    <service name="createProjectTimesheet" engine="simple" default-entity-name="Timesheet"
+        location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="createTimesheetForThisWeek">
+        <description>Creates Timesheet for this week if no required date specified.</description>
+        <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
+        <auto-attributes include="pk" mode="OUT" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true">
+            <exclude field-name="fromDate"/>
+            <exclude field-name="thruDate"/>
+        </auto-attributes>
+        <attribute name="requiredDate" type="Timestamp" mode="IN" optional="true"/>
+    </service>
+
     <service name="projectMgrPermission" engine="simple"
         location="org/ofbiz/project/ProjectPermissionServices.xml" invoke="projectMgrPermission">
         <implements service="permissionInterface"/>
@@ -61,7 +73,7 @@
     <service name="createProject" engine="simple" default-entity-name="WorkEffort"
         location="org/ofbiz/project/ProjectServices.xml" invoke="createProject">
         <description>Copy a project planning from a template.</description>
-        <permission-service service-name="projectPermission" main-action="CREATE"/>
+        <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
         <implements service="interfaceWorkEffort"/>        
         <auto-attributes mode="INOUT" include="pk" optional="true"/>
         <attribute name="projectId" type="String" mode="INOUT" optional="true"/>
@@ -76,7 +88,7 @@
     </service>
     
     <service name="createProjectTask" engine="simple" default-entity-name="WorkEffort"
-        location="org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml" invoke="createWorkEffortAndPartyAssign">
+        location="org/ofbiz/project/ProjectServices.xml" invoke="createProjectTask">
         <description>Create a new task and optionally assign to a resource.</description>
         <permission-service service-name="projectMgrPermission" main-action="CREATE"/>
         <implements service="interfaceWorkEffort"/>        
@@ -164,7 +176,7 @@
     <service name="updateTaskAssigment" default-entity-name="WorkEffortPartyAssignment" engine="simple"
         location="org/ofbiz/project/ProjectServices.xml" invoke="updateTaskAssigment">
         <description>Update a WorkEffortPartyAssignment Entity, including set enddate and create new</description>
-        <permission-service service-name="projectMgrPermission" main-action="UPDATE" />
+        <permission-service service-name="projectMgrPermission" main-action="UPDATE"/>
         <attribute name="workEffortId" type="String" mode="INOUT"/>
         <attribute name="newPartyId" type="String" mode="IN" optional="true"/>
         <attribute name="partyId" type="String" mode="IN"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Tue Jan  1 00:45:58 2008
@@ -178,7 +178,7 @@
     </request-map>
     <request-map uri="createTask">
         <security https="true" auth="true"/>
-        <event type="service" invoke="createWorkEffort"/>
+        <event type="service" invoke="createProjectTask"/>
         <response name="success" type="view" value="EditTask"/>
         <response name="error" type="view" value="EditTask"/>
     </request-map>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml Tue Jan  1 00:45:58 2008
@@ -63,7 +63,7 @@
                     <decorator-section name="body">
                         <section>
                             <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <decorator-section-include name="body"/>
@@ -91,7 +91,7 @@
                     <decorator-section name="body">
                         <section>
                             <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <section>
@@ -133,7 +133,7 @@
                     <decorator-section name="body">
                         <section>
                             <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <section>
@@ -176,8 +176,8 @@
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
-                            <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                            <condition>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <decorator-section-include name="body"/>
@@ -203,7 +203,7 @@
                         <section>
                             <!-- do check for PartyAbility, _VIEW permission -->
                             <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <decorator-section-include name="body"/>
@@ -232,7 +232,7 @@
                     <decorator-section name="body">
                         <section>
                             <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <!--include-menu name="TimesheetTabBar" location="component://projectmgr/widget/Menus.xml"/-->
@@ -258,8 +258,8 @@
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <section>
-                            <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                            <condition>
+                                    <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <widgets>
                                 <include-menu name="MyTimeSubTabBar" location="component://projectmgr/widget/Menus.xml"/>
@@ -284,7 +284,7 @@
                     <decorator-section name="body">
                         <section>
                             <condition>
-                                <if-has-permission permission="WORKEFFORTMGR" action="_VIEW"/>
+                                <if-has-permission permission="PROJECTMGR" action="_VIEW"/>
                             </condition>
                             <actions>
                                 <entity-condition entity-name="Facility" list-name="allFacilities">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=607817&r1=607816&r2=607817&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Tue Jan  1 00:45:58 2008
@@ -233,12 +233,13 @@
             <set field="phaseName" from-field="resultProject.phaseName"/>
         </row-actions>
         <field name="fromDate"><hidden/></field>
+        <field name="workEffortId"><hidden/></field>
         <field name="oldRoleTypeId" parameter-name="roleTypeId"><hidden value="${roleTypeId}"/></field>
         <field name="oldPartyId" parameter-name="partyId"><hidden value="${partyId}"/></field>
-        <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}" widget-style="buttontext">
+        <field name="workEffortName" title="${uiLabelMap.ProjectMgrTaskName}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${workEffortName}" target="taskView?workEffortId=${workEffortId}"/>
         </field>
-        <field name="phaseName" title="${uiLabelMap.ProjectMgrPhaseName}"><hyperlink target="FindPhase?projectId=${projectId}" description="${phaseName}"/></field>
+        <field name="phaseName" title="${uiLabelMap.ProjectMgrPhaseName}"><display description="${phaseName}"/></field>
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}"><hyperlink target="projectView?projectId=${projectId}" description="${projectName}"/></field>
         <field name="currentStatusId" ><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
         <field name="priority"><display/></field>
@@ -265,6 +266,10 @@
                 </entity-options>    
             </drop-down>
         </field>
+        <field name="workEffortId"><hidden/></field>
+        <field name="oldPartyId" parameter-name="partyId"><hidden value="${partyId}"/></field>
+        <field name="oldRoleTypeId" parameter-name="roleTypeId"><hidden value="${roleTypeId}"/></field>
+        <field name="fromDate"><hidden/></field>
         <field name="updateButton"><submit/></field>
         <field name="remove" title="${uiLabelMap.CommonRemove}"><hyperlink target="updateTaskAssigment?workEffortId=${workEffortId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}&amp;statusId=PAS_ENDED" description="${uiLabelMap.CommonRemove}"/></field>
         <field name="toComplete" title="${uiLabelMap.CommonStatustoComplete}"><hyperlink target="updateTaskAssigment?workEffortId=${workEffortId}&amp;partyId=${partyId}&amp;roleTypeId=${roleTypeId}&amp;fromDate=${fromDate}&amp;statusId=PAS_COMPLETED" description="${uiLabelMap.CommonStatustoComplete}"/></field>