Version 23.70.2: Mar 19, 2024 Changes in course info.

This commit is contained in:
acanas 2024-03-19 23:39:54 +01:00
parent 12c503501e
commit de62eb7e5e
3 changed files with 202 additions and 282 deletions

View File

@ -633,10 +633,11 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/
#define Log_PLATFORM_VERSION "SWAD 23.70.1 (2024-03-19)"
#define Log_PLATFORM_VERSION "SWAD 23.70.2 (2024-03-19)"
#define CSS_FILE "swad23.67.2.css"
#define JS_FILE "swad23.53.6.js"
/*
Version 23.70.2: Mar 19, 2024 Changes in course info. (335353 lines)
Version 23.70.1: Mar 19, 2024 Bug fixing in syllabus. (335429 lines)
Version 23.70: Mar 19, 2024 Code refactoring and bug fixing in syllabus. (335413 lines)
Version 23.69: Mar 14, 2024 Actions defined as enum type. (335591 lines)

View File

@ -242,6 +242,14 @@ void Inf_ShowInfo (void)
break;
}
/***** Begin box *****/
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
ICanEdit ? &Gbl.Crs.Info.Type :
NULL,
Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE);
/****** Form to select syllabus *****/
Syl_PutFormWhichSyllabus (Syllabus.WhichSyllabus);
@ -284,17 +292,11 @@ void Inf_ShowInfo (void)
}
if (ShowWarningNoInfo)
{
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
ICanEdit ? &Gbl.Crs.Info.Type :
NULL,
Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE);
Ale_ShowAlert (Ale_INFO,Txt_No_information);
/***** End box *****/
Box_BoxEnd ();
}
}
/*****************************************************************************/
/************************ Put icon to edit course info ***********************/
@ -794,28 +796,6 @@ void Inf_WriteURLIntoTxtBuffer (char TxtBuffer[Cns_MAX_BYTES_WWW + 1])
static void Inf_ShowPage (const char *URL)
{
extern const char *Txt_View_in_a_new_window;
extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
const char *Help[Inf_NUM_TYPES] =
{
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
[Inf_LECTURES ] = Hlp_COURSE_Syllabus,
[Inf_PRACTICALS ] = Hlp_COURSE_Syllabus,
[Inf_BIBLIOGRAPHY ] = Hlp_COURSE_Bibliography,
[Inf_FAQ ] = Hlp_COURSE_FAQ,
[Inf_LINKS ] = Hlp_COURSE_Links,
[Inf_ASSESSMENT ] = Hlp_COURSE_Assessment,
};
/***** Begin box *****/
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
ICanEdit ? &Gbl.Crs.Info.Type :
NULL,
Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE);
/***** Link to view in a new window *****/
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"FORM_OUT_%s BOLD\"",
@ -823,9 +803,6 @@ static void Inf_ShowPage (const char *URL)
Ico_PutIconTextLink ("expand-arrows-alt.svg",Ico_BLACK,
Txt_View_in_a_new_window);
HTM_A_End ();
/***** End box *****/
Box_BoxEnd ();
}
/*****************************************************************************/
@ -1364,19 +1341,6 @@ static bool Inf_CheckAndShowPlainTxt (void)
{
extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT + 1];
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
const char *Help[Inf_NUM_TYPES] =
{
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
[Inf_LECTURES ] = Hlp_COURSE_Syllabus,
[Inf_PRACTICALS ] = Hlp_COURSE_Syllabus,
[Inf_BIBLIOGRAPHY ] = Hlp_COURSE_Bibliography,
[Inf_FAQ ] = Hlp_COURSE_FAQ,
[Inf_LINKS ] = Hlp_COURSE_Links,
[Inf_ASSESSMENT ] = Hlp_COURSE_Assessment,
};
/***** Get info text from database *****/
Inf_GetInfoTxtFromDB (Gbl.Hierarchy.Node[Hie_CRS].HieCod,Gbl.Crs.Info.Type,
@ -1384,14 +1348,6 @@ static bool Inf_CheckAndShowPlainTxt (void)
if (TxtHTML[0])
{
/***** Begin box *****/
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
ICanEdit ? &Gbl.Crs.Info.Type :
NULL,
Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE);
if (Gbl.Crs.Info.Type == Inf_INTRODUCTION ||
Gbl.Crs.Info.Type == Inf_TEACHING_GUIDE)
Lay_WriteHeaderClassPhoto (Vie_VIEW);
@ -1409,9 +1365,6 @@ static bool Inf_CheckAndShowPlainTxt (void)
HTM_DIV_End ();
/***** End box *****/
Box_BoxEnd ();
return true;
}
@ -1453,19 +1406,6 @@ static bool Inf_CheckAndShowRichTxt (void)
char MathJaxURL[PATH_MAX + 1];
char Command[512 + PATH_MAX * 3]; // Command to call the program of preprocessing of photos
int ReturnCode;
bool ICanEdit = (Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM);
const char *Help[Inf_NUM_TYPES] =
{
[Inf_INTRODUCTION ] = Hlp_COURSE_Information_textual_information,
[Inf_TEACHING_GUIDE] = Hlp_COURSE_Guide,
[Inf_LECTURES ] = Hlp_COURSE_Syllabus,
[Inf_PRACTICALS ] = Hlp_COURSE_Syllabus,
[Inf_BIBLIOGRAPHY ] = Hlp_COURSE_Bibliography,
[Inf_FAQ ] = Hlp_COURSE_FAQ,
[Inf_LINKS ] = Hlp_COURSE_Links,
[Inf_ASSESSMENT ] = Hlp_COURSE_Assessment,
};
/***** Get info text from database *****/
Inf_GetInfoTxtFromDB (Gbl.Hierarchy.Node[Hie_CRS].HieCod,Gbl.Crs.Info.Type,
@ -1473,14 +1413,6 @@ static bool Inf_CheckAndShowRichTxt (void)
if (TxtMD[0])
{
/***** Begin box *****/
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
ICanEdit ? Inf_PutIconToEditInfo :
NULL,
ICanEdit ? &Gbl.Crs.Info.Type :
NULL,
Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE);
if (Gbl.Crs.Info.Type == Inf_INTRODUCTION ||
Gbl.Crs.Info.Type == Inf_TEACHING_GUIDE)
Lay_WriteHeaderClassPhoto (Vie_VIEW);
@ -1561,9 +1493,6 @@ static bool Inf_CheckAndShowRichTxt (void)
HTM_DIV_End ();
/***** End box *****/
Box_BoxEnd ();
return true;
}

View File

@ -258,11 +258,6 @@ bool Syl_CheckSyllabus (struct Syl_Syllabus *Syllabus,long CrsCod)
bool Syl_CheckAndShowSyllabus (struct Syl_Syllabus *Syllabus)
{
/***** Get syllabus type *****/
Syllabus->WhichSyllabus = Syl_GetParWhichSyllabus ();
Gbl.Crs.Info.Type = (Syllabus->WhichSyllabus == Syl_LECTURES ? Inf_LECTURES :
Inf_PRACTICALS);
/***** Load syllabus from XML file to memory *****/
Syl_LoadListItemsSyllabusIntoMemory (Syllabus,Gbl.Hierarchy.Node[Hie_CRS].HieCod);
@ -301,13 +296,28 @@ bool Syl_CheckAndShowSyllabus (struct Syl_Syllabus *Syllabus)
void Syl_EditSyllabus (void)
{
extern const char *Hlp_COURSE_Syllabus_edit;
extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
struct Syl_Syllabus Syllabus;
/***** Reset syllabus context *****/
Syl_ResetSyllabus (&Syllabus);
/***** Get syllabus type *****/
Syllabus.WhichSyllabus = Syl_GetParWhichSyllabus ();
Gbl.Crs.Info.Type = (Syllabus.WhichSyllabus == Syl_LECTURES ? Inf_LECTURES :
Inf_PRACTICALS);
/***** Begin box *****/
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
NULL,NULL,
Hlp_COURSE_Syllabus_edit,Box_NOT_CLOSABLE);
/***** Edit syllabus *****/
Syl_CheckAndShowSyllabus (&Syllabus);
/***** End box *****/
Box_BoxEnd ();
}
/*****************************************************************************/
@ -483,17 +493,11 @@ int Syl_ReadLevelItemSyllabus (FILE *XML)
static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
{
extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Hlp_COURSE_Syllabus_edit;
extern const char *Hlp_COURSE_Syllabus;
extern const char *Txt_INFO_TITLE[Inf_NUM_TYPES];
extern const char *Txt_Done;
unsigned NumItem;
int Col;
static const char **HelpLink[Vie_NUM_VIEW_TYPES] =
{
[Vie_VIEW] = &Hlp_COURSE_Syllabus,
[Vie_EDIT] = &Hlp_COURSE_Syllabus_edit,
};
static int NumButtons[Vie_NUM_VIEW_TYPES] =
{
[Vie_VIEW] = 0,
@ -514,17 +518,6 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
Gbl.Action.Act == ActModIteSylLec || Gbl.Action.Act == ActModIteSylPra ||
Gbl.Action.Act == ActRgtIteSylLec || Gbl.Action.Act == ActRgtIteSylPra ||
Gbl.Action.Act == ActLftIteSylLec || Gbl.Action.Act == ActLftIteSylPra);
bool ICanEdit = Gbl.Usrs.Me.Role.Logged == Rol_TCH ||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM;
bool PutIconToEdit = Syllabus->ViewType == Vie_VIEW && ICanEdit;
/***** Begin box *****/
Box_BoxBegin (Txt_INFO_TITLE[Gbl.Crs.Info.Type],
PutIconToEdit ? Inf_PutIconToEditInfo :
NULL,
PutIconToEdit ? &Gbl.Crs.Info.Type :
NULL,
*HelpLink[Syllabus->ViewType],Box_NOT_CLOSABLE);
/***** Begin table *****/
HTM_TABLE_BeginWide ();
@ -575,9 +568,6 @@ static void Syl_ShowSyllabus (struct Syl_Syllabus *Syllabus)
Btn_PutConfirmButton (Txt_Done);
Frm_EndForm ();
}
/***** End box *****/
Box_BoxEnd ();
}
/*****************************************************************************/