Author: erwan
Date: Wed Jun 1 13:26:37 2011 New Revision: 1130143 URL: http://svn.apache.org/viewvc?rev=1130143&view=rev Log: A patch from Pierre Gaudin OFBIZ-4298: fix js Gantt display for milestone and associated workeffort Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/project/gantChart.ftl Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy?rev=1130143&r1=1130142&r2=1130143&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy Wed Jun 1 13:26:37 2011 @@ -118,19 +118,13 @@ if (phases) { // dependency can only show one in the ganttchart, so onl show the latest one.. preTasks = delegator.findByAnd("WorkEffortAssoc", ["workEffortIdTo" : task.workEffortId], ["workEffortIdFrom"]); - latestTaskId = ""; - Timestamp latestDate = null; + latestTaskIds = new LinkedList(); preTasks.each { preTask -> wf = preTask.getRelatedOne("FromWorkEffort"); - if (wf.estimatedStartDate) { - if (!latestDate || latestDate.before(wf.estimatedStartDate)) { - latestTaskId = wf.workEffortId; - latestDate = wf.estimatedStartDate; - } - } + latestTaskIds.add(wf.workEffortId); } - if (latestDate) { - taskInfo.preDecessor = latestTaskId; + if (UtilValidate.isNotEmpty(latestTaskIds)) { + taskInfo.preDecessor = latestTaskIds; } ganttList.add(taskInfo); } Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/project/gantChart.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/project/gantChart.ftl?rev=1130143&r1=1130142&r2=1130143&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/project/gantChart.ftl (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/project/gantChart.ftl Wed Jun 1 13:26:37 2011 @@ -36,7 +36,7 @@ g.setShowComp(1); // Show/Hide % Complet g.AddTaskItem(new JSGantt.TaskItem(${t.taskNr},"${t.taskSeqNum?if_exists}. ${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","009900", "${t.url}", 0 , "${t.resource?if_exists}", ${t.completion?if_exists} , 0, ${t.phaseNr}, 1<#if t.preDecessor?exists>, ${t.preDecessor}</#if>)); </#if> <#if t.workEffortTypeId == "MILESTONE"> - g.AddTaskItem(new JSGantt.TaskItem(${t.taskNr},"${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedStartDate)}","00ff00", "", 1 , "", 100 , 0,${t.phaseNr}, "", "" )); + g.AddTaskItem(new JSGantt.TaskItem(${t.taskNr},"${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","00ff00", "", 1 , "${t.resource?if_exists}", ${t.completion?if_exists} , 0,${t.phaseNr}, "", "" )); </#if> </#list> |
Free forum by Nabble | Edit this page |