Version 20.36.47: Mar 01, 2021 Query moved to module swad_timeline_database.

This commit is contained in:
acanas 2021-03-01 16:54:18 +01:00
parent 64e2fc804a
commit 689fcce5d2
4 changed files with 29 additions and 11 deletions

View File

@ -552,11 +552,8 @@ enscript -2 --landscape --file-align=2 --highlight --line-numbers -o - * > swad1
enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * > swad17.26.7_color_2_columnas.ps
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 20.36.46 (2021-03-01)"
#define CSS_FILE "swad20.33.9.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Juan Miguel Boyero Corral: Este verano ha habido varias personas que han solicitado incluir la funcionalidad del apartado de Actividades en SWADroid. Si lo ves viable podríamos estudiarlo.
TODO: José Martínez Aroza: Si estoy viendo la lista de trabajos de un grupo de estudiantes y pulso F5 (reenviando datos) entonces sale el listado duplicado, y la siguiente vez triplicado, etc.
@ -600,7 +597,12 @@ 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
*/
#define Log_PLATFORM_VERSION "SWAD 20.36.47 (2021-03-01)"
#define CSS_FILE "swad20.33.9.css"
#define JS_FILE "swad20.6.2.js"
/*
Version 20.36.47: Mar 01, 2021 Query moved to module swad_timeline_database. (305543 lines)
Version 20.36.46: Mar 01, 2021 Fixed bugs in timeline. (305529 lines)
Version 20.36.45: Mar 01, 2021 Queries moved to module swad_timeline_database. (305528 lines)
Version 20.36.44: Mar 01, 2021 Query moved to module swad_timeline_database. (305516 lines)

View File

@ -77,6 +77,21 @@ static long TL_DB_GetMedCodFromPub (long PubCod,const char *DBTable);
/*****************************************************************************/
// Returns the number of rows got
unsigned TL_DB_GetWho (MYSQL_RES **mysql_res)
{
/***** Get which users from database *****/
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get timeline users",
"SELECT TimelineUsrs" // row[0]
" FROM usr_last WHERE UsrCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/********************* Get data of note using its code ***********************/
/*****************************************************************************/
// Returns the number of rows got
unsigned TL_DB_GetDataOfNoteByCod (long NotCod,MYSQL_RES **mysql_res)
{
/***** Trivial check: note code should be > 0 *****/

View File

@ -47,6 +47,9 @@
/****************************** Public prototypes ****************************/
/*****************************************************************************/
/****************************** Timeline from who ****************************/
unsigned TL_DB_GetWho (MYSQL_RES **mysql_res);
/*********************************** Notes ***********************************/
unsigned TL_DB_GetDataOfNoteByCod (long NotCod,MYSQL_RES **mysql_res);
long TL_DB_GetPubCodOfOriginalNote (long NotCod);
@ -71,7 +74,7 @@ void TL_DB_RemoveNotePubs (long NotCod);
void TL_DB_RemoveNote (long NotCod);
void TL_DB_RemoveAllNotesUsr (long UsrCod);
/********************************** Posts ************************************/
/********************************* Posts *************************************/
unsigned TL_DB_GetPostByCod (long PstCod,MYSQL_RES **mysql_res);
long TL_DB_GetMedCodFromPost (long PubCod);
long TL_DB_CreateNewPost (const struct TL_Pst_PostContent *Content);

View File

@ -31,6 +31,7 @@
#include "swad_parameter.h"
#include "swad_setting.h"
#include "swad_timeline.h"
#include "swad_timeline_database.h"
#include "swad_timeline_who.h"
/*****************************************************************************/
@ -134,10 +135,7 @@ static Usr_Who_t TL_Who_GetWhoFromDB (void)
Usr_Who_t Who = Usr_WHO_UNKNOWN;
/***** Get which users from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get timeline users from user's last data",
"SELECT TimelineUsrs" // row[0]
" FROM usr_last WHERE UsrCod=%ld",
Gbl.Usrs.Me.UsrDat.UsrCod) == 1)
if (TL_DB_GetWho (&mysql_res) == 1)
{
row = mysql_fetch_row (mysql_res);