You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/10/24 06:15:43 UTC

svn commit: r707540 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ servicedef/ webapp/projectmgr/WEB-INF/ webapp/projectmgr/WEB-INF/actions/ widget/ widget/forms/

Author: hansbak
Date: Thu Oct 23 21:15:43 2008
New Revision: 707540

URL: http://svn.apache.org/viewvc?rev=707540&view=rev
Log:
only show the roles which are applicable for the prooject or task and easy add new parties to projectmanager

Added:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy   (with props)
Modified:
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ResourceForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.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=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Thu Oct 23 21:15:43 2008
@@ -55,6 +55,9 @@
     <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"/>
+        <if-compare field="parameters.checkPartyRole" value="Y" operator="equals">
+            <return/>
+        </if-compare>
         <if>
             <!-- check if a change in partyId Or roletypeId: need to delete and create new -->
             <condition>

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml?rev=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectSimpleEvents.xml Thu Oct 23 21:15:43 2008
@@ -94,4 +94,10 @@
             </else>
         </if-not-empty>
     </simple-method>
+    <simple-method method-name="addProjectMgrResource" short-description="Set the task status to complete, if resources assigned that status will also be set to complete">
+        <set-service-fields service-name="createPartyRole" map-name="parameters" to-map-name="roleData"/>
+        <call-service service-name="createPartyRole" in-map-name="roleData"/>
+        <set field="roleData.roleTypeId" value="PROJECT_TEAM"/>
+        <call-service service-name="createPartyRole" in-map-name="roleData"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Thu Oct 23 21:15:43 2008
@@ -229,8 +229,9 @@
         <attribute name="workEffortId" type="String" mode="INOUT"/>
         <attribute name="newPartyId" type="String" mode="IN" optional="true"/>
         <attribute name="partyId" type="String" mode="IN"/>
+        <attribute name="checkPartyRole" type="String" mode="IN"/>
         <attribute name="newRoleTypeId" type="String" mode="IN" optional="true"/>
-        <attribute name="roleTypeId" type="String" mode="IN"/>
+        <attribute name="roleTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="statusId" type="String" mode="IN"/>
         <attribute name="fromDate" type="Timestamp" mode="INOUT" optional="true"/>
         <attribute name="delegateReasonEnumId" type="String" mode="IN" optional="true"/>

Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy?rev=707540&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy (added)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy Thu Oct 23 21:15:43 2008
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+import org.ofbiz.entity.*;
+import org.ofbiz.entity.util.EntityUtil;
+
+if(userLogin){
+	partyId = userLogin.partyId;
+	workEffortId = parameters.workEffortId;
+	roleList = [];
+
+	roleTypeList = delegator.findByAnd("ProjectPartyAndPhaseAndTask", [partyId : partyId, workEffortId : workEffortId]);
+	roleTypeList = EntityUtil.filterByDate(roleTypeList);
+	if(roleTypeList!=null){
+		roleTypeList.each { roleType ->
+		// get desc in roletypetable
+			roletypeDesc = delegator.findByPrimaryKeyCache("RoleType",["roleTypeId":roleType.roleTypeId]);
+			roleMap = [:];
+			roleMap.KEY = roletypeDesc.roleTypeId;
+			roleMap.VALUE = roletypeDesc.description;
+			roleList.add(roleMap);
+		}
+	}
+	context.roleList = roleList;
+}

Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Thu Oct 23 21:15:43 2008
@@ -113,7 +113,7 @@
     </request-map>
     <request-map uri="addResource">
         <security https="true" auth="true"/>
-        <event type="service" invoke="createPartyRole"/>
+        <event type="simple" invoke="addProjectMgrResource" path="org/ofbiz/project/ProjectSimpleEvents.xml"/>
         <response name="success" type="view" value="FindResource"/>
     </request-map>
     <request-map uri="removeResource">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml?rev=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/TaskScreens.xml Thu Oct 23 21:15:43 2008
@@ -99,41 +99,20 @@
                                     </condition>
                                     <widgets>
                                         <container style="lefthalf">
-                                            <container style="screenlet">
-                                                <container style="screenlet-title-bar">
-                                                    <container style="h3">
-                                                        <label text="${uiLabelMap.ProjectMgrAssignATaskToMe}"/>
-                                                    </container>
-                                                </container>
-                                                <container style="screenlet-body">
-                                                    <include-form name="assignTaskToMe" location="component://projectmgr/widget/forms/TaskForms.xml"/>
-                                                </container>
-                                            </container>                                                                        
+                                            <screenlet title="${uiLabelMap.ProjectMgrAssignATaskToMe}">
+                                                <include-form name="assignTaskToMe" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                            </screenlet>
                                         </container>
                                         <container style="righthalf">
-                                            <container style="screenlet">
-                                                <container style="screenlet-title-bar">
-                                                    <container style="h3">
-                                                        <label text="${uiLabelMap.ProjectMgrAddNewTask}"/>
-                                                    </container>
-                                                </container>
-                                                <container style="screenlet-body">
-                                                    <include-form name="EditTask" location="component://projectmgr/widget/forms/TaskForms.xml"/>
-                                                </container>
-                                            </container>                                                                           
+                                            <screenlet title="${uiLabelMap.ProjectMgrAddNewTask}">
+                                                <include-form name="EditTask" location="component://projectmgr/widget/forms/TaskForms.xml"/>
+                                            </screenlet>
                                         </container>                                                                             
                                     </widgets>
                                     <fail-widgets>
-                                        <container style="screenlet">
-                                            <container style="screenlet-title-bar">
-                                                <container style="h3">
-                                                    <label text="${uiLabelMap.ProjectMgrAssignATaskToMe}"/>
-                                                </container>
-                                            </container>
-                                               <container style="screenlet-body">
-                                                <label style="h3" text="${uiLabelMap.ProjectMgrTaskMember}"></label>
-                                            </container>
-                                        </container>                                                                        
+                                        <screenlet title="${uiLabelMap.ProjectMgrAssignATaskToMe}">
+                                            <label style="h3" text="${uiLabelMap.ProjectMgrTaskMember}"></label>
+                                        </screenlet>
                                     </fail-widgets>
                                 </section>
                             </widgets>                            

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Thu Oct 23 21:15:43 2008
@@ -381,21 +381,30 @@
                 </entity-options>        
             </drop-down>
         </field>
-        <field use-when="workEffortId!=projectId" entry-name="xx" name="partyId"><!-- task level -->
-            <drop-down>
-                <entity-options entity-name="WorkEffortPartyAssignView" filter-by-date="true" description="${firstName} ${middleName} ${lastName} ${groupName}">
+        <field name="checkPartyRole"><hidden value="N"/></field>  
+        <field use-when="workEffortId!=projectId" name="partyId" event="onChange" action="javascript:document.AddWorkEffortPartyAssign.checkPartyRole.value='Y';document.AddWorkEffortPartyAssign.submit();"><!-- task level -->
+            <drop-down  allow-empty="true" current="selected">
+                <entity-options entity-name="WorkEffortPartyAssignView"  filter-by-date="true" description="${firstName} ${middleName} ${lastName} ${groupName}">
                     <entity-constraint name="workEffortId" env-name="projectId"/>
+                    <entity-order-by field-name="firstName"/>
                     <entity-order-by field-name="lastName"/>
                     <entity-order-by field-name="groupName"/>
                     <entity-order-by field-name="roleTypeId"/>
                 </entity-options>        
             </drop-down>
         </field>
-        <field entry-name="xx" name="roleTypeId" title="${uiLabelMap.PartyRoleType}">
+        <field use-when="workEffortId==projectId" entry-name="xx" name="roleTypeId" title="${uiLabelMap.PartyRoleType}"><!-- project level -->
             <drop-down>
                 <entity-options entity-name="RoleType" description="${description}">
                     <entity-constraint name="parentTypeId" value="PROJECT_TEAM"/>
-                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field entry-name="xx" name="roleTypeId" title="${uiLabelMap.PartyRoleType}">
+            <drop-down>
+                <entity-options entity-name="PartyRoleDetailAndPartyDetail" description="${description}">
+                    <entity-constraint name="parentTypeId" value="PROJECT_TEAM"/>
+                    <entity-constraint name="partyId" env-name="parameters.partyId"/>
                 </entity-options>
             </drop-down>
         </field>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ResourceForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ResourceForms.xml?rev=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ResourceForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ResourceForms.xml Thu Oct 23 21:15:43 2008
@@ -52,7 +52,14 @@
     <form name="AddResource" type="single" target="addResource"
         header-row-style="header-row" default-table-style="basic-table">
         <field name="PartyId" parameter-name="partyId" title="${uiLabelMap.PartyPartyId}"><lookup target-form-name="LookupPartyName"/></field>
-        <field name="roleTypeId"><hidden value="PROJECT_TEAM"/></field>
+        <field name="roleTypeId">
+            <drop-down allow-empty="false">
+                <entity-options entity-name="RoleType" description="${description}">
+                    <entity-constraint name="parentTypeId" operator="equals" value="PROJECT_TEAM"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="addButton" ><submit/></field>
     </form>
     <form name="AddPartyRole" extends="AddPartyRole" extends-resource="component://party/webapp/partymgr/party/PartyForms.xml">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=707540&r1=707539&r2=707540&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Thu Oct 23 21:15:43 2008
@@ -284,10 +284,13 @@
     </form>
     <form name="assignTaskToMe" type="single" target="addTaskAssignment"
         header-row-style="header-row" default-table-style="basic-table">
+        <actions>
+            <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/getPartyRoles.groovy"/>
+        </actions>
         <field name="partyId"><hidden value="${userLogin.partyId}"/></field>
         <field name="statusId"><hidden value="PAS_ASSIGNED"/></field>
-        <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}">
-            <drop-down allow-empty="false">
+        <field name="workEffortId" title="${uiLabelMap.ProjectMgrTaskName}" event="onChange" action="javascript:document.assignTaskToMe.checkPartyRole.value='Y';document.assignTaskToMe.submit();">
+            <drop-down allow-empty="true">
                 <entity-options entity-name="ProjectPartyAndPhaseAndTask" description="${projectName} -- ${phaseName} -- ${workEffortName}" key-field-name="workEffortId" filter-by-date="true">
                     <entity-constraint name="partyId" operator="equals" value="${parameters.userLogin.partyId}"/>
                     <entity-constraint name="currentStatusId" operator="equals" value="PTS_CREATED"/>
@@ -297,12 +300,10 @@
                 </entity-options>
            </drop-down>
         </field>
+        <field name="checkPartyRole"><hidden value="N"/></field> 
         <field name="roleTypeId">
-            <drop-down>
-                <entity-options entity-name="RoleType" description="${description}">
-                    <entity-constraint name="parentTypeId" value="PROJECT_TEAM"/>
-                    <entity-order-by field-name="description"/>
-                </entity-options>        
+            <drop-down current="selected" allow-empty="false">
+                <list-options list-name="roleList" key-name="KEY" description="${VALUE}"/>
             </drop-down>
         </field>
         <field name="addButton"><submit/></field>