blob: 1f94de3bb0f679e71c8ce6fb19388dd830553d2a [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2010 Eclipse Foundation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/common.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/debug.php");
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();
// Not sure who we're protecting this from.
//mustBeCommitter();
include($App->getProjectCommon());
require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Proposal.class.php");
$proposals = get_proposals();
ob_start();
$pageKeywords = "";
$pageTitle = "Proposals";
$pageAuthor = "Wayne Beaton";
?>
<div id="midcolumn">
<div class="homeitem">
<h1><?= $pageTitle ?></h1>
<p>The Eclipse Project Handbook contains information about our process for
<a href="https://www.eclipse.org/projects/handbook/#starting">proposing
a new open source project</a> at the Eclipse Foundation.</p>
<p>
<a class="btn btn-primary" href="https://projects.eclipse.org/create/project-proposal"><i class="fa fa-plus" aria-hidden="true"></i> New Proposal</a>
</p>
<?php
usort($proposals, function($proposal1, $proposal2) {
if ($proposal1->getDate() == $proposal2->getDate()) return 0;
return $proposal1->getDate() > $proposal2->getDate() ? -1 : 1;
});
function dumpProposals($title, $proposals, $when) {
$foundOne = false;
foreach($proposals as $proposal) {
if (call_user_func($when, $proposal)) {
if (!$foundOne) {
echo "<h2>{$title}</h2>";
echo "<ul>";
$foundOne = true;
}
echo "<li>{$proposal->asHtml()}</li>";
}
}
if ($foundOne) {
echo "</ul>";
}
}
dumpProposals("Active", $proposals, function (Proposal $proposal) {return $proposal->isActive();});
dumpProposals("Complete", $proposals, function (Proposal $proposal) {return $proposal->isSuccessful();});
dumpProposals("Withdrawn", $proposals, function (Proposal $proposal) {return $proposal->isWithdrawn();});
?>
</div>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
$App->generatePage(null, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>