diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 1ce55f0..b4bbc19 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -45,8 +45,19 @@ use phpOMS\Utils\Parser\Markdown\Markdown; */ final class ApiController extends Controller { - // @todo Create another notification whenever a comment is created for a card - // The card owner and all previous commentators should receive a notification + /** + * Create a notification for a card + * + * @param KanbanCard $card Card to create notification for + * @param RequestAbstract $request Request + * + * @return void + * + * @todo Create another notification whenever a comment is created for a card + * The card owner and all previous commentators should receive a notification + * + * @since 1.0.0 + */ private function createCardNotifications(KanbanCard $card, RequestAbstract $request) : void { $accounts = AccountMapper::findReadPermission( @@ -57,15 +68,15 @@ final class ApiController extends Controller ); foreach ($accounts as $account) { - $notification = new Notification(); - $notification->module = self::NAME; - $notification->title = $card->name; - $notification->createdBy = $card->createdBy; + $notification = new Notification(); + $notification->module = self::NAME; + $notification->title = $card->name; + $notification->createdBy = $card->createdBy; $notification->createdFor = new NullAccount($account); - $notification->type = NotificationType::CREATE; - $notification->category = PermissionCategory::CARD; - $notification->element = $card->id; - $notification->redirect = '{/base}/kanban/card?{?}&id=' . $card->id; + $notification->type = NotificationType::CREATE; + $notification->category = PermissionCategory::CARD; + $notification->element = $card->id; + $notification->redirect = '{/base}/kanban/card?{?}&id=' . $card->id; $this->createModel($request->header->account, $notification, NotificationMapper::class, 'notification', $request->getOrigin()); } @@ -129,7 +140,7 @@ final class ApiController extends Controller && ($commentApi = $this->app->moduleManager->get('Comments', 'Api'))::ID > 0 ) { /** @var \Modules\Comments\Controller\ApiController $commentApi */ - $commnetList = $commentApi->createCommentList(); + $commnetList = $commentApi->createCommentList(); $card->commentList = $commnetList; } diff --git a/Controller/SearchController.php b/Controller/SearchController.php index 841ba9b..7f2d2ab 100644 --- a/Controller/SearchController.php +++ b/Controller/SearchController.php @@ -64,10 +64,10 @@ final class SearchController extends Controller 'link' => '{/base}/kanban/card?id=' . $doc->id, 'account' => '', 'createdAt' => $doc->createdAt, - 'image' => '', - 'tags' => $doc->tags, - 'type' => 'list_links', - 'module' => 'Kanban', + 'image' => '', + 'tags' => $doc->tags, + 'type' => 'list_links', + 'module' => 'Kanban', ]; } diff --git a/Models/KanbanCardMapper.php b/Models/KanbanCardMapper.php index 756657e..159d166 100755 --- a/Models/KanbanCardMapper.php +++ b/Models/KanbanCardMapper.php @@ -51,7 +51,7 @@ final class KanbanCardMapper extends DataMapperFactory 'kanban_card_color' => ['name' => 'kanban_card_color', 'type' => 'string', 'internal' => 'color'], 'kanban_card_ref' => ['name' => 'kanban_card_ref', 'type' => 'int', 'internal' => 'ref'], 'kanban_card_column' => ['name' => 'kanban_card_column', 'type' => 'int', 'internal' => 'column'], - 'kanban_card_comment_list' => ['name' => 'kanban_card_comment_list', 'type' => 'int', 'internal' => 'commentList'], + 'kanban_card_comment_list' => ['name' => 'kanban_card_comment_list', 'type' => 'int', 'internal' => 'commentList'], 'kanban_card_created_at' => ['name' => 'kanban_card_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], 'kanban_card_created_by' => ['name' => 'kanban_card_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], ];