| <?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(); |
| $nested = array(); |
| 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 = date('Y-m-d', $reviewDate); |
| $nested[$reviewDate][] = $review; |
| } else { |
| $reviewDate = 'unscheduled'; |
| } |
| } |
| |
| foreach($nested as $date => $reviews) { |
| $reviewDate = $App->getFormattedDate(strtotime($date), 'long'); |
| |
| echo "<h3>$reviewDate</h3>"; |
| echo "<table width=\"100%\"><tbody>"; |
| foreach($reviews as $review) { |
| $project = $review->getProjectName(); |
| if ($url = $review->getProjectUrl()) |
| $project = "<a href=\"$url\">$project</a>"; |
| |
| $description = $review->getReviewName(); |
| if ($url = $review->getSlidesUrl()) |
| $description = "<a href=\"$url\">$description</a>"; |
| |
| if ($review->isSuccessful()) $state = 'Complete'; |
| else if ($review->isWithdrawn()) $state = 'Withdrawn'; |
| else $state = 'Ongoing'; |
| |
| echo "<tr><td width=\"60%\">$project</td><td width=\"25%\">$description</td><td width=\"15%\">$state</td></tr>"; |
| } |
| echo "</tbody></table>"; |
| } |
| |
| 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); |
| ?> |