From 1fef29cb802a350efa8e16833966d795d8e3014a Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 2 Jul 2012 15:30:16 +0200 Subject: [PATCH] [FIX] OPW 575804: web_gantt: hide internal dhtmlx duration for tasks/phases, as it is misleading The `duration` used by the dhtmlx gantt component corresponds to the calendar duration of the event divided by 3. This makes sense only for events spanning full days, and for working times with 8 hours per day. Unfortunately these hypotheses do not hold for most cases inside OpenERP, so we should hide this information. The actual duration of the items can always been viewed by clicking on the corresponding label. bzr revid: odo@openerp.com-20120702133016-gzscrpbbh1a9mgez --- .../static/lib/dhtmlxGantt/sources/dhtmlxgantt.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js b/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js index 9d8b0db2252..c9a07c017ff 100644 --- a/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js +++ b/addons/web_gantt/static/lib/dhtmlxGantt/sources/dhtmlxgantt.js @@ -3139,9 +3139,10 @@ GanttTask.prototype.getPopUpInfo = function(object, event) //data of task var tblInfo = this.Chart.divInfo.lastChild; tblInfo.rows[0].cells[0].innerHTML = "
" + this.TaskInfo.Name + "
"; - tblInfo.rows[0].cells[0].innerHTML += "EST: " + this.TaskInfo.EST.getDate() + "." + (this.TaskInfo.EST.getMonth() + 1) + "." + this.TaskInfo.EST.getFullYear() + "
"; - tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.TaskInfo.Duration + " hours
"; - // tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.TaskInfo.PercentCompleted + "%
"; + tblInfo.rows[0].cells[0].innerHTML += "Start Date: " + this.TaskInfo.EST.getDate() + "." + (this.TaskInfo.EST.getMonth() + 1) + "." + this.TaskInfo.EST.getFullYear() + "
"; + // Hidden because currently misleading or unavailable: + // tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.TaskInfo.Duration + " hours
"; + // tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.TaskInfo.PercentCompleted + "%
"; //show predecessor task if (this.predTask) @@ -3804,8 +3805,9 @@ GanttProject.prototype.getPopUpInfo = function(object, event) var tblInfo = this.Chart.divInfo.lastChild; tblInfo.rows[0].cells[0].innerHTML = "
" + this.Project.Name + "
"; tblInfo.rows[0].cells[0].innerHTML += "Start Date: " + this.Project.StartDate.getDate() + "." + (this.Project.StartDate.getMonth() + 1) + "." + this.Project.StartDate.getFullYear() + "
"; - tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.Duration + " hours
"; - // tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.percentCompleted + "%
"; + // Hidden because currently misleading or unavailable: + // tblInfo.rows[0].cells[0].innerHTML += "Duration: " + this.Duration + " hours
"; + // tblInfo.rows[0].cells[0].innerHTML += "Percent Complete: " + this.percentCompleted + "%
"; this.Chart.divInfo.style.cssText = "z-index:2;position: absolute;display: inline;"; @@ -4081,7 +4083,8 @@ GanttTask.prototype.resizeTaskItem = function(width) taskItem.childNodes[1].firstChild.width = width + "px"; //resize info - this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = countHours; + // Hidden because currently misleading: + // this.cTaskItem[0].childNodes[1].firstChild.rows[0].cells[0].innerHTML = countHours; taskItem.childNodes[2].childNodes[0].style.width = width + "px"; taskItem.childNodes[2].childNodes[1].style.left = width - 10 + "px"; };