cvs: pearweb /public_html/css packages_status.css /public_html/qa packages_status.php packages_status_detail.php
| From: | Tobias Schlitt | Date: | Tue, 16 Aug 2005 19:01:29 +0000 |
| Subject: | cvs: pearweb /public_html/css packages_status.css /public_html/qa packages_status.php packages_status_detail.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-3597@lists.php.net to get a copy of this message | ||
toby Tue Aug 16 15:01:29 2005 EDT
Added files:
/pearweb/public_html/qa packages_status_detail.php
Modified files:
/pearweb/public_html/css packages_status.css
/pearweb/public_html/qa packages_status.php
Log:
* Splitted packages_status.php (by Arnaud).
* Refined css (by Arnaud).
http://cvs.php.net/diff.php/pearweb/public_html/css/packages_status.css?r1=1.1&r2=1.2&ty=u Index: pearweb/public_html/css/packages_status.css diff -u pearweb/public_html/css/packages_status.css:1.1 pearweb/public_html/css/packages_status.css:1.2 --- pearweb/public_html/css/packages_status.css:1.1 Sat Aug 13 07:14:33 2005 +++ pearweb/public_html/css/packages_status.css Tue Aug 16 15:01:27 2005 @@ -1,10 +1,4 @@ /* Parts of the code borrowed from csszengarden.com, hicksdesign.co.uk */ -html { margin: 0px; - padding: 0px; padding-left: 2%;} - -body { font-size: 13px; - font-family: "Lucida Grande","Lucida Sans Unicode",geneva,verdana,sans-serif; color: #525252; background-color: #fff; margin: 0px; padding: 0px;} - #pageHeader h1 { font-size: 18px; } @@ -13,40 +7,34 @@ font-size: 14px; } -table { - border : 1px solid #330033; margin: 0px; +#new #old table { + border : 1px solid #330033; + margin: 0px; padding: 0px; margin-top: 5px; margin-bottom: 20px; } -table th { +#new #old th { color: #000; border-bottom: 1px solid #000; } -td { +#new #old td { padding: 2px; - border-left: dashed 1px #669999; border-right: dashed 1px #669999; + border-left: dashed 1px #339900; + border-right: dashed 1px #339900; } -table caption { +#new #old table caption { color: #000; font-size: 90%; } -.old table { - background-color: #BEBDFF; -} - -.old caption { - color: #F00; -} - #footer { font-size: 9px; } em { font-weight: bold; -} \ No newline at end of file +} http://cvs.php.net/diff.php/pearweb/public_html/qa/packages_status.php?r1=1.5&r2=1.6&ty=u Index: pearweb/public_html/qa/packages_status.php diff -u pearweb/public_html/qa/packages_status.php:1.5 pearweb/public_html/qa/packages_status.php:1.6 --- pearweb/public_html/qa/packages_status.php:1.5 Sun Aug 14 11:35:04 2005 +++ pearweb/public_html/qa/packages_status.php Tue Aug 16 15:01:27 2005 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: Arnaud Limbourg <arnaud@limbourg.com> | +----------------------------------------------------------------------+ - $Id: packages_status.php,v 1.5 2005/08/14 15:35:04 toby Exp $ + $Id: packages_status.php,v 1.6 2005/08/16 19:01:27 toby Exp $ */ /** @@ -25,178 +25,23 @@ */ auth_require('pear.qa'); -require 'HTML/Table.php'; - -$extra_styles[] = '/css/packages_status.css'; -// Sortable tables http://www.kryogenix.org/code/browser/sorttable/ -$extra_header = ' - <script src="/javascript/sorttable.js"></script> -'; -// Deactivate sidebar navigation, don't know if I got this right -// $SIDEBAR_DATA = '-'; - response_header('Quality Assurance Initiative - Packages status', false, $extra_header); -$pck = new package(); - -$packages = $pck->listAll(false, false, false); - -if (PEAR::isError($packages)) { - report_error('Cannot list packages'); - response_footer(); - exit(); -} - -$total_packages_nbr = $studied_packages_nbr = 0; - $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); $tables = array(); -$time_scale = 15552000; // how much time elapsed since last release, in seconds - -foreach ($states as $state) { - $tables[$state]['old'] = new HTML_Table( - array( - 'id' => 'old' . $state, - 'cellspacing' => 0, - 'class' => 'sortable' - ) - ); - $tables[$state]['old']->setCaption( - 'Packages with state <em>' - . $state . '</em> which have not been released in ' - . $time_scale / 86400 . ' days' - ); - $tables[$state]['old']->setHeaderContents(0, 0, 'Package'); - $tables[$state]['old']->setHeaderContents(0, 1, 'Version'); - $tables[$state]['old']->setHeaderContents(0, 2, 'Date'); - $tables[$state]['old']->setHeaderContents(0, 3, '# bugs'); - - $tables[$state]['new'] = new HTML_Table( - array( - 'id' => 'new' . $state, - 'cellspacing' => 0, - 'class' => 'sortable' - ) - ); - $tables[$state]['new']->setCaption( - 'Packages with state <em>' - . $state . '</em> with a release in the past ' - . $time_scale / 86400 . ' days' - ); - $tables[$state]['new']->setHeaderContents(0, 0, 'Package'); - $tables[$state]['new']->setHeaderContents(0, 1, 'Version'); - $tables[$state]['new']->setHeaderContents(0, 2, 'Date'); - $tables[$state]['new']->setHeaderContents(0, 3, '# bugs'); -} - -foreach ($packages as $package => $pck_data) { - $total_packages_nbr++; - - $latest_release = $pck->getRecent(1, $package); - if (PEAR::isError($latest_release) || count($latest_release) == 0) { - continue; - } - - $release_date = strtotime($latest_release[0]['releasedate']); - - $status = 'new'; - - if (time() - $time_scale > $release_date) { - $status = 'old'; - } - - $tables[$latest_release[0]['state']][$status]->addRow( - array( - make_link('/package/' . $package, - $package, '', 'title=' . $package), - $latest_release[0]['version'], - date('d F Y', $release_date), - $bugcount = bugcount($package) - ) - ); +echo "View packages status for the following state\n"; - $studied_packages_nbr++; -} - -$html = ''; -foreach ($tables as $state => $table) { - if ($table['old']->getRowCount() > 1) { - $html .= '<p class="old">' . $table['old']->toHtml() . '</p>'; - } - if ($table['new']->getRowCount() > 1) { - $html .= '<p id="new">' . $table['new']->toHtml() . '</div>' . "\n"; - } +echo "<ul>\n"; +foreach ($states as $state) { + $link = make_link( + '/qa/packages_status_detail.php?state=' . $state, + 'See packages status for state ' . $state, '', + 'title="Details for state ' . $state . '"'); + echo '<li>' . $state . '</li>'; } - -$out = ' -<div id="container"> - <p id="pageHeader"> - <h1>Summary</h1> - <div id="subtitle"> - <h2>Number of packages in PEAR: {{TOTAL_PACKAGES_NUMBER}}</h2> - <h2>Number of packages studied here : {{STUDIED_PACKAGES_NUMBER}}</h2> - </div> - </p> - - <div id="details"> - {{TABLES}} - </div> - - <div id="footer"> - Page last updated on: {{UPDATE_DATE}} - </div> -</div> -'; - -$search = array( - '{{TOTAL_PACKAGES_NUMBER}}', - '{{STUDIED_PACKAGES_NUMBER}}', - '{{TABLES}}', - '{{UPDATE_DATE}}', -); - -$replace = array( - $total_packages_nbr, - $studied_packages_nbr, - $html, - date('d F Y \a\t H:i:s') -); - -$out = str_replace($search, $replace, $out); - -echo $out; +echo "</ul>\n"; response_footer(); - -/** - * Count number of bugs for a package - * - * @string package name - * @return int number of bugs - */ -function bugcount($package) -{ - global $dbh; - - $query = ' - SELECT - COUNT(*) - FROM - bugdb - WHERE - package_name=' . $dbh->quoteSmart($package) . ' - AND bug_type = "Bug" - AND status IN ("Open", "Critical", "Assigned", "Analyzed") - '; - - $count = $dbh->getOne($query); - - if (PEAR::isError($count)) { - return 0; - } - - return (int) $count; -} ?> http://cvs.php.net/co.php/pearweb/public_html/qa/packages_status_detail.php?r=1.1&p=1 Index: pearweb/public_html/qa/packages_status_detail.php +++ pearweb/public_html/qa/packages_status_detail.php <?php /* +----------------------------------------------------------------------+ | PEAR Web site version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001-2005 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Arnaud Limbourg <arnaud@limbourg.com> | +----------------------------------------------------------------------+ $Id: packages_status_detail.php,v 1.1 2005/08/16 19:01:28 toby Exp $ */ /** * This page will show a list of packages with latest * release information along with bug count and any other info * that may be used to identify unmaintained packages */ auth_require('pear.qa'); require 'HTML/Table.php'; $extra_styles[] = '/css/packages_status.css'; // Sortable tables http://www.kryogenix.org/code/browser/sorttable/ $extra_header = '<script src="/javascript/sorttable.js"></script>'; $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); response_header('Quality Assurance Initiative - Packages status', false, $extra_header); $state = htmlspecialchars($_GET['state']); if (!in_array($state, $states)) { report_error('This is not a valid state'); response_footer(); exit(); } $pck = new package(); $packages = $pck->listAll(false, false, false, $state); if (PEAR::isError($packages)) { report_error('Cannot list packages'); response_footer(); exit(); } $total_packages_nbr = $studied_packages_nbr = 0; $tables = array(); $time_scale = 15552000; // how much time elapsed since last release, in seconds $tables[$state]['old'] = new HTML_Table( array( 'id' => 'old', 'cellspacing' => 0, 'class' => 'sortable' ) ); $tables[$state]['old']->setCaption( 'Packages with state <em>' . $state . '</em> which have not been released in ' . $time_scale / 86400 . ' days' ); $tables[$state]['old']->setHeaderContents(0, 0, 'Package'); $tables[$state]['old']->setHeaderContents(0, 1, 'Version'); $tables[$state]['old']->setHeaderContents(0, 2, 'Date'); $tables[$state]['old']->setHeaderContents(0, 3, '# bugs'); $tables[$state]['new'] = new HTML_Table( array( 'id' => 'new', 'cellspacing' => 0, 'class' => 'sortable' ) ); $tables[$state]['new']->setCaption( 'Packages with state <em>' . $state . '</em> with a release in the past ' . $time_scale / 86400 . ' days' ); $tables[$state]['new']->setHeaderContents(0, 0, 'Package'); $tables[$state]['new']->setHeaderContents(0, 1, 'Version'); $tables[$state]['new']->setHeaderContents(0, 2, 'Date'); $tables[$state]['new']->setHeaderContents(0, 3, '# bugs'); foreach ($packages as $package => $pck_data) { $total_packages_nbr++; $latest_release = $pck->getRecent(1, $package); if (PEAR::isError($latest_release) || count($latest_release) == 0) { continue; } // we just want to see the packages for a given state if ($latest_release[0]['state'] != $state) { continue; } $release_date = strtotime($latest_release[0]['releasedate']); $status = 'new'; if (time() - $time_scale > $release_date) { $status = 'old'; } $tables[$state][$status]->addRow( array( make_link('/package/' . $package, $package, '', 'title="' . $package . '"'), $latest_release[0]['version'], date('d F Y', $release_date), bugcount($package) ) ); $studied_packages_nbr++; } $html = ''; foreach ($tables as $state => $table) { if ($table['old']->getRowCount() > 1) { $html .= '<p class="old">' . $table['old']->toHtml() . '</p>'; } if ($table['new']->getRowCount() > 1) { $html .= '<p id="new">' . $table['new']->toHtml() . '</div>' . "\n"; } } $out = ' <div id="container"> <p id="pageHeader"> <h1>Summary</h1> <div id="subtitle"> <h2>Number of packages in PEAR: {{TOTAL_PACKAGES_NUMBER}}</h2> <h2>Number of packages studied here : {{STUDIED_PACKAGES_NUMBER}}</h2> </div> </p> <div id="details"> {{TABLES}} </div> <div id="footer"> Page last updated on: {{UPDATE_DATE}} </div> </div> '; $search = array( '{{TOTAL_PACKAGES_NUMBER}}', '{{STUDIED_PACKAGES_NUMBER}}', '{{TABLES}}', '{{UPDATE_DATE}}', ); $replace = array( $total_packages_nbr, $studied_packages_nbr, $html, date('d F Y \a\t H:i:s') ); $out = str_replace($search, $replace, $out); echo $out; response_footer(); /** * Count number of bugs for a package * * @string package name * @return int number of bugs */ function bugcount($package) { global $dbh; $query = ' SELECT COUNT(*) FROM bugdb WHERE package_name=' . $dbh->quoteSmart($package) . ' AND bug_type = "Bug" AND status IN ("Open", "Critical", "Assigned", "Analyzed") '; $count = $dbh->getOne($query); if (PEAR::isError($count)) { return 0; } if ($count > 0 && $count < 10) { $count = 0 . $count; } return (int) $count; } ?>
http://cvs.php.net/diff.php/pearweb/public_html/css/packages_status.css?r1=1.1&r2=1.2&ty=u Index: pearweb/public_html/css/packages_status.css diff -u pearweb/public_html/css/packages_status.css:1.1 pearweb/public_html/css/packages_status.css:1.2 --- pearweb/public_html/css/packages_status.css:1.1 Sat Aug 13 07:14:33 2005 +++ pearweb/public_html/css/packages_status.css Tue Aug 16 15:01:27 2005 @@ -1,10 +1,4 @@ /* Parts of the code borrowed from csszengarden.com, hicksdesign.co.uk */ -html { margin: 0px; - padding: 0px; padding-left: 2%;} - -body { font-size: 13px; - font-family: "Lucida Grande","Lucida Sans Unicode",geneva,verdana,sans-serif; color: #525252; background-color: #fff; margin: 0px; padding: 0px;} - #pageHeader h1 { font-size: 18px; } @@ -13,40 +7,34 @@ font-size: 14px; } -table { - border : 1px solid #330033; margin: 0px; +#new #old table { + border : 1px solid #330033; + margin: 0px; padding: 0px; margin-top: 5px; margin-bottom: 20px; } -table th { +#new #old th { color: #000; border-bottom: 1px solid #000; } -td { +#new #old td { padding: 2px; - border-left: dashed 1px #669999; border-right: dashed 1px #669999; + border-left: dashed 1px #339900; + border-right: dashed 1px #339900; } -table caption { +#new #old table caption { color: #000; font-size: 90%; } -.old table { - background-color: #BEBDFF; -} - -.old caption { - color: #F00; -} - #footer { font-size: 9px; } em { font-weight: bold; -} \ No newline at end of file +} http://cvs.php.net/diff.php/pearweb/public_html/qa/packages_status.php?r1=1.5&r2=1.6&ty=u Index: pearweb/public_html/qa/packages_status.php diff -u pearweb/public_html/qa/packages_status.php:1.5 pearweb/public_html/qa/packages_status.php:1.6 --- pearweb/public_html/qa/packages_status.php:1.5 Sun Aug 14 11:35:04 2005 +++ pearweb/public_html/qa/packages_status.php Tue Aug 16 15:01:27 2005 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: Arnaud Limbourg <arnaud@limbourg.com> | +----------------------------------------------------------------------+ - $Id: packages_status.php,v 1.5 2005/08/14 15:35:04 toby Exp $ + $Id: packages_status.php,v 1.6 2005/08/16 19:01:27 toby Exp $ */ /** @@ -25,178 +25,23 @@ */ auth_require('pear.qa'); -require 'HTML/Table.php'; - -$extra_styles[] = '/css/packages_status.css'; -// Sortable tables http://www.kryogenix.org/code/browser/sorttable/ -$extra_header = ' - <script src="/javascript/sorttable.js"></script> -'; -// Deactivate sidebar navigation, don't know if I got this right -// $SIDEBAR_DATA = '-'; - response_header('Quality Assurance Initiative - Packages status', false, $extra_header); -$pck = new package(); - -$packages = $pck->listAll(false, false, false); - -if (PEAR::isError($packages)) { - report_error('Cannot list packages'); - response_footer(); - exit(); -} - -$total_packages_nbr = $studied_packages_nbr = 0; - $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); $tables = array(); -$time_scale = 15552000; // how much time elapsed since last release, in seconds - -foreach ($states as $state) { - $tables[$state]['old'] = new HTML_Table( - array( - 'id' => 'old' . $state, - 'cellspacing' => 0, - 'class' => 'sortable' - ) - ); - $tables[$state]['old']->setCaption( - 'Packages with state <em>' - . $state . '</em> which have not been released in ' - . $time_scale / 86400 . ' days' - ); - $tables[$state]['old']->setHeaderContents(0, 0, 'Package'); - $tables[$state]['old']->setHeaderContents(0, 1, 'Version'); - $tables[$state]['old']->setHeaderContents(0, 2, 'Date'); - $tables[$state]['old']->setHeaderContents(0, 3, '# bugs'); - - $tables[$state]['new'] = new HTML_Table( - array( - 'id' => 'new' . $state, - 'cellspacing' => 0, - 'class' => 'sortable' - ) - ); - $tables[$state]['new']->setCaption( - 'Packages with state <em>' - . $state . '</em> with a release in the past ' - . $time_scale / 86400 . ' days' - ); - $tables[$state]['new']->setHeaderContents(0, 0, 'Package'); - $tables[$state]['new']->setHeaderContents(0, 1, 'Version'); - $tables[$state]['new']->setHeaderContents(0, 2, 'Date'); - $tables[$state]['new']->setHeaderContents(0, 3, '# bugs'); -} - -foreach ($packages as $package => $pck_data) { - $total_packages_nbr++; - - $latest_release = $pck->getRecent(1, $package); - if (PEAR::isError($latest_release) || count($latest_release) == 0) { - continue; - } - - $release_date = strtotime($latest_release[0]['releasedate']); - - $status = 'new'; - - if (time() - $time_scale > $release_date) { - $status = 'old'; - } - - $tables[$latest_release[0]['state']][$status]->addRow( - array( - make_link('/package/' . $package, - $package, '', 'title=' . $package), - $latest_release[0]['version'], - date('d F Y', $release_date), - $bugcount = bugcount($package) - ) - ); +echo "View packages status for the following state\n"; - $studied_packages_nbr++; -} - -$html = ''; -foreach ($tables as $state => $table) { - if ($table['old']->getRowCount() > 1) { - $html .= '<p class="old">' . $table['old']->toHtml() . '</p>'; - } - if ($table['new']->getRowCount() > 1) { - $html .= '<p id="new">' . $table['new']->toHtml() . '</div>' . "\n"; - } +echo "<ul>\n"; +foreach ($states as $state) { + $link = make_link( + '/qa/packages_status_detail.php?state=' . $state, + 'See packages status for state ' . $state, '', + 'title="Details for state ' . $state . '"'); + echo '<li>' . $state . '</li>'; } - -$out = ' -<div id="container"> - <p id="pageHeader"> - <h1>Summary</h1> - <div id="subtitle"> - <h2>Number of packages in PEAR: {{TOTAL_PACKAGES_NUMBER}}</h2> - <h2>Number of packages studied here : {{STUDIED_PACKAGES_NUMBER}}</h2> - </div> - </p> - - <div id="details"> - {{TABLES}} - </div> - - <div id="footer"> - Page last updated on: {{UPDATE_DATE}} - </div> -</div> -'; - -$search = array( - '{{TOTAL_PACKAGES_NUMBER}}', - '{{STUDIED_PACKAGES_NUMBER}}', - '{{TABLES}}', - '{{UPDATE_DATE}}', -); - -$replace = array( - $total_packages_nbr, - $studied_packages_nbr, - $html, - date('d F Y \a\t H:i:s') -); - -$out = str_replace($search, $replace, $out); - -echo $out; +echo "</ul>\n"; response_footer(); - -/** - * Count number of bugs for a package - * - * @string package name - * @return int number of bugs - */ -function bugcount($package) -{ - global $dbh; - - $query = ' - SELECT - COUNT(*) - FROM - bugdb - WHERE - package_name=' . $dbh->quoteSmart($package) . ' - AND bug_type = "Bug" - AND status IN ("Open", "Critical", "Assigned", "Analyzed") - '; - - $count = $dbh->getOne($query); - - if (PEAR::isError($count)) { - return 0; - } - - return (int) $count; -} ?> http://cvs.php.net/co.php/pearweb/public_html/qa/packages_status_detail.php?r=1.1&p=1 Index: pearweb/public_html/qa/packages_status_detail.php +++ pearweb/public_html/qa/packages_status_detail.php <?php /* +----------------------------------------------------------------------+ | PEAR Web site version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001-2005 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 2.02 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available at through the world-wide-web at | | http://www.php.net/license/2_02.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Arnaud Limbourg <arnaud@limbourg.com> | +----------------------------------------------------------------------+ $Id: packages_status_detail.php,v 1.1 2005/08/16 19:01:28 toby Exp $ */ /** * This page will show a list of packages with latest * release information along with bug count and any other info * that may be used to identify unmaintained packages */ auth_require('pear.qa'); require 'HTML/Table.php'; $extra_styles[] = '/css/packages_status.css'; // Sortable tables http://www.kryogenix.org/code/browser/sorttable/ $extra_header = '<script src="/javascript/sorttable.js"></script>'; $states = array('snapshot', 'devel', 'alpha', 'beta', 'stable'); response_header('Quality Assurance Initiative - Packages status', false, $extra_header); $state = htmlspecialchars($_GET['state']); if (!in_array($state, $states)) { report_error('This is not a valid state'); response_footer(); exit(); } $pck = new package(); $packages = $pck->listAll(false, false, false, $state); if (PEAR::isError($packages)) { report_error('Cannot list packages'); response_footer(); exit(); } $total_packages_nbr = $studied_packages_nbr = 0; $tables = array(); $time_scale = 15552000; // how much time elapsed since last release, in seconds $tables[$state]['old'] = new HTML_Table( array( 'id' => 'old', 'cellspacing' => 0, 'class' => 'sortable' ) ); $tables[$state]['old']->setCaption( 'Packages with state <em>' . $state . '</em> which have not been released in ' . $time_scale / 86400 . ' days' ); $tables[$state]['old']->setHeaderContents(0, 0, 'Package'); $tables[$state]['old']->setHeaderContents(0, 1, 'Version'); $tables[$state]['old']->setHeaderContents(0, 2, 'Date'); $tables[$state]['old']->setHeaderContents(0, 3, '# bugs'); $tables[$state]['new'] = new HTML_Table( array( 'id' => 'new', 'cellspacing' => 0, 'class' => 'sortable' ) ); $tables[$state]['new']->setCaption( 'Packages with state <em>' . $state . '</em> with a release in the past ' . $time_scale / 86400 . ' days' ); $tables[$state]['new']->setHeaderContents(0, 0, 'Package'); $tables[$state]['new']->setHeaderContents(0, 1, 'Version'); $tables[$state]['new']->setHeaderContents(0, 2, 'Date'); $tables[$state]['new']->setHeaderContents(0, 3, '# bugs'); foreach ($packages as $package => $pck_data) { $total_packages_nbr++; $latest_release = $pck->getRecent(1, $package); if (PEAR::isError($latest_release) || count($latest_release) == 0) { continue; } // we just want to see the packages for a given state if ($latest_release[0]['state'] != $state) { continue; } $release_date = strtotime($latest_release[0]['releasedate']); $status = 'new'; if (time() - $time_scale > $release_date) { $status = 'old'; } $tables[$state][$status]->addRow( array( make_link('/package/' . $package, $package, '', 'title="' . $package . '"'), $latest_release[0]['version'], date('d F Y', $release_date), bugcount($package) ) ); $studied_packages_nbr++; } $html = ''; foreach ($tables as $state => $table) { if ($table['old']->getRowCount() > 1) { $html .= '<p class="old">' . $table['old']->toHtml() . '</p>'; } if ($table['new']->getRowCount() > 1) { $html .= '<p id="new">' . $table['new']->toHtml() . '</div>' . "\n"; } } $out = ' <div id="container"> <p id="pageHeader"> <h1>Summary</h1> <div id="subtitle"> <h2>Number of packages in PEAR: {{TOTAL_PACKAGES_NUMBER}}</h2> <h2>Number of packages studied here : {{STUDIED_PACKAGES_NUMBER}}</h2> </div> </p> <div id="details"> {{TABLES}} </div> <div id="footer"> Page last updated on: {{UPDATE_DATE}} </div> </div> '; $search = array( '{{TOTAL_PACKAGES_NUMBER}}', '{{STUDIED_PACKAGES_NUMBER}}', '{{TABLES}}', '{{UPDATE_DATE}}', ); $replace = array( $total_packages_nbr, $studied_packages_nbr, $html, date('d F Y \a\t H:i:s') ); $out = str_replace($search, $replace, $out); echo $out; response_footer(); /** * Count number of bugs for a package * * @string package name * @return int number of bugs */ function bugcount($package) { global $dbh; $query = ' SELECT COUNT(*) FROM bugdb WHERE package_name=' . $dbh->quoteSmart($package) . ' AND bug_type = "Bug" AND status IN ("Open", "Critical", "Assigned", "Analyzed") '; $count = $dbh->getOne($query); if (PEAR::isError($count)) { return 0; } if ($count > 0 && $count < 10) { $count = 0 . $count; } return (int) $count; } ?>