From bdecd27961a21d141d9867a1475010509d3e98a2 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 15 Oct 2014 22:22:49 +0000 Subject: [PATCH] Show planned times on gantt chart while editing real times --- etemplate/js/et2_widget_gantt.js | 25 ++++++++++++++++ etemplate/templates/default/etemplate2.css | 35 +++++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_widget_gantt.js b/etemplate/js/et2_widget_gantt.js index e56c77f704..dcb51a7701 100644 --- a/etemplate/js/et2_widget_gantt.js +++ b/etemplate/js/et2_widget_gantt.js @@ -1011,6 +1011,31 @@ $j(function() { } }; + gantt.templates.leftside_text = function(start, end, task) { + var text = ''; + if(task.planned_start) + { + if(typeof task.planned_start == 'string') task.planned_start = new Date(task.planned_start); + var p_start = gantt.posFromDate(task.planned_start) - gantt.posFromDate(start); + text = "
" + + gantt.date.date_to_str(gantt.config.api_date)(task.planned_start) + + "
"; + } + return text; + }; + gantt.templates.rightside_text = function(start, end, task) { + var text = ''; + if(task.planned_end) + { + if(typeof task.planned_end == 'string') task.planned_end = new Date(task.planned_end); + var p_end = gantt.posFromDate(task.planned_end) - gantt.posFromDate(end); + text = "
" + + gantt.date.date_to_str(gantt.config.api_date)(task.planned_end) + + "
"; + } + return text; + }; + // Link styling gantt.templates.link_class = function(link) { var link_class = ''; diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index 02887b75d1..96f9c86837 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -1510,7 +1510,10 @@ div.ui-toolbar-menulist{ { background-size: 18px; } - +.et2_gantt .gantt_side_content +{ + overflow: visible; +} .et2_gantt .gantt_task_progress { text-align: left; @@ -1544,6 +1547,36 @@ div.ui-toolbar-menulist{ { border-left-color: red; } +.et2_gantt .gantt_task_planned +{ + margin-top: 7px; + position: absolute; + opacity: 0.3; + border-style: outset; + border-width: 2px; + border-top: none; + border-bottom: none; + width: 2px; +} +.et2_gantt .gantt_task_planned:hover span { + display:inline; +} +.et2_gantt .gantt_task_planned span +{ + z-index: 10; + display: none; + background: white; + position: relative; + top: 2em; +} +.et2_gantt .gantt_left .gantt_task_planned +{ + border-right: none; +} +.et2_gantt .gantt_right .gantt_task_planned +{ + border-left: none; +} /** * Do not wrap content of a single widget incl. a label or children of a hbox.