Add a quick task link creation as it is possible for subtask

This commit is contained in:
Olivier Maridat 2015-03-10 14:49:10 +01:00
parent ef1fea4509
commit 80fb1ce1e5
3 changed files with 23 additions and 2 deletions

View File

@ -74,6 +74,7 @@ class Task extends Base
'links' => $this->taskLink->getLinks($task['id']),
'task' => $task,
'values' => $values,
'link_label_list' => $this->link->getList(0, false),
'columns_list' => $this->board->getColumnsList($task['project_id']),
'colors_list' => $this->color->getList(),
'date_format' => $this->config->get('application_date_format'),

View File

@ -1,7 +1,7 @@
<?= $this->render('task/details', array('task' => $task, 'project' => $project)) ?>
<?= $this->render('task/time', array('task' => $task, 'values' => $values, 'date_format' => $date_format, 'date_formats' => $date_formats)) ?>
<?= $this->render('task/show_description', array('task' => $task)) ?>
<?= $this->render('tasklink/show', array('task' => $task, 'links' => $links)) ?>
<?= $this->render('tasklink/show', array('task' => $task, 'links' => $links, 'link_label_list' => $link_label_list)) ?>
<?= $this->render('subtask/show', array('task' => $task, 'subtasks' => $subtasks, 'project' => $project)) ?>
<?= $this->render('task/timesheet', array('task' => $task)) ?>
<?= $this->render('file/show', array('task' => $task, 'files' => $files)) ?>

View File

@ -41,4 +41,24 @@
</tr>
<?php endforeach ?>
</table>
<?php endif ?>
<?php if (! isset($not_editable) && isset($link_label_list)): ?>
<form action="<?= $this->u('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off">
<?= $this->formCsrf() ?>
<?= $this->formHidden('task_id', array('task_id' => $task['id'])) ?>
<?= $this->formHidden('opposite_task_id', array()) ?>
<?= $this->formSelect('link_id', $link_label_list, array(), array()) ?>
<?= $this->formText(
'title',
array(),
array(),
array('required', 'data-dst-field="opposite_task_id"', 'data-search-url="'.$this->u('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"'),
'task-autocomplete') ?>
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
</form>
<?php endif ?>
<?php endif ?>