$date = $fields['date'];
$user_id = (int) $fields['user_id'];
+ $group_id = (int) $fields['group_id'];
$client_id = $fields['client_id'];
$project_id = $fields['project_id'];
$name = $fields['name'];
$paid = (int) $fields['paid'];
$created = ', now(), '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', '.$mdb2->quote($user->id);
- $sql = "insert into tt_expense_items (date, user_id, client_id, project_id, name, cost, invoice_id, paid, created, created_ip, created_by, status) ".
- "values (".$mdb2->quote($date).", $user_id, ".$mdb2->quote($client_id).", ".$mdb2->quote($project_id).
+ $sql = "insert into tt_expense_items (date, user_id, group_id, client_id, project_id, name, cost, invoice_id, paid, created, created_ip, created_by, status) ".
+ "values (".$mdb2->quote($date).", $user_id, $group_id, ".$mdb2->quote($client_id).", ".$mdb2->quote($project_id).
", ".$mdb2->quote($name).", ".$mdb2->quote($cost).", ".$mdb2->quote($invoice_id).", $paid $created, ".$mdb2->quote($status).")";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
$this->logMap[$this->currentElement['ID']] =
ttTimeHelper::insert(array(
'user_id' => $this->userMap[$this->currentElement['USER_ID']],
+ 'group_id' => $this->group_id,
'date' => $this->currentElement['DATE'],
'start' => $this->currentElement['START'],
'finish' => $this->currentElement['FINISH'],
ttExpenseHelper::insert(array(
'date' => $this->currentElement['DATE'],
'user_id' => $this->userMap[$this->currentElement['USER_ID']],
+ 'group_id' => $this->group_id,
'client_id' => $this->clientMap[$this->currentElement['CLIENT_ID']],
'project_id' => $this->projectMap[$this->currentElement['PROJECT_ID']],
'name' => $this->currentElement['NAME'],
global $user;
$mdb2 = getConnection();
- $user_id = $fields['user_id'];
- $group_id = $fields['group_id'];
+ $user_id = (int) $fields['user_id'];
+ $group_id = (int) $fields['group_id'];
$date = $fields['date'];
$start = $fields['start'];
$finish = $fields['finish'];
if ($duration) {
$sql = "insert into tt_log (user_id, group_id, date, duration, client_id, project_id, task_id, invoice_id, comment, billable, paid, created, created_ip, created_by $status_f) ".
- "values ($user_id, ".$mdb2->quote($group_id).", ".$mdb2->quote($date).", '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $created_v $status_v)";
+ "values ($user_id, $group_id, ".$mdb2->quote($date).", '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $created_v $status_v)";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
if (!$duration && ttTimeHelper::getUncompleted($user_id)) return false;
$sql = "insert into tt_log (user_id, group_id, date, start, duration, client_id, project_id, task_id, invoice_id, comment, billable, paid, created, created_ip, created_by $status_f) ".
- "values ($user_id, ".$mdb2->quote($group_id).", ".$mdb2->quote($date).", '$start', '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $created_v $status_v)";
+ "values ($user_id, $group_id, ".$mdb2->quote($date).", '$start', '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $created_v $status_v)";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
// Prepare an array of fields for regular insert function.
$fields4insert = array();
$fields4insert['user_id'] = $user->getActiveUser();
+ $fields4insert['group_id'] = $user->getActiveGroup();
$fields4insert['date'] = $entry_date;
$fields4insert['duration'] = $fields['duration'];
$fields4insert['client'] = ttWeekViewHelper::parseFromWeekViewRow($fields['row_id'], 'cl');
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.96.4297 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.96.4298 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
// Now, a new insert.
if ($err->no()) {
- if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'user_id'=>$user->getActiveUser(),
+ if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'user_id'=>$user->getActiveUser(),'group_id'=>$user->getActiveGroup(),
'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) {
header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT));
exit();
// Insert record.
if ($err->no()) {
- if (ttExpenseHelper::insert(array('date'=>$cl_date,'user_id'=>$user->getActiveUser(),
+ if (ttExpenseHelper::insert(array('date'=>$cl_date,'user_id'=>$user->getActiveUser(),'group_id'=>$user->getActiveGroup(),
'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) {
header('Location: expenses.php');
exit();
// Now, a new insert.
if ($err->no()) {
- if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'user_id'=>$user->getActiveUser(),
+ if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'user_id'=>$user->getActiveUser(),'group_id'=>$user->getActiveGroup(),
'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) {
header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT));
exit();
// Insert record.
if ($err->no()) {
- if (ttExpenseHelper::insert(array('date'=>$cl_date,'user_id'=>$user->getActiveUser(),
+ if (ttExpenseHelper::insert(array('date'=>$cl_date,'user_id'=>$user->getActiveUser(),'group_id'=>$user->getActiveGroup(),
'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) {
header('Location: expenses.php');
exit();
$id = ttTimeHelper::insert(array(
'date'=>$new_date->toString(DB_DATEFORMAT),
'user_id'=>$user->getActiveUser(),
+ 'group_id'=>$user->getActiveGroup(),
'client'=>$cl_client,
'project'=>$cl_project,
'task'=>$cl_task,