diff options
Diffstat (limited to 'app/Template/tasklink')
-rw-r--r-- | app/Template/tasklink/create.php | 27 | ||||
-rw-r--r-- | app/Template/tasklink/remove.php | 15 | ||||
-rw-r--r-- | app/Template/tasklink/show.php | 41 |
3 files changed, 83 insertions, 0 deletions
diff --git a/app/Template/tasklink/create.php b/app/Template/tasklink/create.php new file mode 100644 index 00000000..fb438cd8 --- /dev/null +++ b/app/Template/tasklink/create.php @@ -0,0 +1,27 @@ +<div class="page-header"> + <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"> + + <?= $this->formCsrf() ?> + <?= $this->formHidden('task_id', $values) ?> + <?= $this->formHidden('opposite_task_id', $values) ?> + + <?= $this->formLabel(t('Label'), 'link_id') ?> + <?= $this->formSelect('link_id', $labels, $values, $errors) ?> + + <?= $this->formLabel(t('Task'), 'title') ?> + <?= $this->formText( + 'title', + $values, + $errors, + array('required', 'data-dst-field="opposite_task_id"', 'data-search-url="'.$this->u('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"'), + 'task-autocomplete') ?> + + <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'])) ?> + </div> +</form>
\ No newline at end of file diff --git a/app/Template/tasklink/remove.php b/app/Template/tasklink/remove.php new file mode 100644 index 00000000..9322ec24 --- /dev/null +++ b/app/Template/tasklink/remove.php @@ -0,0 +1,15 @@ +<div class="page-header"> + <h2><?= t('Remove a link') ?></h2> +</div> + +<div class="confirm"> + <p class="alert alert-info"> + <?= t('Do you really want to remove this link with task #%d?', $link['opposite_task_id']) ?> + </p> + + <div class="form-actions"> + <?= $this->a(t('Yes'), 'tasklink', 'remove', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), true, 'btn btn-red') ?> + <?= t('or') ?> + <?= $this->a(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </div> +</div>
\ No newline at end of file diff --git a/app/Template/tasklink/show.php b/app/Template/tasklink/show.php new file mode 100644 index 00000000..ca4e4383 --- /dev/null +++ b/app/Template/tasklink/show.php @@ -0,0 +1,41 @@ +<?php if (! empty($links)): ?> +<div class="page-header"> + <h2><?= t('Links') ?></h2> +</div> +<table class="table-fixed" id="links"> + <tr> + <th class="column-30"><?= t('Label') ?></th> + <th class="column-60"><?= t('Task') ?></th> + <?php if (! isset($not_editable)): ?> + <th><?= t('Action') ?></th> + <?php endif ?> + </tr> + <?php foreach ($links as $link): ?> + <tr> + <td><?= t('This task') ?> <strong><?= t($link['label']) ?></strong></td> + <?php if (! isset($not_editable)): ?> + <td> + <?= $this->a( + $this->e('#'.$link['task_id'].' - '.$link['title']), + 'task', 'show', array('task_id' => $link['task_id'], 'project_id' => $link['project_id']), + false, + $link['is_active'] ? '' : 'task-link-closed' + ) ?> + </td> + <td> + <?= $this->a(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + </td> + <?php else: ?> + <td> + <?= $this->a( + $this->e('#'.$link['task_id'].' - '.$link['title']), + 'task', 'readonly', array('task_id' => $link['task_id'], 'token' => $project['token']), + false, + $link['is_active'] ? '' : 'task-link-closed' + ) ?> + </td> + <?php endif ?> + </tr> + <?php endforeach ?> +</table> +<?php endif ?>
\ No newline at end of file |