From: Nik Okuntseff Date: Sat, 2 Mar 2019 15:16:55 +0000 (+0000) Subject: Some fixes to export/import of timesheets. X-Git-Tag: timetracker_1.19-1~240 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=179facbe37379829ddffc9ee2e29ca6c3d969ce8;p=timetracker.git Some fixes to export/import of timesheets. --- diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index ac35cd87..59bdc8c8 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -333,8 +333,10 @@ class ttGroupExportHelper { $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 .= " submit_status=\"".$timesheet_item['submit_status']."\""; $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 .= " approve_status=\"".$timesheet_item['approve_status']."\""; $timesheet_part .= " approve_comment=\"".htmlspecialchars($timesheet_item['approve_comment'])."\""; $timesheet_part .= " status=\"".$timesheet_item['status']."\""; diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index edd59b6b..0efb6b03 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -286,9 +286,8 @@ class ttOrgImportHelper { 'project_id' => $this->currentGroupProjectMap[$attrs['PROJECT_ID']], 'name' => $attrs['NAME'], 'comment' => $attrs['COMMENT'], - // TODO: add handling of these. - //`start_date` date NOT NULL, # timesheet start date - //`end_date` date NOT NULL, # timesheet end date + 'start_date' => $attrs['START_DATE'], + 'end_date' => $attrs['END_DATE'], 'submit_status' => $attrs['SUBMIT_STATUS'], 'approve_status' => $attrs['APPROVE_STATUS'], 'approve_comment' => $attrs['APPROVE_COMMENT'], @@ -916,19 +915,23 @@ class ttOrgImportHelper { $group_id = (int) $fields['group_id']; $org_id = (int) $fields['org_id']; $client_id = $fields['client_id']; + $project_id = $fields['project_id']; $name = $fields['name']; + $comment = $fields['comment']; + $start_date = $fields['start_date']; + $end_date = $fields['end_date']; $submit_status = $fields['submit_status']; - $submitter_comment = $fields['submitter_comment']; - $approval_status = $fields['approval_status']; - $manager_comment = $fields['manager_comment']; + $approve_status = $fields['approve_status']; + $approve_comment = $fields['approve_comment']; $status = $fields['status']; // Insert a new timesheet record. - $sql = "insert into tt_timesheets (user_id, group_id, org_id, client_id, name,". - " submit_status, submitter_comment, approval_status, manager_comment, status)". - " values($user_id, $group_id, $org_id, ".$mdb2->quote($client_id).", ".$mdb2->quote($name).", ". - $mdb2->quote($fields['submit_status']).", ".$mdb2->quote($fields['submiter_comment']).", ". - $mdb2->quote($fields['approval_status']).", ".$mdb2->quote($fields['manager_comment']).", ".$mdb2->quote($fields['status']).")"; + $sql = "insert into tt_timesheets (user_id, group_id, org_id, client_id, project_id, name,". + " comment, start_date, end_date, submit_status, approve_status, approve_comment, status)". + " values($user_id, $group_id, $org_id, ".$mdb2->quote($client_id).", ".$mdb2->quote($project_id).", ".$mdb2->quote($name).", ". + $mdb2->quote($comment).", ".$mdb2->quote($start_date).", ".$mdb2->quote($end_date).", ". + $mdb2->quote($submit_status).", ".$mdb2->quote($approve_status).", ". + $mdb2->quote($approve_comment).", ".$mdb2->quote($status).")"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 02b5b048..ac521a4b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.50.4805 | Copyright © Anuko | +  Anuko Time Tracker 1.18.50.4806 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}