MDL-58835 report_insights: Fix redirections

This commit is contained in:
David Monllao 2017-09-13 09:49:14 +02:00
parent 59f431e8a7
commit a6edbef556
3 changed files with 4 additions and 4 deletions

View File

@ -130,7 +130,7 @@ class renderer extends plugin_renderer_base {
} }
if (!CLI_SCRIPT) { 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; return $output;
@ -200,7 +200,7 @@ class renderer extends plugin_renderer_base {
} }
if (!CLI_SCRIPT) { 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; return $output;

View File

@ -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)}})}}}); 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)}})}}});

View File

@ -56,7 +56,7 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat
predictionContainers[0].remove(); predictionContainers[0].remove();
// Move back if no remaining predictions. // Move back if no remaining predictions.
if ($('.insights-list tr').length === 0) { if ($('.insights-list tr').length < 2) {
window.history.back(); window.history.back();
} }
}).fail(Notification.exception); }).fail(Notification.exception);