diff --git a/swad_centre.c b/swad_centre.c index f6331d3a..16e407ce 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1777,6 +1777,9 @@ void Ctr_RemoveCentre (void) /***** Remove information related to files in centre *****/ Brw_RemoveCtrFilesFromDB (Ctr.CtrCod); + /***** Remove all classrooms in centre *****/ + Cla_RemoveAllClassroomsInCtr (Ctr.CtrCod); + /***** Remove directories of the centre *****/ snprintf (PathCtr,sizeof (PathCtr), "%s/%s/%02u/%u", diff --git a/swad_changelog.h b/swad_changelog.h index e3602f99..6f8529e8 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -364,10 +364,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.27.9 (2019-01-05)" +#define Log_PLATFORM_VERSION "SWAD 18.27.10 (2019-01-05)" #define CSS_FILE "swad18.22.css" #define JS_FILE "swad17.17.1.js" /* + Version 18.27.10: Jan 05, 2019 Remove all classrooms in a centre when it is removed. (239151 lines) Version 18.27.9: Jan 05, 2019 When a classroom is removed, if it is assigned to groups, remove the association in groups. (239136 lines) Version 18.27.8: Jan 05, 2019 Get classroom short name from database in listing of groups. (239130 lines) Version 18.27.7: Jan 04, 2019 Show classroom in listing of groups. (239121 lines) diff --git a/swad_classroom.c b/swad_classroom.c index c057daa1..ecac9642 100644 --- a/swad_classroom.c +++ b/swad_classroom.c @@ -590,6 +590,19 @@ void Cla_RemoveClassroom (void) Cla_EditClassrooms (); } +/*****************************************************************************/ +/******************** Remove all classrooms in a centre **********************/ +/*****************************************************************************/ + +void Cla_RemoveAllClassroomsInCtr (long CtrCod) + { + /***** Remove all classrooms in centre *****/ + DB_QueryDELETE ("can not remove classrooms", + "DELETE FROM classrooms" + " WHERE CtrCod=%ld", + CtrCod); + } + /*****************************************************************************/ /******************* Change the short name of a classroom ********************/ /*****************************************************************************/ diff --git a/swad_classroom.h b/swad_classroom.h index 88a22f3f..6c13e42e 100644 --- a/swad_classroom.h +++ b/swad_classroom.h @@ -89,9 +89,13 @@ void Cla_GetDataOfClassroomByCod (struct Classroom *Cla); long Cla_GetParamClaCod (void); void Cla_RemoveClassroom (void); +void Cla_RemoveAllClassroomsInCtr (long CtrCod); + void Cla_RenameClassroomShort (void); void Cla_RenameClassroomFull (void); + void Cla_ChangeCapacity (void); + void Cla_ChangeClassroomLocation (void); void Cla_RecFormNewClassroom (void);