fwrite($this->file, $this->indentation." </custom_field_log>\n");
unset($custom_field_log);
+ // Write expense items.
+ $expense_items = ttTeamHelper::getExpenseItems($this->group_id);
+ fwrite($this->file, $this->indentation." <expense_items>\n");
+ foreach ($expense_items as $expense_item) {
+ $expense_item_part = $this->indentation.' '."<expense_item date=\"".$expense_item['date']."\"";
+ $expense_item_part .= " user_id=\"".$this->userMap[$expense_item['user_id']]."\"";
+ $expense_item_part .= " client_id=\"".$this->clientMap[$expense_item['client_id']]."\"";
+ $expense_item_part .= " project_id=\"".$this->projectMap[$expense_item['project_id']]."\"";
+ $expense_item_part .= " name=\"".htmlentities($expense_item['name'])."\"";
+ $expense_item_part .= " cost=\"".$expense_item['cost']."\"";
+ $expense_item_part .= " invoice_id=\"".$this->invoiceMap[$expense_item['invoice_id']]."\"";
+ $expense_item_part .= " paid=\"".$expense_item['paid']."\"";
+ $expense_item_part .= " status=\"".$expense_item['status']."\"";
+ $expense_item_part .= "></expense_item>\n";
+ fwrite($this->file, $expense_item_part);
+ }
+ fwrite($this->file, $this->indentation." </expense_items>\n");
+ unset($expense_items);
+
// Call self recursively for all subgroups.
foreach ($this->subgroups as $subgroup) {
$subgroup_helper = new ttGroupExportHelper($subgroup['id'], $this->file, $this->indentation.' ');
import('ttClientHelper');
import('ttInvoiceHelper');
import('ttCustomFieldHelper');
+import('ttExpenseHelper');
// ttOrgImportHelper - this class is a future replacement for ttImportHelper.
// Currently, it is work in progress.
$this->errors->add($i18n->get('error.db'));
}
}
+
+ if ($name == 'EXPENSE_ITEM') {
+ // We get here when processing <expense_item> tags for the current group.
+ $expense_item_id = ttExpenseHelper::insert(array(
+ 'date' => $attrs['DATE'],
+ 'user_id' => $this->currentGroupUserMap[$attrs['USER_ID']],
+ 'group_id' => $this->current_group_id,
+ // 'org_id' => $this->org_id, TODO: add this when org_id field is added to the table.
+ 'client_id' => $this->currentGroupClientMap[$attrs['CLIENT_ID']],
+ 'project_id' => $this->currentGroupProjectMap[$attrs['PROJECT_ID']],
+ 'name' => $attrs['NAME'],
+ 'cost' => $attrs['COST'],
+ 'invoice_id' => $this->currentGroupInvoiceMap[$attrs['INVOICE_ID']],
+ 'paid' => $attrs['PAID'],
+ 'status' => $attrs['STATUS']));
+ if (!$expense_item_id) $this->errors->add($i18n->get('error.db'));
+ }
}
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.12.4414 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.12.4415 | 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>