blob: 91635c797f6c0368598d01f1acca19b3af1eebdd [file] [log] [blame]
<?php
include($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/include-before-definitions.php");
$pageTitle = "Master Timeline";
$pageKeywords = "timeline";
$pageAuthor = "Bjorn Freeman-Benson Nov 20/05";
include($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/include-after-definitions.php");
?>
<div id="maincontent">
<div id="midcolumn">
<h1><?= $pageTitle ?></h1>
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/projects/projectList.class.php");
define("QUARTERS_TO_DISPLAY",8);
define("TOTAL_COLSPAN",24);
define ("DATES_TXT",".dates.txt");
$rows = array();
$baseyear = date('Y'); // This year
function getfile($file){
$fp = fopen($file,"r");
while(!feof($fp))
$output .= fgets($fp,1024);
fclose($fp);
return $output;
}
$rows = array();
$baseyear = date('Y'); // This year
$basemonth = date('m');
switch($basemonth){
case ($basemonth <= 3) : $basemonth = 10;
$baseyear--;
break;
case ($basemonth <= 6) : $basemonth = 1;
break;
case ($basemonth <= 9) : $basemonth = 4;
break;
case ($basemonth <= 12): $basemonth = 7;
break;
}
function makedates($year,$month){
$lastyear = 0;
$i = 0;
$totalspan = 0;
if ($month <= 3){
$firstquarter = 1;
$firstcolspan = 12;
$lastcolspan = 12;
}else if ($month <= 6){
$firstquarter = 2;
$firstcolspan = 9;
$lastcolspan = 3;
}else if ($month <= 9){
$firstquarter = 3;
$firstcolspan = 6;
$lastcolspan = 6;
}else{
$firstquarter = 4;
$firstcolspan = 3;
$lastcolspan = 9;
}
$quarter = $firstquarter;
while($i<QUARTERS_TO_DISPLAY){
if ($i == 0){
$colspan = $firstcolspan;
$totalspan += $colspan;
}else if ($lastyear != $year){
$colspan = TOTAL_COLSPAN - $totalspan - $lastcolspan;
if ($colspan == 0)
$colspan += $lastcolspan;
$totalspan += $colspan;
}
if ($lastyear != $year){
$years[] = array($year,$colspan);
$lastyear = $year;
}
if ($quarter % 4 == 0)
$year++;
$q = array('Q'.$quarter,3);
$quarters[$i++] = $q;
$quarter = (++$quarter % 4);
if ($quarter == 0)
$quarter = 4;
}
return array($years,$quarters);
}
list($years,$quarters) = makedates($baseyear,$basemonth);
$c = count($years)-1;
$lastyear = $years[$c][0];
$c = count($quarters)-1;
$lastmonth = substr($quarters[$c][0],1,1); // Get last quarter
$lastmonth *= 3; // 3 months in each quarter
switch($basemonth){
case ($basemonth <= 3) : $firstmonth = 1;
break;
case ($basemonth <= 6) : $firstmonth = 4;
break;
case ($basemonth <= 9) : $firstmonth = 7;
break;
case ($basemonth <= 12): $firstmonth = 10;
break;
}
$projectList = new ProjectList();
$projectList->selectProjectList("", "", "1", "", "", "");
$count = $projectList->getCount();
for($pr=0;$pr<$projectList->getCount();$pr++){
$project = $projectList->getItemAt($pr);
$projectName = $project->getName();
$url = $project->getUrlIndex();
if (substr($url,-1,1) != "/")
$url .= "/";
$url .= DATES_TXT;
$localfile = str_replace("http://www.eclipse.org/",$_SERVER['DOCUMENT_ROOT']."/", $url);
$localfile = str_replace("http://eclipse.org/", $_SERVER['DOCUMENT_ROOT']."/", $localfile);
if (!file_exists($localfile)){
$localfile = str_replace("http://www.eclipse.org/", "/home/data/httpd/www.eclipse.org/html/", $url);
$localfile = str_replace("http://eclipse.org/", "/home/data/httpd/www.eclipse.org/html/", $localfile);
$indexpos = strpos($localfile,"index.");
if ($indexpos){
$localfile = substr($localfile,0,$indexpos);
if (substr($localfile,-1,1) != "/")
$localfile .= "/";
$localfile .= DATES_TXT;
}
}
if (!file_exists($localfile))
continue;
$contents = getfile($localfile);
$lines = explode("\n", $contents);
$arow = array($lines[0], $lines[1], array()); // project name, url, array
for($i=2;$i<count($lines);$i++){ // Find dates on the rest of the lines
$words = explode(" ", $lines[$i]);
if (strlen($words[0]) > 0){
list($name, $month, $year,$url,$kind) = sscanf($lines[$i], "%s %d/%d %s %s");
if (($year == $lastyear) && ($month > $lastmonth))
continue;
if (($year == $baseyear) && ($month < $firstmonth))
continue;
if (($month >= 1) && ($month <= 12) && ($year >= $baseyear)){
$x = $month + (($year - $baseyear) * 12) - $basemonth + 1;
$arow[2][] = array($x, $words[0], $url, $kind);
}
}
}
$rows[] = $arow;
}
?>
<table border=0 cellspacing="0" cellpadding="0">
<!-- YEARS -->
<tr><td></td>
<?php
$max_month = 0;
foreach($years as $v2){
echo "<td colspan=".$v2[1]." align=\"center\" bgcolor=gray><table width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">";
echo "<tr><td bgcolor=\"#0000FF\" align=\"center\"><font color=\"#FFFF00\">" .$v2[0]."</font>";
echo "</td></tr></table></td>\n";
$max_month += $v2[1];
}
?>
</tr>
<!-- QUARTERS -->
<tr><td></td>
<?php
foreach($quarters as $v2){
echo "<td colspan=".$v2[1]." align=\"center\" bgcolor=gray><table width=\"75\" cellspacing=\"1\" cellpadding=\"0\">";
echo "<tr><td bgcolor=\"#0000FF\" align=\"center\"><font color=\"#FFFF00\">" .$v2[0]."</font>";
echo "</td></tr></table></td>\n";
}
?>
</tr>
<!-- INITIAL ARROWS -->
<tr>
<?php
$arrows = array();
$arrows[0] = "&nbsp;";
for($i=1;$i<=$max_month;$i++)
$arrows[$i] = "&nbsp;";
foreach($rows as $arow)
foreach ($arow[2] as $releases)
$arrows[$releases[0]] = "<img src=\"arrow.gif\"/>";
foreach($arrows as $cell)
echo "<td width=25 align=\"center\">".$cell."</td>\n";
?>
</tr>
<!-- ROWS -->
<?php
$cells = array();
for($y=0;$y<count($rows);$y++){
$cells[$y] = array();
$arow = $rows[$y];
$cells[$y][0] = "<td align=right><font face=\"Arial,Helvetica\" size=2><b><a href=\"".$arow[1]."\">".$arow[0]."</a></b></font></td>\n";
for($i=1;$i<=$max_month;$i++)
$cells[$y][$i] = " ";
$items = $arow[2];
for($i=count($items)-1;$i>=0;$i--){
$item = $items[$i];
$idx = $item[0];
$string = $item[1];
if (strlen($string) > 3)
$string = "<span style=\"letter-spacing: -1pt\">".$string."</span>";
if (strtolower($item[2]) == "tentative")
$string = "<font color=gray><em>".$string."</em>";
else
if (strtolower($item[2]) == "completed")
$string = "<font color=\"#006600\">".$string."</font>";
else
$string = "<font color=black>".$string."</font>";
if ($item[3] != "")
$string = "<a href=\"".$item[3]."\">".$string."</a>";
$cells[$y][$idx] = $string;
for ($z =$y-1;$z>=0;$z--)
if ($cells[$z][$idx] == " ")
$cells[$z][$idx] = "|";
}
}
for($y=0;$y<count($cells);$y++){
for($x=count($cells[$y])-1;$x>1;$x--)
if (strlen($cells[$y][$x]) > 1)
break;
for(;$x>0;$x--){
if ($cells[$y][$x] == " ")
$cells[$y][$x] = "@";
if ($cells[$y][$x] == "|")
$cells[$y][$x] = "#";
}
}
foreach($cells as $cellrow){
echo "<tr>\n";
$first = 0;
foreach($cellrow as $cell){
if ($first == 0){
$first = 1;
echo $cell;
}else
if (strlen($cell) == 1){
if ($cell == " ")
echo "<td>&nbsp;</td>\n";
if ($cell == "@")
echo "<td align=center><img src=\"dots.gif\"/></td>\n";
if ($cell == "#")
echo "<td align=center><img src=\"line-dots.gif\"/></td>\n";
if ($cell == "|")
echo "<td align=center><img src=\"line.gif\"/></td>\n";
}else
echo "<td align=center>".$cell."</td>\n";
}
echo "</tr>\n";
}
?>
</table>
<p>&nbsp;</p>
<p><font color="#006600">Green</font> releases are completed.
Normal black releases are planned.
<font color=gray><em>Grey italic</em></font> releases are tentative.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>See <a href="how-things-work.php">How Things Work</a> for how this page is generated.</p>
</td>
</tr>
</table>
<?php
include($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/include-end-of-page.php");
?>