Commit 8e2650ac authored by Robert Lyon's avatar Robert Lyon

Bug 1850227: Adding 'task' icon to returned ajax

If the task has a taskview associated

behatnotneeded

Change-Id: If9bdb8b6b040c32dcb20fa5d8b6059016bf4928e
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 129f6d5f
......@@ -54,12 +54,17 @@ try {
if (!$userPlan) {
$userPlan = PlansTools::createUserPlanFromGroupPlan($rootGroupPlan);
}
$taskview = $rootGroupTask->get('taskview');
if ($userTask) {
$portfolioElement = PlansTools::getPortfolioElementByTypeAndId($rootGroupTask->get('outcometype'), $rootGroupTask->get('outcome'));
$outcomeurl = PlansTools::createOutcomeUrlForPortfolioElement($portfolioElement);
$buttons = '';
if ($taskview) {
$buttons .= '<a href="' . get_config('wwwroot') . 'view/view.php?id=' . $taskview . '" class="btn btn-secondary btn-sm btn-view" title="' . get_string('showassignedview', 'artefact.plans') . '">
<span class="icon icon-info icon-lg" role="presentation" aria-hidden="true"></span>
</a>';
}
if ($outcomeurl) {
$buttons = '';
$buttons .= '<a href="' . $outcomeurl . '" class="btn btn-secondary btn-sm btn-outcome" title="' . get_string('editassignedoutcome', 'artefact.plans') . '">
<span class="icon icon-file icon-lg" role="presentation" aria-hidden="true"></span>
</a>';
......@@ -78,6 +83,11 @@ try {
$portfolioElement = PlansTools::getPortfolioElementByTypeAndId($newUserTask->get('outcometype'), $outcomeId);
$outcomeurl = PlansTools::createOutcomeUrlForPortfolioElement($portfolioElement);
$buttons = '';
if ($taskview) {
$buttons .= '<a href="' . get_config('wwwroot') . 'view/view.php?id=' . $taskview . '" class="btn btn-secondary btn-sm btn-view" title="' . get_string('showassignedview', 'artefact.plans') . '">
<span class="icon icon-info icon-lg" role="presentation" aria-hidden="true"></span>
</a>';
}
if ($outcomeurl) {
$buttons .= '<a href="' . $outcomeurl . '" class="btn btn-secondary btn-sm btn-outcome" title="' . get_string('editassignedoutcome', 'artefact.plans') . '">
<span class="icon icon-file icon-lg" role="presentation" aria-hidden="true"></span>
......
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