diff --git a/swad_agenda.c b/swad_agenda.c index 7e1b6efb..c8a5f7ed 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -1080,8 +1080,7 @@ static void Agd_GetventDataByCod (struct Agd_Event *AgdEvent) /* Get whether the event is public or not (row[1]) and whether it is hidden or not (row[2]) */ AgdEvent->Public = (row[1][0] == 'Y'); - AgdEvent->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + AgdEvent->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]); /* Get start date (row[3]) and end date (row[4]) in UTC time */ AgdEvent->TimeUTC[Dat_STR_TIME] = Dat_GetUNIXTimeFromStr (row[3]); diff --git a/swad_assignment.c b/swad_assignment.c index 22e149c6..f4887e3b 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -881,8 +881,7 @@ static void Asg_GetAssignmentDataFromRow (MYSQL_RES **mysql_res, Asg->AsgCod = Str_ConvertStrCodToLongCod (row[0]); /* Get whether the assignment is hidden or not (row[1]) */ - Asg->HiddenOrVisible = (row[1][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Asg->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[1][0]); /* Get author of the assignment (row[2]) */ Asg->UsrCod = Str_ConvertStrCodToLongCod (row[2]); diff --git a/swad_attendance.c b/swad_attendance.c index a5b40089..80e29ed3 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -764,8 +764,7 @@ void Att_GetEventDataFromRow (MYSQL_ROW row,struct Att_Event *Event) Event->CrsCod = Str_ConvertStrCodToLongCod (row[1]); /***** Get whether the attendance event is hidden or not (row[2]) *****/ - Event->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Event->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]); /***** Get author of the attendance event (row[3]) *****/ Event->UsrCod = Str_ConvertStrCodToLongCod (row[3]); diff --git a/swad_banner.c b/swad_banner.c index ef418c85..bd79ba79 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -342,8 +342,7 @@ static void Ban_GetBannerDataFromRow (MYSQL_RES *mysql_res, Err_WrongBannerExit (); /***** Get if the banner is hidden (row[1]) *****/ - Ban->HiddenOrVisible = (row[1][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Ban->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[1][0]); /***** Get short name (row[2]), full name (row[3]), image (row[4]) and URL (row[5]) of the banner *****/ diff --git a/swad_browser.c b/swad_browser.c index 62556f56..4bb61c05 100644 --- a/swad_browser.c +++ b/swad_browser.c @@ -4515,7 +4515,8 @@ static void Brw_PutIconToContractFolder (const char *FileBrowserId,const char *R switch (HiddenOrVisible) { 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); break; case HidVis_VISIBLE: @@ -7458,8 +7459,7 @@ HidVis_HiddenOrVisible_t Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_ row = mysql_fetch_row (mysql_res); /* File is hidden? (row[0]) */ - HiddenOrVisible = (row[0][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + HiddenOrVisible = HidVid_GetHiddenOrVisible (row[0][0]); } else { diff --git a/swad_changelog.h b/swad_changelog.h index 6de072a1..ad927017 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -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: 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 sé 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 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 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) diff --git a/swad_exam.c b/swad_exam.c index 17fc02e7..65d281a1 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -896,8 +896,7 @@ void Exa_GetExamDataByCod (struct Exa_Exam *Exam) Exam->CrsCod = Str_ConvertStrCodToLongCod (row[1]); /* Get whether the exam is hidden (row[2]) */ - Exam->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Exam->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]); /* Get author of the exam (row[3]) */ Exam->UsrCod = Str_ConvertStrCodToLongCod (row[3]); diff --git a/swad_exam_session.c b/swad_exam_session.c index f39afc6c..2493889b 100644 --- a/swad_exam_session.c +++ b/swad_exam_session.c @@ -758,8 +758,7 @@ static void ExaSes_GetSessionDataFromRow (MYSQL_RES *mysql_res, Err_WrongExamExit (); /* Get whether the session is hidden (row[2]) */ - Session->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Session->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]); /* Get session teacher (row[3]) */ Session->UsrCod = Str_ConvertStrCodToLongCod (row[3]); diff --git a/swad_game.c b/swad_game.c index b4abc3cc..c29a8434 100644 --- a/swad_game.c +++ b/swad_game.c @@ -952,8 +952,7 @@ void Gam_GetGameDataByCod (struct Gam_Game *Game) Game->CrsCod = Str_ConvertStrCodToLongCod (row[1]); /* Get whether the game is hidden (row[2]) */ - Game->HiddenOrVisible = (row[2][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Game->HiddenOrVisible = HidVid_GetHiddenOrVisible (row[2][0]); /* Get author of the game (row[3]) */ Game->UsrCod = Str_ConvertStrCodToLongCod (row[3]); diff --git a/swad_program.c b/swad_program.c index c8d2bbcf..5f2ad6a9 100644 --- a/swad_program.c +++ b/swad_program.c @@ -1188,8 +1188,7 @@ void Prg_GetListItems (void) Prg_Gbl.List.Items[NumItem].Level = Str_ConvertStrToUnsigned (row[2]); /* Get whether the program item is hidden or not (row[3]) */ - Prg_Gbl.List.Items[NumItem].HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Prg_Gbl.List.Items[NumItem].HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]); } } @@ -1257,8 +1256,7 @@ static void Prg_GetItemDataFromRow (MYSQL_RES **mysql_res, Item->Hierarchy.Level = Str_ConvertStrToUnsigned (row[2]); /* Get whether the program item is hidden or not (row[3]) */ - Item->Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Item->Hierarchy.HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]); /* Get author of the program item (row[4]) */ Item->UsrCod = Str_ConvertStrCodToLongCod (row[4]); diff --git a/swad_program_resource.c b/swad_program_resource.c index ffd6fabe..ff250710 100644 --- a/swad_program_resource.c +++ b/swad_program_resource.c @@ -352,8 +352,7 @@ static void PrgRsc_GetResourceDataFromRow (MYSQL_RES *mysql_res, Item->Resource.Hierarchy.RscInd = Str_ConvertStrToUnsigned (row[2]); /***** Get whether the program item is hidden (row(3)) *****/ - Item->Resource.Hierarchy.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Item->Resource.Hierarchy.HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]); /***** Get link type and code (row[4], row[5]) *****/ Item->Resource.Link.Type = Rsc_GetTypeFromString (row[4]); diff --git a/swad_project.c b/swad_project.c index 401d7c18..018af57a 100644 --- a/swad_project.c +++ b/swad_project.c @@ -3370,8 +3370,7 @@ void Prj_GetProjectDataByCod (struct Prj_Project *Prj) and whether the project is assigned or not (row[5]) */ Prj->Locked = (row[3][0] == 'Y') ? Prj_LOCKED : Prj_UNLOCKED; - Prj->Hidden = (row[4][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Prj->Hidden = HidVid_GetHiddenOrVisible (row[4][0]); Prj->Assigned = (row[5][0] == 'Y') ? Prj_ASSIGNED : Prj_NONASSIG; diff --git a/swad_survey.c b/swad_survey.c index dccb73fe..b702948e 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -1147,8 +1147,7 @@ void Svy_GetSurveyDataByCod (struct Svy_Survey *Svy) Svy->HieCod = Str_ConvertStrCodToLongCod (row[2]); /* Get whether the survey is hidden (row[3]) */ - Svy->Status.HiddenOrVisible = (row[3][0] == 'Y') ? HidVis_HIDDEN : - HidVis_VISIBLE; + Svy->Status.HiddenOrVisible = HidVid_GetHiddenOrVisible (row[3][0]); /* Get roles (row[4]) */ 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) { + extern const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE]; extern const char *Txt_Group; extern const char *Txt_Groups; extern const char *Txt_and; 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_ROW row; unsigned NumGrps; @@ -2139,7 +2134,8 @@ static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy) /***** Write heading *****/ 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 : Txt_Groups);