24 lines
997 B
PHP
24 lines
997 B
PHP
<?php
|
|
/**
|
|
* Done/Todo badge on the board card face. Rendered by template:board:private:task:before-title; the
|
|
* CSS in layout/done_style.php pins it to the top-right (below the header) and colors the two states.
|
|
* Only shown to users who may edit the task (a read-only viewer sees no badge). Expanded cards only
|
|
* (collapsed cards do not fire this hook).
|
|
*/
|
|
if (! $this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])) {
|
|
return;
|
|
}
|
|
$done = $this->OrganonDoneHelper->isDone($task);
|
|
?>
|
|
<span class="organontweaks-done<?= $done ? ' is-done' : '' ?>">
|
|
<?= $this->url->link(
|
|
$done ? '<i class="fa fa-check-square"></i> '.t('Done') : '<i class="fa fa-square"></i> '.t('Todo'),
|
|
'DoneController',
|
|
'toggle',
|
|
array('plugin' => 'OrganonTweaks', 'task_id' => $task['id'], 'project_id' => $task['project_id'], 'from' => 'board'),
|
|
true,
|
|
'',
|
|
$done ? t('Mark as not done') : t('Mark as done')
|
|
) ?>
|
|
</span>
|