summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-06-07 15:02:10 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-06-07 15:02:10 -0700
commit9d4be201aaaeaac23f4b18fb6c91caca857a2f0f (patch)
tree0b669aa0d7d382679100a69c0f9a59287b906568 /app/Template
parentdfea2f23653644b574322a5199c120a32e1f29f3 (diff)
Add quick link assign me in different views
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/task_private.php4
-rw-r--r--app/Template/dashboard/overview.php1
-rw-r--r--app/Template/dashboard/tasks.php1
-rw-r--r--app/Template/task/details.php21
-rw-r--r--app/Template/task/dropdown.php7
-rw-r--r--app/Template/task_list/listing.php1
-rw-r--r--app/Template/task_list/task_title.php2
7 files changed, 22 insertions, 15 deletions
diff --git a/app/Template/board/task_private.php b/app/Template/board/task_private.php
index ece5efbe..396184dd 100644
--- a/app/Template/board/task_private.php
+++ b/app/Template/board/task_private.php
@@ -18,7 +18,7 @@
<div class="task-board-collapsed">
<div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse"></i></div>
<?php if ($this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?>
- <?= $this->render('task/dropdown', array('task' => $task)) ?>
+ <?= $this->render('task/dropdown', array('task' => $task, 'redirect' => 'board')) ?>
<?= $this->modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php else: ?>
<strong><?= '#'.$task['id'] ?></strong>
@@ -36,7 +36,7 @@
<div class="task-board-saving-icon" style="display: none;"><i class="fa fa-spinner fa-pulse fa-2x"></i></div>
<div class="task-board-header">
<?php if ($this->user->hasProjectAccess('TaskModificationController', 'edit', $task['project_id'])): ?>
- <?= $this->render('task/dropdown', array('task' => $task)) ?>
+ <?= $this->render('task/dropdown', array('task' => $task, 'redirect' => 'board')) ?>
<?= $this->modal->large('edit', '', 'TaskModificationController', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
<?php else: ?>
<strong><?= '#'.$task['id'] ?></strong>
diff --git a/app/Template/dashboard/overview.php b/app/Template/dashboard/overview.php
index f38c0d44..a352ce02 100644
--- a/app/Template/dashboard/overview.php
+++ b/app/Template/dashboard/overview.php
@@ -63,6 +63,7 @@
<div class="table-list-row color-<?= $task['color_id'] ?>">
<?= $this->render('task_list/task_title', array(
'task' => $task,
+ 'redirect' => 'dashboard',
)) ?>
<?= $this->render('task_list/task_details', array(
diff --git a/app/Template/dashboard/tasks.php b/app/Template/dashboard/tasks.php
index bde1e2f3..4392e40b 100644
--- a/app/Template/dashboard/tasks.php
+++ b/app/Template/dashboard/tasks.php
@@ -13,6 +13,7 @@
<div class="table-list-row color-<?= $task['color_id'] ?>">
<?= $this->render('task_list/task_title', array(
'task' => $task,
+ 'redirect' => 'dashboard-tasks',
)) ?>
<?= $this->render('task_list/task_details', array(
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index cf305743..2712d49b 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -85,6 +85,9 @@
<?= t('not assigned') ?>
<?php endif ?>
</span>
+ <?php if ($editable && $task['owner_id'] != $this->user->getId()): ?>
+ - <span><?= $this->url->link(t('Assign to me'), 'TaskModificationController', 'assignToMe', ['task_id' => $task['id'], 'project_id' => $task['project_id']]) ?></span>
+ <?php endif ?>
</li>
<?php if ($task['creator_username']): ?>
<li>
@@ -116,12 +119,14 @@
<span><?= $this->dt->datetime($task['date_due']) ?></span>
</li>
<?php endif ?>
- <?php if ($task['date_started']): ?>
- <li>
- <strong><?= t('Started:') ?></strong>
+ <li>
+ <strong><?= t('Started:') ?></strong>
+ <?php if ($task['date_started']): ?>
<span><?= $this->dt->datetime($task['date_started']) ?></span>
- </li>
- <?php endif ?>
+ <?php elseif ($editable): ?>
+ <span><?= $this->url->link(t('Start now'), 'TaskModificationController', 'start', ['task_id' => $task['id'], 'project_id' => $task['project_id']]) ?></span>
+ <?php endif ?>
+ </li>
<li>
<strong><?= t('Created:') ?></strong>
<span><?= $this->dt->datetime($task['date_creation']) ?></span>
@@ -164,11 +169,5 @@
)) ?>
<?php endif ?>
- <?php if ($editable && empty($task['date_started'])): ?>
- <div class="buttons-header">
- <?= $this->url->button('play', t('Set start date'), 'TaskModificationController', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- </div>
- <?php endif ?>
-
<?= $this->hook->render('template:task:details:bottom', array('task' => $task)) ?>
</section>
diff --git a/app/Template/task/dropdown.php b/app/Template/task/dropdown.php
index 44fe6eeb..1bad6615 100644
--- a/app/Template/task/dropdown.php
+++ b/app/Template/task/dropdown.php
@@ -2,9 +2,14 @@
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><strong>#<?= $task['id'] ?> <i class="fa fa-caret-down"></i></strong></a>
<ul>
<?php if ($this->projectRole->canUpdateTask($task)): ?>
+ <?php if (array_key_exists('owner_id', $task) && $task['owner_id'] != $this->user->getId()): ?>
+ <li>
+ <?= $this->url->icon('hand-o-right', t('Assign to me'), 'TaskModificationController', 'assignToMe', ['task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => isset($redirect) ? $redirect : '']) ?>
+ </li>
+ <?php endif ?>
<?php if (array_key_exists('date_started', $task) && empty($task['date_started'])): ?>
<li>
- <?= $this->url->icon('play', t('Set the start date automatically'), 'TaskModificationController', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?= $this->url->icon('play', t('Set the start date automatically'), 'TaskModificationController', 'start', ['task_id' => $task['id'], 'project_id' => $task['project_id'], 'redirect' => isset($redirect) ? $redirect : '']) ?>
</li>
<?php endif ?>
<li>
diff --git a/app/Template/task_list/listing.php b/app/Template/task_list/listing.php
index 7891b543..595a190b 100644
--- a/app/Template/task_list/listing.php
+++ b/app/Template/task_list/listing.php
@@ -15,6 +15,7 @@
<?= $this->render('task_list/task_title', array(
'task' => $task,
'show_items_selection' => true,
+ 'redirect' => 'list',
)) ?>
<?= $this->render('task_list/task_details', array(
diff --git a/app/Template/task_list/task_title.php b/app/Template/task_list/task_title.php
index 92d61b6c..662ce1e5 100644
--- a/app/Template/task_list/task_title.php
+++ b/app/Template/task_list/task_title.php
@@ -3,7 +3,7 @@
<?php if (isset($show_items_selection)): ?>
<input type="checkbox" data-list-item="selectable" name="tasks[]" value="<?= $task['id'] ?>">
<?php endif ?>
- <?= $this->render('task/dropdown', array('task' => $task)) ?>
+ <?= $this->render('task/dropdown', array('task' => $task, 'redirect' => isset($redirect) ? $redirect : '')) ?>
<?php else: ?>
<strong><?= '#'.$task['id'] ?></strong>
<?php endif ?>