1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/Template/tasklink/show.php

105 lines
4.4 KiB
PHP
Raw Normal View History

2015-02-25 17:29:06 +01:00
<?php if (! empty($links)): ?>
<div class="page-header">
<h2><?= t('Links') ?></h2>
</div>
2015-08-16 17:04:56 +02:00
<table id="links">
2015-02-25 17:29:06 +01:00
<tr>
2015-08-16 17:04:56 +02:00
<th class="column-20"><?= t('Label') ?></th>
<th class="column-30"><?= t('Task') ?></th>
<th><?= t('Column') ?></th>
<th><?= t('Assignee') ?></th>
2015-02-25 17:29:06 +01:00
<?php if (! isset($not_editable)): ?>
<th><?= t('Action') ?></th>
<?php endif ?>
</tr>
2015-08-16 17:04:56 +02:00
<?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 ?>
2015-02-25 17:29:06 +01:00
<td>
2015-08-16 17:04:56 +02:00
<?php if (! isset($not_editable)): ?>
<?= $this->url->link(
$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->url->link(
$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 ?>
2015-02-25 17:29:06 +01:00
</td>
<td><?= $this->e($link['column_title']) ?></td>
<td>
2015-08-16 17:04:56 +02:00
<?php if (! empty($link['task_assignee_username'])): ?>
<?php if (! isset($not_editable)): ?>
<?= $this->url->link($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 ?>
2015-02-25 17:29:06 +01:00
</td>
2015-08-16 17:04:56 +02:00
<?php if (! isset($not_editable)): ?>
2015-02-25 17:29:06 +01:00
<td>
2015-08-16 17:04:56 +02:00
<ul>
<li><?= $this->url->link(t('Edit'), 'tasklink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li>
<li><?= $this->url->link(t('Remove'), 'tasklink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id'])) ?></li>
</ul>
2015-02-25 17:29:06 +01:00
</td>
2015-08-16 17:04:56 +02:00
<?php endif ?>
</tr>
<?php endforeach ?>
2015-02-25 17:29:06 +01:00
<?php endforeach ?>
</table>
2015-04-21 17:56:16 +02:00
<?php if (! isset($not_editable) && isset($link_label_list)): ?>
2015-08-16 17:04:56 +02:00
<form action="<?= $this->url->href('tasklink', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" method="post" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?>
<?= $this->form->hidden('opposite_task_id', array()) ?>
<?= $this->form->select('link_id', $link_label_list, array(), array()) ?>
<?= $this->form->text(
2015-04-21 17:56:16 +02:00
'title',
array(),
array(),
2015-08-16 17:04:56 +02:00
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->url->href('app', 'autocomplete', array('exclude_task_id' => $task['id'])).'"',
),
2015-04-21 17:56:16 +02:00
'task-autocomplete') ?>
2015-08-16 17:04:56 +02:00
2015-04-21 17:56:16 +02:00
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
</form>
<?php endif ?>
2015-08-16 17:04:56 +02:00
2015-04-21 17:56:16 +02:00
<?php endif ?>