From e2cd8d3c6d806c5aa7328a3ec00e80c250a6beff Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Fri, 2 Feb 2018 14:53:56 +0100 Subject: [PATCH] MDL-61249 enrol_manual: Fix end date calculation This patch has been given by Bruno Malaval. --- enrol/manual/ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enrol/manual/ajax.php b/enrol/manual/ajax.php index 5f21c654ec085..3f182fd6bd753 100644 --- a/enrol/manual/ajax.php +++ b/enrol/manual/ajax.php @@ -91,7 +91,7 @@ } $roleid = optional_param('roletoassign', null, PARAM_INT); - $duration = optional_param('duration', 0, PARAM_FLOAT); + $duration = optional_param('duration', 0, PARAM_INT); $startdate = optional_param('startdate', 0, PARAM_INT); $recovergrades = optional_param('recovergrades', 0, PARAM_INT); @@ -125,7 +125,7 @@ if ($duration <= 0) { $timeend = 0; } else { - $timeend = $timestart + intval($duration*24*60*60); + $timeend = $timestart + $duration; } $instances = $manager->get_enrolment_instances();