MDL-60760 tool_analytics: No onlycli link for managers
authorDavid Monllao <davidm@moodle.com>
Thu, 9 Nov 2017 16:00:33 +0000 (17:00 +0100)
committerDavid Monllao <davidm@moodle.com>
Thu, 9 Nov 2017 16:05:08 +0000 (17:05 +0100)
admin/tool/analytics/classes/output/models_list.php
admin/tool/analytics/lang/en/tool_analytics.php

index f33980c..0e8d4e8 100644 (file)
@@ -264,8 +264,13 @@ class models_list implements \renderable, \templatable {
         } else {
             $url = new \moodle_url('/admin/settings.php', array('section' => 'analyticssettings'),
                 'id_s_analytics_onlycli');
+
+            $langstrid = 'clievaluationandpredictionsnoadmin';
+            if (is_siteadmin()) {
+                $langstrid = 'clievaluationandpredictions';
+            }
             $data->infos = array(
-                (object)array('message' => get_string('clievaluationandpredictions', 'tool_analytics', $url->out()),
+                (object)array('message' => get_string($langstrid, 'tool_analytics', $url->out()),
                     'closebutton' => true)
             );
         }
index 6891ec2..258578c 100644 (file)
@@ -33,6 +33,7 @@ $string['clearpredictions'] = 'Clear predictions';
 $string['clearmodelpredictions'] = 'Are you sure you want to clear all "{$a}" predictions?';
 $string['clienablemodel'] = 'You can enable the model by selecting a time-splitting method by its ID. Note that you can also enable it later using the web interface (\'none\' to exit).';
 $string['clievaluationandpredictions'] = 'A scheduled task iterates through enabled models and gets predictions. Models evaluation via the web interface is disabled. You can allow these processes to be executed manually via the web interface by disabling the <a href="{$a}">\'onlycli\'</a> analytics setting.';
+$string['clievaluationandpredictionsnoadmin'] = 'A scheduled task iterates through enabled models and gets predictions. Models evaluation via the web interface is disabled. Contact your site administrator if you are really interested in executing these processes via web interface.';
 $string['editmodel'] = 'Edit "{$a}" model';
 $string['edittrainedwarning'] = 'This model has already been trained. Note that changing its indicators or its time-splitting method will delete its previous predictions and start generating new predictions.';
 $string['enabled'] = 'Enabled';