$this->invoiceMap[$this->currentElement['ID']] =
ttInvoiceHelper::insert(array(
'group_id' => $this->group_id,
+ 'org_id' => $this->org_id,
'name' => $this->currentElement['NAME'],
'date' => $this->currentElement['DATE'],
'client_id' => $this->clientMap[$this->currentElement['CLIENT_ID']],
ttTimeHelper::insert(array(
'user_id' => $this->userMap[$this->currentElement['USER_ID']],
'group_id' => $this->group_id,
+ 'org_id' => $this->org_id,
'date' => $this->currentElement['DATE'],
'start' => $this->currentElement['START'],
'finish' => $this->currentElement['FINISH'],
$mdb2 = getConnection();
$group_id = (int) $fields['group_id'];
+ $org_id = (int) $fields['org_id'];
$name = $fields['name'];
if (!$name) return false;
}
// Insert a new invoice record.
- $sql = "insert into tt_invoices (group_id, name, date, client_id $status_f)".
- " values($group_id, ".$mdb2->quote($name).", ".$mdb2->quote($date).", $client_id $status_v)";
+ $sql = "insert into tt_invoices (group_id, org_id, name, date, client_id $status_f)".
+ " values($group_id, $org_id, ".$mdb2->quote($name).", ".$mdb2->quote($date).", $client_id $status_v)";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
if (isset($fields['project_id'])) $project_id = (int) $fields['project_id'];
// Create a new invoice record.
- $sql = "insert into tt_invoices (group_id, name, date, client_id) values(".
- $user->getActiveGroup().", ".$mdb2->quote($name).", ".$mdb2->quote($date).", $client_id)";
+ $sql = "insert into tt_invoices (group_id, org_id, name, date, client_id) values(".
+ $user->getActiveGroup().", $user->org_id, ".$mdb2->quote($name).", ".$mdb2->quote($date).", $client_id)";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
$user_id = (int) $fields['user_id'];
$group_id = (int) $fields['group_id'];
+ $org_id = (int) $fields['org_id'];
$date = $fields['date'];
$start = $fields['start'];
$finish = $fields['finish'];
if (!$paid) $paid = 0;
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, $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)";
+ $sql = "insert into tt_log (user_id, group_id, org_id, date, duration, client_id, project_id, task_id, invoice_id, comment, billable, paid, created, created_ip, created_by $status_f) ".
+ "values ($user_id, $group_id, $org_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 === false) $duration = 0;
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, $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)";
+ $sql = "insert into tt_log (user_id, group_id, org_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, $group_id, $org_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;
$fields4insert = array();
$fields4insert['user_id'] = $user->getActiveUser();
$fields4insert['group_id'] = $user->getActiveGroup();
+ $fields4insert['org_id'] = $user->org_id;
$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.18.11.4385 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.11.4386 | 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>
setChange("ALTER TABLE `tt_log` ADD `org_id` int(11) default NULL AFTER `group_id`");
setChange("ALTER TABLE `tt_invoices` ADD `org_id` int(11) default NULL AFTER `group_id`");
setChange("UPDATE `tt_site_config` SET param_value = '1.18.11', modified = now() where param_name = 'version_db' and param_value = '1.18.10'");
+ setChange("UPDATE `tt_log` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.11') set org_id = group_id where org_id is null");
+ setChange("UPDATE `tt_invoices` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.18.11') set org_id = group_id where org_id is null");
}
if ($_POST["cleanup"]) {
'date' => $cl_date,
'user_id' => $user->getActiveUser(),
'group_id' => $user->getActiveGroup(),
+ 'org_id' => $user->org_id,
'client' => $cl_client,
'project' => $cl_project,
'task' => $cl_task,
'date' => $cl_date,
'user_id' => $user->getActiveUser(),
'group_id' => $user->getActiveGroup(),
+ 'org_id' => $user->org_id,
'client' => $cl_client,
'project' => $cl_project,
'task' => $cl_task,
'date' => $cl_date,
'user_id' => $user->getActiveUser(),
'group_id' => $user->getActiveGroup(),
+ 'org_id' => $user->org_id,
'client' => $cl_client,
'project' => $cl_project,
'task' => $cl_task,
'date'=>$new_date->toString(DB_DATEFORMAT),
'user_id'=>$user->getActiveUser(),
'group_id'=>$user->getActiveGroup(),
+ 'org_id' => $user->org_id,
'client'=>$cl_client,
'project'=>$cl_project,
'task'=>$cl_task,