diff --git a/edit_form.php b/edit_form.php index bd2a22a..22c5303 100644 --- a/edit_form.php +++ b/edit_form.php @@ -24,6 +24,7 @@ class enrol_self_edit_form extends moodleform { $mform->addElement('header', 'header', get_string('pluginname', 'enrol_apply')); $mform->addElement('text', 'name', get_string('custominstancename', 'enrol')); + $mform->setType('name', PARAM_TEXT); $options = array(ENROL_INSTANCE_ENABLED => get_string('yes'), ENROL_INSTANCE_DISABLED => get_string('no')); $mform->addElement('select', 'status', get_string('status', 'enrol_apply'), $options); diff --git a/lib.php b/lib.php index dca539c..187c91e 100644 --- a/lib.php +++ b/lib.php @@ -75,7 +75,7 @@ class enrol_apply_plugin extends enrol_plugin { $roleid = $instance->roleid; if(!$roleid){ - $role = $DB->get_record_sql('select * from '.$CFG->prefix.'role where archetype="student" limit 1'); + $role = $DB->get_record_sql("select * from ".$CFG->prefix."role where archetype='student' limit 1"); $roleid = $role->id; } @@ -161,7 +161,7 @@ function confirmEnrolment($enrols){ if($DB->update_record('user_enrolments',$enroluser)){ $userenrolments = $DB->get_record_sql('select * from '.$CFG->prefix.'user_enrolments where id='.$enrol); - $role = $DB->get_record_sql('select * from '.$CFG->prefix.'role where archetype="student" limit 1'); + $role = $DB->get_record_sql("select * from ".$CFG->prefix."role where archetype='student' limit 1"); @$roleAssignments->userid = $userenrolments->userid; @$roleAssignments->roleid = $role->id; @$roleAssignments->contextid = 3; diff --git a/version.php b/version.php index 2e35745..64d7def 100644 --- a/version.php +++ b/version.php @@ -18,8 +18,8 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 20131209; +$plugin->version = 2014061000; $plugin->requires = 2011080100; $plugin->maturity = MATURITY_STABLE; -$plugin->release = 'Course Enrol Apply Plugin Version 1.2.1 (build 20131209)'; +$plugin->release = 'Course Enrol Apply Plugin Version 1.2.2 (build 2014061000)'; $plugin->cron = 180;