Commit ece65af4 authored by Lisa Seeto's avatar Lisa Seeto

Bug 1827811: Plans block

behatnotneeded

The plan block's 'details' link will only display if license metadata is available.
The link will open the modal with licensing information.
Update how the licensemetadata is set in smarty variable.
remove old details link and use new block header instead.
remove the use of modal functionality, block headers & smarty vars

Change-Id: I5f06d9ba84ff018a50ba774763be3fcede9b2576
Signed-off-by: default avatarLisa Seeto <lisaseeto@catalyst.net.nz>
parent f7431a3a
...@@ -125,8 +125,6 @@ class PluginBlocktypePlans extends MaharaCoreBlocktype { ...@@ -125,8 +125,6 @@ class PluginBlocktypePlans extends MaharaCoreBlocktype {
} }
$plans[$planid]['id'] = $planid; $plans[$planid]['id'] = $planid;
$plans[$planid]['view'] = $instance->get('view'); $plans[$planid]['view'] = $instance->get('view');
$plans[$planid]['details'] = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $planid . '&view=' .
$instance->get_view()->get('id') . '&block=' . $blockid;
$plans[$planid]['numtasks'] = $tasks['count']; $plans[$planid]['numtasks'] = $tasks['count'];
$tasks['planid'] = $planid; $tasks['planid'] = $planid;
...@@ -146,6 +144,7 @@ class PluginBlocktypePlans extends MaharaCoreBlocktype { ...@@ -146,6 +144,7 @@ class PluginBlocktypePlans extends MaharaCoreBlocktype {
$smarty->assign('editing', $editing); $smarty->assign('editing', $editing);
$smarty->assign('blockid', $instance->get('id')); $smarty->assign('blockid', $instance->get('id'));
$smarty->assign('versioning', $versioning); $smarty->assign('versioning', $versioning);
return $smarty->fetch('blocktype:plans:content.tpl'); return $smarty->fetch('blocktype:plans:content.tpl');
} }
......
...@@ -289,12 +289,7 @@ class ArtefactTypePlan extends ArtefactType { ...@@ -289,12 +289,7 @@ class ArtefactTypePlan extends ArtefactType {
$template = 'artefact:plans:taskrows.tpl'; $template = 'artefact:plans:taskrows.tpl';
$baseurl = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $this->id; $baseurl = ''; //will set in the jsonscript
if (!empty($options['viewid'])) {
$baseurl .= '&view=' . $options['viewid'];
}
$baseurl .= '&planid=' . $this->id;
$pagination = array( $pagination = array(
'baseurl' => $baseurl, 'baseurl' => $baseurl,
'id' => 'task_pagination', 'id' => 'task_pagination',
......
...@@ -47,25 +47,7 @@ if ($blockid && !$artefactid) { ...@@ -47,25 +47,7 @@ if ($blockid && !$artefactid) {
'jsonscript' => 'artefact/plans/viewtasks.json.php', 'jsonscript' => 'artefact/plans/viewtasks.json.php',
); );
} }
else {
$planid = param_integer('artefact');
$viewid = param_integer('view');
if (!can_view_view($viewid)) {
json_reply(true, get_string('accessdenied', 'error'));
}
$options = array('viewid' => $viewid);
$tasks = ArtefactTypeTask::get_tasks($planid, $offset, $limit);
$template = 'artefact:plans:taskrows.tpl';
$baseurl = get_config('wwwroot') . 'artefact/artefact.php?artefact=' . $planid . '&view=' . $options['viewid'];
$pagination = array(
'baseurl' => $baseurl,
'id' => 'task_pagination',
'datatable' => 'tasklist',
'jsonscript' => 'artefact/plans/viewtasks.json.php',
);
}
ArtefactTypeTask::render_tasks($tasks, $template, $options, $pagination, $editing); ArtefactTypeTask::render_tasks($tasks, $template, $options, $pagination, $editing);
json_reply(false, (object) array('message' => false, 'data' => $tasks)); json_reply(false, (object) array('message' => false, 'data' => $tasks));
...@@ -1374,8 +1374,6 @@ class BlockInstance { ...@@ -1374,8 +1374,6 @@ class BlockInstance {
if (method_exists($classname, 'feed_url')) { if (method_exists($classname, 'feed_url')) {
$smarty->assign('feedlink', call_static_method($classname, 'feed_url', $this)); $smarty->assign('feedlink', call_static_method($classname, 'feed_url', $this));
} }
$smarty->assign('link', call_static_method($classname, 'get_link', $this));
} }
$smarty->assign('content', $content); $smarty->assign('content', $content);
......
...@@ -50,9 +50,6 @@ ...@@ -50,9 +50,6 @@
{/if} {/if}
{/if} {/if}
{/foreach} {/foreach}
{if !$editing && !$versioning}
<a href="{$plan.details}" class="detail-link link-blocktype"><span class="icon icon-link" role="presentation" aria-hidden="true"></span> {str tag=detailslinkalt section=view}</a>
{/if}
{else} {else}
<div class="lead text-center content-text">{str tag='notasks' section='artefact.plans'}</div> <div class="lead text-center content-text">{str tag='notasks' section='artefact.plans'}</div>
{/if} {/if}
......
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