diff --git a/Admin/Installer.php b/Admin/Installer.php index 92b8cfc..762d171 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -87,7 +87,7 @@ final class Installer extends InstallerAbstract $request->setData('title', \reset($attribute['l11n'])); $request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en'); $request->setData('is_required', $attribute['is_required'] ?? false); - $request->setData('is_custom_allowed', $attribute['is_custom_allowed'] ?? false); + $request->setData('custom', $attribute['is_custom_allowed'] ?? false); $request->setData('validation_pattern', $attribute['validation_pattern'] ?? ''); $module->apiTaskAttributeTypeCreate($request, $response); diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 13e9519..0b43d94 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -155,8 +155,8 @@ final class ApiController extends Controller foreach ($uploaded as $media) { $this->createModelRelation( $request->header->account, - $task->getId(), - $media->getId(), + $task->id, + $media->id, TaskMapper::class, 'media', '', @@ -164,15 +164,15 @@ final class ApiController extends Controller ); $accountPath = '/Accounts/' - . $account->getId() . ' ' + . $account->id . ' ' . $account->login . '/Tasks/' . $task->createdAt->format('Y') . '/' . $task->createdAt->format('m') . '/' - . $task->getId(); + . $task->id; $ref = new Reference(); $ref->name = $media->name; - $ref->source = new NullMedia($media->getId()); + $ref->source = new NullMedia($media->id); $ref->createdBy = new NullAccount($request->header->account); $ref->setVirtualPath($accountPath); @@ -182,23 +182,23 @@ final class ApiController extends Controller /** @var \Modules\Media\Models\Media $media */ $collection = MediaMapper::getParentCollection($path)->limit(1)->execute(); - if ($collection instanceof NullCollection) { + if ($collection->id === 0) { $collection = $this->app->moduleManager->get('Media')->createRecursiveMediaCollection( $accountPath, $request->header->account, __DIR__ . '/../../../Modules/Media/Files/Accounts/' - . $account->getId() . '/Tasks/' + . $account->id . '/Tasks/' . $task->createdAt->format('Y') . '/' . $task->createdAt->format('m') . '/' - . $task->getId() + . $task->id ); } } $this->createModelRelation( $request->header->account, - $collection->getId(), - $ref->getId(), + $collection->id, + $ref->id, CollectionMapper::class, 'sources', '', @@ -216,8 +216,8 @@ final class ApiController extends Controller $this->createModelRelation( $request->header->account, - $task->getId(), - $media->getId(), + $task->id, + $media->id, TaskMapper::class, 'media', '', @@ -226,7 +226,7 @@ final class ApiController extends Controller $ref = new Reference(); $ref->name = $media->name; - $ref->source = new NullMedia($media->getId()); + $ref->source = new NullMedia($media->id); $ref->createdBy = new NullAccount($request->header->account); $ref->setVirtualPath($path); @@ -236,7 +236,7 @@ final class ApiController extends Controller /** @var \Modules\Media\Models\Media $media */ $collection = MediaMapper::getParentCollection($path)->limit(1)->execute(); - if ($collection instanceof NullCollection) { + if ($collection->id === 0) { $collection = $this->app->moduleManager->get('Media')->createRecursiveMediaCollection( $path, $request->header->account, @@ -247,8 +247,8 @@ final class ApiController extends Controller $this->createModelRelation( $request->header->account, - $collection->getId(), - $ref->getId(), + $collection->id, + $ref->id, CollectionMapper::class, 'sources', '', @@ -273,7 +273,7 @@ final class ApiController extends Controller . $task->createdAt->format('Y') . '/' . $task->createdAt->format('m') . '/' . $task->createdAt->format('d') . '/' - . $task->getId(); + . $task->id; } /** @@ -530,23 +530,23 @@ final class ApiController extends Controller foreach ($uploaded as $media) { $this->createModelRelation( $request->header->account, - $element->getId(), - $media->getId(), + $element->id, + $media->id, TaskElementMapper::class, 'media', '', $request->getOrigin() ); - $accountPath = '/Accounts/' . $account->getId() . ' ' + $accountPath = '/Accounts/' . $account->id . ' ' . $account->login . '/Tasks/' . $task->createdAt->format('Y') . '/' . $task->createdAt->format('m') . '/' - . $task->getId(); + . $task->id; $ref = new Reference(); $ref->name = $media->name; - $ref->source = new NullMedia($media->getId()); + $ref->source = new NullMedia($media->id); $ref->createdBy = new NullAccount($request->header->account); $ref->setVirtualPath($accountPath); @@ -556,17 +556,17 @@ final class ApiController extends Controller $collection = $this->app->moduleManager->get('Media')->createRecursiveMediaCollection( $accountPath, $request->header->account, - __DIR__ . '/../../../Modules/Media/Files/Accounts/' . $account->getId() + __DIR__ . '/../../../Modules/Media/Files/Accounts/' . $account->id . '/Tasks/' . $task->createdAt->format('Y') . '/' . $task->createdAt->format('m') . '/' - . $task->getId() + . $task->id ); } $this->createModelRelation( $request->header->account, - $collection->getId(), - $ref->getId(), + $collection->id, + $ref->id, CollectionMapper::class, 'sources', '', @@ -584,8 +584,8 @@ final class ApiController extends Controller $this->createModelRelation( $request->header->account, - $element->getId(), - $media->getId(), + $element->id, + $media->id, TaskElementMapper::class, 'media', '', @@ -594,7 +594,7 @@ final class ApiController extends Controller $ref = new Reference(); $ref->name = $media->name; - $ref->source = new NullMedia($media->getId()); + $ref->source = new NullMedia($media->id); $ref->createdBy = new NullAccount($request->header->account); $ref->setVirtualPath($path); @@ -610,8 +610,8 @@ final class ApiController extends Controller $this->createModelRelation( $request->header->account, - $collection->getId(), - $ref->getId(), + $collection->id, + $ref->id, CollectionMapper::class, 'sources', '', @@ -638,7 +638,7 @@ final class ApiController extends Controller $element->due = $request->getDataDateTime('due') ?? $task->due; $element->setPriority($request->getDataInt('priority') ?? $task->getPriority()); $element->setStatus((int) ($request->getData('status'))); - $element->task = $task->getId(); + $element->task = $task->id; $element->description = Markdown::parse($request->getDataString('plain') ?? ''); $element->descriptionRaw = $request->getDataString('plain') ?? ''; @@ -1039,7 +1039,7 @@ final class ApiController extends Controller $this->createModelRelation( $request->header->account, (int) $request->getData('attributetype'), - $attrValue->getId(), + $attrValue->id, TaskAttributeTypeMapper::class, 'defaults', '', $request->getOrigin() ); } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 2fc7b37..100cfbe 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -203,11 +203,11 @@ final class BackendController extends Controller implements DashboardElementInte $accountId = $request->header->account; - if (!($task->createdBy->getId() === $accountId + 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->getId()) + 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; diff --git a/Models/RelationAbstract.php b/Models/RelationAbstract.php index 685faec..38277a1 100755 --- a/Models/RelationAbstract.php +++ b/Models/RelationAbstract.php @@ -33,7 +33,7 @@ abstract class RelationAbstract implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Duty. diff --git a/Models/Task.php b/Models/Task.php index 122cfcb..2a21359 100755 --- a/Models/Task.php +++ b/Models/Task.php @@ -38,7 +38,7 @@ class Task implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Title. @@ -107,7 +107,7 @@ class Task implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $type = TaskType::SINGLE; + public int $type = TaskType::SINGLE; /** * Status. @@ -115,7 +115,7 @@ class Task implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $status = TaskStatus::OPEN; + public int $status = TaskStatus::OPEN; /** * Completion status diff --git a/Models/TaskAttribute.php b/Models/TaskAttribute.php index 9b129a8..cb1f31a 100755 --- a/Models/TaskAttribute.php +++ b/Models/TaskAttribute.php @@ -30,7 +30,7 @@ class TaskAttribute implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Task this attribute belongs to diff --git a/Models/TaskAttributeType.php b/Models/TaskAttributeType.php index fd633be..6ef3805 100755 --- a/Models/TaskAttributeType.php +++ b/Models/TaskAttributeType.php @@ -33,7 +33,7 @@ class TaskAttributeType implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Name/string identifier by which it can be found/categorized diff --git a/Models/TaskAttributeValue.php b/Models/TaskAttributeValue.php index 117dda3..276e202 100755 --- a/Models/TaskAttributeValue.php +++ b/Models/TaskAttributeValue.php @@ -35,7 +35,7 @@ class TaskAttributeValue implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Depending attribute type diff --git a/Models/TaskElement.php b/Models/TaskElement.php index 7ed8e23..87cb935 100755 --- a/Models/TaskElement.php +++ b/Models/TaskElement.php @@ -36,7 +36,7 @@ class TaskElement implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Description. @@ -84,7 +84,7 @@ class TaskElement implements \JsonSerializable * @var int * @since 1.0.0 */ - private int $status = TaskStatus::OPEN; + public int $status = TaskStatus::OPEN; /** * Due. @@ -248,7 +248,7 @@ class TaskElement implements \JsonSerializable { foreach ($this->accRelation as $acc) { if ($acc->getDuty() === DutyType::TO - && $acc->getRelation()->getId() === $id + && $acc->getRelation()->id === $id ) { return true; } @@ -270,7 +270,7 @@ class TaskElement implements \JsonSerializable { foreach ($this->grpRelation as $grp) { if ($grp->getDuty() === DutyType::TO - && $grp->getRelation()->getId() === $id + && $grp->getRelation()->id === $id ) { return true; } @@ -292,7 +292,7 @@ class TaskElement implements \JsonSerializable { foreach ($this->accRelation as $acc) { if ($acc->getDuty() === DutyType::CC - && $acc->getRelation()->getId() === $id + && $acc->getRelation()->id === $id ) { return true; } @@ -314,7 +314,7 @@ class TaskElement implements \JsonSerializable { foreach ($this->grpRelation as $grp) { if ($grp->getDuty() === DutyType::CC - && $grp->getRelation()->getId() === $id + && $grp->getRelation()->id === $id ) { return true; } @@ -352,10 +352,10 @@ class TaskElement implements \JsonSerializable */ public function addGroupTo(Group $group) : void { - $groupId = $group->getId(); + $groupId = $group->id; foreach ($this->grpRelation as $grp) { - $grpId = $grp->getRelation()->getId(); + $grpId = $grp->getRelation()->id; if ($grpId === $groupId && $grp->getDuty() === DutyType::TO) { return; @@ -376,10 +376,10 @@ class TaskElement implements \JsonSerializable */ public function addAccountTo(Account $account) : void { - $accountId = $account->getId(); + $accountId = $account->id; foreach ($this->accRelation as $acc) { - $accId = $acc->getRelation()->getId(); + $accId = $acc->getRelation()->id; if ($accId === $accountId && $acc->getDuty() === DutyType::TO) { return; @@ -444,10 +444,10 @@ class TaskElement implements \JsonSerializable */ public function addGroupCC(Group $group) : void { - $groupId = $group->getId(); + $groupId = $group->id; foreach ($this->grpRelation as $grp) { - $grpId = $grp->getRelation()->getId(); + $grpId = $grp->getRelation()->id; if ($grpId === $groupId && $grp->getDuty() === DutyType::CC) { return; @@ -468,10 +468,10 @@ class TaskElement implements \JsonSerializable */ public function addAccountCC(Account $account) : void { - $accountId = $account->getId(); + $accountId = $account->id; foreach ($this->accRelation as $acc) { - $accId = $acc->getRelation()->getId(); + $accId = $acc->getRelation()->id; if ($accId === $accountId && $acc->getDuty() === DutyType::CC) { return; diff --git a/Models/TaskSeen.php b/Models/TaskSeen.php index 05a88de..bb03589 100755 --- a/Models/TaskSeen.php +++ b/Models/TaskSeen.php @@ -32,7 +32,7 @@ class TaskSeen * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; public \DateTime $seenAt; diff --git a/Models/TaskTemplate.php b/Models/TaskTemplate.php index ba64fe3..33a6c2a 100755 --- a/Models/TaskTemplate.php +++ b/Models/TaskTemplate.php @@ -30,5 +30,5 @@ class TaskTemplate extends Task * @var int * @since 1.0.0 */ - protected int $type = TaskType::TEMPLATE; + public int $type = TaskType::TEMPLATE; } diff --git a/Theme/Backend/Components/Tasks/list.tpl.php b/Theme/Backend/Components/Tasks/list.tpl.php index 97255c9..cc4797e 100755 --- a/Theme/Backend/Components/Tasks/list.tpl.php +++ b/Theme/Backend/Components/Tasks/list.tpl.php @@ -31,7 +31,7 @@ use phpOMS\Uri\UriFactory; tasks as $key => $task) : ++$c; - $url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('task/single?{?}&id=' . $task->getId())); + $url = UriFactory::build(!empty($task->redirect) ? $task->redirect : ('task/single?{?}&id=' . $task->id)); $color = 'darkred'; if ($task->getStatus() === TaskStatus::DONE) { $color = 'green'; } diff --git a/Theme/Backend/Components/Tasks/status.tpl.php b/Theme/Backend/Components/Tasks/status.tpl.php index 4e79d71..a070222 100755 --- a/Theme/Backend/Components/Tasks/status.tpl.php +++ b/Theme/Backend/Components/Tasks/status.tpl.php @@ -1,13 +1,13 @@
-
+ data-src="api/admin/find/accgrp?search={!#iid; ?>}">
-