From a6edbef55695edb242e84fd6c97a07542166af66 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Wed, 13 Sep 2017 09:49:14 +0200 Subject: [PATCH] MDL-58835 report_insights: Fix redirections --- admin/tool/analytics/classes/output/renderer.php | 4 ++-- report/insights/amd/build/actions.min.js | 2 +- report/insights/amd/src/actions.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/tool/analytics/classes/output/renderer.php b/admin/tool/analytics/classes/output/renderer.php index 2bbfbc961cb..32bdcfc4482 100644 --- a/admin/tool/analytics/classes/output/renderer.php +++ b/admin/tool/analytics/classes/output/renderer.php @@ -130,7 +130,7 @@ class renderer extends plugin_renderer_base { } if (!CLI_SCRIPT) { - $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue')); + $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue'), 'get'); } return $output; @@ -200,7 +200,7 @@ class renderer extends plugin_renderer_base { } if (!CLI_SCRIPT) { - $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue')); + $output .= $OUTPUT->single_button(new \moodle_url('/admin/tool/analytics/index.php'), get_string('continue'), 'get'); } return $output; diff --git a/report/insights/amd/build/actions.min.js b/report/insights/amd/build/actions.min.js index 59d50353d90..431a58b2287 100644 --- a/report/insights/amd/build/actions.min.js +++ b/report/insights/amd/build/actions.min.js @@ -1 +1 @@ -define(["jquery","core/ajax","core/notification"],function(a,b,c){return{init:function(d){a("a[data-prediction-methodname][data-prediction-id="+d+"]").on("click",function(e){e.preventDefault();var f=a(e.currentTarget),g=f.attr("data-prediction-methodname"),h=f.closest("tr");if(h.length>0){var i=b.call([{methodname:g,args:{predictionid:d}}])[0];i.done(function(){h[0].remove(),0===a(".insights-list tr").length&&window.history.back()}).fail(c.exception)}})}}}); \ No newline at end of file +define(["jquery","core/ajax","core/notification"],function(a,b,c){return{init:function(d){a("a[data-prediction-methodname][data-prediction-id="+d+"]").on("click",function(e){e.preventDefault();var f=a(e.currentTarget),g=f.attr("data-prediction-methodname"),h=f.closest("tr");if(h.length>0){var i=b.call([{methodname:g,args:{predictionid:d}}])[0];i.done(function(){h[0].remove(),a(".insights-list tr").length<2&&window.history.back()}).fail(c.exception)}})}}}); \ No newline at end of file diff --git a/report/insights/amd/src/actions.js b/report/insights/amd/src/actions.js index 2ffe7f27509..bc10ce2a415 100644 --- a/report/insights/amd/src/actions.js +++ b/report/insights/amd/src/actions.js @@ -56,7 +56,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat predictionContainers[0].remove(); // Move back if no remaining predictions. - if ($('.insights-list tr').length === 0) { + if ($('.insights-list tr').length < 2) { window.history.back(); } }).fail(Notification.exception);