Add quick link assign me in different views

This commit is contained in:
Frédéric Guillot
2018-06-07 15:02:10 -07:00
parent dfea2f2365
commit 9d4be201aa
41 changed files with 94 additions and 48 deletions

View File

@@ -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>

View File

@@ -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>