Commit 4abafdd1 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Show Customer in timesheet details.

parent 05bf8f64
...@@ -320,6 +320,7 @@ function showproject() ...@@ -320,6 +320,7 @@ function showproject()
$q = new DBQuery(); $q = new DBQuery();
$q->addQuery('project_id'); $q->addQuery('project_id');
$q->addQuery('project_name'); $q->addQuery('project_name');
$q->addQuery('project_company');
$q->addQuery('project_status'); $q->addQuery('project_status');
$q->addTable('projects'); $q->addTable('projects');
$q->addOrder('project_name ASC'); $q->addOrder('project_name ASC');
...@@ -339,6 +340,18 @@ function showproject() ...@@ -339,6 +340,18 @@ function showproject()
$tasks = $t->LoadList(); $tasks = $t->LoadList();
$t->Clear(); $t->Clear();
// show company in details
$company = "unknown";
$t->addQuery('company_id');
$t->addQuery('company_name');
$t->addTable('companies');
$t->addWhere('company_id = '. $row["project_company"]);
$companies = $t->LoadList();
foreach ($companies as $list) {
$company = $list['company_name'];
}
$t->Clear();
$amount = 0; $amount = 0;
foreach ($tasks as $item) { foreach ($tasks as $item) {
// Query the task_log table for actual start dates. // Query the task_log table for actual start dates.
...@@ -370,7 +383,7 @@ function showproject() ...@@ -370,7 +383,7 @@ function showproject()
echo '<tr>'; echo '<tr>';
echo '<td>&nbsp;</td>'; echo '<td>&nbsp;</td>';
echo '<td><a href="?m=projects&a=view&project_id=' . $row["project_id"] . '">' . $row["project_name"] . '</a></td>'; echo '<td><a href="?m=projects&a=view&project_id=' . $row["project_id"] . '">' . $row["project_name"] . '</a></td>';
echo '<td>&nbsp;</td>'; echo '<td>'. $company .'</td>';
echo '<td>' . $amount . '</td>'; echo '<td>' . $amount . '</td>';
$timesheet_worked = $timesheet_worked + $amount; $timesheet_worked = $timesheet_worked + $amount;
echo '<td>' . $project_types[$row['project_status']] . '</td>'; echo '<td>' . $project_types[$row['project_status']] . '</td>';
...@@ -384,11 +397,11 @@ function showproject() ...@@ -384,11 +397,11 @@ function showproject()
// 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>';
echo '<th nowrap="nowrap">&nbsp;</th>'; echo '<th nowrap="nowrap">&nbsp;</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Project' ) .'</th>'; echo '<th nowrap="nowrap">'. $AppUI->_( 'Project' ) .'</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Customer' ) .'</th>'; echo '<th nowrap="nowrap">'. $AppUI->_( 'Customer' ) .'</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Worked hours' ) .'</th>'; echo '<th nowrap="nowrap">'. $AppUI->_( 'Worked hours' ) .'</th>';
echo '<th nowrap="nowrap">'. $AppUI->_( 'Project status' ) .'</th>'; echo '<th nowrap="nowrap">'. $AppUI->_( 'Project status' ) .'</th>';
echo '</tr>'; echo '</tr>';
echo '<form name="projectFrm" action="./index.php?m=timesheet" method="post">'; echo '<form name="projectFrm" action="./index.php?m=timesheet" method="post">';
......
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