Commit 6b7dea45 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Bug 1433769: allowing the task tags to display



- Like plan tags already do

Change-Id: If284d0288ce4043294653c194a84eea228b5dd6b
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 5da644b0
......@@ -587,7 +587,7 @@ class ArtefactTypeTask extends ArtefactType {
($results = get_records_sql_array("
SELECT a.id, at.artefact AS task, at.completed, ".db_format_tsfield('completiondate').",
a.title, a.description, a.parent
a.title, a.description, a.parent, a.owner
FROM {artefact} a
JOIN {artefact_plans_task} at ON at.artefact = a.id
WHERE a.artefacttype = 'task' AND a.parent = ?
......@@ -605,6 +605,7 @@ class ArtefactTypeTask extends ArtefactType {
$result->completiondate = format_date($result->completiondate, 'strftimedate');
}
$result->description = '<p>' . preg_replace('/\n\n/','</p><p>', $result->description) . '</p>';
$result->tags = ArtefactType::artefact_get_tags($result->id);
}
}
......@@ -649,8 +650,18 @@ class ArtefactTypeTask extends ArtefactType {
$tasks['pagination_js'] = $pagination['javascript'];
}
// @TODO: make blocktype use this too
/**
* Function to append the rendered html to the $tasks data object
*
* @param array $tasks The tasks array containing task objects + pagination count data
* @param string $template The name of the template to use for rendering
* @param array $options The block instance options
* @param array $pagination The pagination data
*
* @return array $tasks The tasks array updated with rendered table html
*/
public function render_tasks(&$tasks, $template, $options, $pagination) {
$smarty = smarty_core();
$smarty->assign_by_ref('tasks', $tasks);
$smarty->assign_by_ref('options', $options);
......
......@@ -14,6 +14,7 @@
<th>{str tag='completiondate' section='artefact.plans'}</th>
<th>{str tag='title' section='artefact.plans'}</th>
<th>{str tag='description' section='artefact.plans'}</th>
<th>{str tag='tags'}</th>
<th class="center">{str tag='completed' section='artefact.plans'}</th>
<th></th>
</tr>
......
......@@ -4,7 +4,9 @@
<td class="c1 completiondate">{$task->completiondate}</td>
{if $task->description}
<td class="plantasktitledescript"><a class="task-title" href="">{$task->title}</a>
<div class="task-desc hidden">{$task->description|clean_html|safe}</div></td>
<div class="task-desc hidden">{$task->description|clean_html|safe}
{if $task->tags}<p class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$task->owner tags=$task->tags}</p>{/if}
</div></td>
{else}
<td class="plantasktitle">{$task->title}</td>
{/if}
......@@ -15,7 +17,9 @@
<td class="c1 completiondate">{$task->completiondate}</td>
{if $task->description}
<td class="plantasktitledescript"><a class="task-title" href="">{$task->title}</a>
<div class="task-desc hidden" id="task-desc-{$task->id}">{$task->description|clean_html|safe}</div></td>
<div class="task-desc hidden" id="task-desc-{$task->id}">{$task->description|clean_html|safe}
{if $task->tags}<p class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$task->owner tags=$task->tags}</p>{/if}
</div></td>
{else}
<td class="plantasktitle">{$task->title}</td>
{/if}
......
......@@ -4,12 +4,14 @@
<td class="completiondate">{$task->completiondate}</td>
<td class="plantasktitle">{$task->title}</td>
<td class="plantaskdescription">{$task->description|clean_html|safe}</td>
<td class="plantasktags">{if $task->tags}{list_tags owner=$task->owner tags=$task->tags}{/if}</td>
<td class="incomplete"><img src="{$WWWROOT}theme/raw/static/images/failure_small.png" alt="{str tag=overdue section=artefact.plans}" /></td>
{else}
<tr class="{cycle values='r0,r1'}">
<td class="completiondate">{$task->completiondate}</td>
<td class="plantasktitle">{$task->title}</td>
<td class="plantaskdescription">{$task->description|clean_html|safe}</td>
<td class="plantasktags">{if $task->tags}{list_tags owner=$task->owner tags=$task->tags}{/if}</td>
{if $task->completed == 1}
<td class="completed"><img src="{$WWWROOT}theme/raw/static/images/success_small.png" alt="{str tag=completed section=artefact.plans}" /></td>
{else}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment