| <?php | |
| /******************************************************************************* | |
| * Copyright (c) 2014 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 (Eclipse Foundation)- initial API and implementation | |
| *******************************************************************************/ | |
| require_once(dirname(__FILE__) . "/../../eclipse.org-common/system/app.class.php"); | |
| $App = new App(); | |
| require_once(dirname(__FILE__) . "/../classes/common.php"); | |
| require_once(dirname(__FILE__) . "/../classes/debug.php"); | |
| $sql = " | |
| SELECT | |
| bugs.bug_id as bug_id, | |
| bugs.short_desc as title, | |
| attachments.attach_id as attach_id, | |
| attachments.description as description, | |
| attachments.isobsolete as isobsolete | |
| FROM bugs | |
| join products on (bugs.product_id = products.id) | |
| join components on (bugs.component_id = components.id) | |
| join attachments on (bugs.bug_id = attachments.bug_id and attachments.isobsolete = 0) | |
| WHERE | |
| products.name = 'Community' | |
| AND components.name = 'Proposals and Reviews' | |
| AND attachments.description like 'Approved IP Log%'"; | |
| $result = $App->bugzilla_sql($sql); | |
| $output = array(); | |
| while( $row = mysql_fetch_assoc($result) ) { | |
| if (!preg_match(' /\[release\] ([a-z0-9\-\.]+) ([0-9\.]+)/i',$row['title'],$matches)) continue; | |
| $bug = $row['bug_id']; | |
| $attachment = $row['attach_id']; | |
| $project = $matches[1]; | |
| $version = $matches[2]; | |
| $output[$project][$version] = array( | |
| 'id' => $bug, | |
| 'bug' => "https://bugs.eclipse.org/bugs/show_bug.cgi?id=$bug", | |
| 'iplog' => "https://bugs.eclipse.org/bugs/attachment.cgi?id=$attachment" | |
| ); | |
| } | |
| echo json_encode($output); | |
| ?> |