//>>built
define("dojox/gantt/GanttProjectItem",["./GanttTaskItem","dojo/_base/declare","./GanttProjectControl","dojo/domReady!"],function(e,f){return f("dojox.gantt.GanttProjectItem",[e],{constructor:function(d){this.id=d.id;this.name=d.name||this.id;this.startDate=d.startDate||new Date;this.parentTasks=[]},getTaskById:function(d){for(var b=0;b<this.parentTasks.length;b++){var a=this.getTaskByIdInTree(this.parentTasks[b],d);if(a)return a}return null},getTaskByIdInTree:function(d,b){if(d.id==b)return d;for(var a=
0;a<d.cldTasks.length;a++){var c=d.cldTasks[a];if(c.id==b||0<c.cldTasks.length&&0<c.cldTasks.length&&(c=this.getTaskByIdInTree(c,b)))return c}return null},addTask:function(d){this.parentTasks.push(d);d.setProject(this)},deleteTask:function(d){var b=this.getTaskById(d);if(b)if(b.parentTask){var a=b.parentTask;for(b=0;b<a.cldTasks.length;b++){var c=a.cldTasks[b];if(c.id==d){c.nextChildTask?c.previousChildTask?(c.previousChildTask.nextChildTask=c.nextChildTask,c.nextChildTask.previousChildTask=c.previousChildTask):
c.nextChildTask.previousChildTask=null:c.previousChildTask&&(c.previousChildTask.nextChildTask=null);c=null;a.cldTasks.splice(b,1);break}}}else for(b=0;b<this.parentTasks.length;b++)if(a=this.parentTasks[b],a.id==d){a.nextParentTask?a.previousParentTask?(a.previousParentTask.nextParentTask=a.nextParentTask,a.nextParentTask.previousParentTask=a.previousParentTask):a.nextParentTask.previousParentTask=null:a.previousParentTask&&(a.previousParentTask.nextParentTask=null);a=null;this.parentTasks.splice(b,
1);break}}})});