$timesheet_part = $this->indentation.' '."<timesheet id=\"".$this->timesheetMap[$timesheet_item['id']]."\"";
$timesheet_part .= " user_id=\"".$this->userMap[$timesheet_item['user_id']]."\"";
$timesheet_part .= " client_id=\"".$this->clientMap[$timesheet_item['client_id']]."\"";
+ $timesheet_part .= " project_id=\"".$this->projectMap[$timesheet_item['project_id']]."\"";
$timesheet_part .= " name=\"".htmlspecialchars($timesheet_item['name'])."\"";
+ $timesheet_part .= " comment=\"".htmlspecialchars($timesheet_item['comment'])."\"";
+ $timesheet_part .= " start_date=\"".$timesheet_item['start_date']."\"";
+ $timesheet_part .= " end_date=\"".$timesheet_item['end_date']."\"";
$timesheet_part .= " submit_status=\"".$timesheet_item['submit_status']."\"";
- $timesheet_part .= " submitter_comment=\"".htmlspecialchars($timesheet_item['submitter_name'])."\"";
- $timesheet_part .= " approval_status=\"".$timesheet_item['approval_status']."\"";
- $timesheet_part .= " manager_comment=\"".htmlspecialchars($timesheet_item['manager_comment'])."\"";
+ $timesheet_part .= " approve_status=\"".$timesheet_item['approve_status']."\"";
+ $timesheet_part .= " approve_comment=\"".htmlspecialchars($timesheet_item['approve_comment'])."\"";
$timesheet_part .= " status=\"".$timesheet_item['status']."\"";
$timesheet_part .= "></timesheet>\n";
fwrite($this->file, $timesheet_part);
$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 .= " timesheet_id=\"".$this->timesheetMap[$expense_item['timesheet_id']]."\"";
$expense_item_part .= " name=\"".htmlspecialchars($expense_item['name'])."\"";
$expense_item_part .= " cost=\"".$expense_item['cost']."\"";
$expense_item_part .= " invoice_id=\"".$this->invoiceMap[$expense_item['invoice_id']]."\"";
unset($predefined_expense_part);
}
+ // Write templates.
+ $templates = $this->getRecordsFromTable('tt_templates');
+ if (count($templates) > 0) {
+ fwrite($this->file, $this->indentation." <templates>\n");
+ foreach ($templates as $template) {
+ $template_part = $this->indentation.' '."<template name=\"".htmlspecialchars($template['name'])."\"";
+ $template_part .= " description=\"".htmlspecialchars($template['description'])."\"";
+ $template_part .= " content=\"".htmlspecialchars($template['content'])."\"";
+ $template_part .= " status=\"".$template['status']."\"";
+ $template_part .= "></template>\n";
+ fwrite($this->file, $template_part);
+ }
+ fwrite($this->file, $this->indentation." </templates>\n");
+ unset($templates);
+ unset($template_part);
+ }
+
// Write monthly quotas.
$quotas = ttTeamHelper::getMonthlyQuotas($this->group_id);
if (count($quotas) > 0) {