| <?php | |
| /******************************************************************************* | |
| * Copyright (c) 2018 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 | |
| *******************************************************************************/ | |
| /** | |
| * FIXME Experimental. Refactoring required. | |
| */ | |
| 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"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Project.class.php"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Release.class.inc"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/common.php"); | |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/database.inc"); | |
| $App = new App(); | |
| $Nav = new Nav(); | |
| $Menu = new Menu(); | |
| include($App->getProjectCommon()); | |
| callIfNotCommitter('exit'); | |
| $pageTitle = "Eclipse Foundation PMC Tasks"; | |
| $pageKeywords = ""; | |
| $pageAuthor = "Wayne Beaton"; | |
| /** | |
| * This function renders a project selection drop-down. | |
| * When the | |
| * user selects a value, the page is reloaded with the id of the | |
| * selected project in the <code>id</code> parameter. All other | |
| * parameters that had been passed to the page are preserved via | |
| * hidden fields. | |
| * | |
| * @param string $id | |
| * The id of the selected project | |
| */ | |
| function dumpProjectSelectionForm($id) { | |
| echo "<form method=\"get\">"; | |
| foreach ( $_GET as $key => $value ) { | |
| if ($key == 'id') | |
| continue; | |
| echo "<input type=\"hidden\" name=\"$key\" value=\"$value\""; | |
| } | |
| echo "<p>Select a project: "; | |
| echo "<select name=\"id\" onchange=\"this.form.submit()\">"; | |
| foreach ( Project::getTopLevelProjects() as $project ) { | |
| $selected = $id == $project->getId () ? ' selected="true"' : ''; | |
| echo "<option value=\"{$project->getId()}\"$selected>{$project->getFormalName()}</option>"; | |
| } | |
| echo "</select>"; | |
| echo "<input type=\"submit\" value=\"Go!\"/>"; | |
| echo "</p>"; | |
| echo "</form>"; | |
| } | |
| $id = $_GET['id']; | |
| $root = Project::getProject($id); | |
| if ($root == null || !$root->isTopLevel()) { | |
| $id = null; | |
| $root = null; | |
| } | |
| function withCqsAwaitingPMC($id, $callable) { | |
| $sql = " | |
| select | |
| b.bug_id as id, | |
| c.name as project, | |
| b.short_desc as description, | |
| b.cf_type as type, | |
| date(b.creation_ts) as created, | |
| b.bug_status as status, | |
| b.resolution as resolution, | |
| b.bug_severity as state | |
| from bugs as b | |
| join components as c on b.component_id = c.id | |
| join products as p on b.product_id = p.id | |
| where p.name=':id' | |
| and bug_status='NEW' | |
| and bug_severity='awaiting_pmc' | |
| order by c.name | |
| "; | |
| query('ipzilla', $sql, array(':id' => $id), $callable); | |
| } | |
| function dumpFutureReleases($id) { | |
| echo "<ul>"; | |
| Release::releasesAfter($id)->withEach(function(Release $release) { | |
| echo "<li><a href=\"{$release->getUrl()}\">{$release->getName()}</a> "; | |
| echo date('Y-m-d', $release->getDate()); | |
| if ($url = $release->getTrackingBugUrl()) { | |
| echo "<a href=\"{$url}\">[track]</a>"; | |
| } | |
| // dumpOpenCQs($release); | |
| echo "</li>"; | |
| }); | |
| echo "</ul>"; | |
| } | |
| function dumpOpenCQs(Release $release) { | |
| echo "<ul>"; | |
| $sql = ' | |
| select | |
| b.bug_id as id, b.short_desc as title | |
| from bugs as b | |
| join components as c on b.component_id=c.id | |
| where c.name=\'$id\' | |
| and bug_status in (\'NEW\', \'REOPENED\')'; | |
| query ('ipzilla', $sql, array('$id' => $release->getId()), function ($row) { | |
| $id = $row ['id']; | |
| $title = $row ['title']; | |
| echo "<li><a target=_blank href=\"https://dev.eclipse.org/ipzilla/show_bug.cgi?id=$id\">$id</a> $title</li>"; | |
| }); | |
| echo "</ul>"; | |
| } | |
| ob_start(); | |
| ?> | |
| <div id="maincontent"> | |
| <div id="midcolumn"> | |
| <h1><?= $pageTitle ?></h1> | |
| <p><strong>Experimental</strong> Provide a list of links to tasks that require the PMC's attention.</p> | |
| <?php dumpProjectSelectionForm($id) ?> | |
| <?php if ($id) { ?> | |
| <h2><?php print $root->getFormalName(); ?></h2> | |
| <h3>Intellectual Property</h3> | |
| <?php | |
| $cqs = array(); | |
| withCqsAwaitingPMC($root->getId(), function($cq) use (&$cqs) { | |
| $cqs[$cq['project']][] = $cq; | |
| }); | |
| if ($cqs) { | |
| print "<p>The following CQs require some attention from the PMC.</p>"; | |
| foreach ($cqs as $id => $list) { | |
| $project = Project::getProject($id); | |
| $name = $project ? $project->getFormalName() : $id; | |
| print "<h4>{$name}</h4>"; | |
| print "<ul>"; | |
| foreach($list as $cq) { | |
| print "<li><a href=\"https://dev.eclipse.org/ipzilla/show_bug.cgi?id={$cq['id']}\">{$cq['id']}</a> {$cq['description']}</li>"; | |
| } | |
| print "</ul>"; | |
| } | |
| } else { | |
| print "<p>There are no CQs that require PMC attention at this time.</p>"; | |
| } | |
| ?> | |
| <h3>Upcoming Releases</h3> | |
| <?php | |
| dumpFutureReleases($id); | |
| ?> | |
| <?php } ?> | |
| </div> | |
| </div> | |
| <?php | |
| $html = ob_get_contents(); | |
| ob_end_clean(); | |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); | |
| ?> |