From 279f370b3f8ccceaba9b5f8966cf998623501d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Monlla=C3=B3?= Date: Fri, 18 Oct 2019 14:52:08 +0800 Subject: [PATCH] MDL-66592 report_insights: Help icon for indicator calculations desc --- report/insights/classes/output/insight.php | 5 +++++ report/insights/templates/insight_details.mustache | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/report/insights/classes/output/insight.php b/report/insights/classes/output/insight.php index 79431affd8d..b28b0f29849 100644 --- a/report/insights/classes/output/insight.php +++ b/report/insights/classes/output/insight.php @@ -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; } diff --git a/report/insights/templates/insight_details.mustache b/report/insights/templates/insight_details.mustache index 304e49433be..9917bf7af06 100644 --- a/report/insights/templates/insight_details.mustache +++ b/report/insights/templates/insight_details.mustache @@ -137,7 +137,7 @@ {{#calculations}} {{name}} - {{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}} + {{#outcomeicon}}{{> core/pix_icon}}{{/outcomeicon}} {{displayvalue}} {{#outcomehelp}}{{> core/help_icon}}{{/outcomehelp}} {{/calculations}}