| <?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 - initial API and implementation |
| *******************************************************************************/ |
| |
| header("Content-type: text/xml"); |
| |
| 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"); |
| $App = new App(); |
| |
| //login_committer(); |
| |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/projects/classes/Proposal.class.php"); |
| |
| $proposals = get_proposals($App); |
| |
| ob_start(); |
| |
| function sort_by_date($proposal1, $proposal2) { |
| if ($proposal1->getDate() == $proposal2->getDate()) return 0; |
| return $proposal1->getDate() > $proposal2->getDate() ? -1 : 1; |
| } |
| |
| usort($proposals, 'sort_by_date'); |
| |
| echo "<proposals>"; |
| foreach($proposals as $proposal) { |
| $name = $proposal->getName(); |
| $id = $proposal->getProjectId(); |
| echo "<proposal id=\"$id\" name=\"$name\">"; |
| foreach($proposal->statuses as $status) { |
| $text = $status->getText(); |
| $date = $App->getFormattedDate($status->getDate(), 'short'); |
| |
| echo "<event date=\"$date\" description=\"$text\"/>"; |
| } |
| echo "</proposal>"; |
| } |
| echo "</proposals>"; |
| |
| ?> |