diff --git a/etemplate/js/et2_widget_gantt.js b/etemplate/js/et2_widget_gantt.js index 778cf03c8f..f1a8dff4c1 100644 --- a/etemplate/js/et2_widget_gantt.js +++ b/etemplate/js/et2_widget_gantt.js @@ -753,4 +753,33 @@ $j(function() { return "weekend" } }; + + // Link styling + gantt.templates.link_class = function(link) { + var link_class = ''; + var source = gantt.getTask(link.source); + var target = gantt.getTask(link.target); + var valid = true; + + var types = gantt.config.links; + switch (link.type) + { + case types.finish_to_start: + valid = (source.end_date <= target.start_date) + break; + case types.start_to_start: + valid = (source.start_date <= target.start_date); + break; + case types.finish_to_finish: + valid = (source.end_date >= target.end_date); + break; + case types.start_to_finish: + valid = (source.start_date >= target.end_date) + break; + } + + link_class += valid ? '' : 'invalid_constraint'; + + return link_class; + } }); \ No newline at end of file diff --git a/etemplate/templates/default/etemplate2.css b/etemplate/templates/default/etemplate2.css index d9e7e9dfce..f3f2dfbde2 100644 --- a/etemplate/templates/default/etemplate2.css +++ b/etemplate/templates/default/etemplate2.css @@ -1448,6 +1448,18 @@ div.ui-toolbar-menulist{ { background-color: #f7eb91; } +.et2_gantt .gantt_task_link.invalid_constraint .gantt_line_wrapper div +{ + background-color: red; +} +.et2_gantt .gantt_task_link.invalid_constraint .gantt_link_arrow_left +{ + border-right-color: red; +} +.et2_gantt .gantt_task_link.invalid_constraint .gantt_link_arrow_right +{ + border-left-color: red; +} /** * Do not wrap content of a single widget incl. a label or children of a hbox.