Added option to send email to managers as well as teachers.
The email message now contains a link to manage applications (the link allows teachers to manage all applications in a course, while managers see all applications in all courses).
@ -42,6 +42,7 @@ $string['apply:unenrolapply'] = 'Cancel·lar-se a si mateix del curs'; // Needs
$string['notification'] = '<b>Sol·licitud d\'inscripció enviada correctament</b>. <br/><br/>Rebràs una notificació per correu electrònic un cop estigui confirmada la inscripció.';
$string['sendmailtoteacher'] = 'Enviar notificacions per correu als professors';
$string['sendmailtomanager'] = 'Enviar notificacions per correu als administradors';
$string['mailtoteacher_suject'] = 'Nova inscripció al curs!';
$string['editdescription'] = 'Descripció de l\'àrea de text';
@ -42,6 +42,7 @@ $string['apply:unenrolapply'] = 'Cancel self from the course';
$string['notification'] = '<b>Enrollment Application successfully sent</b>. <br/><br/>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['sendmailtomanager'] = 'Send email notification to managers';
@ -42,6 +42,7 @@ $string['apply:unenrolapply'] = 'Cancelarse a si mismo del curso'; // Needs more
$string['notification'] = '<b>Solicitud de matriculación enviada correctamente</b>. <br/><br/>Será notificado por correo electrónico en cuanto se confirme su matriculación.';
$string['sendmailtoteacher'] = 'Enviar notificaciones por correo a los profesores';
$string['sendmailtomanager'] = 'Enviar notificaciones por correo a los gestores';
add_to_log($instance->courseid, 'course', 'enrol', '../enrol/users.php?id='.$instance->courseid, $instance->courseid); //there should be userid somewhere!
@ -160,7 +161,7 @@ function getAllEnrolment($id = null){
if($id){
$userenrolments = $DB->get_records_sql('select ue.userid,ue.id,u.firstname,u.lastname,u.email,u.picture,c.fullname as course,ue.timecreated from '.$CFG->prefix.'user_enrolments as ue left join '.$CFG->prefix.'user as u on ue.userid=u.id left join '.$CFG->prefix.'enrol as e on ue.enrolid=e.id left join '.$CFG->prefix.'course as c on e.courseid=c.id where ue.status=1 and e.courseid='.$id);
}else{
$userenrolments = $DB->get_records_sql('select ue.userid,ue.id,u.firstname,u.lastname,u.email,u.picture,c.fullname as course,ue.timecreated from '.$CFG->prefix.'user_enrolments as ue left join '.$CFG->prefix.'user as u on ue.userid=u.id left join '.$CFG->prefix.'enrol as e on ue.enrolid=e.id left join '.$CFG->prefix.'course as c on e.courseid=c.id where ue.status=1');
$userenrolments = $DB->get_records_sql('select ue.id,ue.userid,u.firstname,u.lastname,u.email,u.picture,c.fullname as course,ue.timecreated from '.$CFG->prefix.'user_enrolments as ue left join '.$CFG->prefix.'user as u on ue.userid=u.id left join '.$CFG->prefix.'enrol as e on ue.enrolid=e.id left join '.$CFG->prefix.'course as c on e.courseid=c.id where ue.status=1');
}
return $userenrolments;
}
@ -221,20 +222,23 @@ function sendConfirmMail($info){