cvs: pearweb /public_html/bugs stats.php
| From: | Helgi �ormar �orbj�rnsson | Date: | Wed, 30 Jun 2004 01:35:17 +0000 |
| Subject: | cvs: pearweb /public_html/bugs stats.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21286@lists.php.net to get a copy of this message | ||
dufuz Tue Jun 29 21:35:17 2004 EDT
Modified files:
/pearweb/public_html/bugs stats.php
Log:
Fixed the ordering stuff, changed some html id's to classes.
http://cvs.php.net/diff.php/pearweb/public_html/bugs/stats.php?r1=1.19&r2=1.20&ty=u
Index: pearweb/public_html/bugs/stats.php
diff -u pearweb/public_html/bugs/stats.php:1.19 pearweb/public_html/bugs/stats.php:1.20
--- pearweb/public_html/bugs/stats.php:1.19 Tue Jun 29 20:38:48 2004
+++ pearweb/public_html/bugs/stats.php Tue Jun 29 21:35:17 2004
@@ -15,7 +15,7 @@
* @package Bugs
* @copyright Copyright (c) 1997-2004 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License
- * @version $Id: stats.php,v 1.19 2004/06/30 00:38:48 dufuz Exp $
+ * @version $Id: stats.php,v 1.20 2004/06/30 01:35:17 dufuz Exp $
*/
/**
@@ -27,6 +27,8 @@
$category = $_GET['category'];
$developer = $_GET['developer'];
+$rev = $_GET['rev'];
+$sort_by = $_GET['sort_by'];
$dbh->setFetchMode(DB_FETCHMODE_ASSOC);
@@ -96,15 +98,6 @@
}
}
-function bugstats($status, $name)
-{
- global $package_name;
-
- if ($package_name[$status][$name] > 0) {
- return '<a href="search.php?cmd=display&status=' .
ucfirst($status) . ($name == 'all' ? '' : '&package_name[]=' .
urlencode($name)) . '&by=Any&limit=10'.$string.'">' .
$package_name[$status][$name] . "</a>\n";
- }
-}
-
if ($total > 0) {
/* prepare for sorting by bug report count */
foreach($package_name['all'] as $name => $value) {
@@ -121,31 +114,47 @@
if (!isset($package_name['feedback'][$name])) {
$package_name['feedback'][$name] = 0; }
}
- if (!isset($_GET['sort_by'])) {
- $_GET['sort_by'] = 'open';
+ if (!isset($sort_by)) {
+ $sort_by = 'open';
}
if (!isset($_GET['rev'])) {
- $_GET['rev'] = 1;
+ $rev = 1;
}
if ($_GET['rev'] == 1) {
- arsort($package_name[$_GET['sort_by']]);
+ arsort($package_name[$sort_by]);
} else {
- asort($package_name[$_GET['sort_by']]);
+ asort($package_name[$sort_by]);
}
reset($package_name);
}
+function bugstats($status, $name)
+{
+ global $package_name;
+
+ if ($package_name[$status][$name] > 0) {
+ return '<a href="search.php?cmd=display&status=' .
ucfirst($status) . ($name == 'all' ? '' : '&package_name[]=' .
urlencode($name)) . '&by=Any&limit=10'.$string.'">' .
$package_name[$status][$name] . "</a>\n";
+ }
+}
+
+
function sort_url ($name)
{
global $sort_by,$rev,$phpver,$category,$developer;
- if ($type == $_GET['sort_by']) {
- $reve = ($_GET['rev'] == 1) ? 0 : 1;
+ if ($name == $sort_by) {
+ $reve = ($rev == 1) ? 0 : 1;
} else {
$reve = 1;
}
- return '<a
href="./stats.php?sort_by='.urlencode($name).'&rev='.$reve.'&category='.$category.'&developer='.$developer.'">'.ucfirst($name).'</a>';
+ if ($sort_by != $name) {
+ $attr = '';
+ } else {
+ $attr = 'class="bug_stats_choosen"';
+ }
+ return '<a
href="./stats.php?sort_by='.urlencode($name).'&rev='.$reve.'&category='.$category.'&developer='.$developer.'"
'.$attr.'>'.ucfirst($name).'</a>';
+
}
function package_link ($name)
@@ -164,10 +173,10 @@
function display_stat_header($total, $grandtotal = true) {
global $dbh;
if ($grandtotal) {
- $stat_head = '<tr
id="bug_header"><td><strong>Name</strong></td>
+ $stat_head = '<tr
class="bug_header"><td><strong>Name</strong></td>
<td> </td>';
} else {
- $stat_head = '<tr
id="bug_header"><td> </td><td> </td>';
+ $stat_head = '<tr
class="bug_header"><td> </td><td> </td>';
}
$stat_head .= '<td><strong>' . sort_url('closed') .
'</strong></td>
<td><strong>' . sort_url('open') .
'</strong></td>
@@ -187,7 +196,7 @@
/**
* Fetch list of all categories
*/
-echo '<table>'."\n";
+echo '<table style="font-size: 90%;">'."\n";
$res = category::listAll();
$_SERVER['QUERY_STRING'] ? $query_string = '?' .
$_SERVER['QUERY_STRING'] : '';
echo '<tr><td colspan="13">
@@ -249,7 +258,7 @@
</tr>' . "\n";
$stat_row = 1;
-foreach ($package_name[$_GET['sort_by']] as $name => $value) {
+foreach ($package_name[$sort_by] as $name => $value) {
if ($name != 'all') {
/* Output a new header row every 40 lines */
if (($stat_row++ % 40) == 0) {