* Copyright 1999-2001 (c) VA Linux Systems
* http://sourceforge.net
*
- * @version $Id$
- *
*/
* and "special project list" respectively
*/
function stats_generate_trove_pulldown( $selected_id = 0 ) {
-
$res = db_query("
SELECT trove_cat_id,fullpath
FROM trove_cat
<select name="trovecatid">';
print '
- <option value="-2">All Projects</option>
- <option value="-1">Special Project List</option>';
+ <option value="-2">'._('All Projects').'</option>
+ <option value="-1">'._('Special Projects').'</option>';
while ( $row = db_fetch_array($res) ) {
print '
if ( $row = db_fetch_array($res) ) {
return $row["fullpath"];
} else {
- return " ( $trovecatid returned no category name ) ";
+ return sprintf(_(" (no category found with ID %d)"), $trovecatid) ;
}
}
function stats_site_projects_form( $report='last_30', $orderby = 'downloads', $projects = 0, $trovecat = 0 ) {
-
print '<form action="projects.php" method="get">' . "\n";
- print '<table width="100%" cellpadding="0" cellspacing="0" style="background-color:#eeeeee">' . "\n";
+ print '<table width="100%" cellpadding="0" cellspacing="0" class="tableheading">' . "\n";
- print '<tr><td><strong>Projects in trove category: </strong></td><td>';
+ print '<tr><td><strong>'._('Projects in trove category:').'</strong></td><td>';
stats_generate_trove_pulldown( $trovecat );
print '</td></tr>';
- print '<tr><td><strong>OR enter Special Project List: </strong></td>';
+ print '<tr><td><strong>'._('OR enter Special Project List:').'</strong></td>';
print '<td> <input type="text" width="100" name="projects" value="'. $projects . '" />';
- print ' (<strong>comma separated</strong> group_id\'s) </td></tr>';
+ print ' ('._('<strong>comma separated</strong> group_id\'s)').'</td></tr>';
- print '<tr><td><strong>Report: </strong></td><td>';
+ print '<tr><td><strong>'._('Report:').'</strong></td><td>';
$reports_ids=array();
$reports_ids[]='last_30';
$reports_ids[]='all';
$reports_names=array();
- $reports_names[]='Last 30 Days';
- $reports_names[]='All Time';
+ $reports_names[]=_('last_30');
+ $reports_names[]=_('all');
echo html_build_select_box_from_arrays($reports_ids, $reports_names, 'report', $report, false);
print ' </td></tr>';
- print '<tr><td><strong>View By: </strong></td><td>';
+ print '<tr><td><strong>'._('View by:').'</strong></td><td>';
$orderby_vals = array("downloads",
"site_views",
"subdomain_views",
print html_build_select_box_from_arrays ( $orderby_vals, $orderby_vals, "orderby", $orderby, false );
print '</td></tr>';
- print '<tr><td colspan="2" align="center"> <input type="submit" value="Generate Report" /> </td></tr>';
+ print '<tr><td colspan="2" style="text-align:center"> <input type="submit" value="'._('Generate Report').'" /> </td></tr>';
print '</table>' . "\n";
print '</form>' . "\n";
*
*/
function stats_site_project_result( $report, $orderby, $projects, $trove ) {
-
//
// Determine if we are looking at ALL projects,
// a trove category, or a specific list
//
+ $grp_str='';
+/*
if ($trove == '-2') {
//do a query of ALL groups
$grp_str='';
WHERE trove_cat_id ='$trove'
AND g.group_id=trove_group_link.group_id) ";
}
+*/
+
+ if (!$orderby) {
+ $orderby = "group_name ASC";
+ }else {
+ $orderby .= " DESC, group_name ASC";
+ }
if ($report == 'last_30') {
s.group_id = g.group_id
$grp_str
GROUP BY g.group_id, g.group_name
- ORDER BY $orderby DESC ";
+ ORDER BY $orderby";
} else {
WHERE
s.group_id = g.group_id
$grp_str
- ORDER BY $orderby DESC ";
-
+ ORDER BY $orderby";
}
- return db_query( $sql, 30, 0, SYS_DB_STATS);
+ return db_query( $sql, 0, 0, SYS_DB_STATS);
}
function stats_site_projects( $report, $orderby, $projects, $trove ) {
-
+ $i=0;
+ $offset=0;
+ $trove_cat=0;
$res=stats_site_project_result( $report, $orderby, $projects, $trove );
-
- // if there are any rows, we have valid data (or close enough).
+ // if there are any rows, we have valid data (or close enough).
if ( db_numrows( $res ) > 1 ) {
?>
- <p><table width="100%" cellpadding="0" cellspacing="0" border="0">
-
- <tr valign="top" align="right" style="bgcolor:#eeeeee">
- <td><strong>Group Name</strong></td>
- <td colspan="2"><strong>Page Views</strong></td>
- <td><strong>Downloads</strong></td>
- <td colspan="2"><strong>Bugs</strong></td>
- <td colspan="2"><strong>Support</strong></td>
- <td colspan="2"><strong>Patches</strong></td>
- <td colspan="2"><strong>All Trkr</strong></td>
- <td colspan="2"><strong>Tasks</strong></td>
- <td colspan="3"><strong>CVS</strong></td>
+ <table width="100%" cellpadding="0" cellspacing="0" border="1">
+
+ <tr valign="top" align="right" class="tableheading">
+ <td><strong><?php echo _('Group Name'); ?></strong></td>
+ <td colspan="2"><strong><?php echo _('Page Views'); ?></strong></td>
+ <?php if ($GLOBALS['sys_use_frs']) { ?>
+ <td><strong><?php echo _('Downloads'); ?></strong></td>
+ <?php } ?>
+ <?php if ($GLOBALS['sys_use_tracker']) { ?>
+ <td colspan="2"><strong><?php echo _('Bugs'); ?></strong></td>
+ <td colspan="2"><strong><?php echo _('Support'); ?></strong></td>
+ <td colspan="2"><strong><?php echo _('Patches'); ?></strong></td>
+ <td colspan="2"><strong><?php echo _('All Trkr'); ?></strong></td>
+ <?php } ?>
+ <?php if ($GLOBALS['sys_use_pm']) { ?>
+ <td colspan="2"><strong><?php echo _('Tasks'); ?></strong></td>
+ <?php } ?>
+ <?php if ($GLOBALS['sys_use_scm']) { ?>
+ <td colspan="3"><strong><?php echo _('CVS'); ?></strong></td>
+ <?php } ?>
</tr>
<?php
$uri_string .= "&orderby=";
?>
- <tr valign="top" align="right" style="bgcolor:#eeeeee">
+ <tr valign="top" align="right" class="tableheading">
<td> </td>
- <td><a href="<?php echo $uri_string; ?>site_views">Site</a></td>
- <td><a href="<?php echo $uri_string; ?>subdomain_views">Subdomain</a></td>
- <td><a href="<?php echo $uri_string; ?>downloads">Total</a></td>
- <td><a href="<?php echo $uri_string; ?>bugs_opened">Opn</a></td>
- <td><a href="<?php echo $uri_string; ?>bugs_closed">Cls</a></td>
- <td><a href="<?php echo $uri_string; ?>support_opened">Opn</a></td>
- <td><a href="<?php echo $uri_string; ?>support_closed">Cls</a></td>
- <td><a href="<?php echo $uri_string; ?>patches_opened">Opn</a></td>
- <td><a href="<?php echo $uri_string; ?>patches_closed">Cls</a></td>
- <td><a href="<?php echo $uri_string; ?>artifacts_opened">Opn</a></td>
- <td><a href="<?php echo $uri_string; ?>artifacts_closed">Cls</a></td>
- <td><a href="<?php echo $uri_string; ?>tasks_opened">Opn</a></td>
- <td><a href="<?php echo $uri_string; ?>tasks_closed">Cls</a></td>
- <td><a href="<?php echo $uri_string; ?>cvs_checkouts">CO's</a></td>
- <td><a href="<?php echo $uri_string; ?>cvs_commits">Comm's</a></td>
- <td><a href="<?php echo $uri_string; ?>cvs_adds">Adds</a></td>
+ <td><a href="<?php echo $uri_string; ?>site_views"><?php echo _('Site'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>subdomain_views"><?php echo _('Subdomain'); ?></a></td>
+ <?php if ($GLOBALS['sys_use_frs']) { ?>
+ <td><a href="<?php echo $uri_string; ?>downloads"><?php echo _('Total'); ?></a></td>
+ <?php } ?>
+ <?php if ($GLOBALS['sys_use_tracker']) { ?>
+ <td><a href="<?php echo $uri_string; ?>bugs_opened"><?php echo _('Opened'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>bugs_closed"><?php echo _('Closed'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>support_opened"><?php echo _('Opened'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>support_closed"><?php echo _('Closed'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>patches_opened"><?php echo _('Opened'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>patches_closed"><?php echo _('Closed'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>artifacts_opened"><?php echo _('Opened'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>artifacts_closed"><?php echo _('Closed'); ?></a></td>
+ <?php } ?>
+ <?php if ($GLOBALS['sys_use_pm']) { ?>
+ <td><a href="<?php echo $uri_string; ?>tasks_opened"><?php echo _('Opened'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>tasks_closed"><?php echo _('Closed'); ?></a></td>
+ <?php } ?>
+ <?php if ($GLOBALS['sys_use_scm']) { ?>
+ <td><a href="<?php echo $uri_string; ?>cvs_checkouts"><?php echo _('Checkouts'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>cvs_commits"><?php echo _('Commits'); ?></a></td>
+ <td><a href="<?php echo $uri_string; ?>cvs_adds"><?php echo _('Adds'); ?></a></td>
+ <?php } ?>
</tr>
<?php
$i = $offset;
while ( $row = db_fetch_array($res) ) {
print '<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle($i) . ' align="right">'
- . '<td>' . ($i + 1) . '. <a href="/project/stats/?group_id=' . $row["group_id"] . '">' . $row["group_name"] . '</a></td>'
+ . '<td>' . ($i + 1)." " . util_make_link ('/project/stats/?group_id='.$row["group_id"], $row["group_name"]) . '</td>'
. '<td> ' . number_format( $row["site_views"],0 ) . '</td>'
- . '<td> ' . number_format( $row["subdomain_views"],0 ) . '</td>'
- . '<td> ' . number_format( $row["downloads"],0 ) . '</td>'
- . '<td> ' . number_format( $row["bugs_opened"],0 ) . '</td>'
+ . '<td> ' . number_format( $row["subdomain_views"],0 ) . '</td>';
+ if ($GLOBALS['sys_use_frs']) {
+ print '<td> ' . number_format( $row["downloads"],0 ) . '</td>';
+ }
+ if ($GLOBALS['sys_use_tracker']) {
+ print '<td> ' . number_format( $row["bugs_opened"],0 ) . '</td>'
. '<td> ' . number_format( $row["bugs_closed"],0 ) . '</td>'
. '<td> ' . number_format( $row["support_opened"],0 ) . '</td>'
. '<td> ' . number_format( $row["support_closed"],0 ) . '</td>'
. '<td> ' . number_format( $row["patches_opened"],0 ) . '</td>'
. '<td> ' . number_format( $row["patches_closed"],0 ) . '</td>'
. '<td> ' . number_format( $row["artifacts_opened"],0 ) . '</td>'
- . '<td> ' . number_format( $row["artifacts_closed"],0 ) . '</td>'
- . '<td> ' . number_format( $row["tasks_opened"],0 ) . '</td>'
- . '<td> ' . number_format( $row["tasks_opened"],0 ) . '</td>'
- . '<td> ' . number_format( $row["cvs_checkouts"],0 ) . '</td>'
+ . '<td> ' . number_format( $row["artifacts_closed"],0 ) . '</td>';
+ }
+ if ($GLOBALS['sys_use_pm']) {
+ print '<td> ' . number_format( $row["tasks_opened"],0 ) . '</td>'
+ . '<td> ' . number_format( $row["tasks_opened"],0 ) . '</td>';
+ }
+ if ($GLOBALS['sys_use_scm']) {
+ print '<td> ' . number_format( $row["cvs_checkouts"],0 ) . '</td>'
. '<td> ' . number_format( $row["cvs_commits"],0 ) . '</td>'
- . '<td> ' . number_format( $row["cvs_adds"],0 ) . '</td>'
- . '</tr>' . "\n";
+ . '<td> ' . number_format( $row["cvs_adds"],0 ) . '</td>';
+ }
+ print '</tr>' . "\n";
$i++;
$sum = stats_util_sum_array( $sum, $row );
}
<?php
} else {
- echo "Query returned no valid data.\n";
- echo "<br /><hr /><br />\n $sql \n<br /><hr /><br />\n\n";
+ echo _('Query returned no valid data.')."\n";
echo db_error();
}
?><?php
function stats_site_projects_daily( $span ) {
-
+ $i=0;
//
// We now only have 30 & 7-day views
//
if ( ($valid_days = db_numrows( $res )) > 1 ) {
?>
- <p><strong>Statistics for the past <?php echo $valid_days; ?> days.</strong></p>
-
- <p>
+ <p><strong><?php printf(_('Statistics for the past %1$s days'), $valid_days); ?></strong></p>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top" align="right">
- <td><strong>Day</strong></td>
- <td><strong>Site Views</strong></td>
- <td><strong>Subdomain Views</strong></td>
- <td><strong>Downloads</strong></td>
- <td><strong>Bugs</strong></td>
- <td><strong>Support</strong></td>
- <td><strong>Patches</strong></td>
- <td><strong>Tasks</strong></td>
- <td><strong>CVS</strong></td>
+ <td><strong><?php echo _('Day'); ?></strong></td>
+ <td><strong><?php echo _('Site Views'); ?></strong></td>
+ <td><strong><?php echo _('Subdomain Views'); ?></strong></td>
+ <td><strong><?php echo _('Downloads'); ?></strong></td>
+ <td><strong><?php echo _('Bugs'); ?></strong></td>
+ <td><strong><?php echo _('Support'); ?></strong></td>
+ <td><strong><?php echo _('Patches'); ?></strong></td>
+ <td><strong><?php echo _('Tasks'); ?></strong></td>
+ <td><strong><?php echo _('CVS'); ?></strong></td>
</tr>
<?php
-
+
while ( $row = db_fetch_array($res) ) {
- $i++;
+ $i++;
print '<tr ' . $GLOBALS['HTML']->boxGetAltRowStyle($i) . ' align="right">'
. '<td>' . gmstrftime("%d %b %Y", mktime(0,0,1,substr($row["month"],4,2),$row["day"],substr($row["month"],0,4)) ) . '</td>'
}
?>
- </table></p>
+ </table>
<?php
} else {
- echo "No data.";
+ echo _('No Data');
}
}
function stats_site_projects_monthly() {
-
+ $i=0;
$sql="SELECT * FROM stats_site_months
ORDER BY month DESC";
if ( ($valid_months = db_numrows( $res )) > 1 ) {
?>
- <p><strong>Statistics for the past <?php echo $valid_months; ?> months.</strong></p>
+ <p><strong><?php printf(_('Statistics for the past %1$s months'), $valid_months); ?></strong></p>
- <p>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top" align="right">
- <td><strong>Month</strong></td>
- <td><strong>Site Views</strong></td>
- <td><strong>Subdomain Views</strong></td>
- <td><strong>Downloads</strong></td>
- <td><strong>Bugs</strong></td>
- <td><strong>Support</strong></td>
- <td><strong>Patches</strong></td>
- <td><strong>All Trkr</strong></td>
- <td><strong>Tasks</strong></td>
- <td><strong>CVS</strong></td>
+ <td><strong><?php echo _('Month'); ?>Month</strong></td>
+ <td><strong><?php echo _('Site Views'); ?></strong></td>
+ <td><strong><?php echo _('Subdomain Views'); ?></strong></td>
+ <td><strong><?php echo _('Downloads'); ?></strong></td>
+ <td><strong><?php echo _('Bugs'); ?></strong></td>
+ <td><strong><?php echo _('Support'); ?></strong></td>
+ <td><strong><?php echo _('Patches'); ?></strong></td>
+ <td><strong><?php echo _('All Trkr'); ?></strong></td>
+ <td><strong><?php echo _('Tasks'); ?></strong></td>
+ <td><strong><?php echo _('CVS'); ?></strong></td>
</tr>
<?php
}
?>
- </table></p>
+ </table>
<?php
} else {
- echo "No data.";
+ echo _('No Data');
}
}
function stats_site_aggregate( ) {
-
$res = db_query("SELECT * FROM stats_site_all_vw", -1, 0, SYS_DB_STATS);
$site_totals = db_fetch_array($res);
?>
- <p><strong>Current Aggregate Statistics for All Time</strong></p>
+ <p><strong><?php echo _('Current Aggregate Statistics for All Time'); ?></strong></p>
- <p><table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
- <td><strong>Site Views</strong></td>
- <td><strong>Subdomain Views</strong></td>
- <td><strong>Downloads</strong></td>
- <td><strong>Developers</strong></td>
- <td><strong>Projects</strong></td>
+ <td><strong><?php echo _('Site Views'); ?></strong></td>
+ <td><strong><?php echo _('Subdomain Views'); ?></strong></td>
+ <td><strong><?php echo _('Downloads'); ?></strong></td>
+ <td><strong><?php echo _('Developers'); ?></strong></td>
+ <td><strong><?php echo _('Projects'); ?></strong></td>
</tr>
<tr>
<td><?php echo number_format( $groups["count"],0 ); ?></td>
</tr>
- </table></p>
+ </table>
<?php
}
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
?>