From 7fc48d26d67d69e5179a6cc748d4bfcd7277c5dd Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 9 Oct 2023 22:06:39 +0000 Subject: [PATCH] update --- Admin/Installer.php | 4 +- Admin/Routes/Web/Api.php | 11 +++ Controller/ApiController.php | 85 +++++++++++++++++++++-- Controller/BackendController.php | 94 +++++++++++++++++++------- Models/TaskMapper.php | 22 ++++++ Theme/Backend/Lang/ar.lang.php | 4 +- Theme/Backend/Lang/cs.lang.php | 4 +- Theme/Backend/Lang/da.lang.php | 4 +- Theme/Backend/Lang/de.lang.php | 4 +- Theme/Backend/Lang/el.lang.php | 4 +- Theme/Backend/Lang/en.lang.php | 1 + Theme/Backend/Lang/es.lang.php | 4 +- Theme/Backend/Lang/fi.lang.php | 4 +- Theme/Backend/Lang/fr.lang.php | 4 +- Theme/Backend/Lang/hu.lang.php | 4 +- Theme/Backend/Lang/it.lang.php | 4 +- Theme/Backend/Lang/ja.lang.php | 4 +- Theme/Backend/Lang/ko.lang.php | 4 +- Theme/Backend/Lang/no.lang.php | 4 +- Theme/Backend/Lang/pl.lang.php | 4 +- Theme/Backend/Lang/pt.lang.php | 4 +- Theme/Backend/Lang/ru.lang.php | 4 +- Theme/Backend/Lang/sv.lang.php | 4 +- Theme/Backend/Lang/th.lang.php | 4 +- Theme/Backend/Lang/tr.lang.php | 4 +- Theme/Backend/Lang/uk.lang.php | 4 +- Theme/Backend/Lang/zh.lang.php | 4 +- Theme/Backend/task-dashboard.tpl.php | 8 +++ Theme/Backend/task-single.tpl.php | 9 +++ tests/Controller/ApiControllerTest.php | 20 +++--- 30 files changed, 254 insertions(+), 84 deletions(-) diff --git a/Admin/Installer.php b/Admin/Installer.php index 757206a..4f79fe3 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -92,7 +92,7 @@ private static function createTaskAttributeTypes(ApplicationAbstract $app, array $module->apiTaskAttributeTypeCreate($request, $response); - $responseData = $response->get(''); + $responseData = $response->getData(''); if (!\is_array($responseData)) { continue; } @@ -164,7 +164,7 @@ private static function createTaskAttributeValues(ApplicationAbstract $app, arra $module->apiTaskAttributeValueCreate($request, $response); - $responseData = $response->get(''); + $responseData = $response->getData(''); if (!\is_array($responseData)) { continue; } diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index d85fec6..e57e1fa 100755 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -47,6 +47,17 @@ ], ], ], + '^.*/task/reminder(\?.*|$)' => [ + [ + 'dest' => '\Modules\Tasks\Controller\ApiController:apiTaskReminderCreate', + 'verb' => RouteVerb::PUT, + 'permission' => [ + 'module' => ApiController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::TASK, + ], + ], + ], '^.*/task/element.*$' => [ [ 'dest' => '\Modules\Tasks\Controller\ApiController:apiTaskElementCreate', diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 131e840..cc93f8d 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -37,6 +37,8 @@ use Modules\Tasks\Models\TaskElement; use Modules\Tasks\Models\TaskElementMapper; use Modules\Tasks\Models\TaskMapper; +use Modules\Tasks\Models\TaskSeen; +use Modules\Tasks\Models\TaskSeenMapper; use Modules\Tasks\Models\TaskStatus; use Modules\Tasks\Models\TaskType; use phpOMS\Localization\BaseStringL11n; @@ -57,6 +59,53 @@ */ final class ApiController extends Controller { + /** + * Api method to remind a task + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return void + * + * @api + * + * @since 1.0.0 + */ + public function apiTaskReminderCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void + { + if (!empty($val = $this->validateTaskReminderCreate($request))) { + $response->header->status = RequestStatusCode::R_400; + $this->createInvalidCreateResponse($request, $response, $val); + + return; + } + + /** @var TaskSeen[] $reminder */ + $reminder = $this->createTaskReminderFromRequest($request); + $this->createModel($request->header->account, $reminder, TaskSeenMapper::class, 'reminder', $request->getOrigin()); + $this->createStandardCreateResponse($request, $response, $reminder); + } + + /** + * Validate reminder create request + * + * @param RequestAbstract $request Request + * + * @return array Returns the validation array of the request + * + * @since 1.0.0 + */ + private function validateTaskReminderCreate(RequestAbstract $request) : array + { + $val = []; + if (($val['id'] = !$request->hasData('id'))) { + return $val; + } + + return []; + } + /** * Validate task create request * @@ -78,6 +127,34 @@ private function validateTaskCreate(RequestAbstract $request) : array return []; } + /** + * Method to create remeinder from request. + * + * @param RequestAbstract $request Request + * + * @return TaskSeen[] Returns the created reminders from the request + * + * @since 1.0.0 + */ + public function createTaskReminderFromRequest(RequestAbstract $request) : array + { + /** @var AccountRelation[] $responsible */ + $responsible = TaskMapper::getResponsible((int) $request->getData('id')); + + $reminder = []; + foreach ($responsible as $account) { + $unseen = new TaskSeen(); + $unseen->task = (int) $request->getData('id'); + $unseen->seenBy = $account->relation->id; + $unseen->reminderBy = new NullAccount($request->header->account); + $unseen->reminderAt = new \DateTime('now'); + + $remidner[] = $unseen; + } + + return $reminder; + } + /** * Api method to create a task * @@ -303,7 +380,7 @@ public function createTaskFromRequest(RequestAbstract $request) : Task $internalResponse = new HttpResponse(); $this->app->moduleManager->get('Tag')->apiTagCreate($request, $internalResponse); - if (!\is_array($data = $internalResponse->get($request->uri->__toString()))) { + if (!\is_array($data = $internalResponse->getDataArray($request->uri->__toString()))) { continue; } @@ -780,11 +857,11 @@ private function createTaskAttributeFromRequest(RequestAbstract $request) : Task $attribute->task = (int) $request->getData('task'); $attribute->type = new NullTaskAttributeType((int) $request->getData('type')); - if ($request->hasData('value')) { - $attribute->value = new NullTaskAttributeValue((int) $request->getData('value')); + if ($request->hasData('value_id')) { + $attribute->value = new NullTaskAttributeValue((int) $request->getData('value_id')); } else { $newRequest = clone $request; - $newRequest->setData('value', $request->getData('custom'), true); + $newRequest->setData('value', $request->getData('value'), true); $value = $this->createTaskAttributeValueFromRequest($request); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index e184abc..28cfa90 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -80,16 +80,24 @@ public function viewTaskDashboard(RequestAbstract $request, ResponseAbstract $re if ($request->getData('ptype') === 'p') { $view->data['tasks'] = $mapperQuery->with('createdBy') - ->where('id', $request->getDataInt('id') ?? 0, '<') - ->execute(); + ->where('id', $request->getDataInt('id') ?? 0, '<') + ->execute(); } elseif ($request->getData('ptype') === 'n') { $view->data['tasks'] = $mapperQuery->with('createdBy') - ->where('id', $request->getDataInt('id') ?? 0, '>') - ->execute(); + ->where('id', $request->getDataInt('id') ?? 0, '>') + ->execute(); } else { $view->data['tasks'] = $mapperQuery->with('createdBy') - ->where('id', 0, '>') - ->execute(); + ->where('id', 0, '>') + ->execute(); + } + + $view->data['task_media'] = []; + foreach ($view->data['tasks'] as $task) { + $view->data['task_media'][$task->id] = TaskMapper::has() + ->with('media') + ->where('id', $task->id) + ->execute(); } $openQuery = new Builder($this->app->dbPool->get(), true); @@ -112,6 +120,13 @@ public function viewTaskDashboard(RequestAbstract $request, ResponseAbstract $re $view->data['open'] = $open; + foreach ($view->data['open'] as $task) { + $view->data['task_media'][$task->id] = TaskMapper::has() + ->with('media') + ->where('id', $task->id) + ->execute(); + } + // given // @todo: this should also include forwarded tasks /** @var \Modules\Tasks\Models\Task[] $given */ @@ -127,6 +142,13 @@ public function viewTaskDashboard(RequestAbstract $request, ResponseAbstract $re $view->data['given'] = $given; + foreach ($view->data['given'] as $task) { + $view->data['task_media'][$task->id] = TaskMapper::has() + ->with('media') + ->where('id', $task->id) + ->execute(); + } + /** @var \Modules\Tasks\Models\TaskSeen[] $unread */ $unread = TaskSeenMapper::getAll() ->where('task', \array_keys($open), 'in') @@ -144,6 +166,13 @@ public function viewTaskDashboard(RequestAbstract $request, ResponseAbstract $re $view->data['unread'] = $unseen; + foreach ($view->data['unread'] as $task) { + $view->data['task_media'][$task->id] = TaskMapper::has() + ->with('media') + ->where('id', $task->id) + ->execute(); + } + return $view; } @@ -230,21 +259,45 @@ public function viewTaskView(RequestAbstract $request, ResponseAbstract $respons ->where('tags/title/language', $request->header->l11n->language) ->execute(); + $accountId = $request->header->account; + + if (!($task->createdBy->id === $accountId + || $task->isCCAccount($accountId) + || $task->isToAccount($accountId)) + && !$this->app->accountManager->get($accountId)->hasPermission( + PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::TASK, $task->id) + ) { + $view->setTemplate('/Web/Backend/Error/403_inline'); + $response->header->status = RequestStatusCode::R_403; + return $view; + } + + $reminderStatus = []; + // Set task as seen - if ($task !== 0) { + if ($task->id !== 0) { /** @var \Modules\Tasks\Models\TaskSeen[] $taskSeen */ $taskSeen = TaskSeenMapper::getAll() - ->where('task', (int) $request->getData('id')) + ->with('reminderBy') + ->where('task', $task->id) ->where('seenBy', $request->header->account) ->execute(); foreach ($taskSeen as $unseen) { - if ($unseen->isRemindered && ($unseen->reminderAt?->getTimestamp() ?? 0) < $request->header->getRequestTime()) { - $old = clone $unseen; - - $unseen->isRemindered = false; - - $this->updateModel($request->header->account, $old, $unseen, TaskSeenMapper::class, 'task_seen', $request->getOrigin()); + // Shows all reminders + if ($unseen->reminderBy !== null + && ($unseen->reminderAt?->getTimestamp() ?? 0) < $request->header->getRequestTime() + && ($unseen->reminderAt?->getTimestamp() ?? 0) > ($unseen->seenAt?->getTimestamp() ?? 0) - 300 + ) { + $reminderStatus[] = $unseen; + + if ($unseen->isRemindered) { + $new = clone $unseen; + $new->seenAt = new \DateTime('now'); + $new->isRemindered = false; + + $this->updateModel($request->header->account, $unseen, $new, TaskSeenMapper::class, 'reminder_seen', $request->getOrigin()); + } } } @@ -257,18 +310,7 @@ public function viewTaskView(RequestAbstract $request, ResponseAbstract $respons } } - $accountId = $request->header->account; - - if (!($task->createdBy->id === $accountId - || $task->isCCAccount($accountId) - || $task->isToAccount($accountId)) - && !$this->app->accountManager->get($accountId)->hasPermission( - PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::TASK, $task->id) - ) { - $view->setTemplate('/Web/Backend/Error/403_inline'); - $response->header->status = RequestStatusCode::R_403; - return $view; - } + $view->data['reminder'] = $reminderStatus; $view->setTemplate('/Modules/Tasks/Theme/Backend/task-single'); $view->data['task'] = $task; diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index f6f7b79..a238507 100755 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -164,6 +164,28 @@ public static function getOpenCreatedBy(int $user) : array return self::getAll()->execute($query); } + /** + * Get responsible users for task + * + * @param int $task Task + * + * @return AccountRelation[] + * + * @since 1.0.0 + */ + public static function getResponsible(int $task) : array + { + $query = AccountRelationMapper::getQuery(); + $query->innerJoin(TaskElementMapper::TABLE) + ->on(AccountRelationMapper::TABLE . '_d1.task_account_task_element', '=', TaskElementMapper::TABLE . '.task_element_task') + ->innerJoin(self::TABLE) + ->on(TaskElementMapper::TABLE . '_d1.task_element_task', '=', self::TABLE . '.task_id') + ->where(self::TABLE . '.task_id', '=', $task); + + return AccountRelationMapper::getAll() + ->execute($query); + } + /** * Get open tasks for user * diff --git a/Theme/Backend/Lang/ar.lang.php b/Theme/Backend/Lang/ar.lang.php index a6ac568..bf3d5a3 100755 --- a/Theme/Backend/Lang/ar.lang.php +++ b/Theme/Backend/Lang/ar.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'bcc', 'By' => 'بواسطة', 'CC' => 'نسخة', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'خلقت', 'Creator' => 'المنشئ', 'Day' => 'يوم', @@ -65,7 +65,7 @@ 'Size' => 'بحجم', 'Statistics' => 'إحصائيات', 'Status' => 'حالة', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'مهمة', 'Tasks' => 'مهام', 'Template' => 'نموذج', diff --git a/Theme/Backend/Lang/cs.lang.php b/Theme/Backend/Lang/cs.lang.php index e9b1f9b..c6a6e36 100755 --- a/Theme/Backend/Lang/cs.lang.php +++ b/Theme/Backend/Lang/cs.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc.', 'By' => 'Podle', 'CC' => 'Cc.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Vytvořený', 'Creator' => 'Tvůrce', 'Day' => 'Den', @@ -65,7 +65,7 @@ 'Size' => 'Velikost', 'Statistics' => 'Statistika', 'Status' => 'Postavení', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Úkol', 'Tasks' => 'Úkoly', 'Template' => 'Šablona', diff --git a/Theme/Backend/Lang/da.lang.php b/Theme/Backend/Lang/da.lang.php index 18ebc57..6b2b90a 100755 --- a/Theme/Backend/Lang/da.lang.php +++ b/Theme/Backend/Lang/da.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => 'Ved', 'CC' => 'Cc.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Oprettet', 'Creator' => 'Skaber.', 'Day' => 'Dag', @@ -65,7 +65,7 @@ 'Size' => 'Størrelse', 'Statistics' => 'Statistikker', 'Status' => 'Status.', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Opgave', 'Tasks' => 'Opgaver.', 'Template' => 'Template.', diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index ae2f8a1..20c29b4 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc.', 'By' => 'Durch', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Erstellt', 'Creator' => 'Schöpfer', 'Day' => 'Tag', @@ -65,7 +65,7 @@ 'Size' => 'Größe', 'Statistics' => 'Statistiken', 'Status' => 'Status', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Aufgabe', 'Tasks' => 'Aufgaben', 'Template' => 'Schablone', diff --git a/Theme/Backend/Lang/el.lang.php b/Theme/Backend/Lang/el.lang.php index 4f59ae5..cabe890 100755 --- a/Theme/Backend/Lang/el.lang.php +++ b/Theme/Backend/Lang/el.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc', 'By' => 'Με', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Δημιουργήθηκε', 'Creator' => 'Δημιουργός', 'Day' => 'Ημέρα', @@ -65,7 +65,7 @@ 'Size' => 'Μέγεθος', 'Statistics' => 'Στατιστική', 'Status' => 'Κατάσταση', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Εργο', 'Tasks' => 'Καθήκοντα', 'Template' => 'Πρότυπο', diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 5229883..fdd292f 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -74,6 +74,7 @@ 'To' => 'To', 'Today' => 'Today', 'Type' => 'Type', + 'ReminderedBy' => 'Remindered by', 'Unread' => 'Unread', 'UnreadChanges' => 'Unread Changes', 'Upload' => 'Upload', diff --git a/Theme/Backend/Lang/es.lang.php b/Theme/Backend/Lang/es.lang.php index 30c8a21..2af61f4 100755 --- a/Theme/Backend/Lang/es.lang.php +++ b/Theme/Backend/Lang/es.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc', 'By' => 'Por', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Creado', 'Creator' => 'Creador', 'Day' => 'Día', @@ -65,7 +65,7 @@ 'Size' => 'Tamaño', 'Statistics' => 'Estadísticas', 'Status' => 'Estado', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Tarea', 'Tasks' => 'Tareas', 'Template' => 'Plantilla', diff --git a/Theme/Backend/Lang/fi.lang.php b/Theme/Backend/Lang/fi.lang.php index 2ab9929..33ffe5e 100755 --- a/Theme/Backend/Lang/fi.lang.php +++ b/Theme/Backend/Lang/fi.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc', 'By' => 'Mennessä', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Luotu', 'Creator' => 'Luoja', 'Day' => 'Päivä', @@ -65,7 +65,7 @@ 'Size' => 'Koko', 'Statistics' => 'Tilastot', 'Status' => 'Tila', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Tehtävä', 'Tasks' => 'Tehtävät', 'Template' => 'Sapluuna', diff --git a/Theme/Backend/Lang/fr.lang.php b/Theme/Backend/Lang/fr.lang.php index b326759..ddc5d08 100755 --- a/Theme/Backend/Lang/fr.lang.php +++ b/Theme/Backend/Lang/fr.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC', 'By' => 'Par', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Établi', 'Creator' => 'Créateur', 'Day' => 'Jour', @@ -65,7 +65,7 @@ 'Size' => 'Taille', 'Statistics' => 'Statistiques', 'Status' => 'Statut', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Tâche', 'Tasks' => 'Tâches', 'Template' => 'Modèle', diff --git a/Theme/Backend/Lang/hu.lang.php b/Theme/Backend/Lang/hu.lang.php index d89890d..8f236da 100755 --- a/Theme/Backend/Lang/hu.lang.php +++ b/Theme/Backend/Lang/hu.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc', 'By' => 'Által', 'CC' => 'Kb', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Létrehozott', 'Creator' => 'Teremtő', 'Day' => 'Nap', @@ -65,7 +65,7 @@ 'Size' => 'Méret', 'Statistics' => 'Statisztika', 'Status' => 'Állapot', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Feladat', 'Tasks' => 'Feladatok', 'Template' => 'Sablon', diff --git a/Theme/Backend/Lang/it.lang.php b/Theme/Backend/Lang/it.lang.php index e898e4c..d2fd8d8 100755 --- a/Theme/Backend/Lang/it.lang.php +++ b/Theme/Backend/Lang/it.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => 'Di', 'CC' => 'Cc.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Creato', 'Creator' => 'Creatore', 'Day' => 'Giorno', @@ -65,7 +65,7 @@ 'Size' => 'Misurare', 'Statistics' => 'Statistiche', 'Status' => 'Stato', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Compito', 'Tasks' => 'Compiti', 'Template' => 'Modello', diff --git a/Theme/Backend/Lang/ja.lang.php b/Theme/Backend/Lang/ja.lang.php index e23369b..0fa81d8 100755 --- a/Theme/Backend/Lang/ja.lang.php +++ b/Theme/Backend/Lang/ja.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => '沿って', 'CC' => 'CC', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => '作成した', 'Creator' => 'クリエーター', 'Day' => '日', @@ -65,7 +65,7 @@ 'Size' => 'サイズ', 'Statistics' => '統計学', 'Status' => '状態', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => '仕事', 'Tasks' => 'タスク', 'Template' => 'レンプレート', diff --git a/Theme/Backend/Lang/ko.lang.php b/Theme/Backend/Lang/ko.lang.php index 26d622e..3525ca6 100755 --- a/Theme/Backend/Lang/ko.lang.php +++ b/Theme/Backend/Lang/ko.lang.php @@ -20,7 +20,7 @@ 'BCC' => '바닥', 'By' => '에 의해', 'CC' => 'CC.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => '만들어진', 'Creator' => '창조자', 'Day' => '낮', @@ -65,7 +65,7 @@ 'Size' => '크기', 'Statistics' => '통계', 'Status' => '상태', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => '일', 'Tasks' => '작업', 'Template' => '주형', diff --git a/Theme/Backend/Lang/no.lang.php b/Theme/Backend/Lang/no.lang.php index aee7923..8e0050c 100755 --- a/Theme/Backend/Lang/no.lang.php +++ b/Theme/Backend/Lang/no.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => 'Av', 'CC' => 'CC.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Opprettet', 'Creator' => 'Skaperen.', 'Day' => 'Dag', @@ -65,7 +65,7 @@ 'Size' => 'Størrelse', 'Statistics' => 'Statistikk', 'Status' => 'Status', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Oppgave', 'Tasks' => 'Oppgaver', 'Template' => 'Mal', diff --git a/Theme/Backend/Lang/pl.lang.php b/Theme/Backend/Lang/pl.lang.php index c72ec9e..4c1616a 100755 --- a/Theme/Backend/Lang/pl.lang.php +++ b/Theme/Backend/Lang/pl.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc.', 'By' => 'Za pomocą', 'CC' => 'Cc.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Utworzony', 'Creator' => 'Twórca', 'Day' => 'Dzień', @@ -65,7 +65,7 @@ 'Size' => 'Rozmiar', 'Statistics' => 'Statystyka', 'Status' => 'Status', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Zadanie', 'Tasks' => 'Zadania', 'Template' => 'Szablon', diff --git a/Theme/Backend/Lang/pt.lang.php b/Theme/Backend/Lang/pt.lang.php index 4c89b43..c86100c 100755 --- a/Theme/Backend/Lang/pt.lang.php +++ b/Theme/Backend/Lang/pt.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => 'Por', 'CC' => 'Cc.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Criado', 'Creator' => 'O Criador', 'Day' => 'Dia', @@ -65,7 +65,7 @@ 'Size' => 'Tamanho', 'Statistics' => 'Estatisticas', 'Status' => 'Status', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Tarefa', 'Tasks' => 'Tarefas', 'Template' => 'Modelo', diff --git a/Theme/Backend/Lang/ru.lang.php b/Theme/Backend/Lang/ru.lang.php index fded442..6d73b3a 100755 --- a/Theme/Backend/Lang/ru.lang.php +++ b/Theme/Backend/Lang/ru.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => 'От', 'CC' => 'CC', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Созданный', 'Creator' => 'Создатель', 'Day' => 'День', @@ -65,7 +65,7 @@ 'Size' => 'Размер', 'Statistics' => 'Статистика', 'Status' => 'Статус', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Задача', 'Tasks' => 'Задания', 'Template' => 'Шаблон', diff --git a/Theme/Backend/Lang/sv.lang.php b/Theme/Backend/Lang/sv.lang.php index 37a93ff..67aa977 100755 --- a/Theme/Backend/Lang/sv.lang.php +++ b/Theme/Backend/Lang/sv.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Bcc', 'By' => 'Förbi', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Skapad', 'Creator' => 'Skapare', 'Day' => 'Dag', @@ -65,7 +65,7 @@ 'Size' => 'Storlek', 'Statistics' => 'Statistik', 'Status' => 'Status', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Uppgift', 'Tasks' => 'Uppdrag', 'Template' => 'Mall', diff --git a/Theme/Backend/Lang/th.lang.php b/Theme/Backend/Lang/th.lang.php index c189f93..7c89b33 100755 --- a/Theme/Backend/Lang/th.lang.php +++ b/Theme/Backend/Lang/th.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'bcc', 'By' => 'โดย', 'CC' => 'cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'สร้าง', 'Creator' => 'ผู้สร้าง', 'Day' => 'วัน', @@ -65,7 +65,7 @@ 'Size' => 'ขนาด', 'Statistics' => 'สถิติ', 'Status' => 'สถานะ', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'งาน', 'Tasks' => 'ภารกิจ', 'Template' => 'แม่แบบ', diff --git a/Theme/Backend/Lang/tr.lang.php b/Theme/Backend/Lang/tr.lang.php index 15cc627..184ded0 100755 --- a/Theme/Backend/Lang/tr.lang.php +++ b/Theme/Backend/Lang/tr.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC', 'By' => 'İle', 'CC' => 'Cc', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Yaratılmış', 'Creator' => 'Yaratıcı', 'Day' => 'Gün', @@ -65,7 +65,7 @@ 'Size' => 'Boyut', 'Statistics' => 'İstatistik', 'Status' => 'Durum', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Görev', 'Tasks' => 'Görevler', 'Template' => 'Şablon', diff --git a/Theme/Backend/Lang/uk.lang.php b/Theme/Backend/Lang/uk.lang.php index ad6f82a..4cd6bb1 100755 --- a/Theme/Backend/Lang/uk.lang.php +++ b/Theme/Backend/Lang/uk.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'Відбув', 'By' => 'По', 'CC' => 'Ст', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => 'Створений', 'Creator' => 'Творець', 'Day' => 'День', @@ -65,7 +65,7 @@ 'Size' => 'Розмір', 'Statistics' => 'Статистика', 'Status' => 'Статус', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => 'Завдання', 'Tasks' => 'Завдань', 'Template' => 'Шаблон', diff --git a/Theme/Backend/Lang/zh.lang.php b/Theme/Backend/Lang/zh.lang.php index c5511c9..70cc291 100755 --- a/Theme/Backend/Lang/zh.lang.php +++ b/Theme/Backend/Lang/zh.lang.php @@ -20,7 +20,7 @@ 'BCC' => 'BCC.', 'By' => '经过', 'CC' => 'CC.', - 'Completion' => '#VALUE!', + 'Completion' => '', 'Created' => '创造了', 'Creator' => '创造者', 'Day' => '日', @@ -65,7 +65,7 @@ 'Size' => '尺寸', 'Statistics' => '统计数据', 'Status' => '地位', - 'Tag' => '#VALUE!', + 'Tag' => '', 'Task' => '任务', 'Tasks' => '任务', 'Template' => '模板', diff --git a/Theme/Backend/task-dashboard.tpl.php b/Theme/Backend/task-dashboard.tpl.php index 3c6a445..9ef9633 100755 --- a/Theme/Backend/task-dashboard.tpl.php +++ b/Theme/Backend/task-dashboard.tpl.php @@ -45,6 +45,7 @@ getHtml('Status'); ?> getHtml('Due/Priority'); ?> + getHtml('Title'); ?> getHtml('Tag'); ?> getHtml('Creator'); ?> @@ -74,6 +75,7 @@ getHtml('P' . $task->getPriority()); ?> + data['task_media'][$task->id] ?? false) === true ? '' : ''; ?> printHtml($task->title); ?> @@ -104,6 +106,7 @@ getHtml('Status'); ?> getHtml('Due/Priority'); ?> + getHtml('Title'); ?> getHtml('Tag'); ?> getHtml('For'); ?> @@ -133,6 +136,7 @@ getHtml('P' . $task->getPriority()); ?> + data['task_media'][$task->id] ?? false) === true ? '' : ''; ?> printHtml($task->title); ?> @@ -163,6 +167,7 @@ getHtml('Status'); ?> getHtml('Due/Priority'); ?> + getHtml('Title'); ?> getHtml('Tag'); ?> getHtml('Creator'); ?> @@ -197,6 +202,7 @@ getHtml('P' . $task->getPriority()); ?> + data['task_media'][$task->id] ?? false) === true ? '' : ''; ?> printHtml($task->title); ?> @@ -234,6 +240,7 @@ getHtml('Status'); ?> getHtml('Due/Priority'); ?> + getHtml('Title'); ?> getHtml('Tag'); ?> getHtml('Creator'); ?> @@ -267,6 +274,7 @@ getHtml('P' . $task->getPriority()); ?> + data['task_media'][$task->id] ?? false) === true ? '' : ''; ?> printHtml($task->title); ?> diff --git a/Theme/Backend/task-single.tpl.php b/Theme/Backend/task-single.tpl.php index 6aad489..19d479a 100755 --- a/Theme/Backend/task-single.tpl.php +++ b/Theme/Backend/task-single.tpl.php @@ -30,6 +30,12 @@
+ data['reminder'])) : ?> +
+
getHtml('ReminderedBy'); ?> data['reminder'])->reminderBy->name1; ?>
+
+ +
printHtml($task->createdBy->name1); ?> - printHtml($task->createdAt->format('Y/m/d H:i')); ?> +
+ +
getHtml('S' . $task->getStatus()); ?> diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index d2c42e6..cc67b79 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -119,8 +119,8 @@ public function testCreateTask() : void $this->module->apiTaskCreate($request, $response); - self::assertEquals('Controller Test Title', $response->get('')['response']->title); - self::assertGreaterThan(0, $response->get('')['response']->id); + self::assertEquals('Controller Test Title', $response->getDataArray('')['response']->title); + self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } /** @@ -137,7 +137,7 @@ public function testApiTaskGet() : void $this->module->apiTaskGet($request, $response); - self::assertEquals(1, $response->get('')['response']->id); + self::assertEquals(1, $response->getDataArray('')['response']->id); } /** @@ -157,7 +157,7 @@ public function testApiTaskSet() : void $this->module->apiTaskSet($request, $response); $this->module->apiTaskGet($request, $response); - self::assertEquals('New Title', $response->get('')['response']->title); + self::assertEquals('New Title', $response->getDataArray('')['response']->title); } /** @@ -194,8 +194,8 @@ public function testCreateTaskElement() : void $this->module->apiTaskElementCreate($request, $response); - self::assertEquals('Controller Test', $response->get('')['response']->descriptionRaw); - self::assertGreaterThan(0, $response->get('')['response']->id); + self::assertEquals('Controller Test', $response->getDataArray('')['response']->descriptionRaw); + self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } /** @@ -212,7 +212,7 @@ public function testApiTaskElementGet() : void $this->module->apiTaskElementGet($request, $response); - self::assertEquals(1, $response->get('')['response']->id); + self::assertEquals(1, $response->getDataArray('')['response']->id); } /** @@ -231,7 +231,7 @@ public function testApiTaskElementSet() : void $this->module->apiTaskElementSet($request, $response); $this->module->apiTaskElementGet($request, $response); - self::assertEquals('This is a changed description', $response->get('')['response']->descriptionRaw); + self::assertEquals('This is a changed description', $response->getDataArray('')['response']->descriptionRaw); } /** @@ -249,7 +249,7 @@ public function testInvalidTaskCreate() : void $this->module->apiTaskCreate($request, $response); - self::assertNotEquals([], $response->get('')); + self::assertNotEquals([], $response->getData('')); } /** @@ -269,6 +269,6 @@ public function testInvalidTaskElementCreate() : void $this->module->apiTaskElementCreate($request, $response); - self::assertNotEquals([], $response->get('')); + self::assertNotEquals([], $response->getData('')); } }