diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index f895c77..3f72c69 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -72,7 +72,8 @@ "from": "Tasks", "permission": { "permission": 2, "category": null, "element": null }, "parent": 1001101001, - "children": [] + "children": [], + "status": 3 } ] } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index cc93f8d..17950f5 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -128,7 +128,7 @@ final class ApiController extends Controller } /** - * Method to create remeinder from request. + * Method to create reminder from request. * * @param RequestAbstract $request Request * @@ -149,7 +149,7 @@ final class ApiController extends Controller $unseen->reminderBy = new NullAccount($request->header->account); $unseen->reminderAt = new \DateTime('now'); - $remidner[] = $unseen; + $reminder[] = $unseen; } return $reminder; @@ -360,10 +360,10 @@ final class ApiController extends Controller $task->descriptionRaw = $request->getDataString('plain') ?? ''; $task->setCreatedBy(new NullAccount($request->header->account)); $task->setStatus(TaskStatus::OPEN); - $task->setType(TaskType::SINGLE); + $task->setType($request->getDataInt('type') ?? TaskType::SINGLE); $task->redirect = $request->getDataString('redirect') ?? ''; - if (!$request->hasData('priority')) { + if ($request->hasData('due')) { $task->due = $request->getDataDateTime('due'); } else { $task->setPriority((int) $request->getData('priority')); diff --git a/Controller/BackendController.php b/Controller/BackendController.php index bb67d01..4f375e5 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -24,6 +24,7 @@ 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 Modules\Tasks\Views\TaskView; use phpOMS\Account\PermissionType; use phpOMS\Asset\AssetType; @@ -48,7 +49,7 @@ use phpOMS\Views\View; final class BackendController extends Controller implements DashboardElementInterface { /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -73,22 +74,21 @@ final class BackendController extends Controller implements DashboardElementInte $mapperQuery = TaskMapper::getAnyRelatedToUser($request->header->account) ->with('tags') ->with('tags/title') + ->with('createdBy') ->where('status', TaskStatus::OPEN, '!=') + ->where('type', TaskType::SINGLE) ->where('tags/title/language', $response->header->l11n->language) ->sort('createdAt', OrderType::DESC) ->limit(25); if ($request->getData('ptype') === 'p') { - $view->data['tasks'] = $mapperQuery->with('createdBy') - ->where('id', $request->getDataInt('id') ?? 0, '<') + $view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '<') ->execute(); } elseif ($request->getData('ptype') === 'n') { - $view->data['tasks'] = $mapperQuery->with('createdBy') - ->where('id', $request->getDataInt('id') ?? 0, '>') + $view->data['tasks'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>') ->execute(); } else { - $view->data['tasks'] = $mapperQuery->with('createdBy') - ->where('id', 0, '>') + $view->data['tasks'] = $mapperQuery->where('id', 0, '>') ->execute(); } @@ -97,6 +97,7 @@ final class BackendController extends Controller implements DashboardElementInte $view->data['task_media'][$task->id] = TaskMapper::has() ->with('media') ->where('id', $task->id) + ->where('type', TaskType::SINGLE) ->execute(); } @@ -113,6 +114,7 @@ final class BackendController extends Controller implements DashboardElementInte ->with('tags') ->with('tags/title') ->where('tags/title/language', $response->header->l11n->language) + ->where('type', TaskType::SINGLE) ->where('status', TaskStatus::OPEN) ->sort('createdAt', OrderType::DESC) ->query($openQuery) @@ -135,6 +137,7 @@ final class BackendController extends Controller implements DashboardElementInte ->with('tags') ->with('tags/title') ->where('tags/title/language', $response->header->l11n->language) + ->where('type', TaskType::SINGLE) ->where('status', TaskStatus::OPEN) ->where('createdBy', $response->header->account, '=') ->sort('createdAt', OrderType::DESC) @@ -146,6 +149,7 @@ final class BackendController extends Controller implements DashboardElementInte $view->data['task_media'][$task->id] = TaskMapper::has() ->with('media') ->where('id', $task->id) + ->where('type', TaskType::SINGLE) ->execute(); } @@ -170,6 +174,7 @@ final class BackendController extends Controller implements DashboardElementInte $view->data['task_media'][$task->id] = TaskMapper::has() ->with('media') ->where('id', $task->id) + ->where('type', TaskType::SINGLE) ->execute(); } @@ -197,6 +202,7 @@ final class BackendController extends Controller implements DashboardElementInte ->sort('taskElements/createdAt', OrderType::DESC) ->limit(5) ->where('id', 0, '>') + ->where('type', TaskType::SINGLE) ->where('tags/title/language', $response->header->l11n->language) ->execute(); @@ -206,7 +212,7 @@ final class BackendController extends Controller implements DashboardElementInte } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -326,7 +332,7 @@ final class BackendController extends Controller implements DashboardElementInte } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -354,7 +360,7 @@ final class BackendController extends Controller implements DashboardElementInte } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index bd8404f..a07a5ad 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -17,7 +17,7 @@ namespace Modules\Tasks\Models; use phpOMS\Stdlib\Base\Enum; /** - * Permision state enum. + * Permission category enum. * * @package Modules\Tasks\Models * @license OMS License 2.0 diff --git a/Models/TaskAttributeValue.php b/Models/TaskAttributeValue.php index 6d639e1..e83bdc3 100755 --- a/Models/TaskAttributeValue.php +++ b/Models/TaskAttributeValue.php @@ -104,9 +104,9 @@ class TaskAttributeValue implements \JsonSerializable /** * Localization * - * @var null|BaseStringL11n + * @var string|BaseStringL11n */ - public ?BaseStringL11n $l11n = null; + public string | BaseStringL11n $l11n = ''; /** * Set l11n diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index b334f0e..5153642 100755 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -329,6 +329,7 @@ final class TaskMapper extends DataMapperFactory $query = new Builder(self::$db, true); $query->innerJoin(TaskElementMapper::TABLE) ->on(self::TABLE . '_d1.task_id', '=', TaskElementMapper::TABLE . '.task_element_task') + ->on(self::TABLE . '_d1.task_type', '=', TaskType::SINGLE) ->innerJoin(AccountRelationMapper::TABLE) ->on(TaskElementMapper::TABLE . '.task_element_id', '=', AccountRelationMapper::TABLE . '.task_account_task_element') ->where(AccountRelationMapper::TABLE . '.task_account_account', '=', $user) @@ -345,8 +346,8 @@ final class TaskMapper extends DataMapperFactory WHERE task.task_status != 1 AND ( - task_account.task_account_account = $user - OR task.task_created_by = $user + task_account.task_account_account = {$user} + OR task.task_created_by = {$user} ) LIMIT 25; SQL; diff --git a/Theme/Backend/Components/Tasks/list.tpl.php b/Theme/Backend/Components/Tasks/list.tpl.php index 29d39ae..338c309 100755 --- a/Theme/Backend/Components/Tasks/list.tpl.php +++ b/Theme/Backend/Components/Tasks/list.tpl.php @@ -21,7 +21,7 @@ use phpOMS\Uri\UriFactory;
getHtml('News', 'News'); ?>
- +
getHtml('Status', 'Tasks'); ?> getHtml('Due/Priority', 'Tasks'); ?> diff --git a/Theme/Backend/Lang/ar.lang.php b/Theme/Backend/Lang/ar.lang.php index 25612b7..f51fe81 100755 --- a/Theme/Backend/Lang/ar.lang.php +++ b/Theme/Backend/Lang/ar.lang.php @@ -15,7 +15,7 @@ declare(strict_types=1); return ['Tasks' => [ 'Account' => 'الحساب', 'All' => 'الجميع', - 'AverageAmount' => 'متوسط ​​المبلغ', + 'AverageAmount' => "متوسط \u{200b}\u{200b}المبلغ", 'AverageProcessTime' => 'avg. وقت المعالجة', 'BCC' => 'bcc', 'By' => 'بواسطة', diff --git a/Theme/Backend/dashboard-task.tpl.php b/Theme/Backend/dashboard-task.tpl.php index a20eda9..8e8119d 100755 --- a/Theme/Backend/dashboard-task.tpl.php +++ b/Theme/Backend/dashboard-task.tpl.php @@ -22,7 +22,7 @@ $tasksList = $this->data['tasks'] ?? [];
getHtml('Tasks', 'Tasks'); ?>
- +
getHtml('Status', 'Tasks'); ?> getHtml('Due/Priority', 'Tasks'); ?> diff --git a/Theme/Backend/task-analysis.tpl.php b/Theme/Backend/task-analysis.tpl.php index 87e78a2..93a9960 100755 --- a/Theme/Backend/task-analysis.tpl.php +++ b/Theme/Backend/task-analysis.tpl.php @@ -23,7 +23,7 @@ echo $this->data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/task-create.tpl.php b/Theme/Backend/task-create.tpl.php index 382cb91..f201c00 100755 --- a/Theme/Backend/task-create.tpl.php +++ b/Theme/Backend/task-create.tpl.php @@ -53,7 +53,7 @@ echo $this->data['nav']->render(); ?>
- +
@@ -80,7 +80,7 @@ echo $this->data['nav']->render(); ?>
-
+
diff --git a/Theme/Backend/task-dashboard.tpl.php b/Theme/Backend/task-dashboard.tpl.php index 5f8cfbf..cbc83bc 100755 --- a/Theme/Backend/task-dashboard.tpl.php +++ b/Theme/Backend/task-dashboard.tpl.php @@ -29,8 +29,8 @@ echo $this->data['nav']->render(); ?>
@@ -75,7 +75,7 @@ echo $this->data['nav']->render(); ?> getHtml('P' . $task->getPriority()); ?> -
data['task_media'][$task->id] ?? false) === true ? 'link' : ''; ?> + data['task_media'][$task->id] ?? false) === true ? 'attachment' : ''; ?> printHtml($task->title); ?> @@ -95,7 +95,7 @@ echo $this->data['nav']->render(); ?> $task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, - $task->createdBy->login ?? '' + $task->createdBy->login ?? '', ]) ); ?> @@ -149,7 +149,7 @@ echo $this->data['nav']->render(); ?> getHtml('P' . $task->getPriority()); ?> - data['task_media'][$task->id] ?? false) === true ? 'link' : ''; ?> + data['task_media'][$task->id] ?? false) === true ? 'attachment' : ''; ?> printHtml($task->title); ?> @@ -169,7 +169,7 @@ echo $this->data['nav']->render(); ?> $task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, - $task->createdBy->login ?? '' + $task->createdBy->login ?? '', ]) ); ?> @@ -228,7 +228,7 @@ echo $this->data['nav']->render(); ?> getHtml('P' . $task->getPriority()); ?> - data['task_media'][$task->id] ?? false) === true ? 'link' : ''; ?> + data['task_media'][$task->id] ?? false) === true ? 'attachment' : ''; ?> printHtml($task->title); ?> @@ -248,7 +248,7 @@ echo $this->data['nav']->render(); ?> $task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, - $task->createdBy->login ?? '' + $task->createdBy->login ?? '', ]) ); ?> @@ -313,7 +313,7 @@ echo $this->data['nav']->render(); ?> getHtml('P' . $task->getPriority()); ?> - data['task_media'][$task->id] ?? false) === true ? 'link' : ''; ?> + data['task_media'][$task->id] ?? false) === true ? 'attachment' : ''; ?> printHtml($task->title); ?> @@ -333,7 +333,7 @@ echo $this->data['nav']->render(); ?> $task->createdBy->name1, $task->createdBy->name2, $task->createdBy->name3, - $task->createdBy->login ?? '' + $task->createdBy->login ?? '', ]) ); ?> diff --git a/Theme/Backend/task-single.tpl.php b/Theme/Backend/task-single.tpl.php index 8f3aaa3..922abda 100755 --- a/Theme/Backend/task-single.tpl.php +++ b/Theme/Backend/task-single.tpl.php @@ -409,7 +409,7 @@ echo $this->data['nav']->render(); ?>
-
+