From fca50b95ef83620dff57b3024e66af754046fc4d Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Thu, 12 Dec 2013 16:04:52 +0800 Subject: [PATCH] MDL-42085 Enrol: Always apply enrolment duration. Before the fix, the startdates and duration fields were integrated to HTML code only when the user clicked on the collapsible region to see them. It was wrong because their values were not sent by the form if ever the user didn't expand this Enrolment options region. --- enrol/manual/yui/quickenrolment/quickenrolment.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/enrol/manual/yui/quickenrolment/quickenrolment.js b/enrol/manual/yui/quickenrolment/quickenrolment.js index 83621859f16..dee47d82fb4 100644 --- a/enrol/manual/yui/quickenrolment/quickenrolment.js +++ b/enrol/manual/yui/quickenrolment/quickenrolment.js @@ -156,11 +156,8 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) { } this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url(collapsedimage, 'moodle')); - this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).once('click', function() { - // We want to do this just once, the first time the controls are shown. - this.populateStartDates(); - this.populateDuration(); - }, this); + this.populateStartDates(); + this.populateDuration(); this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).on('click', function(){ this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).toggleClass(CSS.ACTIVE); this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEAREA).toggleClass(CSS.HIDDEN);