}
// Handle time records.
+ $modified_part = ', modified = now(), modified_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', modified_by = '.$mdb2->quote($user->id);
if ($delete_client_entries) {
- $sql = "update tt_log set status = NULL where client_id = $id";
+ $sql = 'update tt_log set status = NULL'.$modified_part." where client_id = $id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
// Handle expense items.
if ($delete_client_entries) {
- $sql = "update tt_expense_items set status = NULL where client_id = $id";
+ $sql = 'update tt_expense_items set status = NULL'.$modified_part." where client_id = $id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
// Handle invoices.
if ($delete_client_entries) {
- $sql = "update tt_invoices set status = NULL where client_id = $id";
+ $sql = "update tt_invoices set status = NULL where client_id = $id and team_id = $user->team_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
if (is_a($affected, 'PEAR_Error'))
return false;
- $sql = "update tt_clients set status = NULL where id = $id and team_id = ".$user->team_id;
+ // Handle users for client.
+ $sql = 'update tt_users set status = NULL'.$modified_part." where client_id = $id and team_id = $user->team_id";
+ $affected = $mdb2->exec($sql);
+ if (is_a($affected, 'PEAR_Error'))
+ return false;
+
+ // Mark client deleted.
+ $sql = "update tt_clients set status = NULL where id = $id and team_id = $user->team_id";
$affected = $mdb2->exec($sql);
return (!is_a($affected, 'PEAR_Error'));
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.73.4176 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.73.4177 | 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>