|
|
@ -504,29 +504,22 @@ jQuery.extend(Timeline, { |
|
|
|
var listToRemove = []; |
|
|
|
var listToRemove = []; |
|
|
|
|
|
|
|
|
|
|
|
// for all projects on the first level
|
|
|
|
// for all projects on the first level
|
|
|
|
jQuery.each(root.getReporters(), function (i, e) { |
|
|
|
jQuery.each(root.getReporters(), function (i, reporter) { |
|
|
|
|
|
|
|
|
|
|
|
// find all projects that are associated
|
|
|
|
// find all projects that are associated
|
|
|
|
jQuery.each(associations, function (j, a) { |
|
|
|
jQuery.each(associations, function (j, association) { |
|
|
|
|
|
|
|
|
|
|
|
if (a.involves(e)) { |
|
|
|
// check if the reporter is involved and hasn't already been included by a second level grouping adjustment
|
|
|
|
var other = a.getOther(e); |
|
|
|
if (!reporter.hasSecondLevelGroupingAdjustment && association.involves(reporter)) { |
|
|
|
|
|
|
|
var other = association.getOther(reporter); |
|
|
|
if (typeof other.getProjectType === "function") { |
|
|
|
if (typeof other.getProjectType === "function") { |
|
|
|
var pt = other.getProjectType(); |
|
|
|
var projectType = other.getProjectType(); |
|
|
|
var type = pt !== null ? pt.id : -1; |
|
|
|
var projectTypeId = projectType !== null ? projectType.id : -1; |
|
|
|
|
|
|
|
|
|
|
|
//check if the type is selected as 2nd level grouping
|
|
|
|
//check if the type is selected as 2nd level grouping
|
|
|
|
var relevant = false; |
|
|
|
if (grouping.indexOf(projectTypeId) !== -1) { |
|
|
|
jQuery.each(grouping, function(k, l) { |
|
|
|
|
|
|
|
if (l === type) { |
|
|
|
|
|
|
|
relevant = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (relevant) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add the other project as a simulated reporter to the current one.
|
|
|
|
// add the other project as a simulated reporter to the current one.
|
|
|
|
e.addReporter(other); |
|
|
|
reporter.addReporter(other); |
|
|
|
other.hasSecondLevelGroupingAdjustment = true; |
|
|
|
other.hasSecondLevelGroupingAdjustment = true; |
|
|
|
// remove the project from the root level of the report.
|
|
|
|
// remove the project from the root level of the report.
|
|
|
|
listToRemove.push(other); |
|
|
|
listToRemove.push(other); |
|
|
@ -538,8 +531,8 @@ jQuery.extend(Timeline, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// remove all children of root that we couldn't remove while still iterating.
|
|
|
|
// remove all children of root that we couldn't remove while still iterating.
|
|
|
|
jQuery.each(listToRemove, function(i, e) { |
|
|
|
jQuery.each(listToRemove, function(i, reporter) { |
|
|
|
root.removeReporter(e); |
|
|
|
root.removeReporter(reporter); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -651,7 +644,7 @@ jQuery.extend(Timeline, { |
|
|
|
} |
|
|
|
} |
|
|
|
var i, selection = this.options.grouping_one_selection; |
|
|
|
var i, selection = this.options.grouping_one_selection; |
|
|
|
var p, groups = [], children; |
|
|
|
var p, groups = [], children; |
|
|
|
if (this.isGrouping()) { |
|
|
|
if (this.isGrouping() && selection) { |
|
|
|
for ( i = 0; i < selection.length; i++ ) { |
|
|
|
for ( i = 0; i < selection.length; i++ ) { |
|
|
|
p = this.getProject(selection[i]); |
|
|
|
p = this.getProject(selection[i]); |
|
|
|
if (p === undefined) { |
|
|
|
if (p === undefined) { |
|
|
|