diff options
Diffstat (limited to 'app/Template/tasklink')
-rw-r--r-- | app/Template/tasklink/create.php | 8 | ||||
-rw-r--r-- | app/Template/tasklink/show.php | 22 |
2 files changed, 27 insertions, 3 deletions
diff --git a/app/Template/tasklink/create.php b/app/Template/tasklink/create.php index fb438cd8..acf9d6d1 100644 --- a/app/Template/tasklink/create.php +++ b/app/Template/tasklink/create.php @@ -2,7 +2,7 @@ <h2><?= t('Add a new link') ?></h2> </div> -<form action="<?= $this->u('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off"> +<form action="<?= $this->u('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'ajax' => isset($ajax))) ?>" method="post" autocomplete="off"> <?= $this->formCsrf() ?> <?= $this->formHidden('task_id', $values) ?> @@ -22,6 +22,10 @@ <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> - <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?php if (isset($ajax)): ?> + <?= $this->a(t('cancel'), 'board', 'show', array('project_id' => $task['project_id']), false, 'close-popover') ?> + <?php else: ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + <?php endif ?> </div> </form>
\ No newline at end of file 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 ?> |