| <?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 |
| *******************************************************************************/ |
| |
| /* |
| * Export committer information from the Foundation database. The information |
| * includes the name, committer id, email addresses, and project affiliations. |
| * |
| * e.g. http://www.eclipse.org/projects/export/cq_stats.csv.php |
| * |
| * INTERNAL USE ONLY: restricted to callers within the Eclipse Foundation. |
| */ |
| 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"); |
| |
| mustBeEclipseFoundationCaller(); |
| |
| $sql = "select |
| b.bug_id, |
| p.name as tlp, |
| c.name as project, |
| b.short_desc as summary, |
| if(b.short_desc regexp '\((Orbit|PB( Orbit)?)\s*\d*\)', 'piggyback', kd.name) as type, |
| b.bug_severity as state, |
| b.bug_status as status, |
| b.resolution as resolution, |
| date(b.creation_ts) as created, |
| max(date(pmc.bug_when)) as pmc, |
| max(date(checkin.bug_when)) as checkin, |
| max(date(approved.bug_when)) as approved |
| from bugs as b |
| join products as p on b.product_id=p.id |
| join components as c on b.component_id=c.id |
| join keywords as k on b.bug_id=k.bug_id |
| join keyworddefs as kd on k.keywordid=kd.id and kd.name in ('thirdparty', 'projectcode') |
| left join bugs_activity as pmc on b.bug_id=pmc.bug_id and pmc.added in ('PMC_Approved+') |
| left join bugs_activity as checkin on b.bug_id=checkin.bug_id and checkin.added in ('checkin', 'checkintocvs') |
| left join bugs_activity as approved on b.bug_id=approved.bug_id and approved.added in ('approved', 'approved_all_projects') |
| group by b.bug_id |
| order by tlp, checkin desc"; |
| |
| $result = $App->ipzilla_sql($sql); |
| |
| $fp = fopen('php://output', 'w'); |
| while ($row=mysql_fetch_assoc($result)) fputcsv($fp, $row); |
| fclose($fp); |
| |
| ?> |