Version 23.0.1: Sep 11, 2023 Code refactoring related to hidden-visible.

This commit is contained in:
acanas 2023-09-11 22:28:56 +02:00
parent f1b5cd4537
commit 3d6ed1ffc9
13 changed files with 23 additions and 34 deletions

View File

@ -1080,8 +1080,7 @@ static void Agd_GetventDataByCod (struct Agd_Event *AgdEvent)
/* Get whether the event is public or not (row[1]) /* Get whether the event is public or not (row[1])
and whether it is hidden or not (row[2]) */ and whether it is hidden or not (row[2]) */
AgdEvent->Public = (row[1][0] == 'Y'); AgdEvent->Public = (row[1][0] == 'Y');
AgdEvent->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : AgdEvent->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]);
HidVis_VISIBLE;
/* Get start date (row[3]) and end date (row[4]) in UTC time */ /* Get start date (row[3]) and end date (row[4]) in UTC time */
AgdEvent->TimeUTC[Dat_STR_TIME] = Dat_GetUNIXTimeFromStr (row[3]); AgdEvent->TimeUTC[Dat_STR_TIME] = Dat_GetUNIXTimeFromStr (row[3]);

View File

@ -881,8 +881,7 @@ static void Asg_GetAssignmentDataFromRow (MYSQL_RES **mysql_res,
Asg->AsgCod = Str_ConvertStrCodToLongCod (row[0]); Asg->AsgCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get whether the assignment is hidden or not (row[1]) */ /* Get whether the assignment is hidden or not (row[1]) */
Asg->HiddenOrVisible = (row[1][0] == 'Y') ? HidVis_HIDDEN : Asg->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[1][0]);
HidVis_VISIBLE;
/* Get author of the assignment (row[2]) */ /* Get author of the assignment (row[2]) */
Asg->UsrCod = Str_ConvertStrCodToLongCod (row[2]); Asg->UsrCod = Str_ConvertStrCodToLongCod (row[2]);

View File

@ -764,8 +764,7 @@ void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event)
Event->CrsCod = Str_ConvertStrCodToLongCod (row[1]); Event->CrsCod = Str_ConvertStrCodToLongCod (row[1]);
/***** Get whether the attendance event is hidden or not (row[2]) *****/ /***** Get whether the attendance event is hidden or not (row[2]) *****/
Event->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : Event->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]);
HidVis_VISIBLE;
/***** Get author of the attendance event (row[3]) *****/ /***** Get author of the attendance event (row[3]) *****/
Event->UsrCod = Str_ConvertStrCodToLongCod (row[3]); Event->UsrCod = Str_ConvertStrCodToLongCod (row[3]);

View File

@ -342,8 +342,7 @@ static void Ban_GetBannerDataFromRow (MYSQL_RES *mysql_res,
Err_WrongBannerExit (); Err_WrongBannerExit ();
/***** Get if the banner is hidden (row[1]) *****/ /***** Get if the banner is hidden (row[1]) *****/
Ban->HiddenOrVisible = (row[1][0] == 'Y') ? HidVis_HIDDEN : Ban->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[1][0]);
HidVis_VISIBLE;
/***** Get short name (row[2]), full name (row[3]), /***** Get short name (row[2]), full name (row[3]),
image (row[4]) and URL (row[5]) of the banner *****/ image (row[4]) and URL (row[5]) of the banner *****/

View File

@ -4515,7 +4515,8 @@ static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *R
switch (HiddenOrVisible) switch (HiddenOrVisible)
{ {
case HidVis_HIDDEN: case HidVis_HIDDEN:
HTM_DIV_Begin ("id=\"contract_%s_%s\" style=\"display:none;\"", HTM_DIV_Begin ("id=\"contract_%s_%s\" class=\"NOT_SHOWN\"",
// HTM_DIV_Begin ("id=\"contract_%s_%s\" style=\"display:none;\"",
FileBrowserId,RowId); FileBrowserId,RowId);
break; break;
case HidVis_VISIBLE: case HidVis_VISIBLE:
@ -7458,8 +7459,7 @@ HidVis_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/* File is hidden? (row[0]) */ /* File is hidden? (row[0]) */
HiddenOrVisible = (row[0][0] == 'Y') ? HidVis_HIDDEN : HiddenOrVisible = HidVid_GetHiddenOrVisible (row[0][0]);
HidVis_VISIBLE;
} }
else else
{ {

View File

@ -628,11 +628,15 @@ TODO: Emilce Barrera Mesa: Quiero preguntarte si es posible que me habilites la
TODO: Emilce Barrera Mesa: Podrías agregar por favor una opción que me permita exportar en excel, cvs o pdf el listado de estudiantes y la nota optenida en el examen. Eso me ayudaría mucho a la hora de pegarlas en mi planilla de excel. TODO: Emilce Barrera Mesa: Podrías agregar por favor una opción que me permita exportar en excel, cvs o pdf el listado de estudiantes y la nota optenida en el examen. Eso me ayudaría mucho a la hora de pegarlas en mi planilla de excel.
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
TODO: Francisco Javier Fernández Baldomero: intento mandar un mensaje a un estudiante vacío sin nickname, que se debe haber creado hoy mismo otro usuario con DNI distinto y nickname
Me sale este error, no si por no recordar yo la sintaxis apropiada para mandar a varios destinatarios. ¿No era así?
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.0 (2023-09-11)" #define Log_PLATFORM_VERSION "SWAD 23.0.1 (2023-09-11)"
#define CSS_FILE "swad22.120.4.css" #define CSS_FILE "swad22.120.4.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 23.0.1: Sep 11, 2023 Code refactoring related to hidden-visible. (337586 lines)
Version 23.0: Sep 11, 2023 Code refactoring related to hidden-visible. (337588 lines) Version 23.0: Sep 11, 2023 Code refactoring related to hidden-visible. (337588 lines)
Version 22.120.17:Sep 10, 2023 Code refactoring related to hidden-visible in surveys. (337563 lines) Version 22.120.17:Sep 10, 2023 Code refactoring related to hidden-visible in surveys. (337563 lines)
Version 22.120.16:Sep 10, 2023 Code refactoring in project visibility. (337575 lines) Version 22.120.16:Sep 10, 2023 Code refactoring in project visibility. (337575 lines)

View File

@ -896,8 +896,7 @@ void Exa_GetExamDataByCod (struct Exa_Exam *Exam)
Exam->CrsCod = Str_ConvertStrCodToLongCod (row[1]); Exam->CrsCod = Str_ConvertStrCodToLongCod (row[1]);
/* Get whether the exam is hidden (row[2]) */ /* Get whether the exam is hidden (row[2]) */
Exam->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : Exam->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]);
HidVis_VISIBLE;
/* Get author of the exam (row[3]) */ /* Get author of the exam (row[3]) */
Exam->UsrCod = Str_ConvertStrCodToLongCod (row[3]); Exam->UsrCod = Str_ConvertStrCodToLongCod (row[3]);

View File

@ -758,8 +758,7 @@ static void ExaSes_GetSessionDataFromRow (MYSQL_RES *mysql_res,
Err_WrongExamExit (); Err_WrongExamExit ();
/* Get whether the session is hidden (row[2]) */ /* Get whether the session is hidden (row[2]) */
Session->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : Session->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]);
HidVis_VISIBLE;
/* Get session teacher (row[3]) */ /* Get session teacher (row[3]) */
Session->UsrCod = Str_ConvertStrCodToLongCod (row[3]); Session->UsrCod = Str_ConvertStrCodToLongCod (row[3]);

View File

@ -952,8 +952,7 @@ void Gam_GetGameDataByCod (struct Gam_Game *Game)
Game->CrsCod = Str_ConvertStrCodToLongCod (row[1]); Game->CrsCod = Str_ConvertStrCodToLongCod (row[1]);
/* Get whether the game is hidden (row[2]) */ /* Get whether the game is hidden (row[2]) */
Game->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : Game->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]);
HidVis_VISIBLE;
/* Get author of the game (row[3]) */ /* Get author of the game (row[3]) */
Game->UsrCod = Str_ConvertStrCodToLongCod (row[3]); Game->UsrCod = Str_ConvertStrCodToLongCod (row[3]);

View File

@ -1188,8 +1188,7 @@ void Prg_GetListItems (void)
Prg_Gbl.List.Items[NumItem].Level = Str_ConvertStrToUnsigned (row[2]); Prg_Gbl.List.Items[NumItem].Level = Str_ConvertStrToUnsigned (row[2]);
/* Get whether the program item is hidden or not (row[3]) */ /* Get whether the program item is hidden or not (row[3]) */
Prg_Gbl.List.Items[NumItem].HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : Prg_Gbl.List.Items[NumItem].HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]);
HidVis_VISIBLE;
} }
} }
@ -1257,8 +1256,7 @@ static void Prg_GetItemDataFromRow (MYSQL_RES **mysql_res,
Item->Hierarchy.Level = Str_ConvertStrToUnsigned (row[2]); Item->Hierarchy.Level = Str_ConvertStrToUnsigned (row[2]);
/* Get whether the program item is hidden or not (row[3]) */ /* Get whether the program item is hidden or not (row[3]) */
Item->Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : Item->Hierarchy.HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]);
HidVis_VISIBLE;
/* Get author of the program item (row[4]) */ /* Get author of the program item (row[4]) */
Item->UsrCod = Str_ConvertStrCodToLongCod (row[4]); Item->UsrCod = Str_ConvertStrCodToLongCod (row[4]);

View File

@ -352,8 +352,7 @@ static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res,
Item->Resource.Hierarchy.RscInd = Str_ConvertStrToUnsigned (row[2]); Item->Resource.Hierarchy.RscInd = Str_ConvertStrToUnsigned (row[2]);
/***** Get whether the program item is hidden (row(3)) *****/ /***** Get whether the program item is hidden (row(3)) *****/
Item->Resource.Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : Item->Resource.Hierarchy.HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]);
HidVis_VISIBLE;
/***** Get link type and code (row[4], row[5]) *****/ /***** Get link type and code (row[4], row[5]) *****/
Item->Resource.Link.Type = Rsc_GetTypeFromString (row[4]); Item->Resource.Link.Type = Rsc_GetTypeFromString (row[4]);

View File

@ -3370,8 +3370,7 @@ void Prj_GetProjectDataByCod (struct Prj_Project *Prj)
and whether the project is assigned or not (row[5]) */ and whether the project is assigned or not (row[5]) */
Prj->Locked = (row[3][0] == 'Y') ? Prj_LOCKED : Prj->Locked = (row[3][0] == 'Y') ? Prj_LOCKED :
Prj_UNLOCKED; Prj_UNLOCKED;
Prj->Hidden = (row[4][0] == 'Y') ? HidVis_HIDDEN : Prj->Hidden = HidVid_GetHiddenOrVisible (row[4][0]);
HidVis_VISIBLE;
Prj->Assigned = (row[5][0] == 'Y') ? Prj_ASSIGNED : Prj->Assigned = (row[5][0] == 'Y') ? Prj_ASSIGNED :
Prj_NONASSIG; Prj_NONASSIG;

View File

@ -1147,8 +1147,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy)
Svy->HieCod = Str_ConvertStrCodToLongCod (row[2]); Svy->HieCod = Str_ConvertStrCodToLongCod (row[2]);
/* Get whether the survey is hidden (row[3]) */ /* Get whether the survey is hidden (row[3]) */
Svy->Status.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : Svy->Status.HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]);
HidVis_VISIBLE;
/* Get roles (row[4]) */ /* Get roles (row[4]) */
if (sscanf (row[4],"%u",&Svy->Roles) != 1) if (sscanf (row[4],"%u",&Svy->Roles) != 1)
@ -2120,15 +2119,11 @@ static void Svy_CreateGrps (long SvyCod)
static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy) static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy)
{ {
extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE];
extern const char *Txt_Group; extern const char *Txt_Group;
extern const char *Txt_Groups; extern const char *Txt_Groups;
extern const char *Txt_and; extern const char *Txt_and;
extern const char *Txt_The_whole_course; extern const char *Txt_The_whole_course;
static const char *GroupClass[HidVis_NUM_HIDDEN_VISIBLE] =
{
[HidVis_HIDDEN ] = "ASG_GRP_LIGHT",
[HidVis_VISIBLE] = "ASG_GRP",
};
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
MYSQL_ROW row; MYSQL_ROW row;
unsigned NumGrps; unsigned NumGrps;
@ -2139,7 +2134,8 @@ static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy)
/***** Write heading *****/ /***** Write heading *****/
HTM_DIV_Begin ("class=\"%s_%s\"", HTM_DIV_Begin ("class=\"%s_%s\"",
GroupClass[Svy->Status.HiddenOrVisible],The_GetSuffix ()); HidVis_GroupClass[Svy->Status.HiddenOrVisible],
The_GetSuffix ());
HTM_TxtColonNBSP (NumGrps == 1 ? Txt_Group : HTM_TxtColonNBSP (NumGrps == 1 ? Txt_Group :
Txt_Groups); Txt_Groups);