--- plugins/tracker/wwwlib/GanttView.php.bak20090731 2009-05-10 18:33:28.000000000 +0800 +++ plugins/tracker/wwwlib/GanttView.php 2009-08-02 16:50:49.000000000 +0800 @@ -45,18 +45,18 @@ $tracker_id=((isset($_REQUEST['tracker_id'])) ? $_REQUEST['tracker_id'] : 0 ); $begin=((isset($_REQUEST['start_date'])) ? $_REQUEST['start_date'] : 0 ); $end=((isset($_REQUEST['end_date'])) ? $_REQUEST['end_date'] : 0 ); -$sortcol=((isset($_REQUEST['sortcol'])) ? $_REQUEST['sortcol'] : null ); -$sortord=((isset($_REQUEST['sortord'])) ? $_REQUEST['sortord'] : 0 ); -$res=((isset($_REQUEST['resolution'])) ? $_REQUEST['resolution'] : null ); -$size=((isset($_REQUEST['size'])) ? $_REQUEST['size'] : 800 ); +$sortcol=((isset($_REQUEST['sortcol'])) ? $_REQUEST['sortcol'] : 'open_date' ); +$sortord=((isset($_REQUEST['sortord'])) ? $_REQUEST['sortord'] : 'ASC' ); +$res=((isset($_REQUEST['resolution'])) ? $_REQUEST['resolution'] : 'Days' ); +$size=((isset($_REQUEST['size'])) ? $_REQUEST['size'] : 0 ); if ($begin=="0") { - $begin = (time()-(30*86400)); + $begin = (time()-(120*86400)); } else { $begin = strtotime($begin); } if ($end=="0") { - $end = time() + (30*86400); + $end = time() + (120*86400); } else { $end=strtotime($end); } @@ -66,7 +66,7 @@ $begin=$endtmp; } -$sizes = array(640=>'640x480', 800=>'800x600', 1024=>'1024x768', 1600=>'1600x1200'); +$sizes = array(0=>'Auto',640=>'640x480', 800=>'800x600', 1024=>'1024x768', 1600=>'1600x1200'); $resolutions = array('Months'=>'Months', 'Weeks'=>'Weeks', 'Days'=>'Days'); echo doHeader($theme, $Lang->getText('TrackerReporting.GanttView'), $size); --- plugins/tracker/wwwlib/graphs/GanttGraph.php.bak20090802 2009-05-10 18:33:28.000000000 +0800 +++ plugins/tracker/wwwlib/graphs/GanttGraph.php 2009-08-02 17:10:10.000000000 +0800 @@ -73,6 +73,9 @@ if ($size==640) { $graph = new GanttGraph (598,480); + //Add Auto Size (Jack.shang 20090802) +} elseif ($size==0){ + $graph = new GanttGraph (); } elseif ($size==1024) { $graph = new GanttGraph (980,768); } elseif ($size==1600) { @@ -108,7 +111,13 @@ // Create GanttBar objects foreach($items as $task) { $task_id = $task->getTrackerItemId(); - $bar = new GanttBar ($i, $task->getSummary(), date('Y-m-d', $task->getOpenDate(null)), date('Y-m-d', $task->getCloseDate(null)-86400)); + // Display AssignedUserName and Status In GanttBar Title (Jack.shang 20090802) + $AssignedUsers = $task->getAssignedUsers(); + foreach($AssignedUsers as $AssignedUser){ + $AssignedUserName = $AssignedUser->getName(); + } + $bar = new GanttBar ($i, $i."-".$task->getSummary()."(".$AssignedUserName.":".(($task->getStatusId()== 0)?'closed':'open').")", date('Y-m-d', $task->getOpenDate(null)), date('Y-m-d', $task->getCloseDate(null)-86400)); + //$bar = new GanttBar ($i, $task->getSummary(), date('Y-m-d', $task->getOpenDate(null)), date('Y-m-d', $task->getCloseDate(null)-86400)); $bar->title->SetFont($font[0], $font[1], $font[2]); $relations = $task->getTrackerItemRelationsRelatedByTrackerItemId();