gforge-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gforge-commits] gforge/www/reporting index.php, NONE, 1.1 projectact.ph


From: tperdue
Subject: [Gforge-commits] gforge/www/reporting index.php, NONE, 1.1 projectact.php, NONE, 1.1 projectact_graph.php, NONE, 1.1 projecttime.php, NONE, 1.1 projecttime_graph.php, NONE, 1.1 rebuild.php, NONE, 1.1 siteact.php, NONE, 1.1 siteact_graph.php, NONE, 1.1 sitetime.php, NONE, 1.1 sitetime_graph.php, NONE, 1.1 sitetimebar.php, NONE, 1.1 sitetimebar_graph.php, NONE, 1.1 timeadd.php, NONE, 1.1 timecategory.php, NONE, 1.1 toolspie.php, NONE, 1.1 toolspie_graph.php, NONE, 1.1 trackerpie_graph.php, NONE, 1.1 useract.php, NONE, 1.1 useract_graph.php, NONE, 1.1 useradded.php, NONE, 1.1 useradded_graph.php, NONE, 1.1 usercum.php, NONE, 1.1 usercum_graph.php, NONE, 1.1 usersummary.php, NONE, 1.1 usertime.php, NONE, 1.1 usertime_graph.php, NONE, 1.1
Date: Wed, 28 Jul 2004 12:31:18 -0500

Update of /cvsroot/gforge/gforge/www/reporting
In directory db.perdue.net:/home/tperdue/share/dev.gforge.org/www/reporting

Added Files:
        index.php projectact.php projectact_graph.php projecttime.php 
        projecttime_graph.php rebuild.php siteact.php 
        siteact_graph.php sitetime.php sitetime_graph.php 
        sitetimebar.php sitetimebar_graph.php timeadd.php 
        timecategory.php toolspie.php toolspie_graph.php 
        trackerpie_graph.php useract.php useract_graph.php 
        useradded.php useradded_graph.php usercum.php 
        usercum_graph.php usersummary.php usertime.php 
        usertime_graph.php 
Log Message:
Release of Reporting Module

--- NEW FILE: index.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: index.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');
require_once('common/reporting/ReportSetup.class');

session_require( array('group'=>$sys_stats_group) );

echo report_header('Main Page');

?>
<h3>Users</h3>
<p>
<a href="useradded.php?SPAN=1">Users Added Weekly (graph)</a><br />
<a href="usercum.php?SPAN=1">Cumulative Users Weekly (graph)</a><br />
<a href="useract.php">Activity (graph)</a><br />
<p>
<h3>Projects</h3>
<p>
Project-specific reports: Tracker, Task Mgr, Forums, Doc Mgr, Downloads<br />
<a href="projectact.php">Activity (graph)</a><br />
<p>
<h3>Site-Wide</h3>
<p>
Site-wide reports: Tracker, Task Mgr, Forums, Doc Mgr, Downloads<br />
<a href="toolspie.php">Pie (graph)</a><br />
<a href="siteact.php">Line (graph)</a><br />
<p>
<h3>Time-Tracking</h3>
<p>
<a href="usertime.php">Individual User Time Report (graph)</a> <a 
href="usertime.php?typ=r">(report)</a><br />
<a href="projecttime.php">Individual Project Time Report (graph)</a> <a 
href="projecttime.php?typ=r">(report)</a><br />
<a href="sitetime.php">Site-Wide Time Report (graph)</a> <a 
href="sitetime.php?typ=r">(report)</a><br />
<a href="sitetimebar.php">Site-Wide Total Hours Graph (graph)</a> <a 
href="sitetimebar.php?typ=r">(report)</a><br />
<a href="usersummary.php">Site-Wide Task &amp; Hours (report)</a><br />
<p>
<h3>Administrative</h3>
<p>
<a href="rebuild.php">Initialize / Rebuild Reporting Tables</a><br />
<a href="timecategory.php">Manage Time Tracker Categories</a><br />
<a href="http://gforge.org/tracker/?atid=116&group_id=7&func=browse";>File 
Support Request</a><br />
<a href="http://gforge.org/tracker/?atid=118&group_id=7&func=browse";>File 
Feature Request</a><br />
<p>
<?php

echo report_footer();

?>

--- NEW FILE: projectact.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: projectact.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}


echo report_header('Project Activity');

?>
<h3>Project Activity</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<input type="hidden" name="sw" value="<?php echo $sw; ?>">
<table><tr>
<td><strong>Project:</strong><br /><?php echo report_group_box('g_id',$g_id); 
?></td>
<td><strong>Area:</strong><br /><?php echo report_area_box('area',$area); 
?></td>
<td><strong>Type:</strong><br /><?php echo report_span_box('SPAN',$SPAN); 
?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<?php if ($g_id) { ?>
        <img src="projectact_graph.php?<?php echo 
"SPAN=$SPAN&start=$start&end=$end&g_id=$g_id&area=$area"; ?>" width="640" 
height="480">
        <p>
        <?php

}

echo report_footer();

?>

--- NEW FILE: projectact_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: projectact_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_line.php');
require_once('common/reporting/ReportProjectAct.class');

if (!$SPAN) {
        $SPAN=1;
}

if (!$area) {
        $area='tracker';
}

//
//      Create Report
//
$report=new ReportProjectAct($SPAN,$g_id,$start,$end); 

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

//
// Get Group Object
//
$g =& group_get_object($g_id);
if (!$g || $g->isError()) {
        exit_error("Could Not Get Group");
}

// Create the graph. These two calls are always required
$graph  = new Graph(640, 480,"auto");
$graph->SetMargin(50,10,35,50);
$graph->SetScale( "textlin");
//$graph->SetScale( "linlog");
//$graph ->SetYScale("log");

if ($area=='tracker') {

        // Create the tracker open plot
        $ydata  =& $report->getTrackerOpened();
        $lineplot =new LinePlot($ydata);
        $lineplot ->SetColor("black");
        $graph->Add( $lineplot);

        // Create the tracker close plot
        $ydata2  =& $report->getTrackerClosed();
        $lineplot2 =new LinePlot($ydata2);
        $lineplot2 ->SetColor("blue");
        $graph->Add( $lineplot2 );

        //      Legends
        $lineplot->SetLegend ("Trk Open");
        $lineplot2 ->SetLegend("Trk Close");

} elseif ($area=='forum') {

        // Create the forum plot
        $ydata3  =& $report->getForum();
        $lineplot3 =new LinePlot($ydata3);
        $lineplot3 ->SetColor("orange");
        $graph->Add( $lineplot3 );

        //      Legends
        $lineplot3 ->SetLegend("Forum");

} elseif ($area=='docman') {

        // Create the Docman plot
        $ydata4  =& $report->getDocs();
        $lineplot4 =new LinePlot($ydata4);
        $lineplot4 ->SetColor("red");
        $graph->Add( $lineplot4 );

        //      Legends
        $lineplot4 ->SetLegend("Docs");

} elseif ($area=='downloads') {

        // Create the Docman plot
        $ydata4  =& $report->getDownloads();
        $lineplot4 =new LinePlot($ydata4);
        $lineplot4 ->SetColor("red");
        $graph->Add( $lineplot4 );

        //      Legends
        $lineplot4 ->SetLegend("Downloads");

} elseif ($area=='taskman') {

        // Create the Tasks Opened plot
        $ydata5  =& $report->getTaskOpened();
        $lineplot5 =new LinePlot($ydata5);
        $lineplot5 ->SetColor("purple");
        $graph->Add( $lineplot5 );

        // Create the Tasks Closed plot
        $ydata6  =& $report->getTaskClosed();
        $lineplot6 =new LinePlot($ydata6);
        $lineplot6 ->SetColor("yellow");
        $graph->Add( $lineplot6 );

        //      Legends
        $lineplot5 ->SetLegend("Task Open");
        $lineplot6 ->SetLegend("Task Close");
}


//
//      Titles
//
$graph->title->Set("Project Activity For: ".$g->getPublicName(). 
        " (".date('m/d/Y',$report->getStartDate()) ."-". 
date('m/d/Y',$report->getEndDate()) .")");
$graph->subtitle->Set($report_company_name);
//$graph->xaxis-> title->Set("Date" );
//$graph->yaxis-> title->Set("Number" ); 

$a=$report->getDates();
$graph->xaxis->SetTickLabels($a); 
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetTextLabelInterval($report->getGraphInterval());

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: projecttime.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: projecttime.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/ReportProjectTime.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

echo report_header('Time Tracking By Project');

$a[]='By Task';
$a[]='By Category';
$a[]='By Subproject';
$a[]='By User';

$a2[]='tasks';
$a2[]='category';
$a2[]='subproject';
$a2[]='user';

?>
<h3>Time Tracking By Project</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<input type="hidden" name="sw" value="<?php echo $sw; ?>">
<input type="hidden" name="typ" value="<?php echo $typ; ?>">
<table><tr>
<td><strong>Project:</strong><br /><?php echo report_group_box('g_id',$g_id); 
?></td>
<td><strong>Type:</strong><br /><?php echo 
html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<?php 
        if ($g_id && $typ=='r') {
                $report=new ReportProjectTime($g_id,$type,$start,$end);

                $labels = $report->labels;
            $data = $report->getData();

            echo $HTML->listTableTop (array('Type','Time'));

            for ($i=0; $i<count($labels); $i++) {

                echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
                        '<td>'. $labels[$i] .'</td><td>'. $data[$i] 
.'</td></tr>';
            }

            echo $HTML->listTableBottom ();

        } elseif ($g_id) { ?>
        <img src="projecttime_graph.php?<?php echo 
"start=$start&end=$end&g_id=$g_id&type=$type"; ?>" width="640" height="480">
        <p>
        <?php

}

echo report_footer();

?>

--- NEW FILE: projecttime_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: projecttime_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie3d.php');
require_once('common/reporting/ReportProjectTime.class');
require_once('common/reporting/report_utils.php');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportProjectTime($g_id,$type,$start,$end);

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

if (!isset($datatype)) {
        $datatype=1;
}

if (!$start) {
        $start=mktime(0,0,0,date('m'),1,date('Y'));;
}
if (!$end) {
        $end=time();
} else {
        $end--;
}

// Create the graph. These two calls are always required
$graph  = new PieGraph(640, 480,"auto");
//$graph->SetMargin(50,10,35,50);

$arr['tasks']='By Task';
$arr['category']='By Category';
$arr['subproject']='By Subproject';
$arr['user']='By User';

$graph->title->Set("Time Report ".$arr[$type]." (".date('m/d/Y',$start) ."-". 
date('m/d/Y',$end) .")");
$graph->subtitle->Set($report_company_name);

report_pie_arr($report->labels,$report->getData());

$p1  = new PiePlot3D( $pie_vals );
$p1->ExplodeSlice (0);
$p1->SetLegends( $pie_labels );
$graph->Add( $p1);

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: rebuild.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: rebuild.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');
require_once('common/reporting/ReportSetup.class');

session_require( array('group'=>$sys_stats_group,'A') );

echo report_header('Main Page');

if ($submit && $im_sure) {

        $r = new ReportSetup();

        if (!$r->initialSetup()) {
                echo $r->getErrorMessage();
        } else {
                Header("Location: index.php?feedback=Successfully+Rebuilt");
        }

}

?>
<h3>Reporting System Initialization</h3>
<p>
Occasionally, if cronjobs failed or the database was damaged, 
you may have to rebuild the reporting tables.
<p>
If you are sure you want to rebuild all the reporting tables, 
check the "I'm Sure" box and click the button below.
<p>
This could take a couple minutes, so DO NOT CLICK MORE THAN ONCE.
<p>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<input type="checkbox" name="im_sure" value="1">I'm Sure<p>
<p>
<input type="submit" name="submit" value="Press ONLY ONCE">
</form>

<?php

echo report_footer();

?>

--- NEW FILE: siteact.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: siteact.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}


echo report_header('Site-Wide Activity');

?>
<h3>Site-Wide Activity</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<table><tr>
<td><strong>Area:</strong><br /><?php echo report_area_box('area',$area); 
?></td>
<td><strong>Type:</strong><br /><?php echo report_span_box('SPAN',$SPAN); 
?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<?php if ($area) { ?>
        <img src="siteact_graph.php?<?php echo 
"SPAN=$SPAN&start=$start&end=$end&area=$area"; ?>" width="640" height="480">
        <p>
        <?php

}

echo report_footer();

?>

--- NEW FILE: siteact_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: siteact_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
//require_once($sys_path_to_jpgraph.'jpgraph_log.php');
require_once($sys_path_to_jpgraph.'jpgraph_line.php');
require_once('common/reporting/ReportSiteAct.class');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportSiteAct($SPAN,$start,$end); 

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

// Create the graph. These two calls are always required
$graph  = new Graph(640, 480,"auto");
$graph->SetMargin(50,10,35,50);
$graph->SetScale( "textlin");
//$graph->SetScale( "linlog");
//$graph ->SetYScale("log");

if ($area=='tracker') {

        // Create the tracker open plot
        $ydata  =& $report->getTrackerOpened();
        $lineplot =new LinePlot($ydata);
        $lineplot ->SetColor("black");
        $graph->Add( $lineplot);

        // Create the tracker close plot
        $ydata2  =& $report->getTrackerClosed();
        $lineplot2 =new LinePlot($ydata2);
        $lineplot2 ->SetColor("blue");
        $graph->Add( $lineplot2 );

        //      Legends
        $lineplot->SetLegend ("Trk Open");
        $lineplot2 ->SetLegend("Trk Close");

} elseif ($area=='forum') {

        // Create the forum plot
        $ydata3  =& $report->getForum();
        $lineplot3 =new LinePlot($ydata3);
        $lineplot3 ->SetColor("orange");
        $graph->Add( $lineplot3 );

        //      Legends
        $lineplot3 ->SetLegend("Forum");

} elseif ($area=='docman') {

        // Create the Docman plot
        $ydata4  =& $report->getDocs();
        $lineplot4 =new LinePlot($ydata4);
        $lineplot4 ->SetColor("red");
        $graph->Add( $lineplot4 );

        //      Legends
        $lineplot4 ->SetLegend("Docs");

} elseif ($area=='taskman') {

        // Create the Tasks Opened plot
        $ydata5  =& $report->getTaskOpened();
        $lineplot5 =new LinePlot($ydata5);
        $lineplot5 ->SetColor("purple");
        $graph->Add( $lineplot5 );

        // Create the Tasks Closed plot
        $ydata6  =& $report->getTaskClosed();
        $lineplot6 =new LinePlot($ydata6);
        $lineplot6 ->SetColor("yellow");
        $graph->Add( $lineplot6 );

        //      Legends
        $lineplot5 ->SetLegend("Task Open");
        $lineplot6 ->SetLegend("Task Close");

} elseif ($area=='downloads') {

        // Create the Downloads plot
        $ydata5  =& $report->getDownloads();
        $lineplot5 =new LinePlot($ydata5);
        $lineplot5 ->SetColor("purple");
        $graph->Add( $lineplot5 );

        //      Legends
        $lineplot5 ->SetLegend("Downloads");

}


//
//      Titles
//
$graph->title->Set("Site-Wide Activity (".date('m/d/Y',$report->getStartDate()) 
."-". date('m/d/Y',$report->getEndDate()) .")");
$graph->subtitle->Set($report_company_name);
//$graph->xaxis-> title->Set("Date" );
//$graph->yaxis-> title->Set("Number" ); 

$a=$report->getDates();
$graph->xaxis->SetTickLabels($a); 
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetTextLabelInterval($report->getGraphInterval());

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: sitetime.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: sitetime.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/ReportSiteTime.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

echo report_header('Site-Wide Time Tracking');

$a[]='By Task';
$a[]='By Category';
$a[]='By Subproject';
$a[]='By User';

$a2[]='tasks';
$a2[]='category';
$a2[]='subproject';
$a2[]='user';

?>
<h3>Site-Wide Time Tracking</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<input type="hidden" name="typ" value="<?php echo $typ; ?>">
<table><tr>
<td><strong>Type:</strong><br /><?php echo 
html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<?php 
if ($typ =='r') {

        $report=new ReportSiteTime($type,$start,$end);
        $labels = $report->labels;
        $data = $report->getData();

        echo $HTML->listTableTop (array('Type','Time'));

        for ($i=0; $i<count($labels); $i++) {

                echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
                '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';

        }

        echo $HTML->listTableBottom ();

} else {
?>
<img src="sitetime_graph.php?<?php echo "start=$start&end=$end&type=$type"; ?>" 
width="640" height="480">
<?php
}
echo report_footer();

?>

--- NEW FILE: sitetime_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: sitetime_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie3d.php');
require_once('common/reporting/ReportSiteTime.class');
require_once('common/reporting/report_utils.php');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportSiteTime($type,$start,$end);

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

if (!isset($datatype)) {
        $datatype=1;
}

if (!$start) {
        $start=mktime(0,0,0,date('m'),1,date('Y'));;
}
if (!$end) {
        $end=time();
} else {
        $end--;
}

// Create the graph. These two calls are always required
$graph  = new PieGraph(640, 480,"auto");
//$graph->SetMargin(50,10,35,50);

$arr['tasks']='By Task';
$arr['category']='By Category';
$arr['subproject']='By Subproject';
$arr['user']='By User';

$graph->title->Set("Time Report ".$arr[$type]." (".date('m/d/Y',$start) ."-". 
date('m/d/Y',$end) .")");
$graph->subtitle->Set($report_company_name);

report_pie_arr($report->labels,$report->getData());

$p1  = new PiePlot3D( $pie_vals );
$p1->ExplodeSlice (0);
$p1->SetLegends( $pie_labels );
$graph->Add( $p1);

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: sitetimebar.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: sitetimebar.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

echo report_header('Site-Wide Time Tracking');

?>
<h3>Site-Wide Time Tracking</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<input type="hidden" name="typ" value="<?php echo $typ; ?>">
<table><tr>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<?php 
if ($typ=='r') {

        if (!$start) {
                $start=mktime(0,0,0,date('m'),1,date('Y'));;
        }
        if (!$end) {
                $end=time();
        } else {
                $end--;
        }

        $res=db_query("SELECT week,sum(hours)
                FROM rep_time_tracking
                WHERE week
                BETWEEN '$start' AND '$end' GROUP BY week");

        $report->setDates($res,0);
        $report->setData($res,1);
        $data=$report->getData();
        $labels=$report->getDates();
        echo $HTML->listTableTop (array('Week','Time'));

        for ($i=0; $i<count($labels); $i++) {

                echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
                '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';

        }

        echo $HTML->listTableBottom ();

} else { ?>
        <img src="sitetimebar_graph.php?<?php echo "start=$start&end=$end"; ?>" 
width="640" height="480">
        <?php
}

echo report_footer();

?>

--- NEW FILE: sitetimebar_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: sitetimebar_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_bar.php');
require_once('common/reporting/Report.class');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new Report();

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

if (!$start) {
        $start=mktime(0,0,0,date('m'),1,date('Y'));;
}
if (!$end) {
        $end=time();
} else {
        $end--;
}

$res=db_query("SELECT week,sum(hours) 
        FROM rep_time_tracking 
        WHERE week 
        BETWEEN '$start' AND '$end' GROUP BY week");

$report->setDates($res,0);
$report->setData($res,1);

//////
// Create the graph. These two calls are always required
$graph = new Graph(640,480,"auto");    
$graph->SetScale("textlin");
$graph->yaxis->scale->SetGrace(20);

// Add a drop shadow
//$graph->SetShadow();

// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,20,35,40);

// Create a bar pot
$bplot = new BarPlot($report->getData());

// Adjust fill color
$bplot->SetFillColor('orange');
$bplot->SetShadow();
$bplot->value->Show();
//$bplot->value->SetAngle(90);
//$bplot->value->SetFormat('%0.1f');
$graph->Add($bplot);

// Setup the titles
$graph->title->Set("Hours Recorded (".date('m/d/Y',$start) ."-". 
date('m/d/Y',$end) .")");
$graph->subtitle->Set($report_company_name);
$graph->xaxis->title->Set("Date");
$graph->yaxis->title->Set("Hours");

// Setup X-axis
$graph->xaxis->SetTickLabels($report->getDates());

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: timeadd.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: timeadd.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

if (!session_loggedin()) {
        exit_not_logged_in();
}

$report=new Report();
if ($report->isError()) {
        exit_error('Error',$report->getErrorMessage());
}

if ($submit) {
/*
        if ($update) {
                
                if ($project_task_id && $report_date && $time_code) {
                        $res=db_query("UPDATE rep_time_tracking 
                                SET time_code='$time_code', hours='$hours'
                                WHERE user_id='".user_getid()."'
                                AND report_date='$report_date'
                                AND project_task_id='$project_task_id'
                                AND time_code='$old_time_code'");
                        if (!$res || db_affected_rows($res) < 1) {
                                exit_error('Error',db_error());
                        } else {
                                $feedback='Successfully Updated';
                        }
                }

        } else
*/
        if ($delete) {

                if ($project_task_id && $report_date && $old_time_code) {
                        $res=db_query("DELETE FROM rep_time_tracking 
                                WHERE user_id='".user_getid()."'
                                AND report_date='$report_date'
                                AND project_task_id='$project_task_id'
                                AND time_code='$old_time_code'");
                        if (!$res || db_affected_rows($res) < 1) {
                                exit_error('Error',db_error());
                        } else {
                                $feedback='Successfully Deleted';
                        }
                } else {
                        echo "$project_task_id && $report_date && 
$old_time_code";
                }

        } elseif ($add) {
                if ($project_task_id && $week && $days_adjust && $time_code && 
$hours) {

                        //$date_list = split('[- :]',$report_date,5);
                //$report_date = 
mktime($date_list[3],$date_list[4],0,$date_list[1],$date_list[2],$date_list[0]);
                        //make it 12 NOON of the report_date
                        $report_date=($week + 
($days_adjust*REPORT_DAY_SPAN))+(12*60*60);
                        $res=db_query("INSERT INTO rep_time_tracking 
(user_id,week,report_date,project_task_id,time_code,hours) 
                                VALUES 
('".user_getid()."','$week','$report_date','$project_task_id','$time_code','$hours')");
                        if (!$res || db_affected_rows($res) < 1) {
                                exit_error('Error',db_error());
                        } else {
                                $feedback='Successfully Added';
                        }
                } else {
                        echo "$project_task_id && $week && $days_adjust && 
$time_code && $hours";
                        exit_error('Error','All Field Are Required.');
                }

        }
}

if ($week) {

        report_header('Time Tracking');

        if (!$group_project_id) {
                $respm=db_query("SELECT pgl.group_project_id,g.group_name || 
'**' || pgl.project_name
                FROM groups g, project_group_list pgl, user_group ug
                WHERE ug.user_id='".user_getid()."' 
                AND ug.group_id=g.group_id
                AND g.group_id=pgl.group_id
                ORDER BY group_name,project_name");
        }
        ?>
        <h3>Time Entries For The Week Starting <?php echo date('Y-m-d',$week); 
?></h3>
        <p>
        <?php
        $res=db_query("SELECT pt.project_task_id, pgl.project_name || '**' || 
pt.summary AS name, 
                        rtt.hours, rtt.report_date, rtc.category_name, 
rtt.time_code
                        FROM groups g, project_group_list pgl, project_task pt, 
rep_time_tracking rtt,
                        rep_time_category rtc
                        WHERE rtt.week='$week'
                        AND rtt.time_code=rtc.time_code
                        AND rtt.user_id='".user_getid()."'
                        AND g.group_id=pgl.group_id
                        AND pgl.group_project_id=pt.group_project_id
                        AND pt.project_task_id=rtt.project_task_id 
                        ORDER BY rtt.report_date");
        $rows=db_numrows($res);
        if ($group_project_id || $rows) {

                $title_arr[]='Project/Task';
                $title_arr[]='Date';
                $title_arr[]='Hours';
                $title_arr[]='Category';
                $title_arr[]=' ';

                echo $HTML->listTableTop ($title_arr);

                while ($r=&db_fetch_array($res)) {
                        echo '<form 
action="'.$PHP_SELF.'?week='.$week.'&project_task_id='.$r['project_task_id'].'" 
method="post" />
                        <input type="hidden" name="submit" value="1" />
                        <input type="hidden" name="report_date" 
value="'.$r['report_date'] .'" />
                        <input type="hidden" name="old_time_code" 
value="'.$r['time_code'] .'" />
                        <tr '.$HTML->boxGetAltRowStyle($xi++).'>
                                <td align="middle">'.$r['name'].'</td>
                                <td align="middle">'. date( 'D, M d, 
Y',$r['report_date']) .'</td>
                                <td align="middle"><!-- <input type="text" 
name="hours" value="'. $r['hours'] .'" size="3" maxlength="3" /> 
-->'.$r['hours'].'</td>
                                <td align="middle"><!-- 
'.report_time_category_box('time_code',$r['time_code']).' 
-->'.$r['category_name'].'</td>
                                <td align="middle"><!-- <input type="submit" 
name="update" value="Update" /> -->
                                <input type="submit" name="delete" 
value="Delete" /></td>
                        </tr></form>';
                        $total_hours += $r['hours'];
                }
                if ($group_project_id) {

                        $respt=db_query("SELECT project_task_id,summary FROM 
project_task WHERE group_project_id='$group_project_id'");

                        echo '<form action="'.$PHP_SELF.'?week='.$week.'" 
method="post" />
                        <input type="hidden" name="submit" value="1" />
                        <tr '.$HTML->boxGetAltRowStyle($xi++).'>
                                <td align="middle">'. html_build_select_box 
($respt,'project_task_id',false,false) .'</td>
                                <td align="middle"><input type="text" 
name="report_date" value="'. date('Y-m-d',$week) .'" size="10" maxlength="10" 
/></td>
                                <td align="middle"><input type="text" 
name="hours" value="" size="3" maxlength="3" /></td>
                                <td 
align="middle">'.report_time_category_box('time_code',false).'</td>
                                <td align="middle"><input type="submit" 
name="add" value="Add" /><input type="submit" name="cancel" value="Cancel" 
/></td>
                        </tr></form>';

                }
                echo '<tr '.$HTML->boxGetAltRowStyle($xi++).'><td 
colspan="2"><strong>Total 
Hours:</strong></td><td><strong>'.$total_hours.'</strong></td><td 
colspan="2"></td></tr>';
                echo $HTML->listTableBottom();

        }
        if (!$group_project_id) {
                ?>
                <p>
                <h3>Add Entry</h3>
                <p>
                Choose a Project/Subproject in the Task Manager. You will then 
have to choose 
                a Task and category to record your time in.
                <p>
                <form action="<?php echo $PHP_SELF; ?>" method="get" />
                <input type="hidden" name="week" value="<?php echo $week; ?>" />
                <table>
                <tr>
                        <td><strong>Task Manager Project:</strong></td>
                        <td><?php echo html_build_select_box 
($respm,'group_project_id',false,false); ?></td>
                        <td><input type="submit" name="submit" value="Next" 
/></td>
                </tr>
                </table>
                </form>
                <p>
                <h3>Change Week</h3>
                <p>
                <form action="<?php echo $PHP_SELF; ?>" method="get" />
                <?php echo report_weeks_box($report,'week'); ?><input 
type="submit" name="submit" value="Change Week" />
                </form>
                <?php
        }
//
//      First Choose A Week to add/update/delete time sheet info
//
} else {

        report_header('Time Tracking');

        ?>
        <h3>Choose A Week to Record Or Edit Your Time.</h3>
        <p>
        After you choose a week, you will be prompted to choose a 
Project/Subproject in the 
        Task Manager.
        <p>
        <form action="<?php echo $PHP_SELF; ?>" method="get" />
        <strong>Week Starting:</strong><br />
        <?php echo report_weeks_box($report,'week'); ?>
        <p>
        <input type="submit" name="submit" value="Next" />
        </form>
        <?php

}

report_footer();

?>

--- NEW FILE: timecategory.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: timecategory.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/ReportSetup.class');

session_require( array('group'=>$sys_stats_group,'A') );


if ($submit) {
        if ($add) {

                $r = new ReportSetup();
                if (!$r->addTimeCode($category_name)) {
                        exit_error('Error',$r->getErrorMessage());
                } else {
                        $feedback="Successful";
                }

        } elseif ($update) {

                $r = new ReportSetup();

                if (!$r->updateTimeCode($time_code,$category_name)) {
                        exit_error('Error',$r->getErrorMessage());
                } else {
                        $feedback="Successful";
                }

                $time_code=false;
                $category_name='';
        }

}

echo report_header('Main Page');

if ($time_code) {
        $res1=db_query("SELECT * FROM rep_time_category WHERE 
time_code='$time_code'");
        $category_name=db_result($res1,0,'category_name');
}
$res=db_query("SELECT * FROM rep_time_category");

$arr[]='Time Code';
$arr[]='Category Name';

echo $HTML->listTableTop($arr);

for ($i=0; $i<db_numrows($res); $i++) {
        echo '<tr 
'.$HTML->boxGetAltRowStyle($i).'><td>'.db_result($res,$i,'time_code').'</td>
                <td><a 
href="timecategory.php?time_code='.db_result($res,$i,'time_code').'">'.db_result($res,$i,'category_name').'</a></td></tr>';
}

echo $HTML->listTableBottom();

?>
<h3>Manage Time Tracker Categories</h3>
<p>
You can create categories for how time might be spent when completing a 
particular task.
Examples of categories include "Meeting", "Coding", "Testing".
<p>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="submit" value="1" />
<input type="hidden" name="time_code" value="<?php echo $time_code; ?>" />
<strong>Category Name:</strong><br />
<input type="text" name="category_name" value="<?php echo $category_name; ?>" >
<p>
<?php

if ($time_code) { 
        echo '<input type="submit" name="update" value="Update" />';
} else {
        echo '<input type="submit" name="add" value="Add" />';
}

?>
</form>

<?php

echo report_footer();

?>

--- NEW FILE: toolspie.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: toolspie.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

session_require( array('group'=>$sys_stats_group) );

echo report_header('Tool Pie Graphs');

if (!isset($datatype)) {
        $datatype=1;
}

?>
<h3>Tool Pie Graphs</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<table><tr>
<td><strong>Trackers:</strong><br /><?php echo 
report_tracker_box('datatype',$datatype); ?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<img src="toolspie_graph.php?<?php echo 
"datatype=$datatype&start=$start&end=$end"; ?>" width="640" height="480">
<p>
<?php

echo report_footer();

?>

--- NEW FILE: toolspie_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: toolspie_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie3d.php');
require_once('common/reporting/Report.class');
require_once('common/reporting/report_utils.php');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new Report();

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

if (!isset($datatype)) {
        $datatype=1;
}

if (!$start) {
        $start=mktime(0,0,0,date('m'),1,date('Y'));;
}
if (!$end) {
        $end=time();
} else {
        $end--;
}


if ($datatype < 5) {

        $sql="SELECT g.group_name,count(*) AS count
        FROM groups g, artifact_group_list agl, artifact a
        WHERE g.group_id=agl.group_id 
        AND agl.group_artifact_id=a.group_artifact_id 
        AND a.open_date BETWEEN '$start' AND '$end'
        AND agl.datatype='$datatype'
        GROUP BY group_name
        ORDER BY count DESC";

} elseif ($datatype == 5) {

        $sql="SELECT g.group_name,count(*) AS count
        FROM groups g, forum_group_list fgl, forum f
        WHERE g.group_id=fgl.group_id
        AND fgl.group_forum_id=f.group_forum_id
        AND f.date BETWEEN '$start' AND '$end'
        GROUP BY group_name
        ORDER BY count DESC";

} elseif ($datatype == 6) {

        $sql="SELECT g.group_name,count(*) AS count
        FROM groups g, project_group_list pgl, project_task pt
        WHERE g.group_id=pgl.group_id
        AND pgl.group_project_id=pt.group_project_id
        AND pt.start_date BETWEEN '$start' AND '$end'
        GROUP BY group_name
        ORDER BY count DESC";

} else {

        $sql="SELECT g.group_name,count(*) AS count
        FROM groups g, frs_package fp, frs_release fr, frs_file ff, 
frs_dlstats_file fdf
        WHERE g.group_id=fp.group_id
        AND fp.package_id=fr.package_id
        AND fr.release_id=ff.release_id
        AND ff.file_id=fdf.file_id
        AND (((fdf.month > '". date('Ym',$start) ."') OR (fdf.month = '". 
date('Ym',$start) ."' AND fdf.day >= '". date('d',$start) ."'))
        AND ((fdf.month < '". date('Ym',$end) ."') OR (fdf.month = '". 
date('Ym',$end) ."' AND fdf.day < '". date('d',$end) ."')))
        GROUP BY group_name
        ORDER BY count DESC";

}

//echo $sql;
//exit;

$res=db_query($sql);

if (db_error()) {
        exit_error('Error',db_error());
}

// Create the graph. These two calls are always required
$graph  = new PieGraph(640, 480,"auto");
//$graph->SetMargin(50,10,35,50);

$arr[1]='Bugs';
$arr[2]='Support Requests';
$arr[3]='Patches';
$arr[4]='Feature Requests';
$arr[0]='Other Trackers';
$arr[5]='Forum Messages';
$arr[6]='Tasks';
$arr[7]='Downloads';
$graph->title->Set($arr[$datatype]." By Project (".date('m/d/Y',$start) ."-". 
date('m/d/Y',$end) .")");
$graph->subtitle->Set($report_company_name);

// Create the tracker open plot
report_pie_arr(util_result_column_to_array($res,0), 
util_result_column_to_array($res,1));

$p1  = new PiePlot3D($pie_vals);
$p1->ExplodeSlice (0);
$p1->SetLegends($pie_labels);
$graph->Add( $p1);

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: trackerpie_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: trackerpie_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie3d.php');
require_once('common/reporting/Report.class');
require_once('common/reporting/report_utils.php');
require_once('www/tracker/include/ArtifactTypeHtml.class');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new Report();

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

if (!isset($area)) {
        $area='category';
}

if (!$start) {
        $start=mktime(0,0,0,date('m'),1,date('Y'));;
}
if (!$end) {
        $end=time();
} else {
        $end--;
}


if ($area == 'category') {

        $sql="SELECT ac.category_name,count(*) 
        FROM artifact a, artifact_category ac
        WHERE a.group_artifact_id='$atid'
        AND a.category_id=ac.id
        AND a.open_date BETWEEN '$start' AND '$end'
        GROUP BY category_name";

} elseif ($area == 'group') {

        $sql="SELECT ag.group_name,count(*) 
        FROM artifact a, artifact_group ag
        WHERE a.group_artifact_id='$atid'
        AND a.artifact_group_id=ag.id
        AND a.open_date BETWEEN '$start' AND '$end'
        GROUP BY group_name";

} elseif ($area == 'resolution') {

        $sql="SELECT ar.resolution_name,count(*) 
        FROM artifact a, artifact_resolution ar
        WHERE a.group_artifact_id='$atid'
        AND a.resolution_id=ar.id
        AND a.open_date BETWEEN '$start' AND '$end'
        GROUP BY resolution_name";

} else {

        $sql="SELECT u.realname,count(*) 
        FROM artifact a, users u
        WHERE a.group_artifact_id='$atid'
        AND a.assigned_to=u.user_id
        AND a.open_date BETWEEN '$start' AND '$end'
        GROUP BY realname";

}

//echo $sql;
//exit;

$res=db_query($sql);

if (db_error()) {
        exit_error('Error',db_error());
}

// Create the graph. These two calls are always required
$graph  = new PieGraph(640, 480,"auto");
//$graph->SetMargin(50,10,35,50);

$arr['category']='By Category';
$arr['group']='By Group';
$arr['resolution']='By Resolution';
$arr['technician']='By Tecnician';
$graph->title->Set($arr[$area]." (".date('m/d/Y',$start) ."-". 
date('m/d/Y',$end) .")");
$graph->subtitle->Set($report_company_name);

// Create the tracker open plot
report_pie_arr(util_result_column_to_array($res,0), 
util_result_column_to_array($res,1));

$p1  = new PiePlot3D($pie_vals);
$p1->ExplodeSlice (0);
$p1->SetLegends($pie_labels);
$graph->Add( $p1);

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: useract.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: useract.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

echo report_header('User Activity');

$abc_array = 
array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
echo "Choose the <strong>First Letter</strong> of the name of the person you 
wish to report on.<p>";
for ($i=0; $i<count($abc_array); $i++) {
        if ($sw == $abc_array[$i]) {
                echo '<strong>'.$abc_array[$i].'</strong>&nbsp;';
        } else { 
                echo '<a 
href="useract.php?sw='.$abc_array[$i].'">'.$abc_array[$i].'</A>&nbsp;';
        }
}

if ($sw) {
        ?>
        <h3>User Activity</h3>
        <p>
        <form action="<?php echo $PHP_SELF; ?>" method="get">
        <input type="hidden" name="sw" value="<?php echo $sw; ?>">
        <table><tr>
        <td><strong>User:</strong><br /><?php echo 
report_useract_box('dev_id',$dev_id,$sw); ?></td>
        <td><strong>Area:</strong><br /><?php echo 
report_area_box('area',$area); ?></td>
        <td><strong>Type:</strong><br /><?php echo 
report_span_box('SPAN',$SPAN); ?></td>
        <td><strong>Start:</strong><br /><?php echo report_months_box($report, 
'start', $start); ?></td>
        <td><strong>End:</strong><br /><?php echo report_months_box($report, 
'end', $end); ?></td>
        <td><input type="submit" name="submit" value="Refresh"></td>
        </tr></table>
        </form>
        <p>
        <?php if ($dev_id) { ?>
                <img src="useract_graph.php?<?php echo 
"SPAN=$SPAN&start=$start&end=$end&dev_id=$dev_id&area=$area"; ?>" width="640" 
height="480">
                <p>
                <?php

        }

}

echo report_footer();

?>

--- NEW FILE: useract_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: useract_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
//require_once($sys_path_to_jpgraph.'jpgraph_log.php');
require_once($sys_path_to_jpgraph.'jpgraph_line.php');
require_once('common/reporting/ReportUserAct.class');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportUserAct($SPAN,$dev_id,$start,$end); 

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

//
// Get User Object
//
$u =& user_get_object($dev_id);
if (!$u || $u->isError()) {
        exit_error("Could Not Get User");
}

// Create the graph. These two calls are always required
$graph  = new Graph(640, 480,"auto");
$graph->SetMargin(50,10,35,50);
$graph->SetScale( "textlin");
//$graph->SetScale( "linlog");
//$graph ->SetYScale("log");

if ($area=='tracker') {

        // Create the tracker open plot
        $ydata  =& $report->getTrackerOpened();
        $lineplot =new LinePlot($ydata);
        $lineplot ->SetColor("black");
        $graph->Add( $lineplot);

        // Create the tracker close plot
        $ydata2  =& $report->getTrackerClosed();
        $lineplot2 =new LinePlot($ydata2);
        $lineplot2 ->SetColor("blue");
        $graph->Add( $lineplot2 );

        //      Legends
        $lineplot->SetLegend ("Trk Open");
        $lineplot2 ->SetLegend("Trk Close");

} elseif ($area=='forum') {

        // Create the forum plot
        $ydata3  =& $report->getForum();
        $lineplot3 =new LinePlot($ydata3);
        $lineplot3 ->SetColor("orange");
        $graph->Add( $lineplot3 );

        //      Legends
        $lineplot3 ->SetLegend("Forum");

} elseif ($area=='docman') {

        // Create the Docman plot
        $ydata4  =& $report->getDocs();
        $lineplot4 =new LinePlot($ydata4);
        $lineplot4 ->SetColor("red");
        $graph->Add( $lineplot4 );

        //      Legends
        $lineplot4 ->SetLegend("Docs");

} elseif ($area=='taskman') {

        // Create the Tasks Opened plot
        $ydata5  =& $report->getTaskOpened();
        $lineplot5 =new LinePlot($ydata5);
        $lineplot5 ->SetColor("purple");
        $graph->Add( $lineplot5 );

        // Create the Tasks Closed plot
        $ydata6  =& $report->getTaskClosed();
        $lineplot6 =new LinePlot($ydata6);
        $lineplot6 ->SetColor("yellow");
        $graph->Add( $lineplot6 );

        //      Legends
        $lineplot5 ->SetLegend("Task Open");
        $lineplot6 ->SetLegend("Task Close");
}


//
//      Titles
//
$graph->title->Set("User Activity For: ".$u->getRealName() 
        ." (".date('m/d/Y',$report->getStartDate()) ."-". 
date('m/d/Y',$report->getEndDate()) .")");
$graph->subtitle->Set($report_company_name);
//$graph->xaxis-> title->Set("Date" );
//$graph->yaxis-> title->Set("Number" ); 

$a=$report->getDates();
$graph->xaxis->SetTickLabels($a); 
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetTextLabelInterval($report->getGraphInterval());

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: useradded.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: useradded.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

$report=new Report();
if ($report->isError()) {
        exit_error('Error',$report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

session_require( array('group'=>$sys_stats_group) );

echo report_header('Users Added');

?>
<h3>Users Added</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<table><tr>
<td><strong>Type:</strong><br /><?php echo report_span_box('SPAN',$SPAN); 
?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<img src="useradded_graph.php?<?php echo "SPAN=$SPAN&start=$start&end=$end"; 
?>" width="640" height="480">
<p>
<?php

echo report_footer();

?>

--- NEW FILE: useradded_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: useradded_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_line.php');
require_once('common/reporting/ReportUserAdded.class');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportUserAdded($SPAN,$start,$end); 

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

// Some data
$ydata  = $report->getData();

// Create the graph. These two calls are always required
$graph  = new Graph(640, 480,"auto");
$graph->SetMargin(50,10,35,50);
$graph->SetScale( "textlin");

// Create the linear plot
$lineplot =new LinePlot($ydata);
$lineplot ->SetColor("black");
$lineplot->SetFillColor("orange");

// Add the plot to the graph
$graph->Add( $lineplot);

//$graph->SetMargin(10,10,25,10);
$graph->title->Set("Users Added ".$report->getSpanName()
        ." (".date('m/d/Y',$report->getStartDate()) ."-". 
date('m/d/Y',$report->getEndDate()) .")");
$graph->subtitle->Set($report_company_name);
//$graph->xaxis-> title->Set("Date" );
//$graph->yaxis-> title->Set("Number" ); 

$a=$report->getDates();
$graph->xaxis->SetTickLabels($a); 
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetTextLabelInterval($report->getGraphInterval());

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: usercum.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: usercum.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}

session_require( array('group'=>$sys_stats_group) );

echo report_header('Cumulative Users');

?>
<h3>Cumulative Users</h3>
<p>
<form action="<?php echo $PHP_SELF; ?>" method="get">
<table><tr>
<td><strong>Type:</strong><br /><?php echo report_span_box('SPAN',$SPAN); 
?></td>
<td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', 
$start); ?></td>
<td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', 
$end); ?></td>
<td><input type="submit" name="submit" value="Refresh"></td>
</tr></table>
</form>
<p>
<img src="usercum_graph.php?<?php echo "SPAN=$SPAN&start=$start&end=$end"; ?>" 
width="640" height="480">
<p>
<?php

echo report_footer();

?>

--- NEW FILE: usercum_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: usercum_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_line.php');
require_once('common/reporting/ReportUserCum.class');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportUserCum($SPAN,$start,$end); 

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

// Some data
$ydata  = $report->getData();

// Create the graph. These two calls are always required
$graph  = new Graph(640, 480,"auto");
$graph->SetMargin(50,10,35,50);
$graph->SetScale( "textlin");

// Create the linear plot
$lineplot =new LinePlot($ydata);
$lineplot ->SetColor("black");
$lineplot->SetFillColor("orange");

// Add the plot to the graph
$graph->Add( $lineplot);

//$graph->SetMargin(10,10,25,10);
$graph->title->Set("Cumulative Users ".$report->getSpanName()
        ." (".date('m/d/Y',$report->getStartDate()) ."-". 
date('m/d/Y',$report->getEndDate()) .")");
$graph->subtitle->Set($report_company_name);
//$graph->xaxis-> title->Set("Date" );
//$graph->yaxis-> title->Set("Number" ); 

$a=$report->getDates();
$graph->xaxis->SetTickLabels($a); 
$graph->xaxis->SetLabelAngle(90);
$graph->xaxis->SetTextLabelInterval($report->getGraphInterval());

// Display the graph
$graph->Stroke();

?>

--- NEW FILE: usersummary.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: usersummary.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/Report.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getWeekStartArr();
        $start = $z[count($z)-1];
}
if (!$end) {
        $end=$z[0];
}
if (!$tstat) {
        $tstat='1';
}

$n[]='Any';
$n[]='Open';
$n[]='Closed';

$l[]='1,2';
$l[]='1';
$l[]='2';

echo report_header('User Summary Report');

        ?>
        <h3>User Summary Report</h3>
        <p>
        Choose the range from the pop-up boxes below. The report will list all 
tasks with an open 
        date in that range.
        <p>
    <form action="<?php echo $PHP_SELF; ?>" method="get">
    <table><tr>
    <td><strong>Start:</strong><br /><?php echo report_weeks_box($report, 
'start', $start); ?></td>
    <td><strong>End:</strong><br /><?php echo report_weeks_box($report, 'end', 
$end); ?></td>
        <td><strong>Task Status:</strong><br /><?php echo 
html_build_select_box_from_arrays($l,$n,'tstat',$tstat,false); ?></td>
    <td><input type="submit" name="submit" value="Refresh"></td>
        </tr></table>
        </form>
        <p>
        <?php

$sql="SELECT users.realname,users.user_id,users.user_name, ps.status_name, 
pgl.group_id, pt.group_project_id, 
pt.summary, pt.hours, pt.end_date, pt.project_task_id, pt.hours, sum(rtt.hours) 
AS remaining_hrs,
(select sum(hours) from rep_time_tracking 
        WHERE user_id=users.user_id 
        AND project_task_id=pt.project_task_id
        AND report_date BETWEEN '$start' AND '$end') AS cumulative_hrs
FROM users, project_assigned_to pat, project_status ps, project_group_list pgl, 
project_task pt
LEFT JOIN rep_time_tracking rtt USING (project_task_id)
WHERE users.user_id=pat.assigned_to_id
AND pgl.group_project_id=pt.group_project_id
AND pat.project_task_id=pt.project_task_id
AND pt.status_id=ps.status_id
AND pt.status_id IN ($tstat)
AND pt.start_date BETWEEN '$start' AND '$end'
GROUP BY realname, users.user_id, user_name, status_name, pgl.group_id, 
pt.group_project_id, 
        summary, pt.hours, end_date, pt.project_task_id, pt.hours";

$res=db_query($sql);
if (!$res || db_numrows($res) < 1) {
        echo 'No Matches Found'.db_error();
} else {

        echo '<table border="1">
                        <tr>
                                <td><strong>Name</strong></td>
                                <td><strong>Task</strong></td>
                                <td><strong>Status</strong></td>
                                <td><strong>Cum. Hrs</strong></td>
                                <td><strong>Rem. Hrs</strong></td>
                                <td><strong>End Date</strong></td>
                        </tr>';
        for ($i=0; $i<db_numrows($res); $i++) {
                $name=db_result($res,$i,'realname');
                if ($last_name != $name) {
                        echo '<tr><td 
colspan="6"><strong>'.$name.'</strong></td></tr>';
                        $last_name = $name;
                }
                echo '<tr><td>&nbsp;</td>
                                <td><a 
href="/pm/task.php?func=detailtask&group_id='.db_result($res,$i,'group_id')
                                        
.'&project_task_id='.db_result($res,$i,'project_task_id')
                                        
.'&group_project_id='.db_result($res,$i,'group_project_id')
                                        .'" 
target="_blank">'.db_result($res,$i,'summary').'</a></td>
                                <td>'.db_result($res,$i,'status_name').'</td>
                                
<td>'.number_format(db_result($res,$i,'cumulative_hrs'),1).'</td>
                                
<td>'.number_format((db_result($res,$i,'hours')-db_result($res,$i,'remaining_hrs')),1).'</td>
                                
<td>'.date($sys_datefmt,db_result($res,$i,'end_date')).'</td>
                                ';

                $task=db_result($res,$i,'project_task_id');
                $sql2="SELECT g.group_name, g.group_id, agl.group_artifact_id, 
agl.name, a.artifact_id, a.summary
                FROM project_task_artifact pta, artifact a, artifact_group_list 
agl, groups g
                WHERE pta.project_task_id='$task'
                AND pta.artifact_id=a.artifact_id
                AND a.group_artifact_id=agl.group_artifact_id
                AND agl.group_id=g.group_id";

                $res2=db_query($sql2);
                if (!$res2 || db_numrows($res2) < 1) {
                        echo db_error();
                } else {
                        for ($j=0; $j<db_numrows($res2); $j++) {
                                $tracker=db_result($res2,$j,'group_name'). '*' 
.db_result($res2,$j,'name');
                                echo '<tr><td colspan="3">&nbsp;</td>
                                        <td>';
                                if ($last_tracker != $tracker) {
                                        $last_tracker = $tracker;
                                        echo $tracker;
                                } else {
                                        echo '&nbsp;';
                                }
                                echo '</td>
                                                <td colspan="2"><a 
href="/tracker/?func=detail&atid='.db_result($res2,$j,'group_artifact_id').
                                                
'&group_id='.db_result($res2,$j,'group_id').
                                                
'&aid='.db_result($res2,$j,'artifact_id').'" 
target="_blank">'.db_result($res2,$j,'summary').'</a></td></tr>';
                        }
                        $last_tracker='';
                }

        }
        echo '</table>';

}

echo report_footer();

?>

--- NEW FILE: usertime.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: usertime.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once('common/reporting/report_utils.php');
require_once('common/reporting/ReportUserTime.class');

session_require( array('group'=>$sys_stats_group) );

$report=new Report();
if ($report->isError()) {
        exit_error($report->getErrorMessage());
}

if (!$start) {
        $z =& $report->getMonthStartArr();
        $start = $z[count($z)-1];
}


echo report_header('User Time Reporting');

$abc_array = 
array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
echo "Choose the <strong>First Letter</strong> of the name of the person you 
wish to report on.<p>";
for ($i=0; $i<count($abc_array); $i++) {
        if ($sw == $abc_array[$i]) {
                echo '<strong>'.$abc_array[$i].'</strong>&nbsp;';
        } else { 
                echo '<a 
href="usertime.php?sw='.$abc_array[$i].'&typ='.$typ.'">'.$abc_array[$i].'</A>&nbsp;';
        }
}

if ($sw) {

        $a[]='By Task';
        $a[]='By Category';
        $a[]='By Subproject';

        $a2[]='tasks';
        $a2[]='category';
        $a2[]='subproject';

        ?>
        <h3>User Time Reporting</h3>
        <p>
        <form action="<?php echo $PHP_SELF; ?>" method="get">
        <input type="hidden" name="sw" value="<?php echo $sw; ?>">
        <input type="hidden" name="typ" value="<?php echo $typ; ?>">
        <table><tr>
        <td><strong>User:</strong><br /><?php echo 
report_usertime_box('dev_id',$dev_id,$sw); ?></td>
        <td><strong>Type:</strong><br /><?php echo 
html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
        <td><strong>Start:</strong><br /><?php echo report_months_box($report, 
'start', $start); ?></td>
        <td><strong>End:</strong><br /><?php echo report_months_box($report, 
'end', $end); ?></td>
        <td><input type="submit" name="submit" value="Refresh"></td>
        </tr></table>
        </form>
        <p>
        <?php
                if ($dev_id && $typ=='r') {
                        $report=new ReportUserTime($dev_id,$type,$start,$end);
                        $labels = $report->labels;
                        $data = $report->getData();

                        echo $HTML->listTableTop (array('Type','Time'));

                        for ($i=0; $i<count($labels); $i++) {

                                echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
                                        '<td>'. $labels[$i] .'</td><td>'. 
$data[$i] .'</td></tr>';

                        }

                        echo $HTML->listTableBottom ();

                } elseif ($dev_id) { ?>
                <img src="usertime_graph.php?<?php echo 
"start=$start&end=$end&dev_id=$dev_id&type=$type"; ?>" width="640" height="480">
                <p>
                <?php

        }

}

echo report_footer();

?>

--- NEW FILE: usertime_graph.php ---
<?php
/**
 * Reporting System
 *
 * Copyright 2004 (c) GForge LLC
 *
 * @version   $Id: usertime_graph.php,v 1.1 2004/07/28 17:31:16 tperdue Exp $
 * @author Tim Perdue address@hidden
 * @date 2003-03-16
 *
 * This file is part of GForge.
 *
 * GForge is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GForge is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GForge; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

require_once('pre.php');
require_once($sys_path_to_jpgraph.'jpgraph.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie.php');
require_once($sys_path_to_jpgraph.'jpgraph_pie3d.php');
require_once('common/reporting/ReportUserTime.class');
require_once('common/reporting/report_utils.php');

session_require( array('group'=>$sys_stats_group) );

//
//      Create Report
//
$report=new ReportUserTime($dev_id,$type,$start,$end);

//
//      Check for error, such as license key problem
//
if ($report->isError()) {
        echo $report->getErrorMessage();
        exit;
}

if (!isset($datatype)) {
        $datatype=1;
}

if (!$start) {
        $start=mktime(0,0,0,date('m'),1,date('Y'));;
}
if (!$end) {
        $end=time();
} else {
        $end--;
}

// Create the graph. These two calls are always required
$graph  = new PieGraph(640, 480,"auto");
//$graph->SetMargin(50,10,35,50);

$arr['tasks']='By Task';
$arr['category']='By Category';
$arr['subproject']='By Subproject';

$graph->title->Set("Time Report ".$arr[$type]." (".date('m/d/Y',$start) ."-". 
date('m/d/Y',$end) .")");
$graph->subtitle->Set($report_company_name);

// Create the tracker open plot
//$data  =& $report->getData();
//$labels =& $report->labels;
report_pie_arr($report->labels,$report->getData());

$p1  = new PiePlot3D( $pie_vals );
$p1->ExplodeSlice (0);
$p1->SetLegends( $pie_labels );
$graph->Add( $p1);

// Display the graph
$graph->Stroke();

?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]