svn commit: r707935 - in /ofbiz/trunk/specialpurpose/projectmgr: entitydef/entitymodel.xml widget/forms/ProjectForms.xml widget/forms/TaskForms.xml

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

svn commit: r707935 - in /ofbiz/trunk/specialpurpose/projectmgr: entitydef/entitymodel.xml widget/forms/ProjectForms.xml widget/forms/TaskForms.xml

hansbak-2
Author: hansbak
Date: Sat Oct 25 19:51:27 2008
New Revision: 707935

URL: http://svn.apache.org/viewvc?rev=707935&view=rev
Log:
only allow selection of the appropriate pre-assigned role on project or projectmanager level

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml?rev=707935&r1=707934&r2=707935&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/entitydef/entitymodel.xml Sat Oct 25 19:51:27 2008
@@ -112,6 +112,25 @@
     </view-link>
   </view-entity>
   
+  <view-entity entity-name="ProjectIdPartyRoleAndPhase"
+    package-name="org.ofbiz.specialpurpose.project"
+    title="WorkEffort for use in party -> project -> phase -> task">
+    <member-entity entity-alias="WEPA" entity-name="WorkEffortPartyAssignment"/>
+    <member-entity entity-alias="RT" entity-name="RoleType"/>
+    <member-entity entity-alias="WEPH" entity-name="WorkEffort"/>
+    <alias entity-alias="WEPH" field="workEffortParentId" name="projectId"/>
+    <alias entity-alias="WEPH" field="workEffortId" name="phaseId"/>
+    <alias entity-alias="WEPA" name="partyId"/>
+    <alias entity-alias="WEPA" name="roleTypeId"/>
+    <alias entity-alias="RT" name="description"/>
+    <view-link entity-alias="WEPH" rel-entity-alias="WEPA">
+      <key-map field-name="workEffortParentId" rel-field-name="workEffortId"/>
+    </view-link>
+    <view-link entity-alias="WEPA" rel-entity-alias="RT">
+      <key-map field-name="roleTypeId"/>
+    </view-link>
+  </view-entity>
+  
   <view-entity entity-name="ProjectAndPhaseAndTaskParty"
     package-name="org.ofbiz.specialpurpose.project"
     title="WorkEffort for use in party -> project -> phase -> task">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=707935&r1=707934&r2=707935&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Sat Oct 25 19:51:27 2008
@@ -367,30 +367,37 @@
     </form>
     <form name="AddWorkEffortPartyAssign" target="createWorkEffortPartyAssign" title="" type="single"
         header-row-style="header-row" default-table-style="basic-table">
-        <alt-target use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)==null" target="EditTaskPartyAssigns"/>
-        <alt-target use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)!=null" target="createTaskPartyAssign"/><!-- this used for tasks else for project -->
+        <alt-target use-when="workEffortId==projectId &amp;&amp; parameters.get(&quot;partyId&quot;)==null" target="ListWorkEffortPartyAssigns"/><!-- this used for project partyId not yet selected -->
+        <alt-target use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)==null" target="EditTaskPartyAssigns"/><!-- this used for tasks , partyId not yet selected-->
+        <alt-target use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)!=null" target="createTaskPartyAssign"/><!-- this used for tasks , partyId selected-->
         <field name="projectId"><hidden/></field>
         <field name="statusId"><hidden value="PRTYASGN_ASSIGNED"/></field>
         <field name="workEffortId"><hidden value="${workEffortId}"/></field>
-        <field use-when="workEffortId==projectId" entry-name="xx" name="partyId" event="onChange" action="javascript:document.AddWorkEffortPartyAssign.submit();"><!-- project level -->
-                <drop-down  allow-empty="true" current="selected">
-                <entity-options entity-name="PartyRoleAndPartyDetail" description="${firstName} ${middleName} ${lastName} ${groupName}">
-                    <entity-constraint name="roleTypeId" value="PROJECT_TEAM"/>
-                    <entity-order-by field-name="lastName"/>
-                    <entity-order-by field-name="groupName"/>
-                    <entity-order-by field-name="roleTypeId"/>
-                </entity-options>        
-            </drop-down>
+        <field use-when="workEffortId==projectId &amp;&amp; parameters.get(&quot;partyId&quot;)!=null" name="partyId"><!-- project level -->
+            <display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName} ${groupName}[${partyId}]">
+                <sub-hyperlink target="ListWorkEffortPartyAssigns?projectId=${workEffortId}" description="${uiLabelMap.CommonChange}"/>        
+            </display-entity>
         </field>
-        <field use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)!=null" name="partyId">
+        <field use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)!=null" name="partyId"><!-- task level -->
             <display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName} ${groupName}[${partyId}]">
                 <sub-hyperlink target="EditTaskPartyAssigns?workEffortId=${workEffortId}" description="${uiLabelMap.CommonChange}"/>        
             </display-entity>
         </field>
+        <field use-when="workEffortId==projectId &amp;&amp; parameters.get(&quot;partyId&quot;)==null" name="partyId" event="onChange" action="javascript:document.AddWorkEffortPartyAssign.submit();"><!-- project level -->
+            <drop-down  allow-empty="true" current="selected">
+                <entity-options entity-name="PartyRoleDetailAndPartyDetail" description="${firstName} ${middleName} ${lastName} ${groupName}">
+                    <entity-constraint name="parentTypeId" value="PROJECT_TEAM"/>
+                    <entity-order-by field-name="firstName"/>
+                    <entity-order-by field-name="lastName"/>
+                    <entity-order-by field-name="groupName"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>        
+            </drop-down>
+        </field>
         <field use-when="workEffortId!=projectId &amp;&amp; parameters.get(&quot;partyId&quot;)==null" name="partyId" event="onChange" action="javascript: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-constraint name="workEffortId" env-name="parameters.workEffortId"/>
                     <entity-order-by field-name="firstName"/>
                     <entity-order-by field-name="lastName"/>
                     <entity-order-by field-name="groupName"/>
@@ -398,14 +405,7 @@
                 </entity-options>        
             </drop-down>
         </field>
-        <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-options>
-            </drop-down>
-        </field>
-        <field use-when="workEffortId!=projectId" entry-name="xx" name="roleTypeId" title="${uiLabelMap.PartyRoleType}">
+        <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"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=707935&r1=707934&r2=707935&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Sat Oct 25 19:51:27 2008
@@ -29,24 +29,17 @@
             </service>
             <set field="statusId" from-field="result.taskInfo.currentStatusId"/>
         </actions>
-        <alt-target use-when="myTask!=void" target="createMyTask"/>
-        <alt-target use-when="task==null" target="createTask"/>
+        <alt-target use-when="myTask!=void &amp;&amp; parameters.get(&quot;workEffortParentId&quot;)!=null" target="createMyTask"/>
+        <alt-target use-when="myTask!=void &amp;&amp; parameters.get(&quot;workEffortParentId&quot;)==null" target="MyTasks"/>
+        <alt-target use-when="myTask==void&amp;&amp;task==null" target="createTask"/>
         <field name="statusId"><hidden value="PAS_ASSIGNED"/></field>
-        <field use-when="myTask!=void" name="partyId"><hidden value="${userLogin.partyId}"/></field>
+        <field name="partyId" use-when="myTask!=void"><hidden value="${userLogin.partyId}"/></field>
         <field name="projectId"><hidden value="${parameters.projectId}"/></field>
         <field name="workEffortTypeId"><hidden value="TASK"/></field>
-        <field use-when="task!=null" name="workEffortId" title="${uiLabelMap.ProjectMgrWorkEffortId}" tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
+        <field name="workEffortId" use-when="task!=null" title="${uiLabelMap.ProjectMgrWorkEffortId}" tooltip="${uiLabelMap.CommonNotModifRecreat}"><display/></field>
         <field name="workEffortName" title="${uiLabelMap.ProjectMgrTaskName}*" tooltip="${uiLabelMap.CommonRequired}"><text/></field>
-        <field use-when="myTask!=void" name="roleTypeId" title="${uiLabelMap.ProjectMgrMyRoleForThisTask}">
-            <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 name="workEffortParentId" title="${uiLabelMap.ProjectMgrTaskPhase}*" tooltip="${uiLabelMap.CommonRequired}">
-            <drop-down allow-empty="false">
+        <field name="workEffortParentId" use-when="myTask==void" title="${uiLabelMap.ProjectMgrTaskPhase}*" tooltip="${uiLabelMap.CommonRequired}">
+            <drop-down allow-empty="true">
                 <entity-options entity-name="WorkEffort" key-field-name="workEffortId" description="${workEffortName}[${workEffortId}]">
                     <entity-constraint name="workEffortTypeId" value="PHASE"/>
                     <entity-constraint name="workEffortParentId" value="${projectId}"/>
@@ -54,8 +47,13 @@
                 </entity-options>        
             </drop-down>
         </field>
-        <field use-when="myTask!=void" name="workEffortParentId" title="${uiLabelMap.ProjectMgrTaskPhase}*" tooltip="${uiLabelMap.CommonRequired}">
-            <drop-down allow-empty="false">
+        <field name="workEffortParentId" use-when="myTask!=void&amp;&amp;parameters.get(&quot;workEffortParentId&quot;)!=null" title="${uiLabelMap.ProjectMgrTaskPhase}*">
+            <display-entity entity-name="WorkEffort" description="${workEffortName}[${workEffortId}]" key-field-name="workEffortId">
+                <sub-hyperlink target="MyTasks" description="[${uiLabelMap.CommonChange}]"/>
+            </display-entity>
+        </field>
+        <field name="workEffortParentId" use-when="myTask!=void&amp;&amp;parameters.get(&quot;workEffortParentId&quot;)==null" title="${uiLabelMap.ProjectMgrTaskPhase}*" tooltip="${uiLabelMap.CommonRequired}" event="onChange" action="javascript:document.EditTask.submit();">
+                <drop-down allow-empty="true">
                 <entity-options entity-name="ProjectPartyAndPhase" key-field-name="phaseId" description="${projectName} -- ${phaseName}">
                     <entity-constraint name="partyId" env-name="userLogin.partyId"/>
                     <entity-order-by field-name="projectName"/>
@@ -63,14 +61,23 @@
                 </entity-options>        
             </drop-down>
         </field>
-        <field use-when="myTask!=void" name="estimatedHours" title="${uiLabelMap.ProjectMgrEstimatedHours}"><text size="5"/></field>
-        <field use-when="myTask!=void" name="skillTypeId" title="${uiLabelMap.HumanResSkillTypeId}">
+        <field name="roleTypeId" use-when="myTask!=void" title="${uiLabelMap.ProjectMgrMyRoleForThisTask}">
+            <drop-down current="selected" allow-empty="false">
+                    <entity-options entity-name="ProjectIdPartyRoleAndPhase" description="${description}">
+                        <entity-constraint name="partyId" operator="equals" env-name="userLogin.partyId"/>
+                        <entity-constraint name="phaseId" operator="equals" env-name="parameters.workEffortParentId"/>
+                        <entity-order-by field-name="description"/>
+                    </entity-options>
+                </drop-down>
+            </field>
+        <field name="estimatedHours" use-when="myTask!=void" title="${uiLabelMap.ProjectMgrEstimatedHours}"><text size="5"/></field>
+        <field name="skillTypeId" use-when="myTask!=void" title="${uiLabelMap.HumanResSkillTypeId}">
             <drop-down allow-empty="true">
                 <entity-options entity-name="SkillType" description="${description}"/>        
             </drop-down>
         </field>
-        <field use-when="myTask!=null||task==null" name="currentStatusId"><hidden value="PTS_CREATED"/></field>
-        <field use-when="task!=null" name="statusId"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
+        <field name="currentStatusId" use-when="myTask!=null||task==null" ><hidden value="PTS_CREATED"/></field>
+        <field name="statusId" use-when="task!=null"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field>
         <field name="priority" title="${uiLabelMap.CommonPriority}">
             <drop-down allow-empty="true" current="selected">
                 <option key="1" description="1 (${uiLabelMap.WorkEffortPriorityHigh})"/>