Commit 370978e4 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Show total amount of hours worked in timesheet details.

parent 15ee5557
......@@ -136,11 +136,11 @@ if (intval($obj->timesheet_period)) {
}
// Get the current timesheet status
$status = 0;
if (intval($obj->timesheet_status))
$status = $obj->timesheet_status;
else {
$status = 0;
$obj->timesheet_status = 0;
$obj->timesheet_status = $status;
}
// Get the current timesheet creation date
......@@ -263,8 +263,10 @@ if (intval($obj->timesheet_worked)) {
echo '<td align="right" nowrap="nowarp">' . $AppUI->_('Status') . ':&nbsp;</td>';
echo '<td width="100%" align="right"">';
if ( ($canEdit) && (($status == 0) ||
($config_options['approval_by']['value'] == $AppUI->user_id )) ) {
echo 'STATUS: '.$status;
if ( ($canEdit) &&
($config_options['approval_by']['value'] == $AppUI->user_id ) ) {
echo '<select name="timesheet_status" size="1" class="text" onChange="changeIt()">';
echo '<option '; if ($status == 0) echo "selected"; echo 'value="0">' . dPformSafe('Open for Editing') . '</option>';
echo '<option '; if ($status == 1) echo "selected"; echo 'value="1">' . dPformSafe('Submitted') . '</option>';
......@@ -367,17 +369,16 @@ function showproject()
if( $amount > 0 ) {
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>';
echo $amount;
echo '<td><a href="?m=projects&a=view&project_id=' . $row["project_id"] . '">' . $row["project_name"] . '</a></td>';
echo '<td>&nbsp;</td>';
echo '<td>' . $amount . '</td>';
$timesheet_worked = $timesheet_worked + $amount;
echo '</td>';
echo '<td>' . $project_types[$row['project_status']] . '</td>';
echo '</tr>';
}
}
$obj->timesheet_worked = $timesheet_worked;
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()
function showtimesheetproject()
......@@ -410,8 +411,7 @@ function showtimesheetproject()
{
echo '<tr>';
echo '<td>&nbsp;</td>';
echo '<td><a href="?m=projects&a=view&project_id=' . $project["project_id"] . '">' . $project["project_name"] . '</a>';
echo '</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>';
......@@ -425,6 +425,7 @@ function showtimesheetproject()
echo '<tr>';
echo '<th nowrap="nowrap">&nbsp;</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Project' ) .'</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Customer' ) .'</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Worked hours' ) .'</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Project status' ) .'</th>';
echo '</tr>';
......
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