Add public view for tasks
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<?php foreach ($column['tasks'] as $task): ?>
|
||||
<div class="task-board task-<?= $task['color_id'] ?>">
|
||||
|
||||
<?= Helper\template('board_task', array('task' => $task, 'categories' => $categories, 'not_editable' => true)) ?>
|
||||
<?= Helper\template('board_task', array('task' => $task, 'categories' => $categories, 'not_editable' => true, 'project' => $project)) ?>
|
||||
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php if (isset($not_editable)): ?>
|
||||
|
||||
#<?= $task['id'] ?> -
|
||||
<a href="?controller=task&action=readonly&task_id=<?= $task['id'] ?>&token=<?= $project['token'] ?>">#<?= $task['id'] ?></a> -
|
||||
|
||||
<span class="task-board-user">
|
||||
<?php if (! empty($task['owner_id'])): ?>
|
||||
@@ -15,7 +15,9 @@
|
||||
<?php endif ?>
|
||||
|
||||
<div class="task-board-title">
|
||||
<?= Helper\escape($task['title']) ?>
|
||||
<a href="?controller=task&action=readonly&task_id=<?= $task['id'] ?>&token=<?= $project['token'] ?>">
|
||||
<?= Helper\escape($task['title']) ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
@@ -73,7 +75,11 @@
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<a class="task-description-popover" href="?controller=task&action=description&task_id=<?= $task['id'] ?>"><i class="fa fa-file-text-o" title="<?= t('Description') ?>" data-href="?controller=task&action=description&task_id=<?= $task['id'] ?>"></i></a>
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<a class="task-description-popover" href="?controller=task&action=description&task_id=<?= $task['id'] ?>"><i class="fa fa-file-text-o" title="<?= t('Description') ?>" data-href="?controller=task&action=description&task_id=<?= $task['id'] ?>"></i></a>
|
||||
<?php else: ?>
|
||||
<i class="fa fa-file-text-o" title="<?= t('Description') ?>"></i>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<?php if (! isset($preview)): ?>
|
||||
<ul class="comment-actions">
|
||||
<li><a href="#comment-<?= $comment['id'] ?>"><?= t('link') ?></a></li>
|
||||
<?php if (Helper\is_admin() || Helper\is_current_user($comment['user_id'])): ?>
|
||||
<?php if ((! isset($not_editable) || ! $not_editable) && (Helper\is_admin() || Helper\is_current_user($comment['user_id']))): ?>
|
||||
<li>
|
||||
<a href="?controller=comment&action=confirm&task_id=<?= $task['id'] ?>&comment_id=<?= $comment['id'] ?>"><?= t('remove') ?></a>
|
||||
</li>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<?php endif ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php if (isset($no_layout)): ?>
|
||||
<?php if (isset($no_layout) && $no_layout): ?>
|
||||
<?= $content_for_layout ?>
|
||||
<?php else: ?>
|
||||
<header>
|
||||
|
||||
@@ -1,60 +1,70 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Sub-Tasks') ?></h2>
|
||||
<?php if (! empty($subtasks)): ?>
|
||||
<div id="subtasks" class="task-show-section">
|
||||
|
||||
<div class="page-header">
|
||||
<h2><?= t('Sub-Tasks') ?></h2>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$total_spent = 0;
|
||||
$total_estimated = 0;
|
||||
$total_remaining = 0;
|
||||
|
||||
?>
|
||||
|
||||
<table class="subtasks-table">
|
||||
<tr>
|
||||
<th width="40%"><?= t('Title') ?></th>
|
||||
<th><?= t('Status') ?></th>
|
||||
<th><?= t('Assignee') ?></th>
|
||||
<th><?= t('Time tracking') ?></th>
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<th><?= t('Actions') ?></th>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php foreach ($subtasks as $subtask): ?>
|
||||
<tr>
|
||||
<td><?= Helper\escape($subtask['title']) ?></td>
|
||||
<td><?= Helper\escape($subtask['status_name']) ?></td>
|
||||
<td>
|
||||
<?php if (! empty($subtask['username'])): ?>
|
||||
<?= Helper\escape($subtask['name'] ?: $subtask['username']) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (! empty($subtask['time_spent'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($subtask['time_estimated'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<?php if (! isset($not_editable)): ?>
|
||||
<td>
|
||||
<a href="?controller=subtask&action=edit&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>"><?= t('Edit') ?></a>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=subtask&action=confirm&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>"><?= t('Remove') ?></a>
|
||||
</td>
|
||||
<?php endif ?>
|
||||
</tr>
|
||||
<?php
|
||||
$total_estimated += $subtask['time_estimated'];
|
||||
$total_spent += $subtask['time_spent'];
|
||||
$total_remaining = $total_estimated - $total_spent;
|
||||
?>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
||||
<div class="subtasks-time-tracking">
|
||||
<h4><?= t('Time tracking') ?></h4>
|
||||
<ul>
|
||||
<li><?= t('Estimate:') ?> <strong><?= Helper\escape($total_estimated) ?></strong> <?= t('hours') ?></li>
|
||||
<li><?= t('Spent:') ?> <strong><?= Helper\escape($total_spent) ?></strong> <?= t('hours') ?></li>
|
||||
<li><?= t('Remaining:') ?> <strong><?= Helper\escape($total_remaining > 0 ? $total_remaining : 0) ?></strong> <?= t('hours') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$total_spent = 0;
|
||||
$total_estimated = 0;
|
||||
$total_remaining = 0;
|
||||
|
||||
?>
|
||||
|
||||
<table class="subtasks-table">
|
||||
<tr>
|
||||
<th width="40%"><?= t('Title') ?></th>
|
||||
<th><?= t('Status') ?></th>
|
||||
<th><?= t('Assignee') ?></th>
|
||||
<th><?= t('Time tracking') ?></th>
|
||||
<th><?= t('Actions') ?></th>
|
||||
</tr>
|
||||
<?php foreach ($subtasks as $subtask): ?>
|
||||
<tr>
|
||||
<td><?= Helper\escape($subtask['title']) ?></td>
|
||||
<td><?= Helper\escape($subtask['status_name']) ?></td>
|
||||
<td>
|
||||
<?php if (! empty($subtask['username'])): ?>
|
||||
<?= Helper\escape($subtask['name'] ?: $subtask['username']) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (! empty($subtask['time_spent'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (! empty($subtask['time_estimated'])): ?>
|
||||
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="?controller=subtask&action=edit&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>"><?= t('Edit') ?></a>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=subtask&action=confirm&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>"><?= t('Remove') ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$total_estimated += $subtask['time_estimated'];
|
||||
$total_spent += $subtask['time_spent'];
|
||||
$total_remaining = $total_estimated - $total_spent;
|
||||
?>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
||||
<div class="subtasks-time-tracking">
|
||||
<h4><?= t('Time tracking') ?></h4>
|
||||
<ul>
|
||||
<li><?= t('Estimate:') ?> <strong><?= Helper\escape($total_estimated) ?></strong> <?= t('hours') ?></li>
|
||||
<li><?= t('Spent:') ?> <strong><?= Helper\escape($total_spent) ?></strong> <?= t('hours') ?></li>
|
||||
<li><?= t('Remaining:') ?> <strong><?= Helper\escape($total_remaining > 0 ? $total_remaining : 0) ?></strong> <?= t('hours') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
15
app/Templates/task_comments.php
Normal file
15
app/Templates/task_comments.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php if (! empty($comments)): ?>
|
||||
<div id="comments" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Comments') ?></h2>
|
||||
</div>
|
||||
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<?= Helper\template('comment_show', array(
|
||||
'comment' => $comment,
|
||||
'task' => $task,
|
||||
'not_editable' => isset($not_editable) && $not_editable,
|
||||
)) ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
63
app/Templates/task_details.php
Normal file
63
app/Templates/task_details.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<div class="task-<?= $task['color_id'] ?> task-show-details">
|
||||
<h2><?= Helper\escape($task['title']) ?></h2>
|
||||
<?php if ($task['score']): ?>
|
||||
<span class="task-score"><?= Helper\escape($task['score']) ?></span>
|
||||
<?php endif ?>
|
||||
<ul>
|
||||
<li>
|
||||
<?= dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?>
|
||||
</li>
|
||||
<?php if ($task['date_modification']): ?>
|
||||
<li>
|
||||
<?= dt('Last modified on %B %e, %Y at %k:%M %p', $task['date_modification']) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($task['date_completed']): ?>
|
||||
<li>
|
||||
<?= dt('Completed on %B %e, %Y at %k:%M %p', $task['date_completed']) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($task['date_due']): ?>
|
||||
<li>
|
||||
<strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($task['creator_username']): ?>
|
||||
<li>
|
||||
<?= t('Created by %s', $task['creator_name'] ?: $task['creator_username']) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<strong>
|
||||
<?php if ($task['assignee_username']): ?>
|
||||
<?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?>
|
||||
<?php else: ?>
|
||||
<?= t('There is nobody assigned') ?>
|
||||
<?php endif ?>
|
||||
</strong>
|
||||
</li>
|
||||
<li>
|
||||
<?= t('Column on the board:') ?>
|
||||
<strong><?= Helper\escape($task['column_title']) ?></strong>
|
||||
(<?= Helper\escape($task['project_name']) ?>)
|
||||
</li>
|
||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||
<?php if ($task['category_name']): ?>
|
||||
<li>
|
||||
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<?php if ($task['is_active'] == 1): ?>
|
||||
<?= t('Status is open') ?>
|
||||
<?php else: ?>
|
||||
<?= t('Status is closed') ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php if ($project['is_public']): ?>
|
||||
<li>
|
||||
<a href="?controller=task&action=readonly&task_id=<?= $task['id'] ?>&token=<?= $project['token'] ?>" target="_blank"><?= t('Public link') ?></a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
11
app/Templates/task_public.php
Normal file
11
app/Templates/task_public.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<section id="main" class="public-task">
|
||||
|
||||
<?= Helper\template('task_details', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?= Helper\template('task_show_description', array('task' => $task)) ?>
|
||||
|
||||
<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks, 'not_editable' => true)) ?>
|
||||
|
||||
<?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments, 'not_editable' => true)) ?>
|
||||
|
||||
</section>
|
||||
@@ -1,75 +1,9 @@
|
||||
<div class="task-<?= $task['color_id'] ?> task-show-details">
|
||||
<h2><?= Helper\escape($task['title']) ?></h2>
|
||||
<?php if ($task['score']): ?>
|
||||
<span class="task-score"><?= Helper\escape($task['score']) ?></span>
|
||||
<?php endif ?>
|
||||
<ul>
|
||||
<li>
|
||||
<?= dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?>
|
||||
</li>
|
||||
<?php if ($task['date_modification']): ?>
|
||||
<li>
|
||||
<?= dt('Last modified on %B %e, %Y at %k:%M %p', $task['date_modification']) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($task['date_completed']): ?>
|
||||
<li>
|
||||
<?= dt('Completed on %B %e, %Y at %k:%M %p', $task['date_completed']) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($task['date_due']): ?>
|
||||
<li>
|
||||
<strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php if ($task['creator_username']): ?>
|
||||
<li>
|
||||
<?= t('Created by %s', $task['creator_name'] ?: $task['creator_username']) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<strong>
|
||||
<?php if ($task['assignee_username']): ?>
|
||||
<?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?>
|
||||
<?php else: ?>
|
||||
<?= t('There is nobody assigned') ?>
|
||||
<?php endif ?>
|
||||
</strong>
|
||||
</li>
|
||||
<li>
|
||||
<?= t('Column on the board:') ?>
|
||||
<strong><?= Helper\escape($task['column_title']) ?></strong>
|
||||
(<?= Helper\escape($task['project_name']) ?>)
|
||||
</li>
|
||||
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
|
||||
<?php if ($task['category_name']): ?>
|
||||
<li>
|
||||
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<?php if ($task['is_active'] == 1): ?>
|
||||
<?= t('Status is open') ?>
|
||||
<?php else: ?>
|
||||
<?= t('Status is closed') ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?= Helper\template('task_details', array('task' => $task, 'project' => $project)) ?>
|
||||
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<div id="description" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Description') ?></h2>
|
||||
</div>
|
||||
|
||||
<article class="markdown task-show-description">
|
||||
<?= Helper\parse($task['description']) ?: t('There is no description.') ?>
|
||||
</article>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?= Helper\template('task_show_description', array('task' => $task)) ?>
|
||||
|
||||
<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?>
|
||||
|
||||
<?php if (! empty($files)): ?>
|
||||
<div id="attachments" class="task-show-section">
|
||||
@@ -77,25 +11,4 @@
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<?php if (! empty($subtasks)): ?>
|
||||
<div id="subtasks" class="task-show-section">
|
||||
<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
<?php if (! empty($comments)): ?>
|
||||
<div id="comments" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Comments') ?></h2>
|
||||
</div>
|
||||
|
||||
<?php foreach ($comments as $comment): ?>
|
||||
<?= Helper\template('comment_show', array(
|
||||
'comment' => $comment,
|
||||
'task' => $task,
|
||||
)) ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?= Helper\template('task_comments', array('task' => $task, 'comments' => $comments)) ?>
|
||||
|
||||
11
app/Templates/task_show_description.php
Normal file
11
app/Templates/task_show_description.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php if (! empty($task['description'])): ?>
|
||||
<div id="description" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Description') ?></h2>
|
||||
</div>
|
||||
|
||||
<article class="markdown task-show-description">
|
||||
<?= Helper\parse($task['description']) ?: t('There is no description.') ?>
|
||||
</article>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
Reference in New Issue
Block a user