diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 412eeda..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp -*.sln merge=union -*.csproj merge=union -*.vbproj merge=union -*.fsproj merge=union -*.dbproj merge=union - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index b9d6bd9..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,215 +0,0 @@ -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results - -[Dd]ebug/ -[Rr]elease/ -x64/ -build/ -[Bb]in/ -[Oo]bj/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.log -*.scc - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -*.ncrunch* -.*crunch*.local.xml - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.Publish.xml -*.pubxml - -# NuGet Packages Directory -## TODO: If you have NuGet Package Restore enabled, uncomment the next line -#packages/ - -# Windows Azure Build Output -csx -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Others -sql/ -*.Cache -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.[Pp]ublish.xml -*.pfx -*.publishsettings - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -App_Data/*.mdf -App_Data/*.ldf - -############# -## Windows detritus -############# - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Mac crap -.DS_Store - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist/ -build/ -eggs/ -parts/ -var/ -sdist/ -develop-eggs/ -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg diff --git a/edit.php b/edit.php index 2f0b7ee..e9be97f 100644 --- a/edit.php +++ b/edit.php @@ -52,24 +52,17 @@ if ($mform->is_cancelled()) { if ($instance->id) { $instance->status = $data->status; $instance->name = $data->name; - $instance->password = $data->password; - $instance->customint1 = $data->customint1; - $instance->customint2 = $data->customint2; - $instance->customint3 = $data->customint3; - $instance->customint4 = $data->customint4; $instance->customtext1 = $data->customtext1; $instance->roleid = $data->roleid; - $instance->enrolperiod = $data->enrolperiod; - $instance->enrolstartdate = $data->enrolstartdate; - $instance->enrolenddate = $data->enrolenddate; $instance->timemodified = time(); $DB->update_record('enrol', $instance); } else { -// $fields = array('status'=>$data->status, 'name'=>$data->name, 'password'=>$data->password, 'customint1'=>$data->customint1, 'customint2'=>$data->customint2, -// 'customint3'=>$data->customint3, 'customint4'=>$data->customint4, 'customtext1'=>$data->customtext1, -// 'roleid'=>$data->roleid, 'enrolperiod'=>$data->enrolperiod, 'enrolstartdate'=>$data->enrolstartdate, 'enrolenddate'=>$data->enrolenddate); - $fields = array('status'=>$data->status, 'name'=>$data->name, 'customtext1'=>$data->customtext1); + $fields = array( + 'status' =>$data->status, + 'name' =>$data->name, + 'roleid' =>$data->roleid, + 'customtext1' =>$data->customtext1); $plugin->add_instance($course, $fields); } diff --git a/edit_form.php b/edit_form.php index 22c5303..b0a8162 100644 --- a/edit_form.php +++ b/edit_form.php @@ -25,9 +25,21 @@ class enrol_self_edit_form extends moodleform { $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); + $mform->addHelpButton('status', 'status', 'enrol_apply'); + $mform->setDefault('status', $plugin->get_config('status')); + + if ($instance->id) { + $roles = get_default_enrol_roles($context, $instance->roleid); + } else { + $roles = get_default_enrol_roles($context, $plugin->get_config('roleid')); + } + $mform->addElement('select', 'roleid', get_string('defaultrole', 'role'), $roles); + $mform->setDefault('roleid', $plugin->get_config('roleid')); + $mform->addElement('textarea', 'customtext1', get_string('editdescription', 'enrol_apply')); diff --git a/lang/ca/enrol_apply.php b/lang/ca/enrol_apply.php new file mode 100644 index 0000000..6744fd3 --- /dev/null +++ b/lang/ca/enrol_apply.php @@ -0,0 +1,51 @@ +{firstname}:Nom registrat per l\'usuari; {content}:Nom del curs'; +$string['cancelmailcontent_desc'] = 'Sisplau, utilitza marques especials que se substituiran en el contingut del correu.
{firstname}:Nom registrat per l\'usuari; {content}:Nom del curs'; + +$string['confirmusers'] = 'Confirmar inscripcions'; + +$string['coursename'] = 'Curs'; +$string['applyuser'] = 'Nom / Cognom'; +$string['applyusermail'] = 'Correu electrònic'; +$string['applydate'] = 'Data d\'inscripció'; +$string['btnconfirm'] = 'Confirmar'; +$string['btncancel'] = 'Cancel·lar'; +$string['enrolusers'] = 'Inscriure usuaris'; + +$string['status'] = 'Permet inscripció prèvia aprovació'; +$string['confirmenrol'] = 'Gestionar sol·licituds'; + +$string['apply:config'] = 'Configurar instàncies d\'Inscripció prèvia aprovació'; // Needs more insight +$string['apply:manage'] = 'Gestionar la Inscripció prèvia aprovació'; // Needs more insight +$string['apply:unenrol'] = 'Cancel·lar usuaris del curs'; // Needs more insight +$string['apply:unenrolapply'] = 'Cancel·lar-se a si mateix del curs'; // Needs more insight. Very ugly translation! + +$string['notification'] = 'Sol·licitud d\'inscripció enviada correctament.

Rebràs una notificació per correu electrònic un cop estigui confirmada la inscripció.'; + +$string['sendmailtoteacher'] = 'Enviar notificacions per correu als professors'; +$string['mailtoteacher_suject'] = 'Nova inscripció al curs!'; +$string['editdescription'] = 'Descripció de l\'àrea de text'; +$string['applymanage'] = 'Gestionar inscripcions'; + +$string['status_desc'] = 'Allow course access of internally enrolled users.'; + +?> \ No newline at end of file diff --git a/lang/de/enrol_apply.php b/lang/de/enrol_apply.php index be510cd..ee98f69 100644 --- a/lang/de/enrol_apply.php +++ b/lang/de/enrol_apply.php @@ -1,18 +1,25 @@ {Vorname}:Registrierungsname; {Inhalt}:Kursname'; -$string['cancelmailcontent_desc'] = 'Bitte benutzen Sie die Spezialmarkierungen, um den gewünschten Mailinhalt zu ersetzen.
{Vorname}:Registrierungsname; {Inhalt}:Kursname'; +$string['confirmmailsubject'] = 'E-Mail-Betreff für Bestätigung der Einschreibung'; +$string['confirmmailcontent'] = 'E-Mail für Bestätigung der Einschreibung'; +$string['cancelmailsubject'] = 'Mail-Betreff für Verwerfen der Einschreibung'; +$string['cancelmailcontent'] = 'Mail für Verwerfen der Einschreibung'; +$string['confirmmailcontent_desc'] = 'Bitte benutzen Sie die Spezialmarkierungen, um den gewünschten Mailinhalt zu ersetzen.
{firstname}:Registrierungsname; {content}:Kursname'; +$string['cancelmailcontent_desc'] = 'Bitte benutzen Sie die Spezialmarkierungen, um den gewünschten Mailinhalt zu ersetzen.
{firstname}:Registrierungsname; {content}:Kursname'; $string['confirmusers'] = 'Einschreibung bestätigen'; @@ -22,18 +29,22 @@ $string['applyusermail'] = 'Email'; $string['applydate'] = 'Einschreibungsdatum'; $string['btnconfirm'] = 'Bestätigen'; $string['btncancel'] = 'Abbruch'; -$string['enrolusers'] = 'Benutzer einschreiben'; +$string['enrolusers'] = 'Benutzer manuell einschreiben'; $string['status'] = 'Bestätigung der Kurseinschreibung erlauben'; -$string['confirmenrol'] = 'Anwendung verwalten'; +$string['confirmenrol'] = 'Einschreibeanfragen bearbeiten'; $string['apply:config'] = 'Einschreibungsbelegstellen anlegen'; $string['apply:manage'] = 'Einschreibungsanfragen verwalten'; $string['apply:unenrol'] = 'Benutzer aus dem Kurs entfernen'; $string['apply:unenrolapply'] = 'Sich selbst aus dem Kurs entfernen'; -// Description of your plugin. Shown on the plugin's configuration screen. -$string['description'] = ''; -$string['notification'] = 'Einschreibungsantrag wurde erfolgreich gesendet..

Sie werden via Mail informiert, sobald Ihre Einschreibung bestätigt wurde. Wenn Sie sich in andere Kurse einschreiben wollen, klicken Sie bitte den "Kurskatalog" im Hauptmenu an.'; - +$string['notification'] = 'Einschreibungsantrag wurde erfolgreich gesendet..

Sie werden via Mail informiert, sobald Ihre Einschreibung bestätigt wurde.'; + +$string['sendmailtoteacher'] = 'Sende eine Hinweis-E-Mail an den Trainer'; +$string['mailtoteacher_suject'] = 'Neue Anfrage zur Einschreibung'; +$string['editdescription'] = 'Beschreibung anpassen'; +$string['applymanage'] = 'Manage enrolment applications'; + +$string['status_desc'] = 'Kurszugriff für intern eingeschriebene Nutzer/innen erlauben.'; ?> \ No newline at end of file diff --git a/lang/en/enrol_apply.php b/lang/en/enrol_apply.php index 7c73d45..0c1d356 100644 --- a/lang/en/enrol_apply.php +++ b/lang/en/enrol_apply.php @@ -12,14 +12,12 @@ // The name of your plugin. Displayed on admin menus. $string['enrolname'] = 'Course enrol confirmation'; $string['pluginname'] = 'Course enrol confirmation'; +$string['pluginname_desc'] = 'With this plugin users can apply to a course and a teacher have to comfirm before the user gets enroled.'; $string['confirmmailsubject'] = 'Confirm mail subject'; $string['confirmmailcontent'] = 'Confirm mail content'; $string['cancelmailsubject'] = 'Cancel mail subject'; $string['cancelmailcontent'] = 'Cancel mail sontent'; -$string['mailaddress'] = 'Send mail address'; -$string['mailusername'] = 'Send mail username'; -$string['mailpassword'] = 'Send mail password'; $string['confirmmailcontent_desc'] = 'Please use special marks designated email content replaced.
{firstname}:Registration name; {content}:Course name'; $string['cancelmailcontent_desc'] = 'Please use special marks designated email content replaced.
{firstname}:Registration name; {content}:Course name'; @@ -41,13 +39,13 @@ $string['apply:manage'] = 'Manage apply enrolment'; $string['apply:unenrol'] = 'Cancel users from course'; $string['apply:unenrolapply'] = 'Cancel self from the course'; -// Description of your plugin. Shown on the plugin's configuration screen. -$string['description'] = ''; $string['notification'] = 'Enrollment Application successfully sent.

You will be informed by email as soon as your enrollment has been confirmed. If you want to enroll to other courses, please click "course catalogue" in the top menu.'; $string['sendmailtoteacher'] = 'Send email notification to teachers'; $string['mailtoteacher_suject'] = 'New Enrollment request!'; -$string['setting_edit'] = 'Edit'; $string['editdescription'] = 'Textarea description'; $string['applymanage'] = 'Manage enrolment applications'; + +$string['status_desc'] = 'Allow course access of internally enrolled users.'; + ?> \ No newline at end of file diff --git a/lang/es/enrol_apply.php b/lang/es/enrol_apply.php index 7943e31..21c380e 100644 --- a/lang/es/enrol_apply.php +++ b/lang/es/enrol_apply.php @@ -12,14 +12,12 @@ // The name of your plugin. Displayed on admin menus. $string['enrolname'] = 'Matrículas solicitadas'; $string['pluginname'] = 'Matrículas solicitadas'; +$string['pluginname_desc'] = 'With this plugin users can apply to a course and a teacher have to comfirm before the user gets enroled.'; // needs to be translated $string['confirmmailsubject'] = 'Asunto del correo de confirmación'; $string['confirmmailcontent'] = 'Contenido del correo de confirmación'; $string['cancelmailsubject'] = 'Asunto del correo de cancelación'; $string['cancelmailcontent'] = 'Contenido del correo de cancelación'; -$string['mailaddress'] = 'Send mail address'; // Those configuration parameters -$string['mailusername'] = 'Send mail username'; // are commented out in code -$string['mailpassword'] = 'Send mail password'; // Couldn't make an accurate translation without seen those in action $string['confirmmailcontent_desc'] = 'Por favor, use marcas especiales que se substituirán en el contenido del correo.
{firstname}:Nombre registrado por el usuario; {content}:Nombre del curso'; $string['cancelmailcontent_desc'] = 'Por favor, use marcas especiales que se substituirán en el contenido del correo.
{firstname}:Nombre registrado por el usuario; {content}:Nombre del curso'; @@ -41,8 +39,13 @@ $string['apply:manage'] = 'Gestionar matrículas solicitadas'; // Needs more ins $string['apply:unenrol'] = 'Cancelar usuarios del curso'; // Needs more insight $string['apply:unenrolapply'] = 'Cancelarse a si mismo del curso'; // Needs more insight. Very ugly translation! -// Description of your plugin. Shown on the plugin's configuration screen. -$string['description'] = ''; $string['notification'] = 'Solicitud de matriculación enviada correctamente.

Será notificado por correo electrónico en cuanto se confirme su matriculación.'; - + +$string['sendmailtoteacher'] = 'Enviar notificaciones por correo a los profesores'; +$string['mailtoteacher_suject'] = 'Nueva matrícula!'; +$string['editdescription'] = 'Descripción del área de texto'; +$string['applymanage'] = 'Gestionar matrículas'; + +$string['status_desc'] = 'Allow course access of internally enrolled users.'; // needs to be translated + ?> diff --git a/lang/pt_br/enrol_apply.php b/lang/pt_br/enrol_apply.php index 0fa1cc9..145394c 100644 --- a/lang/pt_br/enrol_apply.php +++ b/lang/pt_br/enrol_apply.php @@ -12,14 +12,12 @@ // The name of your plugin. Displayed on admin menus. $string['enrolname'] = 'Matrículas solicitadas'; $string['pluginname'] = 'Matrículas solicitadas'; +$string['pluginname_desc'] = 'With this plugin users can apply to a course and a teacher have to comfirm before the user gets enroled.'; // needs to be translated $string['confirmmailsubject'] = 'Assunto do e-mail de confirmação'; $string['confirmmailcontent'] = 'Conteúdo do e-mail de confirmação'; $string['cancelmailsubject'] = 'Assunto do e-mail de cancelamento'; $string['cancelmailcontent'] = 'Conteúdo do e-mail de cancelamento'; -$string['mailaddress'] = 'Endereço do e-mail de envio'; // Those configuration parameters -$string['mailusername'] = 'Usuário do e-mail de envio'; // are commented out in code -$string['mailpassword'] = 'Senha do e-mail de envio'; // Couldn't make an accurate translation without seen those in action $string['confirmmailcontent_desc'] = 'Por favor, use marcas especiais que substituirão o conteúdo do e-mail.
{firstname}:Nome registrado pelo usuário; {content}:Nome do curso'; $string['cancelmailcontent_desc'] = 'Por favor, use marcas especiais que substituirão o conteúdo do e-mail.
{firstname}:Nome registrado pelo usuário {content}:Nome do curso'; @@ -41,12 +39,13 @@ $string['apply:manage'] = 'Gerenciar matrículas solicitadas'; // Needs more ins $string['apply:unenrol'] = 'Cancelar usuários do curso'; // Needs more insight $string['apply:unenrolapply'] = 'Cancelar minha matrícula do curso'; // Needs more insight. Very ugly translation! -// Description of your plugin. Shown on the plugin's configuration screen. -$string['description'] = ''; $string['notification'] = 'Solicitação de matrícula enviada com sucesso.

Você será notificado por e-mail quando a sua matrícula for confirmada.'; $string['sendmailtoteacher'] = 'Enviar e-mail de notificação para professores'; $string['mailtoteacher_suject'] = 'Nova solicitação de inscrição!'; -$string['setting_edit'] = 'Editar'; $string['editdescription'] = 'Descrição'; -?> +$string['applymanage'] = 'Manage enrolment applications'; // needs to be translated + +$string['status_desc'] = 'Allow course access of internally enrolled users.'; // needs to be translated + +?> \ No newline at end of file diff --git a/lib.php b/lib.php index 187c91e..ee63ad5 100644 --- a/lib.php +++ b/lib.php @@ -11,6 +11,19 @@ */ class enrol_apply_plugin extends enrol_plugin { + /** + * Add new instance of enrol plugin with default settings. + * @param object $course + * @return int id of new instance + */ + public function add_default_instance($course) { + $fields = array( + 'status' => $this->get_config('status'), + 'roleid' => $this->get_config('roleid', 0) + ); + return $this->add_instance($course, $fields); + } + public function allow_unenrol(stdClass $instance) { // users with unenrol cap may unenrol other users manually manually return true; @@ -105,19 +118,19 @@ class enrol_apply_plugin extends enrol_plugin { $icons = array(); - if (has_capability("enrol/manual:manage", $context)) { - $editlink = new moodle_url("/enrol/apply/edit.php", array('courseid'=>$instance->courseid, 'id'=>$instance->id)); - $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('i/edit', get_string('edit'), 'core', array('class'=>'icon'))); - } + if (has_capability('enrol/manual:config', $context)) { + $editlink = new moodle_url("/enrol/apply/edit.php", array('courseid'=>$instance->courseid, 'id'=>$instance->id)); + $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('t/edit', get_string('edit'), 'core', array('class' => 'iconsmall'))); + } if (has_capability('enrol/manual:manage', $context)) { $managelink = new moodle_url("/enrol/apply/apply.php", array('id'=>$_GET['id'],'enrolid'=>$instance->id)); $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('confirmenrol', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } - if (has_capability("enrol/manual:manage", $context)) { - $managelink = new moodle_url("/enrol/apply/enroluser.php", array('enrolid'=>$instance->id)); - $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('enrolusers', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); + if (has_capability("enrol/manual:enrol", $context)) { + $enrollink = new moodle_url("/enrol/apply/enroluser.php", array('enrolid'=>$instance->id)); + $icons[] = $OUTPUT->action_icon($enrollink, new pix_icon('t/enrolusers', get_string('enrolusers', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } return $icons; diff --git a/settings.php b/settings.php index a1ad917..f8d8493 100644 --- a/settings.php +++ b/settings.php @@ -14,19 +14,40 @@ defined('MOODLE_INTERNAL') || die(); if ($ADMIN->fulltree) { //--- general settings ----------------------------------------------------------------------------------- - $settings->add(new admin_setting_heading('enrol_apply_enrolname','','')); + $settings->add(new admin_setting_heading('enrol_apply_enrolname','',get_string('pluginname_desc', 'enrol_apply'))); $settings->add(new admin_setting_configtext('enrol_apply/confirmmailsubject','',get_string('confirmmailsubject', 'enrol_apply'),null,PARAM_TEXT,60)); - $settings->add(new admin_setting_heading('enrol_apply_settings', '', get_string('confirmmailcontent_desc', 'enrol_apply'))); + + $settings->add(new admin_setting_heading('enrol_apply_confirmmailcontent', '', get_string('confirmmailcontent_desc', 'enrol_apply'))); $settings->add(new admin_setting_confightmleditor('enrol_apply/confirmmailcontent', get_string('confirmmailcontent', 'enrol_apply'),'utf-8','')); $settings->add(new admin_setting_configtext('enrol_apply/cancelmailsubject','',get_string('cancelmailsubject', 'enrol_apply'),null,PARAM_TEXT,60)); - //$settings->add(new admin_setting_heading('enrol_apply_settings', '', get_string('cancelmailcontent_desc', 'enrol_apply'))); + + $settings->add(new admin_setting_heading('enrol_apply_cancelmailcontent', '', get_string('cancelmailcontent_desc', 'enrol_apply'))); $settings->add(new admin_setting_confightmleditor('enrol_apply/cancelmailcontent', get_string('cancelmailcontent', 'enrol_apply'),'utf-8','')); $settings->add(new admin_setting_configcheckbox('enrol_apply/sendmailtoteacher', get_string('sendmailtoteacher', 'enrol_apply'), '', 0)); + //--- enrol instance defaults ---------------------------------------------------------------------------- + $settings->add(new admin_setting_heading('enrol_manual_defaults', + get_string('enrolinstancedefaults', 'admin'), get_string('enrolinstancedefaults_desc', 'admin'))); + + $settings->add(new admin_setting_configcheckbox('enrol_apply/defaultenrol', + get_string('defaultenrol', 'enrol'), get_string('defaultenrol_desc', 'enrol'), 0)); + + $options = array(ENROL_INSTANCE_ENABLED => get_string('yes'), + ENROL_INSTANCE_DISABLED => get_string('no')); + $settings->add(new admin_setting_configselect('enrol_apply/status', + get_string('status', 'enrol_apply'), get_string('status_desc', 'enrol_apply'), ENROL_INSTANCE_ENABLED, $options)); + + if (!during_initial_install()) { + $options = get_default_enrol_roles(context_system::instance()); + $student = get_archetype_roles('student'); + $student = reset($student); + $settings->add(new admin_setting_configselect('enrol_apply/roleid', + get_string('defaultrole', 'role'), '', $student->id, $options)); + } } if ($hassiteconfig) { // needs this condition or there is error on login page diff --git a/version.php b/version.php index 64d7def..322220c 100644 --- a/version.php +++ b/version.php @@ -22,4 +22,3 @@ $plugin->version = 2014061000; $plugin->requires = 2011080100; $plugin->maturity = MATURITY_STABLE; $plugin->release = 'Course Enrol Apply Plugin Version 1.2.2 (build 2014061000)'; -$plugin->cron = 180;