diff --git a/db/access.php b/db/access.php index fc120ab..d5609ef 100644 --- a/db/access.php +++ b/db/access.php @@ -24,18 +24,8 @@ defined('MOODLE_INTERNAL') || die(); $capabilities = array( + /* Add, edit or remove manual enrol instance. */ 'enrol/apply:config' => array( - - 'captype' => 'write', - 'contextlevel' => CONTEXT_COURSE, - 'archetypes' => array( - 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW, - ) - ), - - 'enrol/apply:manage' => array( - 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, 'archetypes' => array( @@ -44,7 +34,12 @@ $capabilities = array( ) ), - 'enrol/apply:enrol' => array( + /** + * Enrolment approval. + * If granted on CONTEXT_SYSTEM level it allows approval for all courses + * at Site Administration -> Courses -> Manage enrolment applications. + */ + 'enrol/apply:manageapplications' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, 'archetypes' => array( @@ -53,6 +48,7 @@ $capabilities = array( ) ), + /* Unenrol a user */ 'enrol/apply:unenrol' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, @@ -62,6 +58,7 @@ $capabilities = array( ) ), + /* Allow a user to unenrol himself */ 'enrol/apply:unenrolself' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, diff --git a/lang/ca/enrol_apply.php b/lang/ca/enrol_apply.php index 7473bd5..5c2a903 100644 --- a/lang/ca/enrol_apply.php +++ b/lang/ca/enrol_apply.php @@ -35,7 +35,7 @@ $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:manageapplications'] = 'Gestionar la Inscripció prèvia aprovació'; // Needs more insight $string['apply:unenrol'] = 'Cancel·lar usuaris del curs'; // Needs more insight $string['notification'] = 'Sol·licitud d\'inscripció enviada correctament.

Rebràs una notificació per correu electrònic un cop estigui confirmada la inscripció.'; diff --git a/lang/de/enrol_apply.php b/lang/de/enrol_apply.php index 42fe5bf..91f042c 100644 --- a/lang/de/enrol_apply.php +++ b/lang/de/enrol_apply.php @@ -40,7 +40,7 @@ $string['status'] = 'Bestätigung der Kurseinschreibung erlauben'; $string['confirmenrol'] = 'Einschreibeanfragen bearbeiten'; $string['apply:config'] = 'Einschreibungsbelegstellen anlegen'; -$string['apply:manage'] = 'Einschreibungsanfragen verwalten'; +$string['apply:manageapplications'] = 'Einschreibungsanfragen verwalten'; $string['apply:unenrol'] = 'Benutzer aus dem Kurs entfernen'; $string['notification'] = 'Einschreibungsantrag wurde erfolgreich gesendet..

Sie werden via Mail informiert, sobald Ihre Einschreibung bestätigt wurde.'; diff --git a/lang/en/enrol_apply.php b/lang/en/enrol_apply.php index 2fb9ed9..cb7cbb1 100644 --- a/lang/en/enrol_apply.php +++ b/lang/en/enrol_apply.php @@ -56,8 +56,7 @@ $string['status'] = 'Allow Course enrol confirmation'; $string['confirmenrol'] = 'Manage application'; $string['apply:config'] = 'Configure apply enrol instances'; -$string['apply:enrol'] = 'Enrol users'; -$string['apply:manage'] = 'Manage apply enrolment'; +$string['apply:manageapplications'] = 'Manage apply enrolment'; $string['apply:unenrol'] = 'Cancel users from the course'; $string['apply:unenrolself'] = 'Cancel self from the course'; diff --git a/lang/en_us/en_us_enrol_apply.php b/lang/en_us/en_us_enrol_apply.php index b720c6c..08da6af 100644 --- a/lang/en_us/en_us_enrol_apply.php +++ b/lang/en_us/en_us_enrol_apply.php @@ -35,7 +35,7 @@ $string['status'] = 'Allow course enroll confirmation'; $string['confirmenroll'] = 'Manage application'; $string['apply:config'] = 'Configure apply enroll instances'; -$string['apply:manage'] = 'Manage apply enrollment'; +$string['apply:manageapplications'] = 'Manage apply enrollment'; $string['apply:unenroll'] = 'Cancel users from the course'; $string['apply:unenrollapply'] = 'Cancel self from the course'; diff --git a/lang/es/enrol_apply.php b/lang/es/enrol_apply.php index 69d19f4..e88807b 100644 --- a/lang/es/enrol_apply.php +++ b/lang/es/enrol_apply.php @@ -35,7 +35,7 @@ $string['status'] = 'Aceptar matriculación tras aprobación'; $string['confirmenrol'] = 'Gestionar solicitudes'; $string['apply:config'] = 'Configurar instancias de matrículas solicitadas'; // Needs more insight -$string['apply:manage'] = 'Gestionar matrículas solicitadas'; // Needs more insight +$string['apply:manageapplications'] = 'Gestionar matrículas solicitadas'; // Needs more insight $string['apply:unenrol'] = 'Cancelar usuarios del curso'; // Needs more insight $string['notification'] = 'Solicitud de matriculación enviada correctamente.

Será notificado por correo electrónico en cuanto se confirme su matriculación.'; diff --git a/lang/it/enrol_apply.php b/lang/it/enrol_apply.php index 744a71b..56ac011 100644 --- a/lang/it/enrol_apply.php +++ b/lang/it/enrol_apply.php @@ -35,7 +35,7 @@ $string['status'] = 'Permetti la conferma di iscrizione al corso'; $string['confirmenrol'] = 'Gestisci l\'applicazione'; $string['apply:config'] = 'Configura le istanze del plugin'; -$string['apply:manage'] = 'Gestisci le richieste di iscrizione'; +$string['apply:manageapplications'] = 'Gestisci le richieste di iscrizione'; $string['apply:unenrol'] = 'Cancella gli utenti dal corso'; $string['apply:unenrolself'] = 'Permetti all\'utente di disiscriversi dal corso'; diff --git a/lang/pt_br/enrol_apply.php b/lang/pt_br/enrol_apply.php index b448761..08fe0fb 100644 --- a/lang/pt_br/enrol_apply.php +++ b/lang/pt_br/enrol_apply.php @@ -35,7 +35,7 @@ $string['status'] = 'Aceitar matrícula após aprovação'; $string['confirmenrol'] = 'Gerenciar solicitações'; $string['apply:config'] = 'Configurar instâncias de matrículas solicitadas'; // Needs more insight -$string['apply:manage'] = 'Gerenciar matrículas solicitadas'; // Needs more insight +$string['apply:manageapplications'] = 'Gerenciar matrículas solicitadas'; // Needs more insight $string['apply:unenrol'] = 'Cancelar usuários do curso'; // Needs more insight $string['notification'] = 'Solicitação de matrícula enviada com sucesso.

Você será notificado por e-mail quando a sua matrícula for confirmada.'; diff --git a/lang/zh_cn/enrol_apply.php b/lang/zh_cn/enrol_apply.php index e5d837e..faccad8 100644 --- a/lang/zh_cn/enrol_apply.php +++ b/lang/zh_cn/enrol_apply.php @@ -35,7 +35,7 @@ $string['status'] = '允许选课确认'; $string['confirmenrol'] = '管理申请'; $string['apply:config'] = '配置选课确认的实例'; -$string['apply:manage'] = '管理选课申请'; +$string['apply:manageapplications'] = '管理选课申请'; $string['apply:unenrol'] = '从课程中取消用户的选课'; $string['apply:unenrolself'] = '从课程中取消自身的选课'; diff --git a/lib.php b/lib.php index 7a9196f..f70d236 100644 --- a/lib.php +++ b/lib.php @@ -113,7 +113,7 @@ class enrol_apply_plugin extends enrol_plugin { $icons[] = $OUTPUT->action_icon($editlink, new pix_icon('t/edit', get_string('edit'), 'core', array('class' => 'iconsmall'))); } - if (has_capability('enrol/apply:manage', $context)) { + if (has_capability('enrol/apply:manageapplications', $context)) { $managelink = new moodle_url("/enrol/apply/manage.php", array('id'=>$instance->id)); $icons[] = $OUTPUT->action_icon($managelink, new pix_icon('i/users', get_string('confirmenrol', 'enrol_apply'), 'core', array('class'=>'iconsmall'))); } diff --git a/manage.php b/manage.php index eab4cb7..97ccc9e 100644 --- a/manage.php +++ b/manage.php @@ -23,14 +23,14 @@ require_login(); $manageurlparams = array(); if ($id == null) { $context = context_system::instance(); - require_capability('enrol/apply:manage', $context); + require_capability('enrol/apply:manageapplications', $context); $pageheading = get_string('confirmusers', 'enrol_apply'); } else { $instance = $DB->get_record('enrol', array('id'=>$id, 'enrol'=>'apply'), '*', MUST_EXIST); require_course_login($instance->courseid); $course = get_course($instance->courseid); $context = context_course::instance($course->id, MUST_EXIST); - require_capability('moodle/course:enrolreview', $context); + require_capability('enrol/apply:manageapplications', $context); $manageurlparams['id'] = $instance->id; $pageheading = $course->fullname; }