MDL-66592 report_insights: Help icon for indicator calculations desc

This commit is contained in:
David Monllaó 2019-10-18 14:52:08 +08:00
parent 7229c5e6b5
commit 279f370b3f
2 changed files with 6 additions and 1 deletions

View File

@ -151,6 +151,11 @@ class insight implements \renderable, \templatable {
list($obj->style, $obj->outcomeicon) = self::get_calculation_display($calculation->indicator,
floatval($calculation->value), $output, $calculation->subtype);
$identifier = $calculation->indicator->get_name()->get_identifier() . 'def';
$component = $calculation->indicator->get_name()->get_component();
if (get_string_manager()->string_exists($identifier, $component)) {
$obj->outcomehelp = (new \help_icon($identifier, $component))->export_for_template($output);
}
$data->calculations[] = $obj;
}

View File

@ -137,7 +137,7 @@
{{#calculations}}
<tr>
<th scope="row" class="{{#style}}table-{{style}}{{/style}}">{{name}}</td>
<td class="{{#style}}table-{{style}}{{/style}}">{{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}}</td>
<td class="{{#style}}table-{{style}}{{/style}}">{{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}} {{#outcomehelp}}{{> core/help_icon}}{{/outcomehelp}}</td>
</tr>
{{/calculations}}
</tbody>