* 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 ) {
- global $Language;
$res = db_query("
SELECT trove_cat_id,fullpath
FROM trove_cat
<select name="trovecatid">';
print '
- <option value="-2">'.$Language->getString('stats_site_utils','all_projects').'</option>
- <option value="-1">'.$Language->getString('stats_site_utils','sprecial_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 $Language->getString('stats_site_utils','returned_no_category')) ";
+ return sprintf(_(" (no category found with ID %d)"), $trovecatid) ;
}
}
function stats_site_projects_form( $report='last_30', $orderby = 'downloads', $projects = 0, $trovecat = 0 ) {
- global $Language;
print '<form action="projects.php" method="get">' . "\n";
print '<table width="100%" cellpadding="0" cellspacing="0" class="tableheading">' . "\n";
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";
*/
if (!$orderby) {
- $orderby = "group_name";
+ $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 ) {
- global $Language;
$i=0;
$offset=0;
$trove_cat=0;
<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_cvs']) { ?>
<td colspan="3"><strong><?php echo _('CVS'); ?></strong></td>
+ <?php } ?>
</tr>
<?php
<td> </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>
- <td><a href="<?php echo $uri_string; ?>bugs_opened"><?php echo _('Opn'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>bugs_closed"><?php echo _('Cls'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>support_opened"><?php echo _('Opn'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>support_closed"><?php echo _('Cls'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>patches_opened"><?php echo _('Opn'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>patches_closed"><?php echo _('Cls'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>artifacts_opened"><?php echo _('Opn'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>artifacts_closed"><?php echo _('Cls'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>tasks_opened"><?php echo _('Opn'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>tasks_closed"><?php echo _('Cls'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>cvs_checkouts"><?php echo _('CO\'s'); ?></a></td>
- <td><a href="<?php echo $uri_string; ?>cvs_commits"><?php echo _('Comm\'s'); ?></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="'.$GLOBALS['sys_urlprefix'].'/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 );
}
} else {
echo _('Query returned no valid data.')."\n";
- echo "<br /><hr /><br />\n $sql \n<br /><hr /><br />\n\n";
echo db_error();
}
?><?php
function stats_site_projects_daily( $span ) {
- global $Language;
$i=0;
//
// We now only have 30 & 7-day views
}
function stats_site_projects_monthly() {
- global $Language;
$i=0;
$sql="SELECT * FROM stats_site_months
ORDER BY month DESC";
}
function stats_site_aggregate( ) {
-
- global $Language;
$res = db_query("SELECT * FROM stats_site_all_vw", -1, 0, SYS_DB_STATS);
$site_totals = db_fetch_array($res);
<?php
}
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
?>