summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/board/tasklinks.php3
-rw-r--r--app/Template/tasklink/create.php10
-rw-r--r--app/Template/tasklink/edit.php34
-rw-r--r--app/Template/tasklink/show.php100
4 files changed, 115 insertions, 32 deletions
diff --git a/app/Template/board/tasklinks.php b/app/Template/board/tasklinks.php
index 9c4f52ca..f934cff9 100644
--- a/app/Template/board/tasklinks.php
+++ b/app/Template/board/tasklinks.php
@@ -9,6 +9,9 @@
false,
$link['is_active'] ? '' : 'task-link-closed'
) ?>
+ <?php if (! empty($link['task_assignee_username'])): ?>
+ [<?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>]
+ <?php endif ?>
</li>
<?php endforeach ?>
</ul>
diff --git a/app/Template/tasklink/create.php b/app/Template/tasklink/create.php
index acf9d6d1..3394271a 100644
--- a/app/Template/tasklink/create.php
+++ b/app/Template/tasklink/create.php
@@ -5,7 +5,7 @@
<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) ?>
+ <?= $this->formHidden('task_id', array('task_id' => $task['id'])) ?>
<?= $this->formHidden('opposite_task_id', $values) ?>
<?= $this->formLabel(t('Label'), 'link_id') ?>
@@ -16,7 +16,13 @@
'title',
$values,
$errors,
- array('required', 'data-dst-field="opposite_task_id"', 'data-search-url="'.$this->u('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"'),
+ array(
+ 'required',
+ 'placeholder="'.t('Start to type task title...').'"',
+ 'title="'.t('Start to type task title...').'"',
+ '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">
diff --git a/app/Template/tasklink/edit.php b/app/Template/tasklink/edit.php
new file mode 100644
index 00000000..267bd627
--- /dev/null
+++ b/app/Template/tasklink/edit.php
@@ -0,0 +1,34 @@
+<div class="page-header">
+ <h2><?= t('Edit a link') ?></h2>
+</div>
+
+<form action="<?= $this->u('tasklink', 'update', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'link_id' => $task_link['id'])) ?>" method="post" autocomplete="off">
+
+ <?= $this->formCsrf() ?>
+ <?= $this->formHidden('id', $values) ?>
+ <?= $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',
+ 'placeholder="'.t('Start to type task title...').'"',
+ 'title="'.t('Start to type task title...').'"',
+ '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/show.php b/app/Template/tasklink/show.php
index 75e3c376..d4a3939b 100644
--- a/app/Template/tasklink/show.php
+++ b/app/Template/tasklink/show.php
@@ -2,63 +2,103 @@
<div class="page-header">
<h2><?= t('Links') ?></h2>
</div>
-<table class="table-fixed" id="links">
+<table id="links">
<tr>
- <th class="column-30"><?= t('Label') ?></th>
- <th class="column-40"><?= t('Task') ?></th>
- <th class="column-20"><?= t('Column') ?></th>
+ <th class="column-20"><?= t('Label') ?></th>
+ <th class="column-30"><?= t('Task') ?></th>
+ <th><?= t('Column') ?></th>
+ <th><?= t('Assignee') ?></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)): ?>
+ <?php foreach ($links as $label => $grouped_links): ?>
+ <?php $hide_td = false ?>
+ <?php foreach ($grouped_links as $link): ?>
+ <tr>
+ <?php if (! $hide_td): ?>
+ <td rowspan="<?= count($grouped_links) ?>"><?= t('This task') ?> <strong><?= t($label) ?></strong></td>
+ <?php $hide_td = true ?>
+ <?php endif ?>
+
<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'
- ) ?>
+ <?php if (! isset($not_editable)): ?>
+ <?= $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'
+ ) ?>
+ <?php else: ?>
+ <?= $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'
+ ) ?>
+ <?php endif ?>
+
+ <br/>
+
+ <?php if (! empty($link['task_time_spent'])): ?>
+ <strong><?= $this->e($link['task_time_spent']).'h' ?></strong> <?= t('spent') ?>
+ <?php endif ?>
+
+ <?php if (! empty($link['task_time_estimated'])): ?>
+ <strong><?= $this->e($link['task_time_estimated']).'h' ?></strong> <?= t('estimated') ?>
+ <?php endif ?>
</td>
<td><?= $this->e($link['column_title']) ?></td>
<td>
- <?= $this->a(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ <?php if (! empty($link['task_assignee_username'])): ?>
+ <?php if (! isset($not_editable)): ?>
+ <?= $this->a($this->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'user', 'show', array('user_id' => $link['task_assignee_id'])) ?>
+ <?php else: ?>
+ <?= $this->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?>
+ <?php endif ?>
+ <?php endif ?>
</td>
- <?php else: ?>
+ <?php if (! isset($not_editable)): ?>
<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'
- ) ?>
+ <ul>
+ <li><?= $this->a(t('Edit'), 'tasklink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li>
+ <li><?= $this->a(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li>
+ </ul>
</td>
- <td><?= $this->e($link['column_title']) ?></td>
- <?php endif ?>
- </tr>
+ <?php endif ?>
+ </tr>
+ <?php endforeach ?>
<?php endforeach ?>
</table>
<?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'])).'"'),
+ array(
+ 'required',
+ 'placeholder="'.t('Start to type task title...').'"',
+ 'title="'.t('Start to type task title...').'"',
+ '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 ?>