From 94335e5a97b0f613db9976d0937f3bf89dd8aa97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sun, 2 Sep 2012 10:27:04 +0200 Subject: [PATCH 1/2] MDL-27856 support restore of cohort in the same site --- enrol/cohort/addinstance_form.php | 21 ++++++-- enrol/cohort/lang/en/enrol_cohort.php | 1 + enrol/cohort/lib.php | 76 ++++++++++++++++++++++++++- 3 files changed, 92 insertions(+), 6 deletions(-) diff --git a/enrol/cohort/addinstance_form.php b/enrol/cohort/addinstance_form.php index c2094937c0c..7f65b126a59 100644 --- a/enrol/cohort/addinstance_form.php +++ b/enrol/cohort/addinstance_form.php @@ -29,12 +29,15 @@ defined('MOODLE_INTERNAL') || die(); require_once("$CFG->libdir/formslib.php"); class enrol_cohort_addinstance_form extends moodleform { + + protected $course; + function definition() { global $CFG, $DB; $mform = $this->_form; - $course = $this->_customdata; - $coursecontext = context_course::instance($course->id); + $this->course = $this->_customdata; + $coursecontext = context_course::instance($this->course->id); $enrol = enrol_get_plugin('cohort'); @@ -72,8 +75,18 @@ class enrol_cohort_addinstance_form extends moodleform { $this->add_action_buttons(true, get_string('addinstance', 'enrol')); - $this->set_data(array('id'=>$course->id)); + $this->set_data(array('id'=>$this->course->id)); } - //TODO: validate duplicate role-cohort does not exist + function validation($data, $files) { + global $DB; + + $errors = parent::validation($data, $files); + + if ($DB->record_exists('enrol', array('roleid'=>$data['roleid'], 'customint1'=>$data['cohortid'], 'courseid'=>$this->course->id, 'enrol'=>'cohort'))) { + $errors['cohortid'] = get_string('instanceexists', 'enrol_cohort'); + } + + return $errors; + } } diff --git a/enrol/cohort/lang/en/enrol_cohort.php b/enrol/cohort/lang/en/enrol_cohort.php index 8196bb09bc7..5b5f79a8f9b 100644 --- a/enrol/cohort/lang/en/enrol_cohort.php +++ b/enrol/cohort/lang/en/enrol_cohort.php @@ -28,5 +28,6 @@ $string['ajaxmore'] = 'More...'; $string['cohortsearch'] = 'Search'; $string['cohort:config'] = 'Configure cohort instances'; $string['cohort:unenrol'] = 'Unenrol suspended users'; +$string['instanceexists'] = 'Cohort is already synchronised with selected role'; $string['pluginname'] = 'Cohort sync'; $string['pluginname_desc'] = 'Cohort enrolment plugin synchronises cohort members with course participants.'; diff --git a/enrol/cohort/lib.php b/enrol/cohort/lib.php index 4ad304eb17b..f116b28cf1a 100644 --- a/enrol/cohort/lib.php +++ b/enrol/cohort/lib.php @@ -224,6 +224,78 @@ class enrol_cohort_plugin extends enrol_plugin { return $button; } + + /** + * Restore instance and map settings. + * + * @param restore_enrolments_structure_step $step + * @param stdClass $data + * @param stdClass $course + * @param int $oldid + */ + public function restore_instance(restore_enrolments_structure_step $step, stdClass $data, $course, $oldid) { + global $DB, $CFG; + + if (!$step->get_task()->is_samesite()) { + // No cohort restore from other sites. + $step->set_mapping('enrol', $oldid, 0); + return; + } + + if ($data->roleid and $DB->record_exists('cohort', array('id'=>$data->customint1))) { + $instance = $DB->get_record('enrol', array('roleid'=>$data->roleid, 'customint1'=>$data->customint1, 'courseid'=>$course->id, 'enrol'=>$this->get_name())); + if ($instance) { + $instanceid = $instance; + } else { + $instanceid = $this->add_instance($course, (array)$data); + } + $step->set_mapping('enrol', $oldid, $instanceid); + + require_once("$CFG->dirroot/enrol/cohort/locallib.php"); + enrol_cohort_sync($course->id, false); + + } else if ($this->get_config('unenrolaction') == ENROL_EXT_REMOVED_SUSPENDNOROLES) { + $data->customint1 = 0; + $instance = $DB->get_record('enrol', array('roleid'=>$data->roleid, 'customint1'=>$data->customint1, 'courseid'=>$course->id, 'enrol'=>$this->get_name())); + + if ($instance) { + $instanceid = $instance; + } else { + $data->status = ENROL_INSTANCE_DISABLED; + $instanceid = $this->add_instance($course, (array)$data); + } + $step->set_mapping('enrol', $oldid, $instanceid); + + require_once("$CFG->dirroot/enrol/cohort/locallib.php"); + enrol_cohort_sync($course->id, false); + + } else { + $step->set_mapping('enrol', $oldid, 0); + } + } + + /** + * Restore user enrolment. + * + * @param restore_enrolments_structure_step $step + * @param stdClass $data + * @param stdClass $instance + * @param int $oldinstancestatus + * @param int $userid + */ + public function restore_user_enrolment(restore_enrolments_structure_step $step, $data, $instance, $userid, $oldinstancestatus) { + global $DB; + + if ($this->get_config('unenrolaction') != ENROL_EXT_REMOVED_SUSPENDNOROLES) { + // Enrolments were already synchronised in restore_instance(), we do not want any suspended leftovers. + return; + } + + // ENROL_EXT_REMOVED_SUSPENDNOROLES means all previous enrolments are restored + // but without roles and suspended. + + if (!$DB->record_exists('user_enrolments', array('enrolid'=>$instance->id, 'userid'=>$userid))) { + $this->enrol_user($instance, $userid, null, $data->timestart, $data->timeend, ENROL_USER_SUSPENDED); + } + } } - - From e7193380d804ad3d085a28c26f97622c4f1b7cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sun, 2 Sep 2012 11:00:01 +0200 Subject: [PATCH 2/2] MDL-27856 coding style cleanup --- enrol/cohort/addinstance.php | 8 ++-- enrol/cohort/addinstance_form.php | 8 ++-- enrol/cohort/ajax.php | 7 ++-- enrol/cohort/cli/sync.php | 5 +-- enrol/cohort/db/access.php | 7 +--- enrol/cohort/db/events.php | 2 +- enrol/cohort/db/uninstall.php | 5 +-- enrol/cohort/lang/en/enrol_cohort.php | 6 +-- enrol/cohort/lib.php | 20 +++++----- enrol/cohort/locallib.php | 55 +++++++++++++-------------- enrol/cohort/settings.php | 4 +- enrol/cohort/version.php | 5 +-- 12 files changed, 56 insertions(+), 76 deletions(-) diff --git a/enrol/cohort/addinstance.php b/enrol/cohort/addinstance.php index ebb06fca87f..eacef31c451 100644 --- a/enrol/cohort/addinstance.php +++ b/enrol/cohort/addinstance.php @@ -1,5 +1,4 @@ dirroot/enrol/cohort/addinstance_form.php"); require_once("$CFG->dirroot/enrol/cohort/locallib.php"); -$id = required_param('id', PARAM_INT); // course id +$id = required_param('id', PARAM_INT); // Course id. $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST); $context = context_course::instance($course->id, MUST_EXIST); @@ -42,7 +40,7 @@ $PAGE->set_pagelayout('admin'); navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); -// Try and make the manage instances node on the navigation active +// Try and make the manage instances node on the navigation active. $courseadmin = $PAGE->settingsnav->get('courseadmin'); if ($courseadmin && $courseadmin->get('users') && $courseadmin->get('users')->get('manageinstances')) { $courseadmin->get('users')->get('manageinstances')->make_active(); diff --git a/enrol/cohort/addinstance_form.php b/enrol/cohort/addinstance_form.php index 7f65b126a59..9658b4934bd 100644 --- a/enrol/cohort/addinstance_form.php +++ b/enrol/cohort/addinstance_form.php @@ -1,5 +1,4 @@ get_string('choosedots')); - list($sqlparents, $params) = $DB->get_in_or_equal(get_parent_contexts($coursecontext)); + list($sqlparents, $params) = $DB->get_in_or_equal($coursecontext->get_parent_context_ids()); $sql = "SELECT id, name, contextid FROM {cohort} WHERE contextid $sqlparents @@ -59,7 +57,7 @@ class enrol_cohort_addinstance_form extends moodleform { $roles = get_assignable_roles($coursecontext); $roles[0] = get_string('none'); - $roles = array_reverse($roles, true); // descending default sortorder + $roles = array_reverse($roles, true); // Descending default sortorder. $mform->addElement('header','general', get_string('pluginname', 'enrol_cohort')); diff --git a/enrol/cohort/ajax.php b/enrol/cohort/ajax.php index b09fd4dd64d..c831ecd2ef4 100644 --- a/enrol/cohort/ajax.php +++ b/enrol/cohort/ajax.php @@ -20,8 +20,7 @@ * The general idea behind this file is that any errors should throw exceptions * which will be returned and acted upon by the calling AJAX script. * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2011 Sam Hemelryk * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -33,7 +32,7 @@ require_once($CFG->dirroot.'/enrol/locallib.php'); require_once($CFG->dirroot.'/enrol/cohort/locallib.php'); require_once($CFG->dirroot.'/group/lib.php'); -// Must have the sesskey +// Must have the sesskey. $id = required_param('id', PARAM_INT); // course id $action = required_param('action', PARAM_ALPHANUMEXT); @@ -50,7 +49,7 @@ require_login($course); require_capability('moodle/course:enrolreview', $context); require_sesskey(); -echo $OUTPUT->header(); // send headers +echo $OUTPUT->header(); // Send headers. $manager = new course_enrolment_manager($PAGE, $course); diff --git a/enrol/cohort/cli/sync.php b/enrol/cohort/cli/sync.php index 068c18b2a65..4f1cd3b760b 100644 --- a/enrol/cohort/cli/sync.php +++ b/enrol/cohort/cli/sync.php @@ -23,8 +23,7 @@ * - you need to change the "www-data" to match the apache user account * - use "su" if "sudo" not available * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2011 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -35,7 +34,7 @@ require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php'); require_once($CFG->libdir.'/clilib.php'); require_once("$CFG->dirroot/enrol/cohort/locallib.php"); -// now get cli options +// Now get cli options. list($options, $unrecognized) = cli_get_params(array('verbose'=>false, 'help'=>false), array('v'=>'verbose', 'h'=>'help')); if ($unrecognized) { diff --git a/enrol/cohort/db/access.php b/enrol/cohort/db/access.php index 98ce7b0f232..70c5528af1d 100644 --- a/enrol/cohort/db/access.php +++ b/enrol/cohort/db/access.php @@ -36,7 +36,7 @@ $capabilities = array( ) ), - /* This is used only when sync suspends users instead of full unenrolment */ + /* This is used only when sync suspends users instead of full unenrolment. */ 'enrol/cohort:unenrol' => array( 'captype' => 'write', @@ -47,8 +47,3 @@ $capabilities = array( ), ); - - - - - diff --git a/enrol/cohort/db/events.php b/enrol/cohort/db/events.php index 4f26a20be4e..9de7dcfbde2 100644 --- a/enrol/cohort/db/events.php +++ b/enrol/cohort/db/events.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -/* List of handlers */ +/* List of handlers. */ $handlers = array ( 'cohort_member_added' => array ( 'handlerfile' => '/enrol/cohort/locallib.php', diff --git a/enrol/cohort/db/uninstall.php b/enrol/cohort/db/uninstall.php index 58b0c050b46..5da20bff117 100644 --- a/enrol/cohort/db/uninstall.php +++ b/enrol/cohort/db/uninstall.php @@ -17,8 +17,7 @@ /** * Meta link enrolment plugin uninstallation. * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2011 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -38,4 +37,4 @@ function xmldb_enrol_cohort_uninstall() { role_unassign_all(array('component'=>'enrol_cohort')); return true; -} \ No newline at end of file +} diff --git a/enrol/cohort/lang/en/enrol_cohort.php b/enrol/cohort/lang/en/enrol_cohort.php index 5b5f79a8f9b..b198b76b622 100644 --- a/enrol/cohort/lang/en/enrol_cohort.php +++ b/enrol/cohort/lang/en/enrol_cohort.php @@ -1,5 +1,4 @@ . /** - * Strings for component 'enrol_cohort', language 'en', branch 'MOODLE_20_STABLE' + * Strings for component 'enrol_cohort', language 'en' * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2010 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ diff --git a/enrol/cohort/lib.php b/enrol/cohort/lib.php index f116b28cf1a..c0d500ce463 100644 --- a/enrol/cohort/lib.php +++ b/enrol/cohort/lib.php @@ -17,8 +17,7 @@ /** * Cohort enrolment plugin. * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2010 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -32,9 +31,9 @@ defined('MOODLE_INTERNAL') || die(); */ class enrol_cohort_plugin extends enrol_plugin { /** - * Returns localised name of enrol instance + * Returns localised name of enrol instance. * - * @param object $instance (null is accepted too) + * @param stdClass $instance (null is accepted too) * @return string */ public function get_instance_name($instance) { @@ -67,12 +66,12 @@ class enrol_cohort_plugin extends enrol_plugin { if (!$this->can_add_new_instances($courseid)) { return NULL; } - // multiple instances supported - multiple parent courses linked + // Multiple instances supported - multiple parent courses linked. return new moodle_url('/enrol/cohort/addinstance.php', array('id'=>$courseid)); } /** - * Given a courseid this function returns true if the user is able to enrol or configure cohorts + * Given a courseid this function returns true if the user is able to enrol or configure cohorts. * AND there are cohorts that the user can view. * * @param int $courseid @@ -100,7 +99,6 @@ class enrol_cohort_plugin extends enrol_plugin { return false; } - /** * Called for all enabled enrol plugins that returned true from is_cron_required(). * @return void @@ -116,8 +114,8 @@ class enrol_cohort_plugin extends enrol_plugin { * Called after updating/inserting course. * * @param bool $inserted true if course just inserted - * @param object $course - * @param object $data form data + * @param stdClass $course + * @param stdClass $data form data * @return void */ public function course_updated($inserted, $course, $data) { @@ -158,7 +156,7 @@ class enrol_cohort_plugin extends enrol_plugin { } /** - * Gets an array of the user enrolment actions + * Gets an array of the user enrolment actions. * * @param course_enrolment_manager $manager * @param stdClass $ue A user enrolment object @@ -210,7 +208,7 @@ class enrol_cohort_plugin extends enrol_plugin { $button->strings_for_js('cohort', 'cohort'); $button->strings_for_js('users', 'moodle'); - // No point showing this at all if the user cant manually enrol users + // No point showing this at all if the user cant manually enrol users. $hasmanualinstance = has_capability('enrol/manual:enrol', $manager->get_context()) && $manager->has_instance('manual'); $modules = array('moodle-enrol_cohort-quickenrolment', 'moodle-enrol_cohort-quickenrolment-skin'); diff --git a/enrol/cohort/locallib.php b/enrol/cohort/locallib.php index 869e06c4aa2..ad433f7be3a 100644 --- a/enrol/cohort/locallib.php +++ b/enrol/cohort/locallib.php @@ -17,8 +17,7 @@ /** * Local stuff for cohort enrolment plugin. * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2010 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -36,7 +35,7 @@ require_once($CFG->dirroot . '/enrol/locallib.php'); */ class enrol_cohort_handler { /** - * Event processor - cohort member added + * Event processor - cohort member added. * @param stdClass $ca * @return bool */ @@ -47,7 +46,7 @@ class enrol_cohort_handler { return true; } - // does any enabled cohort instance want to sync with this cohort? + // Does any enabled cohort instance want to sync with this cohort? $sql = "SELECT e.*, r.id as roleexists FROM {enrol} e LEFT JOIN {role} r ON (r.id = e.roleid) @@ -60,14 +59,14 @@ class enrol_cohort_handler { $plugin = enrol_get_plugin('cohort'); foreach ($instances as $instance) { if ($instance->status != ENROL_INSTANCE_ENABLED ) { - // no roles for disabled instances + // No roles for disabled instances. $instance->roleid = 0; } else if ($instance->roleid and !$instance->roleexists) { - // invalid role - let's just enrol, they will have to create new sync and delete this one + // Invalid role - let's just enrol, they will have to create new sync and delete this one. $instance->roleid = 0; } unset($instance->roleexists); - // no problem if already enrolled + // No problem if already enrolled. $plugin->enrol_user($instance, $ca->userid, $instance->roleid, 0, 0, ENROL_USER_ACTIVE); } @@ -75,14 +74,14 @@ class enrol_cohort_handler { } /** - * Event processor - cohort member removed + * Event processor - cohort member removed. * @param stdClass $ca * @return bool */ public static function member_removed($ca) { global $DB; - // does anything want to sync with this cohort? + // Does anything want to sync with this cohort? if (!$instances = $DB->get_records('enrol', array('customint1'=>$ca->cohortid, 'enrol'=>'cohort'), 'id ASC')) { return true; } @@ -110,14 +109,14 @@ class enrol_cohort_handler { } /** - * Event processor - cohort deleted + * Event processor - cohort deleted. * @param stdClass $cohort * @return bool */ public static function deleted($cohort) { global $DB; - // does anything want to sync with this cohort? + // Does anything want to sync with this cohort? if (!$instances = $DB->get_records('enrol', array('customint1'=>$cohort->id, 'enrol'=>'cohort'), 'id ASC')) { return true; } @@ -149,7 +148,7 @@ class enrol_cohort_handler { function enrol_cohort_sync($courseid = NULL, $verbose = false) { global $CFG, $DB; - // purge all roles if cohort sync disabled, those can be recreated later here by cron or CLI + // Purge all roles if cohort sync disabled, those can be recreated later here by cron or CLI. if (!enrol_is_enabled('cohort')) { if ($verbose) { mtrace('Cohort sync plugin is disabled, unassigning all plugin roles and stopping.'); @@ -158,7 +157,7 @@ function enrol_cohort_sync($courseid = NULL, $verbose = false) { return 2; } - // unfortunately this may take a long time, this script can be interrupted without problems + // Unfortunately this may take a long time, this script can be interrupted without problems. @set_time_limit(0); raise_memory_limit(MEMORY_HUGE); @@ -173,7 +172,7 @@ function enrol_cohort_sync($courseid = NULL, $verbose = false) { $unenrolaction = $plugin->get_config('unenrolaction', ENROL_EXT_REMOVED_UNENROL); - // iterate through all not enrolled yet users + // Iterate through all not enrolled yet users. $onecourse = $courseid ? "AND e.courseid = :courseid" : ""; $sql = "SELECT cm.userid, e.id AS enrolid, ue.status FROM {cohort_members} cm @@ -204,7 +203,7 @@ function enrol_cohort_sync($courseid = NULL, $verbose = false) { $rs->close(); - // unenrol as necessary + // Unenrol as necessary. $sql = "SELECT ue.*, e.courseid FROM {user_enrolments} ue JOIN {enrol} e ON (e.id = ue.enrolid AND e.enrol = 'cohort' $onecourse) @@ -217,14 +216,14 @@ function enrol_cohort_sync($courseid = NULL, $verbose = false) { } $instance = $instances[$ue->enrolid]; if ($unenrolaction == ENROL_EXT_REMOVED_UNENROL) { - // remove enrolment together with group membership, grades, preferences, etc. + // Temove enrolment together with group membership, grades, preferences, etc. $plugin->unenrol_user($instance, $ue->userid); if ($verbose) { mtrace(" unenrolling: $ue->userid ==> $instance->courseid via cohort $instance->customint1"); } } else { // ENROL_EXT_REMOVED_SUSPENDNOROLES - // just disable and ignore any changes + // Just disable and ignore any changes. if ($ue->status != ENROL_USER_SUSPENDED) { $plugin->update_user_enrol($instance, $ue->userid, ENROL_USER_SUSPENDED); $context = context_course::instance($instance->courseid); @@ -239,7 +238,7 @@ function enrol_cohort_sync($courseid = NULL, $verbose = false) { unset($instances); - // now assign all necessary roles to enrolled users - skip suspended instances and users + // Now assign all necessary roles to enrolled users - skip suspended instances and users. $onecourse = $courseid ? "AND e.courseid = :courseid" : ""; $sql = "SELECT e.roleid, ue.userid, c.id AS contextid, e.id AS itemid, e.courseid FROM {user_enrolments} ue @@ -264,7 +263,7 @@ function enrol_cohort_sync($courseid = NULL, $verbose = false) { $rs->close(); - // remove unwanted roles - sync role can not be changed, we only remove role when unenrolled + // Remove unwanted roles - sync role can not be changed, we only remove role when unenrolled. $onecourse = $courseid ? "AND e.courseid = :courseid" : ""; $sql = "SELECT ra.roleid, ra.userid, ra.contextid, ra.itemid, e.courseid FROM {role_assignments} ra @@ -384,7 +383,7 @@ function enrol_cohort_get_cohorts(course_enrolment_manager $manager) { } /** - * Check if cohort exists and user is allowed to enrol it + * Check if cohort exists and user is allowed to enrol it. * * @global moodle_database $DB * @param int $cohortid Cohort ID @@ -426,10 +425,10 @@ function enrol_cohort_search_cohorts(course_enrolment_manager $manager, $offset list($sqlparents, $params) = $DB->get_in_or_equal(get_parent_contexts($context)); - // Add some additional sensible conditions + // Add some additional sensible conditions. $tests = array('contextid ' . $sqlparents); - // Modify the query to perform the search if required + // Modify the query to perform the search if required. if (!empty($search)) { $conditions = array( 'name', @@ -452,17 +451,17 @@ function enrol_cohort_search_cohorts(course_enrolment_manager $manager, $offset $order = ' ORDER BY name ASC'; $rs = $DB->get_recordset_sql($fields . $sql . $order, $params, $offset); - // Produce the output respecting parameters + // Produce the output respecting parameters. foreach ($rs as $c) { - // Track offset + // Track offset. $offset++; - // Check capabilities + // Check capabilities. $context = context::instance_by_id($c->contextid); if (!has_capability('moodle/cohort:view', $context)) { continue; } if ($limit === 0) { - // we have reached the required number of items and know that there are more, exit now + // we have reached the required number of items and know that there are more, exit now. $offset--; break; } @@ -472,9 +471,9 @@ function enrol_cohort_search_cohorts(course_enrolment_manager $manager, $offset 'users'=>$DB->count_records('cohort_members', array('cohortid'=>$c->id)), 'enrolled'=>in_array($c->id, $enrolled) ); - // Count items + // Count items. $limit--; } $rs->close(); return array('more' => !(bool)$limit, 'offset' => $offset, 'cohorts' => $cohorts); -} \ No newline at end of file +} diff --git a/enrol/cohort/settings.php b/enrol/cohort/settings.php index db9702a7eed..8c08a745d8e 100644 --- a/enrol/cohort/settings.php +++ b/enrol/cohort/settings.php @@ -17,8 +17,7 @@ /** * Cohort enrolment plugin settings and presets. * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2010 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -45,4 +44,3 @@ if ($ADMIN->fulltree) { $settings->add(new admin_setting_configselect('enrol_cohort/unenrolaction', get_string('extremovedaction', 'enrol'), get_string('extremovedaction_help', 'enrol'), ENROL_EXT_REMOVED_UNENROL, $options)); } } - diff --git a/enrol/cohort/version.php b/enrol/cohort/version.php index 74a2aa8b01b..f23b2b3f6ce 100644 --- a/enrol/cohort/version.php +++ b/enrol/cohort/version.php @@ -17,8 +17,7 @@ /** * Cohort enrolment plugin version specification. * - * @package enrol - * @subpackage cohort + * @package enrol_cohort * @copyright 2010 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -28,4 +27,4 @@ defined('MOODLE_INTERNAL') || die(); $plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'enrol_cohort'; // Full name of the plugin (used for diagnostics) -$plugin->cron = 60*60; // run cron every hour by default, it is not out-of-sync often \ No newline at end of file +$plugin->cron = 60*60; // run cron every hour by default, it is not out-of-sync often