From 6278caca95969b2c8f0a787e50e38bb62a680983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 30 Dec 2019 16:35:49 +0100 Subject: [PATCH] Version19.108.3 --- swad_ID.c | 9 +++---- swad_changelog.h | 3 ++- swad_degree.c | 16 +++++------ swad_degree_config.c | 8 +++--- swad_department.c | 14 +++++----- swad_game.c | 14 +++++----- swad_group.c | 27 +++++++++---------- swad_help.c | 64 +++++++++++++++++++------------------------- 8 files changed, 70 insertions(+), 85 deletions(-) diff --git a/swad_ID.c b/swad_ID.c index 05d01a4eb..fb2cd31d7 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -646,14 +646,13 @@ static void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat, } /* User's ID */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - UsrDat->IDs.List[NumID].Confirmed ? Txt_ID_X_confirmed : - Txt_ID_X_not_confirmed, - UsrDat->IDs.List[NumID].ID); HTM_SPAN_Begin ("class=\"%s\" title=\"%s\"", UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" : "USR_ID_NC", - Gbl.Title); + Str_BuildStrMsg (UsrDat->IDs.List[NumID].Confirmed ? Txt_ID_X_confirmed : + Txt_ID_X_not_confirmed, + UsrDat->IDs.List[NumID].ID)); + Str_FreeStrMsg (); HTM_Txt (UsrDat->IDs.List[NumID].ID); HTM_Txt (UsrDat->IDs.List[NumID].Confirmed ? "✓" : ""); diff --git a/swad_changelog.h b/swad_changelog.h index 86eaa51c9..ac8d6db50 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.108.2 (2019-12-30)" +#define Log_PLATFORM_VERSION "SWAD 19.108.3 (2019-12-30)" #define CSS_FILE "swad19.101.5.css" #define JS_FILE "swad19.91.1.js" /* @@ -502,6 +502,7 @@ ps2pdf source.ps destination.pdf Version 19.10x: Dec 30, 2019 Map in country information. (? lines) Version 19.10x: Dec 30, 2019 Map in institution information. (? lines) + Version 19.108.3: Dec 30, 2019 Code refactoring related to printing messages. (249725 lines) Version 19.108.2: Dec 30, 2019 Code refactoring related to printing messages. (249739 lines) Version 19.108.1: Dec 30, 2019 Code refactoring related to printing messages. (249746 lines) Version 19.108: Dec 30, 2019 Code refactoring related to hierarchy. (249730 lines) diff --git a/swad_degree.c b/swad_degree.c index 67b76fc97..612132347 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -763,11 +763,11 @@ static void Deg_ListDegrees (void) unsigned NumDeg; /***** Begin box *****/ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Degrees_of_CENTRE_X, - Gbl.Hierarchy.Ctr.ShrtName); - Box_BoxBegin (NULL,Gbl.Title,Deg_PutIconsListingDegrees, + Box_BoxBegin (NULL,Str_BuildStrMsg (Txt_Degrees_of_CENTRE_X, + Gbl.Hierarchy.Ctr.ShrtName), + Deg_PutIconsListingDegrees, Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE); + Str_FreeStrMsg (); if (Gbl.Hierarchy.Ctr.Degs.Num) // There are degrees in the current centre { @@ -945,11 +945,11 @@ static void Deg_EditDegreesInternal (void) Hie_WriteMenuHierarchy (); /***** Begin box *****/ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Degrees_of_CENTRE_X, - Gbl.Hierarchy.Ctr.ShrtName); - Box_BoxBegin (NULL,Gbl.Title,Deg_PutIconsEditingDegrees, + Box_BoxBegin (NULL,Str_BuildStrMsg (Txt_Degrees_of_CENTRE_X, + Gbl.Hierarchy.Ctr.ShrtName), + Deg_PutIconsEditingDegrees, Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE); + Str_FreeStrMsg (); if (Gbl.DegTypes.Num) { diff --git a/swad_degree_config.c b/swad_degree_config.c index 9c6863660..fcc84bd91 100644 --- a/swad_degree_config.c +++ b/swad_degree_config.c @@ -334,10 +334,10 @@ static void DegCfg_NumCrss (void) HTM_TD_Begin ("class=\"LB\""); Frm_StartFormGoTo (ActSeeCrs); Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod); - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Courses_of_DEGREE_X, - Gbl.Hierarchy.Deg.ShrtName); - HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL); + HTM_BUTTON_SUBMIT_Begin (Str_BuildStrMsg (Txt_Courses_of_DEGREE_X, + Gbl.Hierarchy.Deg.ShrtName), + "BT_LINK DAT",NULL); + Str_FreeStrMsg (); HTM_Unsigned (Crs_GetNumCrssInDeg (Gbl.Hierarchy.Deg.DegCod)); HTM_BUTTON_End (); Frm_EndForm (); diff --git a/swad_department.c b/swad_department.c index 63faf27a7..40f715158 100644 --- a/swad_department.c +++ b/swad_department.c @@ -111,13 +111,12 @@ void Dpt_SeeDepts (void) Dpt_GetListDepartments (Gbl.Hierarchy.Ins.InsCod); /***** Begin box and table *****/ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Departments_of_INSTITUTION_X, - Gbl.Hierarchy.Ins.FullName); - Box_BoxTableBegin (NULL,Gbl.Title, + Box_BoxTableBegin (NULL,Str_BuildStrMsg (Txt_Departments_of_INSTITUTION_X, + Gbl.Hierarchy.Ins.FullName), Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ? Dpt_PutIconToEditDpts : NULL, Hlp_INSTITUTION_Departments,Box_NOT_CLOSABLE,2); + Str_FreeStrMsg (); /***** Write heading *****/ HTM_TR_Begin (NULL); @@ -267,11 +266,10 @@ static void Dpt_EditDepartmentsInternal (void) Dpt_GetListDepartments (Gbl.Hierarchy.Ins.InsCod); /***** Begin box *****/ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Departments_of_INSTITUTION_X, - Gbl.Hierarchy.Ins.FullName); - Box_BoxBegin (NULL,Gbl.Title,NULL, + Box_BoxBegin (NULL,Str_BuildStrMsg (Txt_Departments_of_INSTITUTION_X, + Gbl.Hierarchy.Ins.FullName),NULL, Hlp_INSTITUTION_Departments_edit,Box_NOT_CLOSABLE); + Str_FreeStrMsg (); /***** Put a form to create a new department *****/ Dpt_PutFormToCreateDepartment (); diff --git a/swad_game.c b/swad_game.c index d3de982c3..4bffb4100 100644 --- a/swad_game.c +++ b/swad_game.c @@ -1869,12 +1869,11 @@ static void Gam_ListOneOrMoreQuestionsForEdition (long GamCod,unsigned NumQsts, /* Put icon to move up the question */ if (ICanEditQuestions && QstInd > 1) { - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Move_up_X, - StrQstInd); Lay_PutContextualLinkOnlyIcon (ActUp_GamQst,NULL,Gam_PutParamsOneQst, "arrow-up.svg", - Gbl.Title); + Str_BuildStrMsg (Txt_Move_up_X, + StrQstInd)); + Str_FreeStrMsg (); } else Ico_PutIconOff ("arrow-up.svg",Txt_Movement_not_allowed); @@ -1882,12 +1881,11 @@ static void Gam_ListOneOrMoreQuestionsForEdition (long GamCod,unsigned NumQsts, /* Put icon to move down the question */ if (ICanEditQuestions && QstInd < MaxQstInd) { - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Move_down_X, - StrQstInd); Lay_PutContextualLinkOnlyIcon (ActDwnGamQst,NULL,Gam_PutParamsOneQst, "arrow-down.svg", - Gbl.Title); + Str_BuildStrMsg (Txt_Move_down_X, + StrQstInd)); + Str_FreeStrMsg (); } else Ico_PutIconOff ("arrow-down.svg",Txt_Movement_not_allowed); diff --git a/swad_group.c b/swad_group.c index ec0da9f6c..d94792f95 100644 --- a/swad_group.c +++ b/swad_group.c @@ -1507,13 +1507,12 @@ static void Grp_ListGroupsForEdition (void) ActOpeGrp, Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (Grp->GrpCod); - snprintf (Gbl.Title,sizeof (Gbl.Title), - Grp->Open ? Txt_Group_X_open_click_to_close_it : - Txt_Group_X_closed_click_to_open_it, - Grp->GrpName); Ico_PutIconLink (Grp->Open ? "unlock.svg" : "lock.svg", - Gbl.Title); + Str_BuildStrMsg (Grp->Open ? Txt_Group_X_open_click_to_close_it : + Txt_Group_X_closed_click_to_open_it, + Grp->GrpName)); + Str_FreeStrMsg (); Frm_EndForm (); HTM_TD_End (); @@ -1523,13 +1522,12 @@ static void Grp_ListGroupsForEdition (void) ActEnaFilZonGrp, Grp_GROUPS_SECTION_ID); Grp_PutParamGrpCod (Grp->GrpCod); - snprintf (Gbl.Title,sizeof (Gbl.Title), - Grp->FileZones ? Txt_File_zones_of_the_group_X_enabled_click_to_disable_them : - Txt_File_zones_of_the_group_X_disabled_click_to_enable_them, - Grp->GrpName); Ico_PutIconLink (Grp->FileZones ? "folder-open-green.svg" : "folder-red.svg", - Gbl.Title); + Str_BuildStrMsg (Grp->FileZones ? Txt_File_zones_of_the_group_X_enabled_click_to_disable_them : + Txt_File_zones_of_the_group_X_disabled_click_to_enable_them, + Grp->GrpName)); + Str_FreeStrMsg (); Frm_EndForm (); HTM_TD_End (); @@ -2377,17 +2375,16 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight) char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; /***** Write icon to show if group is open or closed *****/ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Grp->Open ? Txt_Group_X_open : - Txt_Group_X_closed, - Grp->GrpName); if (Highlight) HTM_TD_Begin ("class=\"BM LIGHT_BLUE\""); else HTM_TD_Begin ("class=\"BM\""); Ico_PutIconOff (Grp->Open ? "unlock.svg" : "lock.svg", - Gbl.Title); + Str_BuildStrMsg (Grp->Open ? Txt_Group_X_open : + Txt_Group_X_closed, + Grp->GrpName)); + Str_FreeStrMsg (); HTM_TD_End (); /***** Group name *****/ diff --git a/swad_help.c b/swad_help.c index 0094d61f9..42efdd42e 100644 --- a/swad_help.c +++ b/swad_help.c @@ -141,23 +141,21 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void) if (ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role] != ActUnk) { /* Request my removing from this course */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Remove_me_from_THE_COURSE_X, - Gbl.Hierarchy.Crs.ShrtName); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_Remove_me_from_THE_COURSE_X, + Gbl.Hierarchy.Crs.ShrtName), ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role], Btn_REMOVE_BUTTON,Txt_Remove_me); + Str_FreeStrMsg (); } } else // I do not belong to this course { /* Request my registration in this course */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Register_me_in_X, - Gbl.Hierarchy.Crs.ShrtName); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_Register_me_in_X, + Gbl.Hierarchy.Crs.ShrtName), ActReqSignUp, Btn_CREATE_BUTTON,Txt_Sign_up); + Str_FreeStrMsg (); } } @@ -168,12 +166,11 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void) Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role == Rol_TCH) // I am a teacher in current course { /* Request students enrolment */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Register_students_in_COURSE_X, - Gbl.Hierarchy.Crs.ShrtName); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_Register_students_in_COURSE_X, + Gbl.Hierarchy.Crs.ShrtName), ActReqEnrSevStd, Btn_CREATE_BUTTON,Txt_Register_students); + Str_FreeStrMsg (); } if (Gbl.Action.Act != ActMyCrs) // I am not seeing the action to list my courses @@ -186,46 +183,42 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void) if (Gbl.Hierarchy.Deg.DegCod > 0) // Degree selected { /* Select a course */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Gbl.Hierarchy.Level == Hie_CRS ? Txt_Select_create_course_in_X : - Txt_Select_or_create_one_course_in_X, - Gbl.Hierarchy.Deg.ShrtName); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Level == Hie_CRS ? Txt_Select_create_course_in_X : + Txt_Select_or_create_one_course_in_X, + Gbl.Hierarchy.Deg.ShrtName), ActSeeCrs, Btn_CONFIRM_BUTTON,Txt_Courses); + Str_FreeStrMsg (); } else if (Gbl.Hierarchy.Ctr.CtrCod > 0) // Centre selected { /* Select a degree */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Gbl.Hierarchy.Deg.DegCod > 0 ? Txt_Select_or_create_another_degree_in_X : - Txt_Select_or_create_one_degree_in_X, - Gbl.Hierarchy.Ctr.ShrtName); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Deg.DegCod > 0 ? Txt_Select_or_create_another_degree_in_X : + Txt_Select_or_create_one_degree_in_X, + Gbl.Hierarchy.Ctr.ShrtName), ActSeeDeg, Btn_CONFIRM_BUTTON,Txt_Degrees); + Str_FreeStrMsg (); } else if (Gbl.Hierarchy.Ins.InsCod > 0) // Institution selected { /* Select a centre */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Gbl.Hierarchy.Ctr.CtrCod > 0 ? Txt_Select_or_create_another_centre_in_X : - Txt_Select_or_create_one_centre_in_X, - Gbl.Hierarchy.Ins.ShrtName); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Ctr.CtrCod > 0 ? Txt_Select_or_create_another_centre_in_X : + Txt_Select_or_create_one_centre_in_X, + Gbl.Hierarchy.Ins.ShrtName), ActSeeCtr, Btn_CONFIRM_BUTTON,Txt_Centres); + Str_FreeStrMsg (); } else if (Gbl.Hierarchy.Cty.CtyCod > 0) // Country selected { /* Select an institution */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Gbl.Hierarchy.Ins.InsCod > 0 ? Txt_Select_or_create_another_institution_in_X : - Txt_Select_or_create_one_institution_in_X, - Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Ins.InsCod > 0 ? Txt_Select_or_create_another_institution_in_X : + Txt_Select_or_create_one_institution_in_X, + Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]), ActSeeIns, Btn_CONFIRM_BUTTON,Txt_Institutions); + Str_FreeStrMsg (); } else /* Select a country */ @@ -247,12 +240,11 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void) Btn_CONFIRM_BUTTON,Txt_Log_in); /* Sign up */ - snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_New_on_PLATFORM_Sign_up, - Cfg_PLATFORM_SHORT_NAME); - Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title, + Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_New_on_PLATFORM_Sign_up, + Cfg_PLATFORM_SHORT_NAME), ActFrmMyAcc, Btn_CREATE_BUTTON,Txt_Create_account); + Str_FreeStrMsg (); } /***** End table and box *****/