Version20.29.2

This commit is contained in:
acanas 2021-02-11 20:41:31 +01:00
parent 66bcd78571
commit b462d78670
4 changed files with 66 additions and 38 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.29.1 (2021-02-11)"
#define Log_PLATFORM_VERSION "SWAD 20.29.2 (2021-02-11)"
#define CSS_FILE "swad20.8.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.29.2: Feb 11, 2021 Code refactoring in timeline. (305806 lines)
Version 20.29.1: Feb 11, 2021 Code refactoring in timeline. (305780 lines)
Version 20.29: Feb 11, 2021 New module swad_timeline_notification. (305767 lines)
Version 20.28: Feb 11, 2021 New module swad_timeline_user. (305675 lines)

View File

@ -431,7 +431,6 @@ void For_ResetForums (struct For_Forums *Forums)
Forums->Thread.ToMove = -1L;
Forums->PstCod = -1L;
}
/*****************************************************************************/

View File

@ -573,6 +573,7 @@ static void TL_Com_WriteComment (struct TL_Timeline *Timeline,
if (ShowCommentAlone == TL_SHOW_ALONE)
{
/***** Box begin *****/
Box_BoxBegin (NULL,NULL,
NULL,NULL,
NULL,Box_NOT_CLOSABLE);
@ -657,6 +658,7 @@ static void TL_Com_WriteComment (struct TL_Timeline *Timeline,
if (ShowCommentAlone == TL_SHOW_ALONE)
{
/***** Box end *****/
HTM_UL_End ();
HTM_DIV_End ();
Box_BoxEnd ();

View File

@ -68,6 +68,14 @@ extern struct Globals Gbl;
static void TL_Not_WriteTopMessage (TL_TopMessage_t TopMessage,long PublisherCod);
static void TL_Not_GetLocationInHierarchy (const struct TL_Not_Note *Not,
struct Ins_Instit *Ins,
struct Ctr_Centre *Ctr,
struct Deg_Degree *Deg,
struct Crs_Course *Crs,
struct For_Forum *Forum,
char ForumName[For_MAX_BYTES_FORUM_NAME + 1]);
static void TL_Not_PutFormGoToAction (const struct TL_Not_Note *Not,
const struct For_Forums *Forums);
@ -208,6 +216,7 @@ void TL_Not_WriteNote (struct TL_Timeline *Timeline,
/***** Begin box ****/
if (ShowNoteAlone == TL_SHOW_ALONE)
{
/***** Box begin *****/
Box_BoxBegin (NULL,NULL,
NULL,NULL,
NULL,Box_CLOSABLE);
@ -275,42 +284,8 @@ void TL_Not_WriteNote (struct TL_Timeline *Timeline,
/* Get location in hierarchy */
if (!Not->Unavailable)
switch (Not->NoteType)
{
case TL_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE:
/* Get institution data */
Ins.InsCod = Not->HieCod;
Ins_GetDataOfInstitutionByCod (&Ins);
break;
case TL_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE:
/* Get centre data */
Ctr.CtrCod = Not->HieCod;
Ctr_GetDataOfCentreByCod (&Ctr);
break;
case TL_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE:
/* Get degree data */
Deg.DegCod = Not->HieCod;
Deg_GetDataOfDegreeByCod (&Deg);
break;
case TL_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE:
case TL_NOTE_EXAM_ANNOUNCEMENT:
case TL_NOTE_NOTICE:
/* Get course data */
Crs.CrsCod = Not->HieCod;
Crs_GetDataOfCourseByCod (&Crs);
break;
case TL_NOTE_FORUM_POST:
/* Get forum type of the post */
For_GetForumTypeAndLocationOfAPost (Not->Cod,&Forums.Forum);
For_SetForumName (&Forums.Forum,ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language
break;
default:
break;
}
TL_Not_GetLocationInHierarchy (Not,&Ins,&Ctr,&Deg,&Crs,
&Forums.Forum,ForumName);
/* Write note type */
TL_Not_PutFormGoToAction (Not,&Forums);
@ -432,6 +407,7 @@ void TL_Not_WriteNote (struct TL_Timeline *Timeline,
/***** End box ****/
if (ShowNoteAlone == TL_SHOW_ALONE)
{
/***** Box end *****/
HTM_UL_End ();
Box_BoxEnd ();
}
@ -500,6 +476,56 @@ void TL_Not_WriteAuthorNote (const struct UsrData *UsrDat)
Frm_EndForm ();
}
/*****************************************************************************/
/*************** Write name and nickname of author of a note *****************/
/*****************************************************************************/
static void TL_Not_GetLocationInHierarchy (const struct TL_Not_Note *Not,
struct Ins_Instit *Ins,
struct Ctr_Centre *Ctr,
struct Deg_Degree *Deg,
struct Crs_Course *Crs,
struct For_Forum *Forum,
char ForumName[For_MAX_BYTES_FORUM_NAME + 1])
{
switch (Not->NoteType)
{
case TL_NOTE_INS_DOC_PUB_FILE:
case TL_NOTE_INS_SHA_PUB_FILE:
/* Get institution data */
Ins->InsCod = Not->HieCod;
Ins_GetDataOfInstitutionByCod (Ins);
break;
case TL_NOTE_CTR_DOC_PUB_FILE:
case TL_NOTE_CTR_SHA_PUB_FILE:
/* Get centre data */
Ctr->CtrCod = Not->HieCod;
Ctr_GetDataOfCentreByCod (Ctr);
break;
case TL_NOTE_DEG_DOC_PUB_FILE:
case TL_NOTE_DEG_SHA_PUB_FILE:
/* Get degree data */
Deg->DegCod = Not->HieCod;
Deg_GetDataOfDegreeByCod (Deg);
break;
case TL_NOTE_CRS_DOC_PUB_FILE:
case TL_NOTE_CRS_SHA_PUB_FILE:
case TL_NOTE_EXAM_ANNOUNCEMENT:
case TL_NOTE_NOTICE:
/* Get course data */
Crs->CrsCod = Not->HieCod;
Crs_GetDataOfCourseByCod (Crs);
break;
case TL_NOTE_FORUM_POST:
/* Get forum type of the post */
For_GetForumTypeAndLocationOfAPost (Not->Cod,Forum);
For_SetForumName (Forum,ForumName,Gbl.Prefs.Language,false); // Set forum name in recipient's language
break;
default:
break;
}
}
/*****************************************************************************/
/************* Put form to go to an action depending on the note *************/
/*****************************************************************************/