mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-23532 enrol - rebased after latest weekly and split new UI components out to the manual plugin
This commit is contained in:
parent
12a52d7c6e
commit
d4c98cffa8
@ -81,6 +81,8 @@ switch ($action) {
|
|||||||
$roleid = optional_param('role', null, PARAM_INT);
|
$roleid = optional_param('role', null, PARAM_INT);
|
||||||
$duration = optional_param('duration', 0, PARAM_INT);
|
$duration = optional_param('duration', 0, PARAM_INT);
|
||||||
$startdate = optional_param('startdate', 0, PARAM_INT);
|
$startdate = optional_param('startdate', 0, PARAM_INT);
|
||||||
|
$recovergrades = optional_param('recovergrades', 0, PARAM_INT);
|
||||||
|
|
||||||
if (empty($roleid)) {
|
if (empty($roleid)) {
|
||||||
$roleid = null;
|
$roleid = null;
|
||||||
}
|
}
|
||||||
@ -112,6 +114,10 @@ switch ($action) {
|
|||||||
$plugin = $plugins[$instance->enrol];
|
$plugin = $plugins[$instance->enrol];
|
||||||
if ($plugin->allow_enrol($instance) && has_capability('enrol/'.$plugin->get_name().':enrol', $context)) {
|
if ($plugin->allow_enrol($instance) && has_capability('enrol/'.$plugin->get_name().':enrol', $context)) {
|
||||||
$plugin->enrol_user($instance, $user->id, $roleid, $timestart, $timeend);
|
$plugin->enrol_user($instance, $user->id, $roleid, $timestart, $timeend);
|
||||||
|
if ($recovergrades) {
|
||||||
|
require_once($CFG->libdir.'/gradelib.php');
|
||||||
|
grade_recover_history_grades($user->id, $instance->courseid);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new enrol_ajax_exception('enrolnotpermitted');
|
throw new enrol_ajax_exception('enrolnotpermitted');
|
||||||
}
|
}
|
||||||
|
@ -182,6 +182,8 @@ class enrol_manual_plugin extends enrol_plugin {
|
|||||||
* @return enrol_user_button
|
* @return enrol_user_button
|
||||||
*/
|
*/
|
||||||
public function get_manual_enrol_button(course_enrolment_manager $manager) {
|
public function get_manual_enrol_button(course_enrolment_manager $manager) {
|
||||||
|
global $CFG;
|
||||||
|
|
||||||
$instance = null;
|
$instance = null;
|
||||||
$instances = array();
|
$instances = array();
|
||||||
foreach ($manager->get_enrolment_instances() as $tempinstance) {
|
foreach ($manager->get_enrolment_instances() as $tempinstance) {
|
||||||
@ -211,12 +213,13 @@ class enrol_manual_plugin extends enrol_plugin {
|
|||||||
|
|
||||||
$modules = array('moodle-enrol_manual-quickenrolment', 'moodle-enrol_manual-quickenrolment-skin');
|
$modules = array('moodle-enrol_manual-quickenrolment', 'moodle-enrol_manual-quickenrolment-skin');
|
||||||
$arguments = array(
|
$arguments = array(
|
||||||
'instances' => $instances,
|
'instances' => $instances,
|
||||||
'courseid' => $instance->courseid,
|
'courseid' => $instance->courseid,
|
||||||
'ajaxurl' => '/enrol/manual/ajax.php',
|
'ajaxurl' => '/enrol/manual/ajax.php',
|
||||||
'url' => $manager->get_moodlepage()->url->out(false),
|
'url' => $manager->get_moodlepage()->url->out(false),
|
||||||
'optionsStartDate' => $startdateoptions,
|
'optionsStartDate' => $startdateoptions,
|
||||||
'defaultRole' => $instance->roleid
|
'defaultRole' => $instance->roleid,
|
||||||
|
'disableGradeHistory' => $CFG->disablegradehistory
|
||||||
);
|
);
|
||||||
$function = 'M.enrol_manual.quickenrolment.init';
|
$function = 'M.enrol_manual.quickenrolment.init';
|
||||||
$button->require_yui_module($modules, $function, array($arguments));
|
$button->require_yui_module($modules, $function, array($arguments));
|
||||||
@ -234,7 +237,9 @@ class enrol_manual_plugin extends enrol_plugin {
|
|||||||
'unlimitedduration',
|
'unlimitedduration',
|
||||||
'startdatetoday',
|
'startdatetoday',
|
||||||
'durationdays',
|
'durationdays',
|
||||||
'enrolperiod'), 'enrol');
|
'enrolperiod',
|
||||||
|
'finishenrollingusers',
|
||||||
|
'recovergrades'), 'enrol');
|
||||||
$button->strings_for_js('assignroles', 'role');
|
$button->strings_for_js('assignroles', 'role');
|
||||||
$button->strings_for_js('startingfrom', 'moodle');
|
$button->strings_for_js('startingfrom', 'moodle');
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
/**
|
/**
|
||||||
* Unenrol a user who was enrolled through a manual enrolment.
|
* Unenrol a user who was enrolled through a manual enrolment.
|
||||||
*
|
*
|
||||||
|
* Please note when unenrolling a user all of their grades are removed as well.
|
||||||
|
*
|
||||||
* @package enrol
|
* @package enrol
|
||||||
* @subpackage manual
|
* @subpackage manual
|
||||||
* @copyright 2011 Sam Hemelryk
|
* @copyright 2011 Sam Hemelryk
|
||||||
|
@ -44,6 +44,7 @@ Structure of the user enroller panel
|
|||||||
|
|
||||||
.user-enroller-panel .uep-content {text-align:center;position:relative;width:100%;border-top:1px solid #999;border-bottom:1px solid #999;}
|
.user-enroller-panel .uep-content {text-align:center;position:relative;width:100%;border-top:1px solid #999;border-bottom:1px solid #999;}
|
||||||
.user-enroller-panel .uep-content .uep-controls {margin:0;padding:3px;background-color:#ddd;text-align:left;border-bottom:1px solid #BBB;}
|
.user-enroller-panel .uep-content .uep-controls {margin:0;padding:3px;background-color:#ddd;text-align:left;border-bottom:1px solid #BBB;}
|
||||||
|
.user-enroller-panel .uep-content .uep-controls .uep-enrolment-option input {vertical-align:middle;margin-left:1em;}
|
||||||
.user-enroller-panel .uep-ajax-content {height:375px;overflow:auto;}
|
.user-enroller-panel .uep-ajax-content {height:375px;overflow:auto;}
|
||||||
.user-enroller-panel .uep-search-results .totalusers {background-color:#eee;padding:5px;border-bottom:1px solid #BBB;font-size:7pt;font-weight: bold;}
|
.user-enroller-panel .uep-search-results .totalusers {background-color:#eee;padding:5px;border-bottom:1px solid #BBB;font-size:7pt;font-weight: bold;}
|
||||||
.user-enroller-panel .uep-search-results .user {width:100%;text-align:left;font-size:9pt;border-bottom:1px solid #ddd;border-top:1px solid #eee;}
|
.user-enroller-panel .uep-search-results .user {width:100%;text-align:left;font-size:9pt;border-bottom:1px solid #ddd;border-top:1px solid #eee;}
|
||||||
|
110
enrol/manual/yui/quickenrolment/quickenrolment.js
vendored
110
enrol/manual/yui/quickenrolment/quickenrolment.js
vendored
@ -49,12 +49,12 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
ODD : 'odd',
|
ODD : 'odd',
|
||||||
EVEN : 'even',
|
EVEN : 'even',
|
||||||
HIDDEN : 'hidden',
|
HIDDEN : 'hidden',
|
||||||
RECOVERGRADESCHECK : 'uep-recovergradescheck',
|
RECOVERGRADES : 'recovergrades',
|
||||||
RECOVERGRADESCHECKTITLE : 'uep-recovergradeschecktitle',
|
RECOVERGRADESTITLE : 'recovergradestitle',
|
||||||
SEARCHOPTIONS : 'uep-searchoptions',
|
SEARCHOPTIONS : 'uep-searchoptions',
|
||||||
COLLAPSIBLEHEADING : 'collapsibleheading',
|
COLLAPSIBLEHEADING : 'collapsibleheading',
|
||||||
COLLAPSIBLEAREA : 'collapsiblearea',
|
COLLAPSIBLEAREA : 'collapsiblearea',
|
||||||
SEARCHOPTION : 'uep-enrolment-option',
|
ENROLMENTOPTION : 'uep-enrolment-option',
|
||||||
SEARCHCONTROLS : 'uep-controls',
|
SEARCHCONTROLS : 'uep-controls',
|
||||||
ROLE : 'role',
|
ROLE : 'role',
|
||||||
STARTDATE : 'startdate',
|
STARTDATE : 'startdate',
|
||||||
@ -64,6 +64,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
CLOSE : 'close',
|
CLOSE : 'close',
|
||||||
CLOSEBTN : 'close-button'
|
CLOSEBTN : 'close-button'
|
||||||
};
|
};
|
||||||
|
var create = Y.Node.create;
|
||||||
|
|
||||||
var USERENROLLER = function(config) {
|
var USERENROLLER = function(config) {
|
||||||
USERENROLLER.superclass.constructor.apply(this, arguments);
|
USERENROLLER.superclass.constructor.apply(this, arguments);
|
||||||
@ -73,43 +74,45 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
_loadingNode : null,
|
_loadingNode : null,
|
||||||
_escCloseEvent : null,
|
_escCloseEvent : null,
|
||||||
initializer : function(config) {
|
initializer : function(config) {
|
||||||
recovergradescheckbox = null;
|
var recovergrades = null;
|
||||||
if (this.get(UEP.DISABLEGRADEHISTORY) != true) {
|
if (this.get(UEP.DISABLEGRADEHISTORY) != true) {
|
||||||
recovergradescheckbox = Y.Node.create('<div class="'+CSS.RECOVERGRADESCHECK+'"><input type="checkbox" id="recovergrades" name="recovergrades" /><span class="'+CSS.RECOVERGRADESCHECKTITLE+'"><label for="recovergrades">'+M.str.enrol.recovergrades+'</label></span></div>');
|
recovergrades = create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.RECOVERGRADES+'"></div>')
|
||||||
|
.append(create('<label class="'+CSS.RECOVERGRADESTITLE+'" for="'+CSS.RECOVERGRADES+'">'+M.str.enrol.recovergrades+'</label>'))
|
||||||
|
.append(create('<input type="checkbox" id="'+CSS.RECOVERGRADES+'" name="'+CSS.RECOVERGRADES+'" />'))
|
||||||
}
|
}
|
||||||
|
|
||||||
this.set(UEP.BASE, Y.Node.create('<div class="'+CSS.PANEL+' '+CSS.HIDDEN+'"></div>')
|
this.set(UEP.BASE, create('<div class="'+CSS.PANEL+' '+CSS.HIDDEN+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.WRAP+'"></div>')
|
.append(create('<div class="'+CSS.WRAP+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.HEADER+' header"></div>')
|
.append(create('<div class="'+CSS.HEADER+' header"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.CLOSE+'"></div>'))
|
.append(create('<div class="'+CSS.CLOSE+'"></div>'))
|
||||||
.append(Y.Node.create('<h2>'+M.str.enrol.enrolusers+'</h2>')))
|
.append(create('<h2>'+M.str.enrol.enrolusers+'</h2>')))
|
||||||
.append(Y.Node.create('<div class="'+CSS.CONTENT+'"></div>')
|
.append(create('<div class="'+CSS.CONTENT+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.SEARCHCONTROLS+'"></div>')
|
.append(create('<div class="'+CSS.SEARCHCONTROLS+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.SEARCHOPTION+' '+CSS.ROLE+'">'+M.str.role.assignroles+'</div>')
|
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.ROLE+'">'+M.str.role.assignroles+'</div>')
|
||||||
.append(Y.Node.create('<select><option value="">'+M.str.enrol.none+'</option></select>'))
|
.append(create('<select><option value="">'+M.str.enrol.none+'</option></select>'))
|
||||||
)
|
)
|
||||||
.append(recovergradescheckbox)
|
.append(create('<div class="'+CSS.SEARCHOPTIONS+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.SEARCHOPTIONS+'"></div>')
|
.append(create('<div class="'+CSS.COLLAPSIBLEHEADING+'"><img alt="" />'+M.str.enrol.enrolmentoptions+'</div>'))
|
||||||
.append(Y.Node.create('<div class="'+CSS.COLLAPSIBLEHEADING+'"><img alt="" />'+M.str.enrol.enrolmentoptions+'</div>'))
|
.append(create('<div class="'+CSS.COLLAPSIBLEAREA+' '+CSS.HIDDEN+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.COLLAPSIBLEAREA+' '+CSS.HIDDEN+'"></div>')
|
.append(recovergrades)
|
||||||
.append(Y.Node.create('<div class="'+CSS.SEARCHOPTION+' '+CSS.STARTDATE+'">'+M.str.moodle.startingfrom+'</div>')
|
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.STARTDATE+'">'+M.str.moodle.startingfrom+'</div>')
|
||||||
.append(Y.Node.create('<select></select>')))
|
.append(create('<select></select>')))
|
||||||
.append(Y.Node.create('<div class="'+CSS.SEARCHOPTION+' '+CSS.DURATION+'">'+M.str.enrol.enrolperiod+'</div>')
|
.append(create('<div class="'+CSS.ENROLMENTOPTION+' '+CSS.DURATION+'">'+M.str.enrol.enrolperiod+'</div>')
|
||||||
.append(Y.Node.create('<select><option value="0" selected="selected">'+M.str.enrol.unlimitedduration+'</option></select>')))
|
.append(create('<select><option value="0" selected="selected">'+M.str.enrol.unlimitedduration+'</option></select>')))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(Y.Node.create('<div class="'+CSS.AJAXCONTENT+'"></div>'))
|
.append(create('<div class="'+CSS.AJAXCONTENT+'"></div>'))
|
||||||
.append(Y.Node.create('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>')
|
.append(create('<div class="'+CSS.LIGHTBOX+' '+CSS.HIDDEN+'"></div>')
|
||||||
.append(Y.Node.create('<img alt="loading" class="'+CSS.LOADINGICON+'" />')
|
.append(create('<img alt="loading" class="'+CSS.LOADINGICON+'" />')
|
||||||
.setAttribute('src', M.util.image_url('i/loading', 'moodle')))
|
.setAttribute('src', M.util.image_url('i/loading', 'moodle')))
|
||||||
.setStyle('opacity', 0.5)))
|
.setStyle('opacity', 0.5)))
|
||||||
.append(Y.Node.create('<div class="'+CSS.FOOTER+'"></div>')
|
.append(create('<div class="'+CSS.FOOTER+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol.usersearch+'</label></div>')
|
.append(create('<div class="'+CSS.SEARCH+'"><label>'+M.str.enrol.usersearch+'</label></div>')
|
||||||
.append(Y.Node.create('<input type="text" id="enrolusersearch" value="" />'))
|
.append(create('<input type="text" id="enrolusersearch" value="" />'))
|
||||||
)
|
)
|
||||||
.append(Y.Node.create('<div class="'+CSS.CLOSEBTN+'"></div>')
|
.append(create('<div class="'+CSS.CLOSEBTN+'"></div>')
|
||||||
.append(Y.Node.create('<input type="button" value="'+M.str.enrol.finishenrollingusers+'" />'))
|
.append(create('<input type="button" value="'+M.str.enrol.finishenrollingusers+'" />'))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -137,7 +140,6 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
base.dd.addHandle('.'+CSS.HEADER+' h2');
|
base.dd.addHandle('.'+CSS.HEADER+' h2');
|
||||||
base.one('.'+CSS.HEADER+' h2').setStyle('cursor', 'move');
|
base.one('.'+CSS.HEADER+' h2').setStyle('cursor', 'move');
|
||||||
|
|
||||||
|
|
||||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).one('img').setAttribute('src', M.util.image_url('t/collapsed', 'moodle'));
|
||||||
this.get(UEP.BASE).one('.'+CSS.SEARCHOPTIONS+' .'+CSS.COLLAPSIBLEHEADING).on('click', function(){
|
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.COLLAPSIBLEHEADING).toggleClass(CSS.ACTIVE);
|
||||||
@ -156,12 +158,12 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
populateAssignableRoles : function() {
|
populateAssignableRoles : function() {
|
||||||
this.on('assignablerolesloaded', function(){
|
this.on('assignablerolesloaded', function(){
|
||||||
var roles = this.get(UEP.ASSIGNABLEROLES);
|
var roles = this.get(UEP.ASSIGNABLEROLES);
|
||||||
var s = this.get(UEP.BASE).one('.'+CSS.SEARCHOPTION+'.'+CSS.ROLE+' select');
|
var s = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.ROLE+' select');
|
||||||
var v = this.get(UEP.DEFAULTROLE);
|
var v = this.get(UEP.DEFAULTROLE);
|
||||||
var index = 0, count = 0;
|
var index = 0, count = 0;
|
||||||
for (var i in roles) {
|
for (var i in roles) {
|
||||||
count++;
|
count++;
|
||||||
var option = Y.Node.create('<option value="'+i+'">'+roles[i]+'</option>');
|
var option = create('<option value="'+i+'">'+roles[i]+'</option>');
|
||||||
if (i == v) {
|
if (i == v) {
|
||||||
index = count;
|
index = count;
|
||||||
}
|
}
|
||||||
@ -172,13 +174,13 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
this.getAssignableRoles();
|
this.getAssignableRoles();
|
||||||
},
|
},
|
||||||
populateStartDates : function() {
|
populateStartDates : function() {
|
||||||
var select = this.get(UEP.BASE).one('.'+CSS.SEARCHOPTION+'.'+CSS.STARTDATE+' select');
|
var select = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.STARTDATE+' select');
|
||||||
var defaultvalue = this.get(UEP.DEFAULTSTARTDATE);
|
var defaultvalue = this.get(UEP.DEFAULTSTARTDATE);
|
||||||
var options = this.get(UEP.OPTIONSTARTDATE);
|
var options = this.get(UEP.OPTIONSTARTDATE);
|
||||||
var index = 0, count = 0;
|
var index = 0, count = 0;
|
||||||
for (var i in options) {
|
for (var i in options) {
|
||||||
count++;
|
count++;
|
||||||
var option = Y.Node.create('<option value="'+i+'">'+options[i]+'</option>');
|
var option = create('<option value="'+i+'">'+options[i]+'</option>');
|
||||||
if (i == defaultvalue) {
|
if (i == defaultvalue) {
|
||||||
index = count;
|
index = count;
|
||||||
}
|
}
|
||||||
@ -187,12 +189,12 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
select.set('selectedIndex', index);
|
select.set('selectedIndex', index);
|
||||||
},
|
},
|
||||||
populateDuration : function() {
|
populateDuration : function() {
|
||||||
var select = this.get(UEP.BASE).one('.'+CSS.SEARCHOPTION+'.'+CSS.DURATION+' select');
|
var select = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.DURATION+' select');
|
||||||
var defaultvalue = this.get(UEP.DEFAULTDURATION);
|
var defaultvalue = this.get(UEP.DEFAULTDURATION);
|
||||||
var index = 0, count = 0;
|
var index = 0, count = 0;
|
||||||
for (var i = 1; i <= 365; i++) {
|
for (var i = 1; i <= 365; i++) {
|
||||||
count++;
|
count++;
|
||||||
var option = Y.Node.create('<option value="'+i+'">'+M.util.get_string('durationdays', 'enrol', i)+'</option>');
|
var option = create('<option value="'+i+'">'+M.util.get_string('durationdays', 'enrol', i)+'</option>');
|
||||||
if (i == defaultvalue) {
|
if (i == defaultvalue) {
|
||||||
index = count;
|
index = count;
|
||||||
}
|
}
|
||||||
@ -326,7 +328,7 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
}
|
}
|
||||||
var users;
|
var users;
|
||||||
if (!args.append) {
|
if (!args.append) {
|
||||||
users = Y.Node.create('<div class="'+CSS.USERS+'"></div>');
|
users = create('<div class="'+CSS.USERS+'"></div>');
|
||||||
} else {
|
} else {
|
||||||
users = this.get(UEP.BASE).one('.'+CSS.SEARCHRESULTS+' .'+CSS.USERS);
|
users = this.get(UEP.BASE).one('.'+CSS.SEARCHRESULTS+' .'+CSS.USERS);
|
||||||
}
|
}
|
||||||
@ -334,26 +336,26 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
for (var i in result.response.users) {
|
for (var i in result.response.users) {
|
||||||
count++;
|
count++;
|
||||||
var user = result.response.users[i];
|
var user = result.response.users[i];
|
||||||
users.append(Y.Node.create('<div class="'+CSS.USER+' clearfix" rel="'+user.id+'"></div>')
|
users.append(create('<div class="'+CSS.USER+' clearfix" rel="'+user.id+'"></div>')
|
||||||
.addClass((i%2)?CSS.ODD:CSS.EVEN)
|
.addClass((i%2)?CSS.ODD:CSS.EVEN)
|
||||||
.append(Y.Node.create('<div class="'+CSS.COUNT+'">'+count+'</div>'))
|
.append(create('<div class="'+CSS.COUNT+'">'+count+'</div>'))
|
||||||
.append(Y.Node.create('<div class="'+CSS.PICTURE+'"></div>')
|
.append(create('<div class="'+CSS.PICTURE+'"></div>')
|
||||||
.append(Y.Node.create(user.picture)))
|
.append(create(user.picture)))
|
||||||
.append(Y.Node.create('<div class="'+CSS.DETAILS+'"></div>')
|
.append(create('<div class="'+CSS.DETAILS+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.FULLNAME+'">'+user.fullname+'</div>'))
|
.append(create('<div class="'+CSS.FULLNAME+'">'+user.fullname+'</div>'))
|
||||||
.append(Y.Node.create('<div class="'+CSS.EMAIL+'">'+user.email+'</div>')))
|
.append(create('<div class="'+CSS.EMAIL+'">'+user.email+'</div>')))
|
||||||
.append(Y.Node.create('<div class="'+CSS.OPTIONS+'"></div>')
|
.append(create('<div class="'+CSS.OPTIONS+'"></div>')
|
||||||
.append(Y.Node.create('<input type="button" class="'+CSS.ENROL+'" value="'+M.str.enrol.enrol+'" />')))
|
.append(create('<input type="button" class="'+CSS.ENROL+'" value="'+M.str.enrol.enrol+'" />')))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.set(UEP.USERCOUNT, count);
|
this.set(UEP.USERCOUNT, count);
|
||||||
if (!args.append) {
|
if (!args.append) {
|
||||||
var usersstr = (result.response.totalusers == '1')?M.str.enrol.ajaxoneuserfound:M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
var usersstr = (result.response.totalusers == '1')?M.str.enrol.ajaxoneuserfound:M.util.get_string('ajaxxusersfound','enrol', result.response.totalusers);
|
||||||
var content = Y.Node.create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
|
var content = create('<div class="'+CSS.SEARCHRESULTS+'"></div>')
|
||||||
.append(Y.Node.create('<div class="'+CSS.TOTALUSERS+'">'+usersstr+'</div>'))
|
.append(create('<div class="'+CSS.TOTALUSERS+'">'+usersstr+'</div>'))
|
||||||
.append(users);
|
.append(users);
|
||||||
if (result.response.totalusers > (this.get(UEP.PAGE)+1)*25) {
|
if (result.response.totalusers > (this.get(UEP.PAGE)+1)*25) {
|
||||||
var fetchmore = Y.Node.create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol.ajaxnext25+'</a></div>');
|
var fetchmore = create('<div class="'+CSS.MORERESULTS+'"><a href="#">'+M.str.enrol.ajaxnext25+'</a></div>');
|
||||||
fetchmore.on('click', this.search, this, true);
|
fetchmore.on('click', this.search, this, true);
|
||||||
content.append(fetchmore)
|
content.append(fetchmore)
|
||||||
}
|
}
|
||||||
@ -373,10 +375,10 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
|||||||
params['enrolid'] = args.enrolid;
|
params['enrolid'] = args.enrolid;
|
||||||
params['sesskey'] = M.cfg.sesskey;
|
params['sesskey'] = M.cfg.sesskey;
|
||||||
params['action'] = 'enrol';
|
params['action'] = 'enrol';
|
||||||
params['role'] = this.get(UEP.BASE).one('.'+CSS.SEARCHOPTION+'.'+CSS.ROLE+' select').get('value');
|
params['role'] = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.ROLE+' select').get('value');
|
||||||
params['startdate'] = this.get(UEP.BASE).one('.'+CSS.SEARCHOPTION+'.'+CSS.STARTDATE+' select').get('value');
|
params['startdate'] = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.STARTDATE+' select').get('value');
|
||||||
params['duration'] = this.get(UEP.BASE).one('.'+CSS.SEARCHOPTION+'.'+CSS.DURATION+' select').get('value');
|
params['duration'] = this.get(UEP.BASE).one('.'+CSS.ENROLMENTOPTION+'.'+CSS.DURATION+' select').get('value');
|
||||||
params['recovergrades'] = this.get(UEP.BASE).one('#recovergrades').get('checked')?1:0;
|
params['recovergrades'] = this.get(UEP.BASE).one('#'+CSS.RECOVERGRADES).get('checked')?1:0;
|
||||||
|
|
||||||
Y.io(M.cfg.wwwroot+this.get(UEP.AJAXURL), {
|
Y.io(M.cfg.wwwroot+this.get(UEP.AJAXURL), {
|
||||||
method:'POST',
|
method:'POST',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user