diff --git a/swad_changelog.h b/swad_changelog.h index d072e2627..d90e2c691 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -494,7 +494,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.118.1 (2020-01-23)" +#define Log_PLATFORM_VERSION "SWAD 19.118.2 (2020-01-23)" #define CSS_FILE "swad19.118.css" #define JS_FILE "swad19.91.1.js" /* @@ -502,6 +502,7 @@ ps2pdf source.ps destination.pdf // TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué? + Version 19.118.2: Jan 23, 2020 Fixed bug in enrolment notifications. (278559 lines) Version 19.118.1: Jan 23, 2020 Fixed bug in marks, reported by Diana Alexandra Dumitru. (278554 lines) Version 19.118: Jan 14, 2020 Responsive maps. (278546 lines) Version 19.117: Jan 14, 2020 Column map moved in countries, institutions and centres. (278523 lines) diff --git a/swad_enrolment.c b/swad_enrolment.c index c8eeba355..bd142b098 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -1943,6 +1943,7 @@ void Enr_SignUpInCrs (void) MYSQL_RES *mysql_res; MYSQL_ROW row; Rol_Role_t RoleFromForm; + bool Notify; long ReqCod = -1L; /***** Check if I already belong to course *****/ @@ -2005,12 +2006,15 @@ void Enr_SignUpInCrs (void) Gbl.Hierarchy.Crs.FullName); /***** Notify teachers or admins by email about the new enrolment request *****/ + // If I want to be a teacher ==> send notification to other teachers, administrators or superusers // If this course has teachers ==> send notification to teachers - // If this course has no teachers and I want to be a teacher ==> send notification to administrators or superusers - if (RoleFromForm == Rol_TCH) // TODO: What happens in user wants to enrole as a non-editing teacher? - if (Usr_GetNumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Crs.CrsCod, - 1 << Rol_TCH)) // This course has teachers - Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_ENROLMENT_REQUEST,ReqCod); + if (RoleFromForm == Rol_TCH) + Notify = true; + else + Notify = (Usr_GetNumUsrsInCrss (Hie_CRS,Gbl.Hierarchy.Crs.CrsCod, + 1 << Rol_TCH) != 0); // This course has teachers + if (Notify) + Ntf_StoreNotifyEventsToAllUsrs (Ntf_EVENT_ENROLMENT_REQUEST,ReqCod); } } diff --git a/swad_notification.c b/swad_notification.c index dee0842c1..f16e533c9 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -1248,7 +1248,7 @@ unsigned Ntf_StoreNotifyEventsToAllUsrs (Ntf_NotifyEvent_t NotifyEvent,long Cod) 1 << Rol_TCH)) // If this course has teachers ==> send notification to teachers NumRows = DB_QuerySELECT (&mysql_res,"can not get users" - " to be notified", + " to be notified", "SELECT UsrCod FROM crs_usr" " WHERE CrsCod=%ld" " AND UsrCod<>%ld"