svn commit: r596553 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh 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: r596553 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh widget/forms/TaskForms.xml

hansbak-2
Author: hansbak
Date: Mon Nov 19 23:00:30 2007
New Revision: 596553

URL: http://svn.apache.org/viewvc?rev=596553&view=rev
Log:
enhance the tasklist with phase and project info

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh?rev=596553&r1=596552&r2=596553&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ListProjectsByDateRange.bsh Mon Nov 19 23:00:30 2007
@@ -112,6 +112,7 @@
                 unAssignedTasks.add(UtilMisc.toMap("workEffortId", task.getString("workEffortId"),
                                                  "workEffortName", task.getString("workEffortName"),  
                                                  "workEffortTypeId", task.getString("workEffortTypeId"),
+                                                 "workEffortParentId", task.getString("workEffortParentId"),
                                                  "createdStamp", task.getTimestamp("createdStamp").toString().substring(0,10),
                                                  "workEffortPurposeTypeId", task.getString("workEffortPurposeTypeId")));
             }
@@ -127,13 +128,27 @@
             workEffortId = task.get("workEffortId");    
             GenericValue workEffortAssoc = EntityUtil.getFirst(delegator.findByAnd("WorkEffortAssoc", UtilMisc.toMap("workEffortIdTo", workEffortId)));
             if (workEffortAssoc == null) {
-            unAssignedTasks.add(UtilMisc.toMap("workEffortId", task.getString("workEffortId"),
+            GenericValue phase = task.getRelatedOne("ParentWorkEffort");
+            GenericValue project = null;
+            if (!UtilValidate.isEmpty(phase)) {
+                project = phase.getRelatedOne("ParentWorkEffort");
+                }
+            fields = UtilMisc.toMap("workEffortId", task.getString("workEffortId"),
                                                  "workEffortName", task.getString("workEffortName"),  
                                                  "workEffortTypeId", task.getString("workEffortTypeId"),
                                                  "createdStamp", task.getTimestamp("createdStamp").toString().substring(0,10),
-                                                 "workEffortPurposeTypeId", task.getString("workEffortPurposeTypeId")));
+                                                 "workEffortPurposeTypeId", task.getString("workEffortPurposeTypeId"));
+            if (!UtilValidate.isEmpty(phase)) {
+                                                 fields.put("phaseId", phase.getString("workEffortId"));
+                                                 fields.put("phaseName", phase.getString("workEffortName"));
+                                                 }
+            if (!UtilValidate.isEmpty(project)) {
+                                                 fields.put("projectId", project.getString("workEffortId"));
+                                                 fields.put("projectName", project.getString("workEffortName"));
+                                                 }
+            unAssignedTasks.add(fields);                                
             }
-            context.put("tasks", unAssignedTasks);        
+        context.put("tasks", unAssignedTasks);        
         }        
     } else {
         List unAssignedTasks=null;

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml?rev=596553&r1=596552&r2=596553&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TaskForms.xml Mon Nov 19 23:00:30 2007
@@ -73,7 +73,7 @@
         </field>
         <field name="workEffortParentId" title="${uiLabelMap.ProjectMgrTaskPhase}">
             <drop-down allow-empty="true">
-                <entity-options entity-name="WorkEffort" description="${workEffortName}[${workEffortId}](project:${workEffortParentId})">
+                <entity-options entity-name="WorkEffort" key-field-name="workEffortId" description="${workEffortName}[${workEffortId}](project:${workEffortParentId})">
                     <entity-constraint name="workEffortTypeId" value="PHASE"/>
                     <entity-order-by field-name="workEffortParentId"/>
                 </entity-options>        
@@ -91,14 +91,14 @@
         <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><date-time/></field>
         <field name="find" title="${uiLabelMap.CommonFind}"><submit/></field>
     </form>
- <!--================ UnAssigned Tasks Lists==============-->
-    <form name="ListTaskLists" type="list" list-name="tasks" paginate-target="FindTaskList">
+    <form name="ListTaskLists" type="list" list-name="tasks" paginate-target="FindTaskList">
         <field name="workEffortId" title="${uiLabelMap.ProjectMgrWorkEffortId}" widget-style="buttontext">
             <hyperlink also-hidden="false" description="${workEffortName} [${workEffortId}]" target="EditTask?workEffortId=${workEffortId}"/>
         </field>
-        <field name="workEffortName" title="${uiLabelMap.CommonName}"><display/></field>
         <field name="workEffortTypeId" title="${uiLabelMap.ProjectMgrWorkEffortTypeId}"><display-entity entity-name="WorkEffortType"/></field>
-        <field name="createdStamp"><display/></field>
+        <field name="createdStamp"><display/></field>
+        <field name="phase"><display description="${phaseName}[${phaseId}]"/></field>
+        <field name="project"><hyperlink target="EditProject?workEffortId=${projectId}" description="${projectName}[${projectId}]"/></field>
     </form>
     <form name="ListChildEfforts" target="updateTaskListAndAssoc" title="" list-name="tasks" type="list" separate-columns="true" paginate-target="FindTaskList">
         <row-actions>