diff --git a/swad_changelog.h b/swad_changelog.h index e9468fcf..49eba7e5 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -553,7 +553,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 20.36.39 (2021-03-01)" +#define Log_PLATFORM_VERSION "SWAD 20.36.40 (2021-03-01)" #define CSS_FILE "swad20.33.9.css" #define JS_FILE "swad20.6.2.js" /* @@ -601,7 +601,8 @@ TODO: DNI de un estudiante sale err TODO: BUG: Cuando un tipo de grupo sólo tiene un grupo, inscribirse es voluntario, el estudiante sólo puede pertenecer a un grupo, y se inscribe en él, debería poder desapuntarse. Ahora no puede. TODO: Salvador Romero Cortés: @acanas opción para editar posts - Version 20.36.39: Mar 01, 2021 Queries moved to module swad_timeline_database. (? lines) + Version 20.36.40: Mar 01, 2021 Query moved to module swad_timeline_database. (305457 lines) + Version 20.36.39: Mar 01, 2021 Queries moved to module swad_timeline_database. (305448 lines) Version 20.36.38: Mar 01, 2021 Code refactoring in timeline notifications. (305441 lines) Version 20.36.37: Mar 01, 2021 Query moved to module swad_timeline_database. (305449 lines) Version 20.36.36: Mar 01, 2021 Query moved to module swad_timeline_database. (305429 lines) diff --git a/swad_timeline_database.c b/swad_timeline_database.c index e1ebda30..10b6ef80 100644 --- a/swad_timeline_database.c +++ b/swad_timeline_database.c @@ -337,6 +337,18 @@ void TL_DB_RemoveNote (long NotCod) Gbl.Usrs.Me.UsrDat.UsrCod); } +/*****************************************************************************/ +/******************** Remove all notes created by a user *********************/ +/*****************************************************************************/ + +void TL_DB_RemoveAllNotesUsr (long UsrCod) + { + /***** Remove all notes created by a user *****/ + DB_QueryDELETE ("can not remove notes", + "DELETE FROM tl_notes WHERE UsrCod=%ld", + UsrCod); + } + /*****************************************************************************/ /********************* Get data of post using its code ***********************/ /*****************************************************************************/ diff --git a/swad_timeline_database.h b/swad_timeline_database.h index 5e328d5f..0024c8ea 100644 --- a/swad_timeline_database.h +++ b/swad_timeline_database.h @@ -69,6 +69,7 @@ void TL_DB_ClearTimelineNotesOfSessionFromDB (void); void TL_DB_RemoveNoteFavs (long NotCod); void TL_DB_RemoveNotePubs (long NotCod); void TL_DB_RemoveNote (long NotCod); +void TL_DB_RemoveAllNotesUsr (long UsrCod); /********************************** Posts ************************************/ unsigned TL_DB_GetPostByCod (long PstCod,MYSQL_RES **mysql_res); diff --git a/swad_timeline_user.c b/swad_timeline_user.c index 2671198c..e6e17f58 100644 --- a/swad_timeline_user.c +++ b/swad_timeline_user.c @@ -154,11 +154,8 @@ void TL_Usr_RemoveUsrContent (long UsrCod) " WHERE PublisherCod=%ld", UsrCod); - /***** Remove all the notes of the user *****/ - DB_QueryDELETE ("can not remove notes", - "DELETE FROM tl_notes" - " WHERE UsrCod=%ld", - UsrCod); + /***** Remove all notes of the user *****/ + TL_DB_RemoveAllNotesUsr (UsrCod); } /*****************************************************************************/