Commit 05bf8f64 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Remove useless showtimesheetproject() function. It was broken anyway.

parent 370978e4
...@@ -381,45 +381,6 @@ function showproject() ...@@ -381,45 +381,6 @@ function showproject()
echo '<tr><td>&nbsp;</td><td>&nbsp;</td><td><b>'.dPformSafe('Total').'</b></td><td><b>'.$timesheet_worked.'</b></td><td>&nbsp;</td></tr>'; echo '<tr><td>&nbsp;</td><td>&nbsp;</td><td><b>'.dPformSafe('Total').'</b></td><td><b>'.$timesheet_worked.'</b></td><td>&nbsp;</td></tr>';
} // end of function showproject() } // end of function showproject()
function showtimesheetproject()
{
global $timesheet_id, $project_types;
// FIXME: There is a bug in this function. It doesn't take current timesheet into account
// as well as it should. Some hours from other periods maybe accounted on this project, while
// we only want to see the time worked in this period.
$q = new DBQuery();
$q->addQuery('timesheet_id');
$q->addQuery('timesheet_project');
$q->addQuery('timesheet_project_amount');
$q->addTable('timesheet_project');
$q->addWhere('timesheet_id = ' . $timesheet_id);
$q->addOrder('timesheet_project ASC');
$timesheet = $q->LoadList();
foreach ($timesheet as $row) {
$p = new DBQuery();
$p->addQuery('project_id');
$p->addQuery('project_name');
$p->addQuery('project_status');
$p->addTable('projects');
$p->addWhere('project_id = ' . $row["timesheet_project"]);
$p->addOrder('project_name ASC');
$projects = $p->LoadList();
foreach ($projects as $project) {
if( intval( $row['timesheet_project_amount'] ) > 0 )
{
echo '<tr>';
echo '<td>&nbsp;</td>';
echo '<td><a href="?m=projects&a=view&project_id=' . $project["project_id"] . '">' . $project["project_name"] . '</a></td>';
echo '<td>' . $row['timesheet_project_amount'] . '</td>';
echo '<td>' . $project_types[$project['project_status']] . '</td>';
echo '</tr>';
}
}
}
} // end of function showtimesheetproject()
// Print the overview table // Print the overview table
echo '<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl">'; echo '<table width="100%" border="0" cellpadding="2" cellspacing="1" class="tbl">';
echo '<tr>'; echo '<tr>';
...@@ -439,14 +400,8 @@ function showtimesheetproject() ...@@ -439,14 +400,8 @@ function showtimesheetproject()
echo '<input type="hidden" name="timesheet_creator" value="'. $obj->timesheet_creator .'" />'; echo '<input type="hidden" name="timesheet_creator" value="'. $obj->timesheet_creator .'" />';
echo '<input type="hidden" name="timesheet_worked" value="'. $obj->timesheet_worked .'" />'; echo '<input type="hidden" name="timesheet_worked" value="'. $obj->timesheet_worked .'" />';
if ($status == 0) showproject();
showproject();
else
// FIXME: Workaround for problem in showtimesheetproject(); function. Now all hours worked are
// recalculated from the projects table, while you actually would like to see the hours as
// submitted/approved by users and manager.
showproject();
//showtimesheetproject();
echo '<script language="javascript">workedHoursChange('. $obj->timesheet_worked .');</script>'; echo '<script language="javascript">workedHoursChange('. $obj->timesheet_worked .');</script>';
echo "</form>"; echo "</form>";
echo "</table>"; echo "</table>";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment