| <?php |
| $basebugs = "251715,252789,252790,252791,252792,252793,252794,252795,252796,252797,252798,252799,252800,252801,252803,252804,252805,252806,252807,252808,252809,252813,252810,252811,252812,252814,252815,252816"; |
| |
| |
| $projects = array(); |
| $requirements = array(); |
| $must_or_should = array(); |
| $target = array(); |
| $data = array(); |
| $data2 = array(); |
| $bugid = array(); |
| |
| //tracks the count of bugs green/yellow/pink/orange |
| $project_bug_status = array(); |
| |
| $contents = file_get_contents( "https://bugs.eclipse.org/bugs/show_bug.cgi?id=${basebugs}&ctype=xml" ); |
| $contents = utf8_encode( $contents ); |
| $xml = simplexml_load_string( $contents ); |
| |
| //print_r( $xml ); |
| |
| function projectof( $rec ) { |
| switch( '' . $rec->product ) { |
| case 'BIRT': |
| case 'Buckminster': |
| case 'CDT': |
| case 'DD': |
| case 'DLTK': |
| case 'Data Tools': |
| case 'ECF': |
| case 'EMF': |
| case 'EMFT': |
| case 'EPP': |
| case 'Equinox': |
| case 'GEF': |
| case 'GMF': |
| case 'JWT': |
| case 'M2M': |
| case 'MDT': |
| case 'PDT': |
| case 'Platform': |
| case 'Riena': |
| case 'RAP': |
| case 'SOA': |
| case 'Subversive': |
| case 'SWTBot': |
| case 'TPTP': |
| case 'Target Management': |
| case 'Web Tools': |
| case 'EclipseLink': |
| return '' . $rec->product; |
| case 'TMF': |
| return 'TMF Xtext'; |
| default: return $rec->product . " " . $rec->component; |
| } |
| } |
| |
| $i = 0; |
| foreach( $xml->bug as $each ) { |
| $req = trim('' . $each->short_desc); |
| $reqid = trim('' . $each->bug_id); |
| $requirements[$reqid] = $req; |
| $must_or_should[$reqid] = ('' . $each->priority) == 'P1'; |
| $target[$reqid] = trim('' . $each->target_milestone); |
| $q = array(); |
| foreach( $each->dependson as $qe ) { |
| $q[] = $qe; |
| } |
| $contents = file_get_contents( "https://bugs.eclipse.org/bugs/show_bug.cgi?id=" . implode( ',', $q ) . "&field=short_desc&field=bug_id&field=bug_status&field=resolution&field=product&field=component&ctype=xml" ); |
| $contents = utf8_encode( $contents ); |
| $yml = simplexml_load_string( $contents ); |
| foreach( $yml->bug as $yach ) { |
| $pk = projectof( $yach ); |
| $projects[$pk] = 1; |
| $data[$reqid][$pk] = '' . $yach->bug_status; |
| $data2[$reqid][$pk] = '' . $yach->resolution; |
| $bugid[$reqid][$pk] = '' . $yach->bug_id; |
| } |
| $i++; |
| } |
| |
| $projects = array_keys( $projects ); |
| sort( $projects ); |
| ?> |
| <table border="1"> |
| <tr><th></th><th></th> |
| <?php |
| foreach( $projects as $each ) { |
| ?><th><?= $each ?></th><?php |
| } |
| ?> |
| </tr> |
| <?php |
| function cmpreq( $a, $b ) { |
| global $must_or_should; |
| global $target; |
| global $requirements; |
| if( $must_or_should[$a] == $must_or_should[$b] ) { |
| if( $target[$a] == $target[$b] ) { |
| return strcmp($requirements[$a],$requirements[$b]); |
| } else { |
| return strcmp($target[$a],$target[$b]); |
| } |
| } else { |
| if( $must_or_should[$a] ) |
| return -1; |
| else return 1; |
| } |
| } |
| uksort( $requirements, 'cmpreq' ); |
| foreach( $requirements as $reqid => $req ) { |
| ?><tr><td><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=<?= $reqid ?>"><?= |
| $must_or_should[$reqid] ? '<b>' : '' ?><?= |
| $req ?><?= |
| $must_or_should[$reqid] ? '</b>' : '' ?></a></td> |
| <td><?= $target[$reqid] ?></td><?php |
| foreach( $projects as $proj ) { |
| if( isset($data[$reqid][$proj]) ) { |
| switch( $data[$reqid][$proj] ) { |
| case 'NEW': |
| case 'ASSIGNED': |
| case 'REOPENED': |
| ?><td style="text-align: center; background-color: #FFFFCC"><a style="text-decoration: none; color: black;" |
| href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=<?= $bugid[$reqid][$proj] ?>"><?= $bugid[$reqid][$proj] ?></a></td><?php |
| |
| $project_bug_status[$proj]['yellow'] ++; |
| break; |
| case 'RESOLVED': |
| case 'VERIFIED': |
| case 'CLOSED': |
| switch( $data2[$reqid][$proj] ) { |
| case 'FIXED': |
| case 'WORKSFORME': |
| case 'DUPLICATE': |
| ?><td style="text-align: center; background-color: #CCFFCC"><a style="text-decoration: none; color: black;" |
| href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=<?= $bugid[$reqid][$proj] ?>"><?= $bugid[$reqid][$proj] ?></a></td><?php |
| |
| $project_bug_status[$proj]['green'] ++; |
| break; |
| case 'WONTFIX': |
| case 'INVALID': |
| case 'WONTFIX': |
| case 'LATER': |
| case 'REMIND': |
| case 'NOT_ECLIPSE': |
| default: |
| ?><td style="text-align: center; background-color: <?= $must_or_should[$reqid] ? "#FFCCCC" : "#FFCC99" ?>"><a style="text-decoration: none; color: black;" |
| href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=<?= $bugid[$reqid][$proj] ?>"><?= $bugid[$reqid][$proj] ?></a></td><?php |
| |
| if($must_or_should[$reqid]){ |
| $project_bug_status[$proj]['red'] ++; |
| }else{ |
| $project_bug_status[$proj]['orange'] ++; |
| } |
| break; |
| } |
| break; |
| default: |
| ?><td><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=<?= $bugid[$reqid][$proj] ?>"><?= $data[$reqid][$proj] ?></a></td><?php |
| $project_bug_status[$proj]['white'] ++; |
| break; |
| } |
| } else { |
| ?><td style="background-color: #EEEEFF; text-align: center;"><em>missing</em></td><?php |
| } |
| } |
| ?></tr> |
| <?php |
| } |
| |
| ?> |
| <tr><th></th><th></th> |
| <?php |
| foreach( $projects as $each ) { |
| ?><th><?php |
| ?><div style="text-align: center; background-color: #CCFFCC;"><?= $project_bug_status[$each]['green'] ? $project_bug_status[$each]['green'] : "-" ; ?></div><?php |
| ?><div style="text-align: center; background-color: #FFFFCC;"><?= $project_bug_status[$each]['yellow'] ? $project_bug_status[$each]['yellow'] : "-"; ?></div><?php |
| ?><div style="text-align: center; background-color: #FFCC99;"><?= $project_bug_status[$each]['orange'] ? $project_bug_status[$each]['orange'] : "-"; ?></div><?php |
| ?><div style="text-align: center; background-color: #FFCCCC;"><?= $project_bug_status[$each]['red'] ? $project_bug_status[$each]['red'] : "-"; ?></div><?php |
| ?></th><?php |
| } |
| ?> |
| </tr> |
| |
| </table> |