Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 20 |
| CompletedTaskListItem | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 20 |
| run | |
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 10 |
|||
| getAttributes | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 5 |
|||
| getData | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 5 |
|||
| <?php | |
| namespace humhub\modules\tasks\widgets\lists; | |
| use humhub\modules\content\components\ContentContainerActiveRecord; | |
| use humhub\modules\tasks\helpers\TaskListUrl; | |
| use humhub\modules\tasks\models\lists\TaskList; | |
| use humhub\modules\tasks\permissions\ManageTasks; | |
| use humhub\widgets\JsWidget; | |
| class CompletedTaskListItem extends JsWidget | |
| { | |
| public $jsWidget = 'task.list.CompletedTaskListViewItem'; | |
| /** | |
| * @var TaskList | |
| */ | |
| public $taskList; | |
| /** | |
| * @var boolean | |
| */ | |
| public $canEdit; | |
| /** | |
| * @var ContentContainerActiveRecord | |
| */ | |
| public $contentContainer; | |
| /** | |
| * @inheritdoc | |
| */ | |
| public function run() | |
| { | |
| if($this->canEdit === null && $this->contentContainer) { | |
| $this->canEdit = $this->contentContainer->can(ManageTasks::class); | |
| } | |
| return $this->render('completedTaskListItem', [ | |
| 'canEdit' => $this->canEdit, | |
| 'taskList' => $this->taskList, | |
| 'options' => $this->getOptions() | |
| ]); | |
| } | |
| public function getAttributes() | |
| { | |
| return [ | |
| 'class' => 'media' | |
| ]; | |
| } | |
| public function getData() | |
| { | |
| return [ | |
| 'reload-url' => TaskListUrl::reloadCompletedTaskList($this->taskList) | |
| ]; | |
| } | |
| } |