blob: cc3549fdbbc04fd319e05cf0a690547e6356fa34 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2010 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 - initial API and implementation
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/common.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php");
trace_file_info(__FILE__);
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();
login_committer();
include($App->getProjectCommon());
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Review.class.php");
$smallIconDir = "http://dev.eclipse.org/small_icons";
$reviews = get_reviews($App);
ob_start();
$pageKeywords = "";
$pageTitle = "Reviews";
$pageAuthor = "Wayne Beaton";
?>
<div id="midcolumn">
<div class="homeitem">
<h1><?= $pageTitle ?></h1>
<?php
// Keep track of the number of reviews in each month.
$counts = array();
echo "<ul>";
foreach($reviews as $review) {
$reviewDate = $review->getReviewDate();
if ($reviewDate) {
// $period is the key in the $counts array. We increment the
// counter for each period as we encounter this. Effectively,
// this counts the number of reviews that occur in any give
// month.
$period = date('Y-m', $reviewDate);
if (isset($counts[$period])) {
$counts[$period]++;
} else {
$counts[$period] = 1;
}
// Format the date.
$reviewDate = $App->getFormattedDate($reviewDate, 'short');
} else {
$reviewDate = 'unscheduled';
}
echo "<li>";
echo $review->asHtml();
echo "<ul>";
foreach($review->statuses as $status) {
$text = $status->getText();
$date = $App->getFormattedDate($status->getDate(), 'short');
echo "<li>$date $text</li>";
}
echo "</ul>";
echo "</li>";
}
echo "</ul>";
echo get_trace_html();
?>
</div>
</div>
<div id="rightcolumn">
<div class="sideitem">
<h6>Summaries</h6>
<?php
krsort($counts);
echo '<ul>';
foreach($counts as $period => $count) {
echo "<li>$period - $count</li>";
}
echo '</ul>';
?>
</div>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>