svn commit: r1758101 - in /ofbiz/trunk: framework/images/webapp/images/jsgantt.js specialpurpose/projectmgr/template/project/GanttChart.ftl

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

svn commit: r1758101 - in /ofbiz/trunk: framework/images/webapp/images/jsgantt.js specialpurpose/projectmgr/template/project/GanttChart.ftl

jleroux@apache.org
Author: jleroux
Date: Sun Aug 28 10:17:04 2016
New Revision: 1758101

URL: http://svn.apache.org/viewvc?rev=1758101&view=rev
Log:
A patch from Florian Montalbano for "Allow Gantt function to compute task with non-numerical ID" https://issues.apache.org/jira/browse/OFBIZ-7971

The Gantt diagram is not generated when at least one of the taks composing it has a non-numerical workEffortId (e.g. A10001).
When importing data or using duplication of workEffort, you can use such id.

How to reproduce :
- Check the Gantt diagram, it should be working fine : https://localhost:8443/projectmgr/control/ganttChart?projectId=9100 

- Create a task with a non-numerical id for the project 9100 or iImport this entry :
<entity-engine-xml>
<WorkEffort workEffortId="A1000" sequenceNum="1" workEffortTypeId="TASK" currentStatusId="PTS_CREATED" lastStatusUpdate="2007-12-14 16:45:21.831" workEffortParentId="9101" scopeEnumId="WES_PRIVATE" workEffortName="ProblemTask" estimatedStartDate="2007-12-03 00:00:00.0" estimatedCompletionDate="2007-12-05 00:00:00.0" revisionNumber="1"/>
</entity-engine-xml>

- Check the Gantt diagram again and now it's failing : https://localhost:8443/projectmgr/control/ganttChart?projectId=9100
(there is an error in the javascript console)

Modified:
    ofbiz/trunk/framework/images/webapp/images/jsgantt.js
    ofbiz/trunk/specialpurpose/projectmgr/template/project/GanttChart.ftl

Modified: ofbiz/trunk/framework/images/webapp/images/jsgantt.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jsgantt.js?rev=1758101&r1=1758100&r2=1758101&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/jsgantt.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/jsgantt.js Sun Aug 28 10:17:04 2016
@@ -42,7 +42,7 @@ var vBenchTime = new Date().getTime();
 * @constructor
 * @for JSGantt
 
-* @param pID {Number} Task unique numeric ID
+* @param pID {String} Task unique ID
 * @param pName {String} Task Name
 * @param pStart {Date} Task start date/time (not required for pGroup=1 )
 * @param pEnd {Date} Task end date/time, you can set the end time to 12:00 to indicate half-day (not required for pGroup=1 )
@@ -1905,9 +1905,9 @@ JSGantt.folder= function (pID,ganttObj)
             JSGantt.show(pID, 1, ganttObj);
 
                if (JSGantt.isIE())
-                  {JSGantt.findObj('group_'+pID).innerText = '–';}
+                  {JSGantt.findObj('group_'+pID).innerText = '�';}
                else
-                  {JSGantt.findObj('group_'+pID).textContent = '–';}
+                  {JSGantt.findObj('group_'+pID).textContent = '�';}
 
          }
 
@@ -1979,7 +1979,7 @@ JSGantt.show =  function (pID, pTop, gan
          } else {
 
             if (JSGantt.isIE()) { // IE;
-               if( JSGantt.findObj('group_'+pID).innerText == '–') {
+               if( JSGantt.findObj('group_'+pID).innerText == '�') {
                   JSGantt.findObj('child_'+vID).style.display = "";
                   JSGantt.findObj('childgrid_'+vID).style.display = "";
                   vList[i].setVisible(1);
@@ -1987,7 +1987,7 @@ JSGantt.show =  function (pID, pTop, gan
 
             } else {
 
-               if( JSGantt.findObj('group_'+pID).textContent == '–') {
+               if( JSGantt.findObj('group_'+pID).textContent == '�') {
                   JSGantt.findObj('child_'+vID).style.display = "";
                   JSGantt.findObj('childgrid_'+vID).style.display = "";
                   vList[i].setVisible(1);

Modified: ofbiz/trunk/specialpurpose/projectmgr/template/project/GanttChart.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/template/project/GanttChart.ftl?rev=1758101&r1=1758100&r2=1758101&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/template/project/GanttChart.ftl (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/template/project/GanttChart.ftl Sun Aug 28 10:17:04 2016
@@ -30,13 +30,13 @@ g.setShowComp(1); // Show/Hide % Complet
 
 <#list phaseTaskList as t>
     <#if t.workEffortTypeId == "PHASE">
-        g.AddTaskItem(new JSGantt.TaskItem(${t.phaseNr}, "${t.phaseSeqNum!}. ${t.phaseName}", "", "", "00ff00", "", 0, "", 0, 1, 0, 1));
+        g.AddTaskItem(new JSGantt.TaskItem("${t.phaseNr}", "${t.phaseSeqNum!}. ${t.phaseName}", "", "", "00ff00", "", 0, "", 0, 1, 0, 1));
     </#if>
     <#if t.workEffortTypeId == "TASK">
-        g.AddTaskItem(new JSGantt.TaskItem(${t.taskNr},"${t.taskSeqNum!}. ${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","009900", "${t.url}", 0 , "${t.resource!}", ${t.completion!} , 0, ${t.phaseNr}, 1<#if t.preDecessor??>, "${t.preDecessor}"</#if>));
+        g.AddTaskItem(new JSGantt.TaskItem("${t.taskNr}","${t.taskSeqNum!}. ${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","009900", "${t.url}", 0 , "${t.resource!}", ${t.completion!} , 0, ${t.phaseNr}, 1<#if t.preDecessor??>, "${t.preDecessor}"</#if>));
     </#if>
     <#if t.workEffortTypeId == "MILESTONE">
-        g.AddTaskItem(new JSGantt.TaskItem(${t.taskNr},"${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","00ff00", "", 1 , "${t.resource!}", ${t.completion!} , 0,${t.phaseNr}, "", "" ));
+        g.AddTaskItem(new JSGantt.TaskItem("${t.taskNr}","${t.taskName}","${StringUtil.wrapString(t.estimatedStartDate)}", "${StringUtil.wrapString(t.estimatedCompletionDate)}","00ff00", "", 1 , "${t.resource!}", ${t.completion!} , 0,${t.phaseNr}, "", "" ));
     </#if>
 </#list>