Skip to content

Commit

Permalink
Permalinks in tasks overview
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Feb 1, 2024
1 parent f94545b commit 393fec1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
1.8.5 (Unreleased)
-------------------------
- Fix #249: Fix replaced method `friendship\Module::isEnabled()`
- Enh #241: Permalinks in tasks overview

1.8.4 (December 21, 2023)
-------------------------
Expand Down
4 changes: 2 additions & 2 deletions helpers/TaskUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public static function exportXlsx($container = null)
return static::toRoute([static::ROUTE_EXPORT, 'format' => 'xlsx', 'container' => $container]);
}

public static function viewTask(Task $task)
public static function viewTask(Task $task, $scheme = false)
{
return static::container($task)->createUrl(static::ROUTE_VIEW_TASK, ['id' => $task->id]);
return static::container($task)->createUrl(static::ROUTE_VIEW_TASK, ['id' => $task->id], $scheme);
}

public static function viewTaskModal(Task $task, $cal = null)
Expand Down
9 changes: 7 additions & 2 deletions widgets/lists/views/taskListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu pull-right">
<li>
<?= Button::asLink(Yii::t('TasksModule.base', 'Permalink'))
->options(['data' => [
'action-click' => 'content.permalink',
'content-permalink' => TaskUrl::viewTask($task, true)]])
->icon('link') ?>
</li>
<li>
<?= Button::asLink(Yii::t('TasksModule.base', 'Edit task'))
->action('ui.modal.load', TaskUrl::editTask($task))
Expand Down Expand Up @@ -135,5 +142,3 @@
<?= TaskListDetails::widget(['task' => $task]) ?>
<?php endif; ?>
<?= Html::endTag('div') ?>


0 comments on commit 393fec1

Please sign in to comment.