Files
OrganonTweaks/Template/board/task_comment_icon.php

15 lines
967 B
PHP
Raw Normal View History

2026-07-05 10:20:45 -03:00
<?php /*
* Rendered by the template:board:task:icons hook, inside the card icons row. When a card
* has no comments yet, Kanboard shows no comment icon at all -- so adding the first comment
* means opening the card and finding the sidebar link. This adds a comment bubble with a
* "+" that opens the same comment modal (CommentListController::show) the native count icon
* uses, so the first comment can be added straight from the board. Cards that already have
* comments render nothing here (the native count icon already shows).
*
* Only shown to users who may create a comment (CommentController::save is PROJECT_MEMBER),
* so it does not appear for read-only viewers.
*/ ?>
<?php if (empty($task['nb_comments']) && $this->user->hasProjectAccess('CommentController', 'save', $task['project_id'])): ?>
<?= $this->modal->medium('comments-o', '+', 'CommentListController', 'show', array('task_id' => $task['id']), t('Add a comment')) ?>
<?php endif ?>