Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-22781 upgrade enrol/flatfile plugin to use enrolments

Patch by Eugene Venter
  • Loading branch information...
commit 6fa788ab37ce725fb4a8aed96c7720d4325c3b17 1 parent 24df3e1
@srynot4sale srynot4sale authored
View
12 enrol/flatfile/lang/en/enrol_flatfile.php
@@ -23,9 +23,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['description'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify.
+$string['pluginname_desc'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify.
The file is a comma separated file assumed to have four or six fields per line:
-<pre>
+<pre class="informationbox">
* operation, role, idnumber(user), idnumber(course) [, starttime, endtime]
where:
* operation = add | del
@@ -36,7 +36,7 @@
* endtime = end time (in seconds since epoch) - optional
</pre>
It could look something like this:
-<pre>
+<pre class="informationbox">
add, student, 5, CF101
add, teacher, 6, CF101
add, teacheredit, 7, CF101
@@ -44,9 +44,11 @@
del, student, 17, CF101
add, student, 21, CF101, 1091115000, 1091215000
</pre>';
-$string['enrolname'] = 'Flat file';
+$string['pluginname'] = 'Flat file (CSV)';
$string['filelockedmail'] = 'The text file you are using for file-based enrolments ({$a}) can not be deleted by the cron process. This usually means the permissions are wrong on it. Please fix the permissions so that Moodle can delete the file, otherwise it might be processed repeatedly.';
$string['filelockedmailsubject'] = 'Important error: Enrolment file';
$string['location'] = 'File location';
+$string['mailstudents'] = 'Notify students by email';
+$string['mailteachers'] = 'Notify teachers by email';
$string['mailadmin'] = 'Notify admin by email';
-$string['mailusers'] = 'Notify users by email';
+$string['mapping'] = 'Flat file mapping';
View
22 enrol/imsenterprise/importnow.php
@@ -1,25 +1,29 @@
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
-require_login();
+require_login(0, false);
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$site = get_site();
/// get language strings
-$str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
+$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
$PAGE->set_url('/enrol/imsenterprise/importnow.php');
-$PAGE->set_title("$site->shortname: $str->enrolments");
-$PAGE->set_heading($site->fullname);
-$PAGE->navbar->add($str->administration, new moodle_url('/admin/index.php'));
-$PAGE->navbar->add($str->enrolments);
-$PAGE->navbar->add('IMS import');
+$PAGE->set_title(get_string('importimsfile', 'enrol_imsenterprise'));
+$PAGE->set_heading(get_string('importimsfile', 'enrol_imsenterprise'));
+$PAGE->navbar->add(get_string('administrationsite'));
+$PAGE->navbar->add(get_string('plugins', 'admin'));
+$PAGE->navbar->add(get_string('enrolments', 'enrol'));
+$PAGE->navbar->add(get_string('pluginname', 'enrol_imsenterprise'), new moodle_url('/admin/settings.php', array('section'=>'enrolsettingsimsenterprise')));
+$PAGE->navbar->add(get_string('importimsfile', 'enrol_imsenterprise'));
+$PAGE->navigation->clear_cache();
+
echo $OUTPUT->header();
-require_once('enrol.php');
+require_once('lib.php');
//echo "Creating the IMS Enterprise enroller object\n";
-$enrol = new enrolment_plugin_imsenterprise();
+$enrol = new enrol_imsenterprise_plugin();
?>
<p>Launching the IMS Enterprise "cron" function. The import log will appear below (giving details of any
View
7 enrol/imsenterprise/lang/en/enrol_imsenterprise.php
@@ -42,9 +42,9 @@
$string['cronfrequency'] = 'Frequency of processing';
$string['deleteusers'] = 'Delete user accounts when specified in IMS data';
$string['deleteusers_help'] = 'If enabled, IMS Enterprise enrolment data can specify the deletion of user accounts (if the "recstatus" flag is set to 3, which represents deletion of an account). As is standard in Moodle, the user record isn\'t actually deleted from Moodle\'s database, but a flag is set to mark the account as deleted.';
-$string['description'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify. The file must follow the IMS Enterprise specifications containing person, group, and membership XML elements.';
+$string['pluginname_desc'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify. The file must follow the IMS Enterprise specifications containing person, group, and membership XML elements.';
$string['doitnow'] = 'perform an IMS Enterprise import right now';
-$string['enrolname'] = 'IMS Enterprise file';
+$string['pluginname'] = 'IMS Enterprise file';
$string['filelockedmail'] = 'The text file you are using for IMS-file-based enrolments ({$a}) can not be deleted by the cron process. This usually means the permissions are wrong on it. Please fix the permissions so that Moodle can delete the file, otherwise it might be processed repeatedly.';
$string['filelockedmailsubject'] = 'Important error: Enrolment file';
$string['fixcasepersonalnames'] = 'Change personal names to Title Case';
@@ -71,3 +71,6 @@
$string['usecapitafix_help'] = 'The student data system produced by Capita has been found to have one slight error in its XML output. If you are using Capita you should enable this setting - otherwise leave it un-ticked.';
$string['usersettings'] = 'User data options';
$string['zeroisnotruncation'] = '0 indicates no truncation';
+$string['roles'] = 'Roles';
+$string['ignore'] = 'Ignore';
+$string['importimsfile'] = 'Import IMS Enterprise file';
Please sign in to comment.
Something went wrong with that request. Please try again.