blob: 44929200ff701a0f42aca044a3efebc5e28c6d7a [file] [log] [blame]
<?php
require('/home/data/httpd/eclipse-php-classes/system/dbconnection_portal_ro.class.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"); $App = new App(); $Nav = new Nav(); $Menu = new Menu();
include('SimultaneousReleaseFunctions.php');
# Begin: page-specific settings.
$pageTitle = "Helios Summary of Projects";
$pageKeywords = "Eclipse Planning Council";
$pageAuthor = "Gabe O'BRien";
$theme = "Nova";
# Paste your HTML content between the markers!
ob_start();
?>
<!-- include empty lef nav col for now -->
<div id="leftcol">
<?php include("SimultaneousReleaseLeftCol.php"); ?>
</div>
<div id="maincontent">
<div id="midcolumn">
<h1><?= $pageTitle ?></h1>
<h2>Simultaneous Release Compliance</h2>
<?php
switch($_GET['action']){
case 'project':
show_a_project($App,$_GET['projectid']);
break;
case 'show_list':
default:
show_list_of_projects($App);
}
?>
</div>
</div>
<?php
$html = ob_get_contents();
ob_end_clean();
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
function show_a_project($App,$projectid){
$project_tracking = get_project_tracking($App,$projectid);
$all_the_fields = get_fields($App,'helios');
?>
<div style="float: right;">
<a target="_blank" href="https://dev.eclipse.org/portal/myfoundation/portal/portal.php">Edit this data at the Foundation's Portal</a>
</div>
<ul style=''>
<li></>Project: <?=$projectid?><br>
<li></>Date: <?=date('c');?><br>
</ul>
<?php
$group_type = "";
foreach($all_the_fields as $fieldlabel => $fields){
$shown_field = str_replace("-"," ",$fieldlabel);
if(empty($fields['fields'])){
$group_type = $shown_field;
?><h3><?=ucwords($fields['name'])?></h3><?php
}else{
if(count($fields['fields']) == 1){
// print "<b>".ucwords($shown_field)."</b><br>";
show_line($group_type,$project_tracking,$fields['fields'][0]['key']);
}else{
print "<b>".ucwords($shown_field)."</b><br>";
foreach($fields['fields'] as $afield){
show_line($group_type,$project_tracking,$afield['key']);
}
}
}
}
}
function show_line($group_type,$project_tracking,$key){
$color = 'yellow';
$value = "";
/*
* check if before M7 and in group baisc/commonrepo
*/
if(($group_type == 'basics' or $group_type == 'commonrepo') and strtotime('now') > strtotime('2010-05-06')){
$color = 'red';
}
/*
* check if data is prensent
*/
if(isset($project_tracking[$key])){
$color = 'green';
$value = $project_tracking[$key];
}
/*
* check for an excpetion
*/
if(isset($project_tracking[$key.'_exception']) and $project_tracking[$key.'_exception'] != ""){
$color = 'lightgreen';
if($project_tracking[$key] != ""){
$value = $project_tracking[$key];
}else{
$value = $project_tracking[$key.'_exception'];
}
}
/*
* swap out new and noteworthy
*/
$sub_field = str_replace("_"," ",$key);
if(preg_match("/New And Noteworthy/i",$sub_field)){
$sub_field = "Link to Supporting Documentation";
}
/*
* display colored diamond
*/
print "&nbsp;&nbsp;<span style='color:$color; font-size: 150%;'>&diams;</span>";
/*
* check value
*/
if($value != ""){
/*
* if the value is a link
*/
if(preg_match("/http:\/\/|https:\/\//i",$value)){
/*
* then make the label a link
*/
echo "<a href='$value'>".ucwords($sub_field)."</a>";
}else{
print ucwords($sub_field);
/*
* display value if not keyword 'on'
*/
if(!preg_match("/^on$/i",trim($value))){
echo ": ".$value;
}
}
}else{
/*
* show the field
*/
print ucwords($sub_field);
}
print "<br>";
}
function show_list_of_projects($App){
$projects_tracking_with_parent = get_projects_tracking_by_parent($App);
$tracking_projects = get_projects_tracking($App);
foreach($tracking_projects as $projectid){
?>
<a href="?action=project&projectid=<?=$projectid?>"><?=$projectid?></a>
<?php
foreach($projects_tracking_with_parent as $k => $v){
if($v == $projectid){
?>
<br>
&nbsp;&nbsp;&nbsp;
<?=$k?>
<?php
}
}
?>
<br>
<?php
}
}
?>