Commit 1bac95f4 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Hide projects on which no time was booked this month. It stops clutering the overview.

parent cf7cf8e1
...@@ -293,11 +293,6 @@ function showproject() ...@@ -293,11 +293,6 @@ function showproject()
$projects = $q->LoadList(); $projects = $q->LoadList();
$timesheet_worked = 0; $timesheet_worked = 0;
foreach ($projects as $row) { foreach ($projects as $row) {
echo '<tr>';
echo '<td>&nbsp;</td>';
echo '<td><a href="?m=projects&a=view&project_id=' . $row["project_id"] . '">' . $row["project_name"] . '</a>';
echo '</td>';
echo '<td>';
$project_id = $row["project_id"]; $project_id = $row["project_id"];
$t = new DBQuery; $t = new DBQuery;
$t->addQuery('task_id'); $t->addQuery('task_id');
...@@ -337,11 +332,19 @@ function showproject() ...@@ -337,11 +332,19 @@ function showproject()
} }
} }
} }
echo $amount; if( $amount > 0 )
$timesheet_worked = $timesheet_worked + $amount; {
echo '</td>'; echo '<tr>';
echo '<td>' . $project_types[$row['project_status']] . '</td>'; echo '<td>&nbsp;</td>';
echo '</tr>'; echo '<td><a href="?m=projects&a=view&project_id=' . $row["project_id"] . '">' . $row["project_name"] . '</a>';
echo '</td>';
echo '<td>';
echo $amount;
$timesheet_worked = $timesheet_worked + $amount;
echo '</td>';
echo '<td>' . $project_types[$row['project_status']] . '</td>';
echo '</tr>';
}
} }
$obj->timesheet_worked = $timesheet_worked; $obj->timesheet_worked = $timesheet_worked;
} // end of function showproject() } // end of function showproject()
...@@ -369,14 +372,17 @@ function showtimesheetproject() ...@@ -369,14 +372,17 @@ function showtimesheetproject()
$p->addOrder('project_name ASC'); $p->addOrder('project_name ASC');
$projects = $p->LoadList(); $projects = $p->LoadList();
foreach ($projects as $project) { foreach ($projects as $project) {
echo '<tr>'; if( intval( $row['timesheet_project_amount'] ) > 0 )
echo '<td>&nbsp;</td>'; {
echo '<td><a href="?m=projects&a=view&project_id=' . $project["project_id"] . '">' . $project["project_name"] . '</a>'; echo '<tr>';
// echo '<td><a href="?m=projects&a=view&project_id=' . $row["timesheet_project"] . '">' . $project["project_name"] . '</a>'; echo '<td>&nbsp;</td>';
echo '</td>'; echo '<td><a href="?m=projects&a=view&project_id=' . $project["project_id"] . '">' . $project["project_name"] . '</a>';
echo '<td>' . $row['timesheet_project_amount'] . '</td>'; // echo '<td><a href="?m=projects&a=view&project_id=' . $row["timesheet_project"] . '">' . $project["project_name"] . '</a>';
echo '<td>' . $project_types[$project['project_status']] . '</td>'; echo '</td>';
echo '</tr>'; echo '<td>' . $row['timesheet_project_amount'] . '</td>';
echo '<td>' . $project_types[$project['project_status']] . '</td>';
echo '</tr>';
}
} }
} }
} // end of function showtimesheetproject() } // end of function showtimesheetproject()
......
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