| <?php |
| /* 221934 - this page to remain on eclipse.org */ |
| |
| // ----------------------------------------------------------------------------------------------- |
| // lists.php - Lists of Committers, Project Leads, Projects for a Committer, etc. |
| // Bjorn's 'list of lists' |
| // |
| // AUTHOR: Karl Matthias |
| // DATE: 2007-07-10 |
| // HISTORY: 2007-10-19 Added components to committers lists |
| // 2007-11-07 Phoenixized default page and fixed blocker on badly formed component names |
| // 2007-11-26 Migrated components to Projects table |
| // 2008-01-10 Updated to better intermingle with project_summary.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"); |
| require_once("common/shared_functions.php"); |
| |
| $App = new App(); |
| $Nav = new Nav(); |
| $Menu = new Menu(); |
| include($App->getProjectCommon()); |
| |
| $pageTitle = "Lists"; |
| $pageKeywords = "committers projects leads project"; |
| $pageAuthor = "Karl Matthias - July 10, 2007"; |
| |
| $extraHtmlHeaders = ' |
| <link rel="stylesheet" type="text/css" href="common/project_summary.css"> |
| '; |
| $App->AddExtraHtmlHeader($extraHtmlHeaders); |
| |
| $iconDir = "http://dev.eclipse.org/large_icons"; |
| |
| ob_start(); |
| include( '_commonLeftNav.php' ); |
| ?> |
| <div id="maincontent"> |
| <div id="midcolumn" style="width:680px;"> |
| <?php |
| |
| $list = $_REQUEST['list']; |
| $param = $_REQUEST['param']; |
| $param2 = $_REQUEST['param2']; |
| |
| // validate param |
| if(!preg_match('/^[a-z.0-9\-_]*$/', $param)) { |
| nice_die('invalid format for parameter'); |
| } |
| if(!preg_match('/^[a-z.0-9\-_ ]*$/i', $param2)) { |
| nice_die('invalid format for parameter2'); |
| } |
| |
| // validate request |
| switch($list) { |
| case 'leads': |
| case 'allcommitters': |
| case 'allbyproject': |
| case 'projectsforcommitter': |
| case 'byproject': |
| case 'bycomponent': |
| break; |
| default: |
| ?> |
| <h1>Project Lists Page</h1> |
| <p>Many inter-linked lists are accessible via this engine. Clicking on a link will |
| take you to a page that displays more specific information.</p> |
| <p>General lists can be accessed using one of the following queries:</p> |
| <ul> |
| <li><a href="?list=allbyproject">All Committers Sorted by Project</a></li> |
| <li><a href="?list=allcommitters">All Committers Sorted by Committer Name</a></li> |
| </ul> |
| <p>Detailed queries are possible and are linked from those two queries.</p> |
| </div></div> |
| <?php |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| exit(); |
| } |
| |
| if($list == 'leads') { |
| box_header('blueonwhite', "", '', false, true); |
| echo "<div style='padding: 1em; width: 100%'>"; |
| echo "<span class='pageheader'>$param Project</span>"; |
| box_header('whiteonblue', 'Project Leads', "$iconDir/apps/preferences-desktop-theme.png"); |
| leads_for_project($param); |
| box_footer('whiteonblue'); |
| echo "</div>"; |
| echo "<br clear='all'/>"; |
| box_footer('blueonwhite'); |
| echo "<br clear='all'/>"; |
| |
| } elseif($list == 'allcommitters') { |
| echo "<h1>All Committers with Project</h1>"; |
| echo "<table>"; |
| $result = $App->foundation_sql("SELECT People.PersonID, FName, LName, ProjectID FROM People, PeopleProjects " . |
| "WHERE Relation = 'CM' " . |
| "AND InactiveDate is NULL " . |
| "AND People.PersonID = PeopleProjects.PersonID " . |
| "ORDER BY LName", $fdbh); |
| while($row = mysql_fetch_assoc($result)) { |
| echo "<tr><td></a> </td><td> <a href='?list=projectsforcommitter¶m=" . $row['PersonID'] ."'>" . $row['FName'] . " " . $row['LName'] . "</a> </td><td> <a href=\"?list=byproject¶m=" . $row['ProjectID'] . "\">" . $row['ProjectID'] . "</a></td></tr>"; |
| } |
| echo "</table>"; |
| |
| } elseif($list == 'allbyproject') { |
| echo "<h1>All Committers by Project</h1>"; |
| echo "<table>"; |
| $result = $App->foundation_sql("SELECT People.PersonID, FName, LName, Projects.ProjectID FROM People, PeopleProjects, Projects " . |
| "WHERE Relation = 'CM' " . |
| "AND InactiveDate is NULL " . |
| "AND People.PersonID = PeopleProjects.PersonID " . |
| "AND Projects.ProjectID = PeopleProjects.ProjectID " . |
| "ORDER BY ProjectID", $fdbh); |
| while($row = mysql_fetch_assoc($result)) { |
| echo "<tr><td><a href=\"?list=byproject¶m=" . $row['ProjectID'] . "\">" . $row['ProjectID'] . "</a> </td><td> <a href='?list=projectsforcommitter¶m=" . $row['PersonID'] ."'>" . $row['FName'] . " " . $row['LName'] . "</a></td></tr>"; |
| } |
| echo "</table>"; |
| |
| } elseif($list == 'projectsforcommitter') { |
| // Get full name from People table |
| $result = $App->foundation_sql("SELECT FName, LName FROM People WHERE PersonID = '$param'"); |
| $row = mysql_fetch_assoc($result); |
| $name = $row['FName'] . ' ' . $row['LName']; |
| |
| // Get employer name if we know it |
| $result = $App->foundation_sql("SELECT Name1 FROM Organizations, OrganizationContacts " . |
| "WHERE PersonID = '$param' " . |
| "AND Relation = 'EMPLY' " . |
| "AND OrganizationContacts.Comments = 'PRIMARY'" . |
| "AND Organizations.OrganizationID = OrganizationContacts.OrganizationID"); |
| $row = mysql_fetch_assoc($result); |
| $company = $row['Name1']; |
| |
| box_header('blueonwhite', "", '', false, true); |
| echo "<div style='padding: 1em;'>"; |
| $name .= isset($company) ? " ($company)" : ""; |
| echo "<div><span class='pageheader'>Projects for $name</span>"; |
| echo isset($top) ? "<span style=\"font-size: small; color: white; margin-left: 2px;\">(<a href=\"http://dash.eclipse.org/dash/commits/web-app/summary.cgi?company=y&year=x&top=$top&project=$param\">dash</a>)</span>" : ''; |
| echo "</div>"; |
| box_header('whiteonblue', 'Committer on', "$iconDir/apps/system-users.png"); |
| |
| echo "<table>"; |
| $result = $App->foundation_sql("SELECT People.PersonID, FName, LName, Projects.ProjectID " . |
| "FROM People, PeopleProjects, Projects " . |
| "WHERE Relation = 'CM' " . |
| "AND InactiveDate is NULL " . |
| "AND People.PersonID = PeopleProjects.PersonID " . |
| "AND PeopleProjects.ProjectID = Projects.ProjectID " . |
| "AND People.PersonID = '$param' " . |
| "ORDER BY ProjectID", $fdbh); |
| if(mysql_num_rows($result) < 1) { |
| die("That is not a committer"); |
| } |
| while($row = mysql_fetch_assoc($result)) { |
| $top = substr($row['ProjectID'], 0, strpos($row['ProjectID'], '.')); |
| $components = component_for_committer($param, $row['ProjectID']); |
| if(strlen($components) > 0) { |
| $components = "<span style='color: gray'>$components</span> "; |
| } |
| $url = "http://dash.eclipse.org/dash/commits/web-app/summary.cgi?type=y&year=x&top=$top&project=" . $row['ProjectID'] . "&login=$param"; |
| echo "<tr><td></a> </td><td> <a href=\"?list=byproject¶m=" . $row['ProjectID'] . "\">" . $row['ProjectID'] . "</a> $components<span style='font-size: x-small;'>(<a href='$url'>dash</a>)</span></td></tr>"; |
| } |
| echo "</table>"; |
| echo "<br clear='all'/>"; |
| box_footer('whiteonblue'); |
| echo "<br clear='all'/></div>"; |
| box_footer('blueonwhite'); |
| |
| } elseif($list == 'byproject') { |
| $top = substr($param, 0, strpos($param, '.')); |
| box_header('blueonwhite', "", '', false, true); |
| echo "<div style='padding: 1em;'>"; |
| echo "<div><span class='pageheader'>$param</span>"; |
| echo isset($top) ? "<span style=\"font-size: small; color: white; margin-left: 2px;\">(<a href=\"http://dash.eclipse.org/dash/commits/web-app/summary.cgi?company=y&year=x&top=$top&project=$param\">dash</a>)</span>" : ''; |
| echo "</div>"; |
| box_header('whiteonblue', 'Committers', "$iconDir/apps/system-users.png"); |
| committers_for_project($param); |
| box_footer('whiteonblue'); |
| |
| box_header('whiteonblue', 'Project Leads', "$iconDir/apps/preferences-desktop-theme.png", true); |
| leads_for_project($param); |
| box_footer('whiteonblue'); |
| echo "<br clear='all'/>"; |
| |
| echo "</div>"; |
| box_footer('blueonwhite'); |
| |
| echo "<br clear='all'/>"; |
| |
| } elseif($list == 'bycomponent') { |
| $name = substr(strrchr($param2, '.'), 1); |
| echo "<h1 style='margin: 0px; padding-left: 0px'>Committers for $param "; |
| echo "</h1>"; |
| echo "<b style='color: gray; padding-left: 1em;'>component: $name </b><br/><br/>\n"; |
| echo "<table>\n"; |
| $result = $App->foundation_sql("SELECT FName, LName, People.PersonID |
| FROM PeopleProjects, People, Projects |
| WHERE ParentProjectID = '$param' |
| AND Projects.ProjectID = '$param2' |
| AND People.PersonID = PeopleProjects.PersonID |
| AND Projects.ProjectID = PeopleProjects.ProjectID |
| ORDER BY LName", $fdbh); |
| if(mysql_num_rows($result) < 1) { |
| die("That is not a project/component or there are no committers on the project/component"); |
| } |
| while($row = mysql_fetch_assoc($result)) { |
| echo "<tr><td> <a href='?list=projectsforcommitter¶m=" . $row['PersonID'] ."'>" . $row['FName'] . " " . $row['LName'] . "</a></td></tr>"; |
| } |
| echo "</table>"; |
| |
| } |
| |
| echo "<br/><hr/> |
| <div style='font-size: small;'> |
| <b>How to read this:</b> Project and Committer names link to detail pages for their respective subject. (dash) links connect to |
| the commits explorer dashboard at <a href='http://dash.eclipse.org/'>dash.eclipse.org</a>. On detail |
| pages components are in comma-separated, gray lists after the name of each committer if the |
| particular project is organizedby component. |
| </div> |
| </div></div>"; |
| |
| $html = ob_get_contents(); |
| ob_end_clean(); |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |