From: Nik Okuntseff Date: Mon, 12 Nov 2018 12:43:36 +0000 (+0000) Subject: More consistent cleanup in group export. X-Git-Tag: timetracker_1.19-1~652 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=252197d9417610f49c555a454995e0949741a01e;p=timetracker.git More consistent cleanup in group export. --- diff --git a/.gitignore b/.gitignore index dc348cfa..d73d8553 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ config.php WEB-INF/templates_c/*.* WEB-INF/templates_c/import_* +WEB-INF/templates_c/tt* WEB-INF/lib/tcpdf/ nbproject/ upload/ diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index 17d40435..ce3dbb67 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -202,6 +202,8 @@ class ttGroupExportHelper { // Write group info. fwrite($this->file, $this->indentation.$group_part); + unset($group); + unset($group_part); // Prepare user map. $users = $this->getUsers(); @@ -256,6 +258,8 @@ class ttGroupExportHelper { fwrite($this->file, $role_part); } fwrite($this->file, $this->indentation." \n"); + unset($roles); + unset($role_part); // Write tasks. fwrite($this->file, $this->indentation." \n"); @@ -268,6 +272,8 @@ class ttGroupExportHelper { fwrite($this->file, $task_part); } fwrite($this->file, $this->indentation." \n"); + unset($tasks); + unset($task_part); // Write projects. fwrite($this->file, $this->indentation." \n"); @@ -288,6 +294,8 @@ class ttGroupExportHelper { fwrite($this->file, $project_part); } fwrite($this->file, $this->indentation." \n"); + unset($projects); + unset($project_part); // Write clients. fwrite($this->file, $this->indentation." \n"); @@ -309,6 +317,8 @@ class ttGroupExportHelper { fwrite($this->file, $client_part); } fwrite($this->file, $this->indentation." \n"); + unset($clients); + unset($client_part); // Write users. fwrite($this->file, $this->indentation." \n"); @@ -327,6 +337,8 @@ class ttGroupExportHelper { fwrite($this->file, $user_part); } fwrite($this->file, $this->indentation." \n"); + unset($users); + unset($user_part); // Write user to project binds. fwrite($this->file, $this->indentation." \n"); @@ -342,6 +354,8 @@ class ttGroupExportHelper { fwrite($this->file, $bind_part); } fwrite($this->file, $this->indentation." \n"); + unset($user_binds); + unset($bind_part); // Write invoices. fwrite($this->file, $this->indentation." \n"); @@ -355,12 +369,15 @@ class ttGroupExportHelper { fwrite($this->file, $invoice_part); } fwrite($this->file, $this->indentation." \n"); + unset($invoices); + unset($invoice_part); // Write time log entries and build logMap at the same time. fwrite($this->file, $this->indentation." \n"); $key = 0; - foreach ($users as $user_item) { - $records = ttTimeHelper::getAllRecords($user_item['id']); + foreach ($this->userMap as $key => $value) { + $user_id = $key; + $records = ttTimeHelper::getAllRecords($user_id); foreach ($records as $record) { $key++; $this->logMap[$record['id']] = $key; @@ -384,6 +401,7 @@ class ttGroupExportHelper { } fwrite($this->file, $this->indentation." \n"); unset($records); + unset($log_part); // Write custom fields. fwrite($this->file, $this->indentation." \n"); @@ -398,6 +416,7 @@ class ttGroupExportHelper { } fwrite($this->file, $this->indentation." \n"); unset($custom_fields); + unset($custom_field_part); // Write custom field options. fwrite($this->file, $this->indentation." \n"); @@ -410,6 +429,7 @@ class ttGroupExportHelper { } fwrite($this->file, $this->indentation." \n"); unset($custom_field_options); + unset($custom_field_option_part); // Write custom field log. $custom_field_log = ttTeamHelper::getCustomFieldLog($this->group_id); @@ -425,6 +445,7 @@ class ttGroupExportHelper { } fwrite($this->file, $this->indentation." \n"); unset($custom_field_log); + unset($custom_field_log_part); // Write expense items. $expense_items = ttTeamHelper::getExpenseItems($this->group_id); @@ -444,6 +465,7 @@ class ttGroupExportHelper { } fwrite($this->file, $this->indentation." \n"); unset($expense_items); + unset($expense_item_part); // Write monthly quotas. $quotas = ttTeamHelper::getMonthlyQuotas($this->group_id); @@ -456,6 +478,8 @@ class ttGroupExportHelper { fwrite($this->file, $quota_part); } fwrite($this->file, $this->indentation." \n"); + unset($quotas); + unset($quota_part); // Write fav reports. $fav_reports = ttTeamHelper::getFavReports($this->group_id); @@ -502,12 +526,25 @@ class ttGroupExportHelper { } fwrite($this->file, $this->indentation." \n"); unset($fav_reports); + unset($fav_report_part); + + // We are mostly done with writing this group data, destroy all maps. + unset($this->roleMap); + unset($this->userMap); + unset($this->taskMap); + unset($this->projectMap); + unset($this->clientMap); + unset($this->invoiceMap); + unset($this->logMap); + unset($this->customFieldMap); + unset($this->customFieldOptionMap); // Call self recursively for all subgroups. foreach ($this->subgroups as $subgroup) { $subgroup_helper = new ttGroupExportHelper($subgroup['id'], $this->file, $this->indentation.' '); $subgroup_helper->writeData(); } + unset($this->subgroups); fwrite($this->file, $this->indentation."\n"); } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 81bfe05d..48b80bfa 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.12.4419 | Copyright © Anuko | +  Anuko Time Tracker 1.18.12.4420 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}