Improve task summary sections
This commit is contained in:
@@ -10,23 +10,6 @@ namespace Kanboard\Controller;
|
||||
*/
|
||||
class Subtask extends Base
|
||||
{
|
||||
/**
|
||||
* Show list of subtasks
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$task = $this->getTask();
|
||||
|
||||
$this->response->html($this->helper->layout->task('subtask/show', array(
|
||||
'users_list' => $this->projectUserRole->getAssignableUsersList($task['project_id']),
|
||||
'task' => $task,
|
||||
'project' => $this->getProject(),
|
||||
'subtasks' => $this->subtask->getAll($task['id']),
|
||||
'editable' => true,
|
||||
'show_title' => true,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation form
|
||||
*
|
||||
|
||||
@@ -76,7 +76,8 @@ class Task extends Base
|
||||
'images' => $this->taskFile->getAllImages($task['id']),
|
||||
'comments' => $this->comment->getAll($task['id'], $this->userSession->getCommentSorting()),
|
||||
'subtasks' => $subtasks,
|
||||
'links' => $this->taskLink->getAllGroupedByLabel($task['id']),
|
||||
'internal_links' => $this->taskLink->getAllGroupedByLabel($task['id']),
|
||||
'external_links' => $this->taskExternalLink->getAll($task['id']),
|
||||
'task' => $task,
|
||||
'values' => $values,
|
||||
'link_label_list' => $this->link->getList(0, false),
|
||||
|
||||
@@ -12,22 +12,6 @@ use Kanboard\Core\ExternalLink\ExternalLinkProviderNotFound;
|
||||
*/
|
||||
class TaskExternalLink extends Base
|
||||
{
|
||||
/**
|
||||
* Creation form
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$task = $this->getTask();
|
||||
|
||||
$this->response->html($this->helper->layout->task('task_external_link/show', array(
|
||||
'links' => $this->taskExternalLink->getAll($task['id']),
|
||||
'task' => $task,
|
||||
'title' => t('List of external links'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* First creation form
|
||||
*
|
||||
@@ -90,7 +74,7 @@ class TaskExternalLink extends Base
|
||||
|
||||
if ($valid && $this->taskExternalLink->create($values)) {
|
||||
$this->flash->success(t('Link added successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
|
||||
return $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
|
||||
}
|
||||
|
||||
$this->edit($values, $errors);
|
||||
@@ -137,7 +121,7 @@ class TaskExternalLink extends Base
|
||||
|
||||
if ($valid && $this->taskExternalLink->update($values)) {
|
||||
$this->flash->success(t('Link updated successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
|
||||
return $this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])), true);
|
||||
}
|
||||
|
||||
$this->edit($values, $errors);
|
||||
@@ -180,6 +164,6 @@ class TaskExternalLink extends Base
|
||||
$this->flash->failure(t('Unable to remove this link.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
|
||||
$this->response->redirect($this->helper->url->to('task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,27 +28,6 @@ class Tasklink extends Base
|
||||
return $link;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show links
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$task = $this->getTask();
|
||||
$project = $this->project->getById($task['project_id']);
|
||||
|
||||
$this->response->html($this->helper->layout->task('tasklink/show', array(
|
||||
'links' => $this->taskLink->getAllGroupedByLabel($task['id']),
|
||||
'task' => $task,
|
||||
'project' => $project,
|
||||
'link_label_list' => $this->link->getList(0, false),
|
||||
'editable' => true,
|
||||
'is_public' => false,
|
||||
'show_title' => true,
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creation form
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Add a comment') ?></h2>
|
||||
</div>
|
||||
<form class="popover-form" method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off" class="form-comment">
|
||||
<form class="popover-form" method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('task_id', $values) ?>
|
||||
<?= $this->form->hidden('user_id', $values) ?>
|
||||
@@ -21,7 +21,7 @@
|
||||
$values,
|
||||
$errors,
|
||||
array(
|
||||
! isset($skip_cancel) ? 'autofocus' : '',
|
||||
'autofocus',
|
||||
'required',
|
||||
'placeholder="'.t('Leave a comment').'"',
|
||||
'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"',
|
||||
@@ -38,9 +38,7 @@
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<?php if (! isset($skip_cancel)): ?>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
|
||||
<?php endif ?>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
36
app/Template/comments/create.php
Normal file
36
app/Template/comments/create.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<form method="post" action="<?= $this->url->href('comment', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('task_id', $values) ?>
|
||||
<?= $this->form->hidden('user_id', $values) ?>
|
||||
|
||||
<div class="form-tabs">
|
||||
<ul class="form-tabs-nav">
|
||||
<li class="form-tab form-tab-selected">
|
||||
<i class="fa fa-pencil-square-o fa-fw"></i><a id="markdown-write" href="#"><?= t('Write') ?></a>
|
||||
</li>
|
||||
<li class="form-tab">
|
||||
<a id="markdown-preview" href="#"><i class="fa fa-eye fa-fw"></i><?= t('Preview') ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="write-area">
|
||||
<?= $this->form->textarea(
|
||||
'comment',
|
||||
$values,
|
||||
$errors,
|
||||
array(
|
||||
'required',
|
||||
'placeholder="'.t('Leave a comment').'"',
|
||||
'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $task['project_id'])).'"',
|
||||
),
|
||||
'comment-textarea'
|
||||
) ?>
|
||||
</div>
|
||||
<div class="preview-area">
|
||||
<div class="markdown"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
</div>
|
||||
</form>
|
||||
31
app/Template/comments/show.php
Normal file
31
app/Template/comments/show.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<section class="accordion-section <?= empty($comments) ? 'accordion-collapsed' : '' ?>">
|
||||
<div class="accordion-title">
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Comments') ?></h3>
|
||||
</div>
|
||||
<div class="accordion-content" id="comments">
|
||||
<div class="comment-sorting">
|
||||
<i class="fa fa-sort"></i>
|
||||
<?= $this->url->link(t('change sorting'), 'comment', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</div>
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<?= $this->render('comment/show', array(
|
||||
'comment' => $comment,
|
||||
'task' => $task,
|
||||
'project' => $project,
|
||||
'editable' => $editable,
|
||||
'is_public' => isset($is_public) && $is_public,
|
||||
)) ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php if ($editable): ?>
|
||||
<?= $this->render('comments/create', array(
|
||||
'values' => array(
|
||||
'user_id' => $this->user->getId(),
|
||||
'task_id' => $task['id'],
|
||||
),
|
||||
'errors' => array(),
|
||||
'task' => $task,
|
||||
)) ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</section>
|
||||
@@ -1,32 +1,12 @@
|
||||
<?php if (isset($show_title)): ?>
|
||||
<div class="task-show-title color-<?= $task['color_id'] ?>">
|
||||
<h2><?= $this->text->e($task['title']) ?></h2>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Sub-Tasks') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-plus fa-fw"></i>
|
||||
<?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="subtasks">
|
||||
|
||||
<?= $this->render('subtask/table', array('subtasks' => $subtasks, 'task' => $task, 'editable' => $editable)) ?>
|
||||
|
||||
<?php if ($editable && $this->user->hasProjectAccess('subtask', 'save', $task['project_id'])): ?>
|
||||
<form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?>
|
||||
<?= $this->form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
|
||||
<?= $this->form->numeric('time_estimated', array(), array(), array('placeholder="'.t('Original estimate').'"')) ?>
|
||||
<?= $this->form->select('user_id', $users_list, array(), array(), array('placeholder="'.t('Assignee').'"')) ?>
|
||||
<button type="submit" class="btn btn-blue"><?= t('Add') ?></button>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<section class="accordion-section <?= empty($subtasks) ? 'accordion-collapsed' : '' ?>">
|
||||
<div class="accordion-title">
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Sub-Tasks') ?></h3>
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<?= $this->render('subtask/table', array(
|
||||
'subtasks' => $subtasks,
|
||||
'task' => $task,
|
||||
'editable' => $editable
|
||||
)) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -66,6 +66,4 @@
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else: ?>
|
||||
<p class="alert"><?= t('There is no subtask at the moment.') ?></p>
|
||||
<?php endif ?>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php if (! empty($comments)): ?>
|
||||
<div id="comments" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2>
|
||||
<?= t('Comments') ?>
|
||||
<span class="comment-sorting">
|
||||
<i class="fa fa-sort"></i>
|
||||
<?= $this->url->link(t('change sorting'), 'comment', 'toggleSorting', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<?= $this->render('comment/show', array(
|
||||
'comment' => $comment,
|
||||
'task' => $task,
|
||||
'project' => $project,
|
||||
'editable' => $editable,
|
||||
'is_public' => isset($is_public) && $is_public,
|
||||
)) ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php if ($editable): ?>
|
||||
<?= $this->render('comment/create', array(
|
||||
'skip_cancel' => true,
|
||||
'values' => array(
|
||||
'user_id' => $this->user->getId(),
|
||||
'task_id' => $task['id'],
|
||||
),
|
||||
'errors' => array(),
|
||||
'task' => $task,
|
||||
)) ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
@@ -1,16 +1,9 @@
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<div id="description" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Description') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-edit fa-fw"></i>
|
||||
<?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<article class="markdown task-show-description">
|
||||
<section class="accordion-section <?= empty($task['description']) ? 'accordion-collapsed' : '' ?>">
|
||||
<div class="accordion-title">
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Description') ?></h3>
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<article class="markdown">
|
||||
<?php if (! isset($is_public)): ?>
|
||||
<?= $this->text->markdown(
|
||||
$task['description'],
|
||||
@@ -36,4 +29,4 @@
|
||||
<?php endif ?>
|
||||
</article>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
@@ -32,6 +32,13 @@
|
||||
<?= $this->url->link(t('Public link'), 'task', 'readonly', array('task_id' => $task['id'], 'token' => $project['token']), false, '', '', true) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($project['is_public'] && !$editable): ?>
|
||||
<li class="smaller">
|
||||
<i class="fa fa-th fa-fw"></i>
|
||||
<?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li class="smaller">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-summary-column">
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<section id="main" class="public-task">
|
||||
|
||||
<?= $this->render('task/details', array('task' => $task, 'project' => $project, 'editable' => false)) ?>
|
||||
|
||||
<p class="pull-right"><?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?></p>
|
||||
|
||||
<?= $this->render('task/description', array(
|
||||
'task' => $task,
|
||||
'project' => $project,
|
||||
@@ -24,12 +21,11 @@
|
||||
'is_public' => true,
|
||||
)) ?>
|
||||
|
||||
<?= $this->render('task/comments', array(
|
||||
<?= $this->render('comments/show', array(
|
||||
'task' => $task,
|
||||
'comments' => $comments,
|
||||
'project' => $project,
|
||||
'editable' => false,
|
||||
'is_public' => true,
|
||||
)) ?>
|
||||
|
||||
</section>
|
||||
</section>
|
||||
|
||||
@@ -7,11 +7,9 @@
|
||||
)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-description', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= $this->render('task/description', array('task' => $task)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-subtasks', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= $this->render('subtask/show', array(
|
||||
'task' => $task,
|
||||
'subtasks' => $subtasks,
|
||||
@@ -20,23 +18,24 @@
|
||||
'editable' => true,
|
||||
)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-tasklinks', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-internal-links', array('task' => $task, 'project' => $project)) ?>
|
||||
<?= $this->render('tasklink/show', array(
|
||||
'task' => $task,
|
||||
'links' => $links,
|
||||
'links' => $internal_links,
|
||||
'project' => $project,
|
||||
'link_label_list' => $link_label_list,
|
||||
'editable' => true,
|
||||
'is_public' => false,
|
||||
)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-timetracking', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= $this->render('task/time_tracking_summary', array('task' => $task)) ?>
|
||||
<?= $this->hook->render('template:task:show:before-external-links', array('task' => $task, 'project' => $project)) ?>
|
||||
<?= $this->render('task_external_link/show', array(
|
||||
'task' => $task,
|
||||
'links' => $external_links,
|
||||
'project' => $project,
|
||||
)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-attachements', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= $this->render('task_file/show', array(
|
||||
'task' => $task,
|
||||
'files' => $files,
|
||||
@@ -44,8 +43,7 @@
|
||||
)) ?>
|
||||
|
||||
<?= $this->hook->render('template:task:show:before-comments', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= $this->render('task/comments', array(
|
||||
<?= $this->render('comments/show', array(
|
||||
'task' => $task,
|
||||
'comments' => $comments,
|
||||
'project' => $project,
|
||||
|
||||
@@ -23,18 +23,6 @@
|
||||
<?= $this->url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li <?= $this->app->checkMenuSelection('subtask', 'show') ?>>
|
||||
<i class="fa fa-tasks fa-fw"></i>
|
||||
<?= $this->url->link(t('Sub-tasks'), 'subtask', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('tasklink', 'show') ?>>
|
||||
<i class="fa fa-code-fork fa-fw"></i>
|
||||
<?= $this->url->link(t('Internal links'), 'tasklink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('TaskExternalLink', 'show') ?>>
|
||||
<i class="fa fa-external-link fa-fw"></i>
|
||||
<?= $this->url->link(t('External links'), 'TaskExternalLink', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||
</li>
|
||||
</ul>
|
||||
<h2><?= t('Actions') ?></h2>
|
||||
<ul>
|
||||
@@ -54,6 +42,14 @@
|
||||
<i class="fa fa-plus fa-fw"></i>
|
||||
<?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-code-fork fa-fw"></i>
|
||||
<?= $this->url->link(t('Add internal link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-external-link fa-fw"></i>
|
||||
<?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-comment-o fa-fw"></i>
|
||||
<?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
|
||||
@@ -1,60 +1,12 @@
|
||||
<div class="task-show-title color-<?= $task['color_id'] ?>">
|
||||
<h2><?= $this->text->e($task['title']) ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('External links') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-external-link fa-fw"></i>
|
||||
<?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if (empty($links)): ?>
|
||||
<p class="alert"><?= t('There is no external link for the moment.') ?></p>
|
||||
<?php else: ?>
|
||||
<table class="table-stripped table-small">
|
||||
<tr>
|
||||
<th class="column-10"><?= t('Type') ?></th>
|
||||
<th><?= t('Title') ?></th>
|
||||
<th class="column-10"><?= t('Dependency') ?></th>
|
||||
<th class="column-15"><?= t('Creator') ?></th>
|
||||
<th class="column-15"><?= t('Date') ?></th>
|
||||
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
|
||||
<th class="column-5"><?= t('Action') ?></th>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php foreach ($links as $link): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $link['type'] ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->e($link['dependency_label']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->e($link['creator_name'] ?: $link['creator_username']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->dt->date($link['date_creation']) ?>
|
||||
</td>
|
||||
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li><?= $this->url->link(t('Edit'), 'TaskExternalLink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
|
||||
<li><?= $this->url->link(t('Remove'), 'TaskExternalLink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
<section class="accordion-section <?= empty($links) ? 'accordion-collapsed' : '' ?>">
|
||||
<div class="accordion-title">
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('External links') ?></h3>
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<?= $this->render('task_external_link/table', array(
|
||||
'links' => $links,
|
||||
'task' => $task,
|
||||
'project' => $project,
|
||||
)) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
42
app/Template/task_external_link/table.php
Normal file
42
app/Template/task_external_link/table.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<table class="table-stripped table-small">
|
||||
<tr>
|
||||
<th class="column-10"><?= t('Type') ?></th>
|
||||
<th><?= t('Title') ?></th>
|
||||
<th class="column-10"><?= t('Dependency') ?></th>
|
||||
<th class="column-15"><?= t('Creator') ?></th>
|
||||
<th class="column-15"><?= t('Date') ?></th>
|
||||
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
|
||||
<th class="column-5"><?= t('Action') ?></th>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php foreach ($links as $link): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $link['type'] ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?= $link['url'] ?>" target="_blank"><?= $this->text->e($link['title']) ?></a>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->e($link['dependency_label']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->e($link['creator_name'] ?: $link['creator_username']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->dt->date($link['date_creation']) ?>
|
||||
</td>
|
||||
<?php if ($this->user->hasProjectAccess('TaskExternalLink', 'edit', $task['project_id'])): ?>
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-cog fa-fw"></i><i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li><?= $this->url->link(t('Edit'), 'TaskExternalLink', 'edit', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
|
||||
<li><?= $this->url->link(t('Remove'), 'TaskExternalLink', 'confirm', array('link_id' => $link['id'], 'task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
47
app/Template/task_file/files.php
Normal file
47
app/Template/task_file/files.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php if (! empty($files)): ?>
|
||||
<table class="table-stripped table-small">
|
||||
<tr>
|
||||
<th><?= t('Filename') ?></th>
|
||||
<th><?= t('Creator') ?></th>
|
||||
<th><?= t('Date') ?></th>
|
||||
<th><?= t('Size') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($files as $file): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<?php if ($this->file->getPreviewType($file['name']) !== null): ?>
|
||||
<li>
|
||||
<i class="fa fa-eye fa-fw"></i>
|
||||
<?= $this->url->link(t('View file'), 'FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<i class="fa fa-download fa-fw"></i>
|
||||
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->e($file['user_name'] ?: $file['username']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->dt->date($file['date']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->bytes($file['size']) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
34
app/Template/task_file/images.php
Normal file
34
app/Template/task_file/images.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php if (! empty($images)): ?>
|
||||
<div class="file-thumbnails">
|
||||
<?php foreach ($images as $file): ?>
|
||||
<div class="file-thumbnail">
|
||||
<a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a>
|
||||
<div class="file-thumbnail-content">
|
||||
<div class="file-thumbnail-title">
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-download fa-fw"></i>
|
||||
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-thumbnail-description">
|
||||
<span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'>
|
||||
<i class="fa fa-info-circle"></i>
|
||||
</span>
|
||||
<?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
@@ -1,90 +1,9 @@
|
||||
<?php if (! empty($files) || ! empty($images)): ?>
|
||||
<div id="attachments" class="task-show-section">
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Attachments') ?></h2>
|
||||
<section class="accordion-section <?= empty($files) && empty($images) ? 'accordion-collapsed' : '' ?>">
|
||||
<div class="accordion-title">
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Attachments') ?></h3>
|
||||
</div>
|
||||
<?php if (! empty($images)): ?>
|
||||
<div class="file-thumbnails">
|
||||
<?php foreach ($images as $file): ?>
|
||||
<div class="file-thumbnail">
|
||||
<a href="<?= $this->url->href('FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>" class="popover"><img src="<?= $this->url->href('FileViewer', 'thumbnail', array('file_id' => $file['id'], 'project_id' => $task['project_id'], 'task_id' => $file['task_id'])) ?>" title="<?= $this->text->e($file['name']) ?>" alt="<?= $this->text->e($file['name']) ?>"></a>
|
||||
<div class="file-thumbnail-content">
|
||||
<div class="file-thumbnail-title">
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-download fa-fw"></i>
|
||||
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-thumbnail-description">
|
||||
<span class="tooltip" title='<?= t('Uploaded: %s', $this->dt->datetime($file['date'])).'<br>'.t('Size: %s', $this->text->bytes($file['size'])) ?>'>
|
||||
<i class="fa fa-info-circle"></i>
|
||||
</span>
|
||||
<?= t('Uploaded by %s', $file['user_name'] ?: $file['username']) ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($files)): ?>
|
||||
<table class="table-stripped">
|
||||
<tr>
|
||||
<th><?= t('Filename') ?></th>
|
||||
<th><?= t('Creator') ?></th>
|
||||
<th><?= t('Date') ?></th>
|
||||
<th><?= t('Size') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($files as $file): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<i class="fa <?= $this->file->icon($file['name']) ?> fa-fw"></i>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-menu dropdown-menu-link-text"><?= $this->text->e($file['name']) ?> <i class="fa fa-caret-down"></i></a>
|
||||
<ul>
|
||||
<?php if ($this->file->getPreviewType($file['name']) !== null): ?>
|
||||
<li>
|
||||
<i class="fa fa-eye fa-fw"></i>
|
||||
<?= $this->url->link(t('View file'), 'FileViewer', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<i class="fa fa-download fa-fw"></i>
|
||||
<?= $this->url->link(t('Download'), 'FileViewer', 'download', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('TaskFile', 'remove', $task['project_id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
<?= $this->url->link(t('Remove'), 'TaskFile', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'file_id' => $file['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->e($file['user_name'] ?: $file['username']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->dt->date($file['date']) ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->text->bytes($file['size']) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<div class="accordion-content">
|
||||
<?= $this->render('task_file/images', array('task' => $task, 'images' => $images)) ?>
|
||||
<?= $this->render('task_file/files', array('task' => $task, 'files' => $files)) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,43 +1,14 @@
|
||||
<?php if (isset($show_title)): ?>
|
||||
<div class="task-show-title color-<?= $task['color_id'] ?>">
|
||||
<h2><?= $this->text->e($task['title']) ?></h2>
|
||||
<section class="accordion-section <?= empty($links) ? 'accordion-collapsed' : '' ?>">
|
||||
<div class="accordion-title">
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Internal links') ?></h3>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Internal links') ?></h2>
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-code-fork fa-fw"></i>
|
||||
<?= $this->url->link(t('Add internal link'), 'tasklink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="link">
|
||||
|
||||
<?= $this->render('tasklink/table', array('links' => $links, 'task' => $task, 'project' => $project, 'editable' => $editable, 'is_public' => $is_public)) ?>
|
||||
|
||||
<?php if ($editable && isset($link_label_list)): ?>
|
||||
<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(
|
||||
'title',
|
||||
array(),
|
||||
array(),
|
||||
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('TaskHelper', 'autocomplete', array('exclude_task_id' => $task['id'])).'"',
|
||||
),
|
||||
'autocomplete') ?>
|
||||
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<?= $this->render('tasklink/table', array(
|
||||
'links' => $links,
|
||||
'task' => $task,
|
||||
'project' => $project,
|
||||
'editable' => $editable,
|
||||
'is_public' => $is_public,
|
||||
)) ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php if (empty($links)): ?>
|
||||
<p class="alert"><?= t('There is no internal link for the moment.') ?></p>
|
||||
<?php else: ?>
|
||||
<?php if (! empty($links)): ?>
|
||||
<table class="task-links-table table-stripped">
|
||||
<?php foreach ($links as $label => $grouped_links): ?>
|
||||
<?php $hide_td = false ?>
|
||||
|
||||
Reference in New Issue
Block a user