blob: 55a941ed1d192c385a21ce11696cc2d4c887a972 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2011 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wayne Beaton (Eclipse Foundation)- initial API and implementation
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php");
$App = new App();
$Nav = new Nav();
$Menu = new Menu();
include($App->getProjectCommon());
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/SimultaneousReleaseInfo.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/common.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/images.inc");
trace_file_info(__FILE__);
$releases = getSimultaneousReleaseNames();
$release = getCurrentSimultaneousReleaseName();
if (isset($_GET['release'])) {
$target = $_GET['release'];
if (in_array($target, $releases)) $release = $target;
}
$releaseName = ucfirst($release);
$pageTitle = "Eclipse $releaseName Release";
$pageKeywords = "";
$pageAuthor = "Wayne Beaton";
$projects = getAllProjectsInSimultaneousRelease($release);
sortProjects($projects, 'name');
ob_start();
?>
<div id="midcolumn">
<h1><?= $pageTitle ?></h1>
<p>The following projects are part of the <?php echo $releaseName; ?> release.</p>
<table cellspacing="0">
<tr class="header">
<td>Project Name</td>
<td align="center">Version</td>
<td align="center">Offset</td>
</tr>
<?
$count = 0;
$new = array();
$ids = array();
foreach ($projects as $project) {
/* var Project $project */
$projectName = $project->getName();
$projectid = $project->getId();
$ids[] = "'$projectid'";
$url = $project->getProjectUrl();
$info = $project->getSimultaneousReleaseInfo($release);
if (!$info) continue;
$projectName = "<b><a href=\"$url\">$projectName</a></b> <a href=\"/projects/project.php?id=$projectid\"><img src=\"$images->projects_small\"></a>";
if ($info->isNew()) {
$new[] = $projectName;
$projectName = "$projectName [new]";
}
$offset = $info->getOffset();
$versions = array();
foreach($info->getReleases() as $projectRelease) {
$version = $projectRelease->getName() ? $projectRelease->getName() : null;
if (!$version) $version = "??";
$download = $projectRelease->getDownload();
if ($download) $version .= "<a href=\"$download\"><img src=\"$images->download_small\"/></a>";
$plan = $projectRelease->getPlan();
if ($plan) $version .= "<a href=\"$plan\"><img src=\"$images->plan_small\"/></a>";
$versions[] = $version;
}
$version = implode(', ', $versions);
$version = preg_replace('/ /', '&nbsp;', $version);
$count++;
echo "<tr class=\"tableRow\">
<td>$projectName</td>
<td align=\"center\">$version</td>
<td align=\"center\">$offset</td>
</tr>";
}
?>
</table>
<?php echo get_trace_html(); ?>
</div>
<div id="rightcolumn">
<div class="sideitem">
<h6>Other Releases</h6>
<?php
echo "<ul>";
foreach($releases as $name) {
$out = ucfirst($name);
if ($name != $release) {
$out = "<a href=\"?release=$name\">$out</a>";
} else {
$date = getSimultaneousReleaseDate($name);
if ($date) $out .= ', ' . $App->getFormattedDate($date);
}
echo "<li>$out</li>";
}
echo "</ul>";
?>
</div>
<div class="sideitem">
<h6>General Information</h6>
<?php
$newCount = count($new);
echo "<p>$count projects; $newCount new this release</p>";
echo "<ul>";
foreach($new as $projectName) echo "<li>$projectName</li>";
echo "</ul>";
?>
</div>
<?php
if (isset($_GET['commas'])) {
echo "<div class=\"sideitem\">";
echo "<h6>Query List</h6>";
$ids = implode(', ',$ids);
$date = getSimultaneousReleaseDate($release);
$endDate = date('Y-m-d', $date);
$startDate = date('Y-m-d', strtotime('-1 year', $date));
$sql = "select
count(distinct login) as committers,
count(distinct revision) as commits,
count(distinct project) as projects
from commits
where
project in ($ids)
and date between '$startDate' and '$endDate'";
echo "<p>$sql</p>";
echo "</div>";
}
?>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>