fwrite($file, "<pack>\n");
// Write team info.
- fwrite($file, "<team currency=\"".$user->currency."\" lock_spec=\"".$user->lock_spec."\" lang=\"".$user->lang.
- "\" decimal_mark=\"".$user->decimal_mark."\" date_format=\"".$user->date_format."\" time_format=\"".$user->time_format.
- "\" week_start=\"".$user->week_start."\" workday_hours=\"".$user->workday_hours.
- "\" plugins=\"".$user->plugins."\" tracking_mode=\"".$user->tracking_mode."\" task_required=\"".$user->task_required.
- "\" record_type=\"".$user->record_type."\">\n");
+ fwrite($file, "<team currency=\"".$user->currency."\" decimal_mark=\"".$user->decimal_mark."\" lang=\"".$user->lang.
+ "\" date_format=\"".$user->date_format."\" time_format=\"".$user->time_format."\" week_start=\"".$user->week_start.
+ "\" tracking_mode=\"".$user->tracking_mode."\" project_required=\"".$user->project_required."\" task_required=\"".$user->task_required.
+ "\" record_type=\"".$user->record_type."\" uncompleted_indicators=\"".$user->uncompleted_indicators."\" bcc_email=\"".$user->bcc_email.
+ "\" plugins=\"".$user->plugins."\" lock_spec=\"".$user->lock_spec."\" workday_hours=\"".$user->workday_hours.
+ "\">\n");
fwrite($file, " <name><![CDATA[".$user->team."]]></name>\n");
fwrite($file, "</team>\n");
foreach ($records as $record) {
$key++;
$this->logMap[$record['id']] = $key;
- fwrite($file, " <log_item id=\"$key\" timestamp=\"".$record['timestamp']."\" user_id=\"".$this->userMap[$record['user_id']]."\" date=\"".$record['date']."\" start=\"".$record['start']."\" finish=\"".$record['finish']."\" duration=\"".($record['start']?"":$record['duration'])."\" client_id=\"".$this->clientMap[$record['client_id']]."\" project_id=\"".$this->projectMap[$record['project_id']]."\" task_id=\"".$this->taskMap[$record['task_id']]."\" invoice_id=\"".$this->invoiceMap[$record['invoice_id']]."\" billable=\"".$record['billable']."\" status=\"".$record['status']."\">\n");
+ fwrite($file, " <log_item id=\"$key\" timestamp=\"".$record['timestamp']."\" user_id=\"".$this->userMap[$record['user_id']]."\" date=\"".$record['date']."\" start=\"".$record['start']."\" finish=\"".$record['finish']."\" duration=\"".($record['start']?"":$record['duration'])."\" client_id=\"".$this->clientMap[$record['client_id']]."\" project_id=\"".$this->projectMap[$record['project_id']]."\" task_id=\"".$this->taskMap[$record['task_id']]."\" invoice_id=\"".$this->invoiceMap[$record['invoice_id']]."\" billable=\"".$record['billable']."\" paid=\"".$record['paid']."\" status=\"".$record['status']."\">\n");
fwrite($file, " <comment><![CDATA[".$record['comment']."]]></comment>\n");
fwrite($file, " </log_item>\n");
}
$team_id = ttTeamHelper::insert(array(
'name' => $this->teamData['NAME'],
'currency' => $this->teamData['CURRENCY'],
- 'lock_spec' => $this->teamData['LOCK_SPEC'],
- 'workday_hours' => $this->teamData['WORKDAY_HOURS'],
- 'lang' => $this->teamData['LANG'],
'decimal_mark' => $this->teamData['DECIMAL_MARK'],
+ 'lang' => $this->teamData['LANG'],
'date_format' => $this->teamData['DATE_FORMAT'],
'time_format' => $this->teamData['TIME_FORMAT'],
'week_start' => $this->teamData['WEEK_START'],
- 'plugins' => $this->teamData['PLUGINS'],
'tracking_mode' => $this->teamData['TRACKING_MODE'],
+ 'project_required' => $this->teamData['PROJECT_REQUIRED'],
'task_required' => $this->teamData['TASK_REQUIRED'],
- 'record_type' => $this->teamData['RECORD_TYPE']));
+ 'record_type' => $this->teamData['RECORD_TYPE'],
+ 'uncompleted_indicators' => $this->teamData['UNCOMPLETED_INDICATORS'],
+ 'bcc_email' => $this->teamData['BCC_EMAIL'],
+ 'plugins' => $this->teamData['PLUGINS'],
+ 'lock_spec' => $this->teamData['LOCK_SPEC'],
+ 'workday_hours' => $this->teamData['WORKDAY_HOURS']));
if ($team_id) {
$this->team_id = $team_id;
foreach ($this->users as $key=>$user_item) {
'invoice' => $this->invoiceMap[$this->currentElement['INVOICE_ID']],
'note' => (isset($this->currentElement['COMMENT']) ? $this->currentElement['COMMENT'] : ''),
'billable' => $this->currentElement['BILLABLE'],
+ 'paid' => $this->currentElement['PAID'],
'status' => $this->currentElement['STATUS']));
}
$mdb2 = getConnection();
- $lock_spec = $fields['lock_spec'];
- if ($lock_spec !== null) {
- $lockspec_f = ', lock_spec';
- $lockspec_v = ', ' . $mdb2->quote($lock_spec);
- } else {
- $lockspec_f = '';
- $lockspec_v = '';
- }
-
- $lang = $fields['lang'];
- if (!$lang) {
- global $i18n;
- $lang = $i18n->lang;
- }
-
$decimal_mark = $fields['decimal_mark'];
if ($decimal_mark !== null) {
$decimal_mark_f = ', decimal_mark';
$decimal_mark_v = '';
}
+ $lang = $fields['lang'];
+ if (!$lang) {
+ global $i18n;
+ $lang = $i18n->lang;
+ }
+
$date_format = $fields['date_format'];
if ($date_format !== null) {
$date_format_f = ', date_format';
$week_start_v = '';
}
- $plugins = $fields['plugins'];
- if ($plugins !== null) {
- $plugins_f = ', plugins';
- $plugins_v = ', ' . $mdb2->quote($plugins);
- } else {
- $plugins_f = '';
- $plugins_v = '';
- }
-
$tracking_mode = $fields['tracking_mode'];
if ($tracking_mode !== null) {
$tracking_mode_f = ', tracking_mode';
$tracking_mode_v = '';
}
+ $project_required = $fields['project_required'];
+ if ($project_required !== null) {
+ $project_required_f = ', project_required';
+ $project_required_v = ', ' . (int)$project_required;
+ } else {
+ $project_required_f = '';
+ $project_required_v = '';
+ }
+
$task_required = $fields['task_required'];
if ($task_required !== null) {
$task_required_f = ', task_required';
$uncompleted_indicators_v = '';
}
+ $bcc_email = $fields['bcc_email'];
+ if ($bcc_email !== null) {
+ $bcc_email_f = ', bcc_email';
+ $bcc_email_v = ', ' . $mdb2->quote($bcc_email);
+ } else {
+ $bcc_email_f = '';
+ $bcc_email_v = '';
+ }
+
+ $plugins = $fields['plugins'];
+ if ($plugins !== null) {
+ $plugins_f = ', plugins';
+ $plugins_v = ', ' . $mdb2->quote($plugins);
+ } else {
+ $plugins_f = '';
+ $plugins_v = '';
+ }
+
+ $lock_spec = $fields['lock_spec'];
+ if ($lock_spec !== null) {
+ $lockspec_f = ', lock_spec';
+ $lockspec_v = ', ' . $mdb2->quote($lock_spec);
+ } else {
+ $lockspec_f = '';
+ $lockspec_v = '';
+ }
+
$workday_hours = $fields['workday_hours'];
if ($workday_hours !== null) {
$workday_hours_f = ', workday_hours';
$workday_hours_v = '';
}
- $sql = "insert into tt_teams (name, currency $lockspec_f, lang $decimal_mark_f $date_format_f $time_format_f $week_start_f $plugins_f $tracking_mode_f $task_required_f $record_type_f $uncompleted_indicators_f $workday_hours_f)
+ $sql = "insert into tt_teams (name, currency $decimal_mark_f, lang $date_format_f $time_format_f $week_start_f $tracking_mode_f $project_required_f $task_required_f $record_type_f $uncompleted_indicators_f $bcc_email_f $plugins_f $lockspec_f $workday_hours_f)
values(".$mdb2->quote(trim($fields['name'])).
- ", ".$mdb2->quote(trim($fields['currency']))." $lockspec_v, ".$mdb2->quote($lang).
- "$decimal_mark_v $date_format_v $time_format_v $week_start_v $plugins_v $tracking_mode_v $task_required_v $record_type_v $uncompleted_indicators_v $workday_hours_v)";
+ ", ".$mdb2->quote(trim($fields['currency']))." $decimal_mark_v, ".$mdb2->quote($lang).
+ "$date_format_v $time_format_v $week_start_v $tracking_mode_v $project_required_v $task_required_v $record_type_v $uncompleted_indicators_v $bcc_email_v $plugins_v $lockspec_v $workday_hours_v)";
$affected = $mdb2->exec($sql);
if (!is_a($affected, 'PEAR_Error')) {
$invoice = $fields['invoice'];
$note = $fields['note'];
$billable = $fields['billable'];
+ $paid = $fields['paid'];
if (array_key_exists('status', $fields)) { // Key exists and may be NULL during migration of data.
$status_f = ', status';
$status_v = ', '.$mdb2->quote($fields['status']);
}
if (!$billable) $billable = 0;
+ if (!$paid) $paid = 0;
if ($duration) {
- $sql = "insert into tt_log (timestamp, user_id, date, duration, client_id, project_id, task_id, invoice_id, comment, billable $status_f) ".
- "values ('$timestamp', $user_id, ".$mdb2->quote($date).", '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable $status_v)";
+ $sql = "insert into tt_log (timestamp, user_id, date, duration, client_id, project_id, task_id, invoice_id, comment, billable, paid $status_f) ".
+ "values ('$timestamp', $user_id, ".$mdb2->quote($date).", '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $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 (timestamp, user_id, date, start, duration, client_id, project_id, task_id, invoice_id, comment, billable $status_f) ".
- "values ('$timestamp', $user_id, ".$mdb2->quote($date).", '$start', '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable $status_v)";
+ "values ('$timestamp', $user_id, ".$mdb2->quote($date).", '$start', '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $status_v)";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error'))
return false;
$sql = "select l.id, l.timestamp, l.user_id, l.date, TIME_FORMAT(l.start, '%k:%i') as start,
TIME_FORMAT(sec_to_time(time_to_sec(l.start) + time_to_sec(l.duration)), '%k:%i') as finish,
TIME_FORMAT(l.duration, '%k:%i') as duration,
- l.client_id, l.project_id, l.task_id, l.invoice_id, l.comment, l.billable, l.status
+ l.client_id, l.project_id, l.task_id, l.invoice_id, l.comment, l.billable, l.paid, l.status
from tt_log l where l.user_id = $user_id order by l.id";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.15.0.3762 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.15.1.3763 | 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>
{/if}
{* initialize preview text *}
<script>
- MakeFormatPreview("date_format_preview", document.getElementById("format_date"));
- MakeFormatPreview("time_format_preview", document.getElementById("format_time"));
+ MakeFormatPreview("date_format_preview", document.getElementById("date_format"));
+ MakeFormatPreview("time_format_preview", document.getElementById("time_format"));
function adjustDecimalPreview()
{