summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorOlivier Maridat <olivier.maridat@trialog.com>2015-03-10 14:49:10 +0100
committerOlivier Maridat <olivier.maridat@trialog.com>2015-03-10 14:49:10 +0100
commit80fb1ce1e5bd864179fe456a68515b6df5de1cb6 (patch)
tree66258c462a6962ecc536c6ad39c0a1e2c56f078d /app/Template
parentef1fea4509a8bd475c9d77ab63764378f1b5067b (diff)
Add a quick task link creation as it is possible for subtask
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/task/show.php2
-rw-r--r--app/Template/tasklink/show.php22
2 files changed, 22 insertions, 2 deletions
diff --git a/app/Template/task/show.php b/app/Template/task/show.php
index d51b5542..3b8f808a 100644
--- a/app/Template/task/show.php
+++ b/app/Template/task/show.php
@@ -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)) ?>
diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php
index a36f89dd..75e3c376 100644
--- a/app/Template/tasklink/show.php
+++ b/app/Template/tasklink/show.php
@@ -41,4 +41,24 @@
</tr>
<?php endforeach ?>
</table>
-<?php endif ?> \ No newline at end of file
+
+<?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 ?>