diff --git a/swad_changelog.h b/swad_changelog.h index 49eba7e5..271a818f 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.40 (2021-03-01)" +#define Log_PLATFORM_VERSION "SWAD 20.36.41 (2021-03-01)" #define CSS_FILE "swad20.33.9.css" #define JS_FILE "swad20.6.2.js" /* @@ -601,6 +601,7 @@ 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.41: Mar 01, 2021 Query moved to module swad_timeline_database. (305466 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) diff --git a/swad_timeline_database.c b/swad_timeline_database.c index 10b6ef80..406c9579 100644 --- a/swad_timeline_database.c +++ b/swad_timeline_database.c @@ -343,7 +343,7 @@ void TL_DB_RemoveNote (long NotCod) void TL_DB_RemoveAllNotesUsr (long UsrCod) { - /***** Remove all notes created by a user *****/ + /***** Remove all notes created by user *****/ DB_QueryDELETE ("can not remove notes", "DELETE FROM tl_notes WHERE UsrCod=%ld", UsrCod); @@ -898,6 +898,18 @@ void TL_DB_UpdateFirstLastPubCodsInSession (long FirstPubCod) Gbl.Session.Id); } +/*****************************************************************************/ +/********************* Remove all publications of a user *********************/ +/*****************************************************************************/ + +void TL_DB_RemoveAllPubsUsr (long UsrCod) + { + /***** Remove all publications of user *****/ + DB_QueryDELETE ("can not remove publications", + "DELETE FROM tl_pubs WHERE PublisherCod=%ld", + UsrCod); + } + /*****************************************************************************/ /****************** Check if a user has favourited a note ********************/ /*****************************************************************************/ diff --git a/swad_timeline_database.h b/swad_timeline_database.h index 0024c8ea..10a6f8f5 100644 --- a/swad_timeline_database.h +++ b/swad_timeline_database.h @@ -113,6 +113,7 @@ long TL_DB_CreateNewPub (const struct TL_Pub_Publication *Pub); void TL_DB_UpdateFirstPubCodInSession (long FirstPubCod); void TL_DB_UpdateLastPubCodInSession (void); void TL_DB_UpdateFirstLastPubCodsInSession (long FirstPubCod); +void TL_DB_RemoveAllPubsUsr (long UsrCod); /****************************** Favourites ***********************************/ bool TL_DB_CheckIfFavedByUsr (TL_Fav_WhatToFav_t WhatToFav, diff --git a/swad_timeline_user.c b/swad_timeline_user.c index e6e17f58..b8380296 100644 --- a/swad_timeline_user.c +++ b/swad_timeline_user.c @@ -149,10 +149,7 @@ void TL_Usr_RemoveUsrContent (long UsrCod) UsrCod); /***** Remove all the publications of the user *****/ - DB_QueryDELETE ("can not remove publications", - "DELETE FROM tl_pubs" - " WHERE PublisherCod=%ld", - UsrCod); + TL_DB_RemoveAllPubsUsr (UsrCod); /***** Remove all notes of the user *****/ TL_DB_RemoveAllNotesUsr (UsrCod);