Version 20.36.26: Feb 28, 2021 Queries moved to module swad_timeline_database.

This commit is contained in:
acanas 2021-02-28 21:44:10 +01:00
parent 8a1639ff37
commit 9bbd553491
4 changed files with 33 additions and 11 deletions

View File

@ -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.25 (2021-02-28)"
#define Log_PLATFORM_VERSION "SWAD 20.36.26 (2021-02-28)"
#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.26: Feb 28, 2021 Queries moved to module swad_timeline_database. (305423 lines)
Version 20.36.25: Feb 28, 2021 Queries moved to module swad_timeline_database. (305405 lines)
Version 20.36.24: Feb 28, 2021 Functions moved to module swad_timeline_database. (305385 lines)
Version 20.36.23: Feb 28, 2021 Function moved to module swad_timeline_database. (305387 lines)

View File

@ -879,3 +879,30 @@ void TL_DB_MarkCommAsFav (long PubCod)
PubCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/********************* Unmark note as favourite in database ******************/
/*****************************************************************************/
void TL_DB_UnmarkNoteAsFav (long NotCod)
{
/***** Delete the mark as favourite from database *****/
DB_QueryDELETE ("can not unfavourite note",
"DELETE FROM tl_notes_fav"
" WHERE NotCod=%ld AND UsrCod=%ld",
NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/******************* Unmark comment as favourite in database *****************/
/*****************************************************************************/
void TL_DB_UnmarkCommAsFav (long PubCod)
{
DB_QueryDELETE ("can not unfavourite comment",
"DELETE FROM tl_comments_fav"
" WHERE PubCod=%ld AND UsrCod=%ld",
PubCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
}

View File

@ -113,5 +113,7 @@ void TL_DB_UpdateFirstLastPubCodsInSession (long FirstPubCod);
/****************************** Favourites ***********************************/
void TL_DB_MarkNoteAsFav (long NotCod);
void TL_DB_MarkCommAsFav (long PubCod);
void TL_DB_UnmarkNoteAsFav (long NotCod);
void TL_DB_UnmarkCommAsFav (long PubCod);
#endif

View File

@ -206,11 +206,7 @@ static void TL_Fav_UnfNote (struct TL_Not_Note *Not)
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the note
{
/***** Delete the mark as favourite from database *****/
DB_QueryDELETE ("can not unfavourite note",
"DELETE FROM tl_notes_fav"
" WHERE NotCod=%ld AND UsrCod=%ld",
Not->NotCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
TL_DB_UnmarkNoteAsFav (Not->NotCod);
/***** Update number of times this note is favourited *****/
TL_Fav_GetNumTimesANoteHasBeenFav (Not);
@ -351,11 +347,7 @@ static void TL_Fav_UnfComment (struct TL_Com_Comment *Com)
Gbl.Usrs.Me.UsrDat.UsrCod)) // I have favourited the comment
{
/***** Delete the mark as favourite from database *****/
DB_QueryDELETE ("can not unfavourite comment",
"DELETE FROM tl_comments_fav"
" WHERE PubCod=%ld AND UsrCod=%ld",
Com->PubCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
TL_DB_UnmarkCommAsFav (Com->PubCod);
/***** Update number of times this comment is favourited *****/
TL_Fav_GetNumTimesACommHasBeenFav (Com);