From 7420fa50ea7e810db85bcb7ced55dc01d21fafcd Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 26 Mar 2019 16:03:40 +0000 Subject: [PATCH] Resuming work on attachments. --- WEB-INF/lib/ttFileHelper.class.php | 16 +++++++++++----- WEB-INF/templates/footer.tpl | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/WEB-INF/lib/ttFileHelper.class.php b/WEB-INF/lib/ttFileHelper.class.php index a45326cb..5c9b385b 100644 --- a/WEB-INF/lib/ttFileHelper.class.php +++ b/WEB-INF/lib/ttFileHelper.class.php @@ -85,8 +85,14 @@ class ttFileHelper { curl_close($ch); $result_array = json_decode($result, true); - if ($result_array && $result_array['id'] && $result_array['key']) { - + if (!$result_array) { + $this->errors->add($i18n->get('error.file_storage')); + } + else if ($result_array['error']) { + // Add an error from file storage facility if we have it. + $this->errors->add($result_array['error']); + } + else if ($result_array['id'] && $result_array['key']) { $this->site_id = $result_array['id']; $this->site_key = $result_array['key']; @@ -159,12 +165,12 @@ class ttFileHelper { $result_array = json_decode($result, true); $file_id = (int) $result_array['file_id']; $file_key = $result_array['file_key']; - $file_error = $result_array['file_error']; + $error = $result_array['error']; if (!$file_id || !$file_key) { - if ($file_error) { + if ($error) { // Add an error from file storage facility if we have it. - $this->errors->add($file_error); + $this->errors->add($error); } return false; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index ae385b3b..eef37602 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.61.4885 | Copyright © Anuko | +  Anuko Time Tracker 1.18.61.4886 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1