Version 20.33.3: Feb 22, 2021 Code refactoring in timeline related to forms.

This commit is contained in:
acanas 2021-02-22 10:03:36 +01:00
parent 9db2439bae
commit ac2a4b5339
5 changed files with 15 additions and 12 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.33.2 (2021-02-22)"
#define Log_PLATFORM_VERSION "SWAD 20.33.3 (2021-02-22)"
#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.33.3: Feb 22, 2021 Code refactoring in timeline related to forms. (304882 lines)
Version 20.33.2: Feb 22, 2021 Code refactoring in timeline related to forms. (304880 lines)
Version 20.33.1: Feb 22, 2021 Code refactoring in timeline related to forms. (304888 lines)
Version 20.33: Feb 21, 2021 New module swad_timeline_form. (304866 lines)

View File

@ -790,7 +790,6 @@ static void TL_Com_RequestRemovalComment (struct TL_Timeline *Timeline)
extern const char *Txt_The_comment_no_longer_exists;
extern const char *Txt_Do_you_really_want_to_remove_the_following_comment;
struct TL_Com_Comment Com;
bool ItsMe;
/***** Initialize image *****/
Med_MediaConstructor (&Com.Content.Media);
@ -801,12 +800,11 @@ static void TL_Com_RequestRemovalComment (struct TL_Timeline *Timeline)
if (Com.PubCod > 0)
{
ItsMe = Usr_ItsMe (Com.UsrCod);
if (ItsMe) // I am the author of this comment
if (Usr_ItsMe (Com.UsrCod)) // I am the author of this comment
{
/***** Show question and button to remove comment *****/
/* Start alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_comment);
/* Begin alert */
TL_Frm_BeginAlertRemove (Txt_Do_you_really_want_to_remove_the_following_comment);
/* Show comment */
TL_Com_WriteComment (Timeline,&Com,

View File

@ -270,9 +270,14 @@ void TL_Frm_FormToShowHiddenComments (long NotCod,
}
/*****************************************************************************/
/******************* End form to remove note / comment ***********************/
/********************** Form to remove note / comment ************************/
/*****************************************************************************/
void TL_Frm_BeginAlertRemove (const char *QuestionTxt)
{
Ale_ShowAlertAndButton1 (Ale_QUESTION,QuestionTxt);
}
void TL_Frm_EndAlertRemove (struct TL_Timeline *Timeline,TL_Frm_Action_t Action,
void (*FuncParams) (void *Args))
{

View File

@ -87,6 +87,7 @@ void TL_Frm_FormToShowHiddenComments (long NotCod,
char IdComments[Frm_MAX_BYTES_ID + 1],
unsigned NumInitialComments);
void TL_Frm_BeginAlertRemove (const char *QuestionTxt);
void TL_Frm_EndAlertRemove (struct TL_Timeline *Timeline,TL_Frm_Action_t Action,
void (*FuncParams) (void *Args));

View File

@ -1017,7 +1017,6 @@ static void TL_Not_RequestRemovalNote (struct TL_Timeline *Timeline)
extern const char *Txt_The_original_post_no_longer_exists;
extern const char *Txt_Do_you_really_want_to_remove_the_following_post;
struct TL_Not_Note Not;
bool ItsMe;
/***** Get data of note *****/
Not.NotCod = TL_Not_GetParamNotCod ();
@ -1025,12 +1024,11 @@ static void TL_Not_RequestRemovalNote (struct TL_Timeline *Timeline)
if (Not.NotCod > 0)
{
ItsMe = Usr_ItsMe (Not.UsrCod);
if (ItsMe) // I am the author of this note
if (Usr_ItsMe (Not.UsrCod)) // I am the author of this note
{
/***** Show question and button to remove note *****/
/* Start alert */
Ale_ShowAlertAndButton1 (Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_following_post);
/* Begin alert */
TL_Frm_BeginAlertRemove (Txt_Do_you_really_want_to_remove_the_following_post);
/* Show note */
TL_Not_WriteNote (Timeline,&Not,