var $taskMap = array(); // Task ids.
var $projectMap = array(); // Project ids.
var $clientMap = array(); // Client ids.
+ var $invoiceMap = array(); // Invoice ids.
// Constructor.
function __construct($group_id, $file, $indentation) {
foreach ($clients as $key=>$client_item)
$this->clientMap[$client_item['id']] = $key + 1;
+ // Prepare invoice map.
+ $invoices = ttTeamHelper::getAllInvoices();
+ foreach ($invoices as $key=>$invoice_item)
+ $this->invoiceMap[$invoice_item['id']] = $key + 1;
+
// Write roles.
fwrite($this->file, $this->indentation." <roles>\n");
foreach ($roles as $role) {
}
fwrite($this->file, $this->indentation." </user_project_binds>\n");
+ // Write invoices.
+ fwrite($this->file, $this->indentation." <invoices>\n");
+ foreach ($invoices as $invoice_item) {
+ $invoice_part = $this->indentation.' '."<invoice id=\"".$this->invoiceMap[$invoice_item['id']]."\"";
+ $invoice_part .= " name=\"".htmlentities($invoice_item['name'])."\"";
+ $invoice_part .= " date=\"".$invoice_item['date']."\"";
+ $invoice_part .= " client_id=\"".$this->clientMap[$invoice_item['client_id']]."\"";
+ $invoice_part .= " status=\"".$invoice_item['status']."\"";
+ $invoice_part .= "></invoice>\n";
+ fwrite($this->file, $invoice_part);
+ }
+ fwrite($this->file, $this->indentation." </invoices>\n");
+
// Call self recursively for all subgroups.
foreach ($this->subgroups as $subgroup) {
$subgroup_helper = new ttGroupExportHelper($subgroup['id'], $this->file, $this->indentation.' ');
'name' => $this->currentElement['NAME'],
'date' => $this->currentElement['DATE'],
'client_id' => $this->clientMap[$this->currentElement['CLIENT_ID']],
- 'discount' => $this->currentElement['DISCOUNT'],
'status' => $this->currentElement['STATUS']));
}
import('ttTaskHelper');
import('ttProjectHelper');
import('ttClientHelper');
+import('ttInvoiceHelper');
// ttOrgImportHelper - this class is a future replacement for ttImportHelper.
// Currently, it is work in progress.
var $currentGroupProjectMap = array();
var $currentGroupClientMap = array();
var $currentGroupUserMap = array();
+ var $currentGroupInvoiceMap = array();
// Constructor.
function __construct(&$errors) {
$this->errors->add($i18n->get('error.db'));
}
}
+
+ if ($name == 'INVOICES') {
+ // If we get here, we have to recycle $currentGroupInvoiceMap.
+ unset($this->currentGroupInvoiceMap);
+ $this->currentGroupInvoiceMap = array();
+ // Invoice map is reconstructed after processing <invoice> elements in XML. See below.
+ }
+
+ if ($name == 'INVOICE') {
+ // We get here when processing <invoice> tags for the current group.
+ $invoice_id = ttInvoiceHelper::insert(array(
+ 'group_id' => $this->current_group_id,
+ 'org_id' => $this->org_id,
+ 'name' => $attrs['NAME'],
+ 'date' => $attrs['DATE'],
+ 'client_id' => $this->currentGroupClientMap[$attrs['CLIENT_ID']],
+ 'status' => $attrs['STATUS']));
+ if ($invoice_id) {
+ // Add a mapping.
+ $this->currentGroupInvoiceMap[$attrs['ID']] = $invoice_id;
+ } else $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.4409 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.12.4410 | 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>