Version19.108.3

This commit is contained in:
Antonio Cañas Vargas 2019-12-30 16:35:49 +01:00
parent fef1cb17ae
commit 6278caca95
8 changed files with 70 additions and 85 deletions

View File

@ -646,14 +646,13 @@ static void ID_ShowFormChangeUsrID (const struct UsrData *UsrDat,
} }
/* User's ID */ /* 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\"", HTM_SPAN_Begin ("class=\"%s\" title=\"%s\"",
UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" : UsrDat->IDs.List[NumID].Confirmed ? "USR_ID_C" :
"USR_ID_NC", "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].ID);
HTM_Txt (UsrDat->IDs.List[NumID].Confirmed ? "✓" : HTM_Txt (UsrDat->IDs.List[NumID].Confirmed ? "✓" :
""); "");

View File

@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf 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 CSS_FILE "swad19.101.5.css"
#define JS_FILE "swad19.91.1.js" #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 country information. (? lines)
Version 19.10x: Dec 30, 2019 Map in institution 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.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.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) Version 19.108: Dec 30, 2019 Code refactoring related to hierarchy. (249730 lines)

View File

@ -763,11 +763,11 @@ static void Deg_ListDegrees (void)
unsigned NumDeg; unsigned NumDeg;
/***** Begin box *****/ /***** Begin box *****/
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxBegin (NULL,Str_BuildStrMsg (Txt_Degrees_of_CENTRE_X,
Txt_Degrees_of_CENTRE_X, Gbl.Hierarchy.Ctr.ShrtName),
Gbl.Hierarchy.Ctr.ShrtName); Deg_PutIconsListingDegrees,
Box_BoxBegin (NULL,Gbl.Title,Deg_PutIconsListingDegrees,
Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE); Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE);
Str_FreeStrMsg ();
if (Gbl.Hierarchy.Ctr.Degs.Num) // There are degrees in the current centre if (Gbl.Hierarchy.Ctr.Degs.Num) // There are degrees in the current centre
{ {
@ -945,11 +945,11 @@ static void Deg_EditDegreesInternal (void)
Hie_WriteMenuHierarchy (); Hie_WriteMenuHierarchy ();
/***** Begin box *****/ /***** Begin box *****/
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxBegin (NULL,Str_BuildStrMsg (Txt_Degrees_of_CENTRE_X,
Txt_Degrees_of_CENTRE_X, Gbl.Hierarchy.Ctr.ShrtName),
Gbl.Hierarchy.Ctr.ShrtName); Deg_PutIconsEditingDegrees,
Box_BoxBegin (NULL,Gbl.Title,Deg_PutIconsEditingDegrees,
Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE); Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE);
Str_FreeStrMsg ();
if (Gbl.DegTypes.Num) if (Gbl.DegTypes.Num)
{ {

View File

@ -334,10 +334,10 @@ static void DegCfg_NumCrss (void)
HTM_TD_Begin ("class=\"LB\""); HTM_TD_Begin ("class=\"LB\"");
Frm_StartFormGoTo (ActSeeCrs); Frm_StartFormGoTo (ActSeeCrs);
Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod); Deg_PutParamDegCod (Gbl.Hierarchy.Deg.DegCod);
snprintf (Gbl.Title,sizeof (Gbl.Title), HTM_BUTTON_SUBMIT_Begin (Str_BuildStrMsg (Txt_Courses_of_DEGREE_X,
Txt_Courses_of_DEGREE_X, Gbl.Hierarchy.Deg.ShrtName),
Gbl.Hierarchy.Deg.ShrtName); "BT_LINK DAT",NULL);
HTM_BUTTON_SUBMIT_Begin (Gbl.Title,"BT_LINK DAT",NULL); Str_FreeStrMsg ();
HTM_Unsigned (Crs_GetNumCrssInDeg (Gbl.Hierarchy.Deg.DegCod)); HTM_Unsigned (Crs_GetNumCrssInDeg (Gbl.Hierarchy.Deg.DegCod));
HTM_BUTTON_End (); HTM_BUTTON_End ();
Frm_EndForm (); Frm_EndForm ();

View File

@ -111,13 +111,12 @@ void Dpt_SeeDepts (void)
Dpt_GetListDepartments (Gbl.Hierarchy.Ins.InsCod); Dpt_GetListDepartments (Gbl.Hierarchy.Ins.InsCod);
/***** Begin box and table *****/ /***** Begin box and table *****/
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxTableBegin (NULL,Str_BuildStrMsg (Txt_Departments_of_INSTITUTION_X,
Txt_Departments_of_INSTITUTION_X, Gbl.Hierarchy.Ins.FullName),
Gbl.Hierarchy.Ins.FullName);
Box_BoxTableBegin (NULL,Gbl.Title,
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ? Dpt_PutIconToEditDpts : Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM ? Dpt_PutIconToEditDpts :
NULL, NULL,
Hlp_INSTITUTION_Departments,Box_NOT_CLOSABLE,2); Hlp_INSTITUTION_Departments,Box_NOT_CLOSABLE,2);
Str_FreeStrMsg ();
/***** Write heading *****/ /***** Write heading *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -267,11 +266,10 @@ static void Dpt_EditDepartmentsInternal (void)
Dpt_GetListDepartments (Gbl.Hierarchy.Ins.InsCod); Dpt_GetListDepartments (Gbl.Hierarchy.Ins.InsCod);
/***** Begin box *****/ /***** Begin box *****/
snprintf (Gbl.Title,sizeof (Gbl.Title), Box_BoxBegin (NULL,Str_BuildStrMsg (Txt_Departments_of_INSTITUTION_X,
Txt_Departments_of_INSTITUTION_X, Gbl.Hierarchy.Ins.FullName),NULL,
Gbl.Hierarchy.Ins.FullName);
Box_BoxBegin (NULL,Gbl.Title,NULL,
Hlp_INSTITUTION_Departments_edit,Box_NOT_CLOSABLE); Hlp_INSTITUTION_Departments_edit,Box_NOT_CLOSABLE);
Str_FreeStrMsg ();
/***** Put a form to create a new department *****/ /***** Put a form to create a new department *****/
Dpt_PutFormToCreateDepartment (); Dpt_PutFormToCreateDepartment ();

View File

@ -1869,12 +1869,11 @@ static void Gam_ListOneOrMoreQuestionsForEdition (long GamCod,unsigned NumQsts,
/* Put icon to move up the question */ /* Put icon to move up the question */
if (ICanEditQuestions && QstInd > 1) if (ICanEditQuestions && QstInd > 1)
{ {
snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Move_up_X,
StrQstInd);
Lay_PutContextualLinkOnlyIcon (ActUp_GamQst,NULL,Gam_PutParamsOneQst, Lay_PutContextualLinkOnlyIcon (ActUp_GamQst,NULL,Gam_PutParamsOneQst,
"arrow-up.svg", "arrow-up.svg",
Gbl.Title); Str_BuildStrMsg (Txt_Move_up_X,
StrQstInd));
Str_FreeStrMsg ();
} }
else else
Ico_PutIconOff ("arrow-up.svg",Txt_Movement_not_allowed); 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 */ /* Put icon to move down the question */
if (ICanEditQuestions && QstInd < MaxQstInd) if (ICanEditQuestions && QstInd < MaxQstInd)
{ {
snprintf (Gbl.Title,sizeof (Gbl.Title),
Txt_Move_down_X,
StrQstInd);
Lay_PutContextualLinkOnlyIcon (ActDwnGamQst,NULL,Gam_PutParamsOneQst, Lay_PutContextualLinkOnlyIcon (ActDwnGamQst,NULL,Gam_PutParamsOneQst,
"arrow-down.svg", "arrow-down.svg",
Gbl.Title); Str_BuildStrMsg (Txt_Move_down_X,
StrQstInd));
Str_FreeStrMsg ();
} }
else else
Ico_PutIconOff ("arrow-down.svg",Txt_Movement_not_allowed); Ico_PutIconOff ("arrow-down.svg",Txt_Movement_not_allowed);

View File

@ -1507,13 +1507,12 @@ static void Grp_ListGroupsForEdition (void)
ActOpeGrp, ActOpeGrp,
Grp_GROUPS_SECTION_ID); Grp_GROUPS_SECTION_ID);
Grp_PutParamGrpCod (Grp->GrpCod); 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" : Ico_PutIconLink (Grp->Open ? "unlock.svg" :
"lock.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 (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
@ -1523,13 +1522,12 @@ static void Grp_ListGroupsForEdition (void)
ActEnaFilZonGrp, ActEnaFilZonGrp,
Grp_GROUPS_SECTION_ID); Grp_GROUPS_SECTION_ID);
Grp_PutParamGrpCod (Grp->GrpCod); 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" : Ico_PutIconLink (Grp->FileZones ? "folder-open-green.svg" :
"folder-red.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 (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
@ -2377,17 +2375,16 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight)
char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
/***** Write icon to show if group is open or closed *****/ /***** 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) if (Highlight)
HTM_TD_Begin ("class=\"BM LIGHT_BLUE\""); HTM_TD_Begin ("class=\"BM LIGHT_BLUE\"");
else else
HTM_TD_Begin ("class=\"BM\""); HTM_TD_Begin ("class=\"BM\"");
Ico_PutIconOff (Grp->Open ? "unlock.svg" : Ico_PutIconOff (Grp->Open ? "unlock.svg" :
"lock.svg", "lock.svg",
Gbl.Title); Str_BuildStrMsg (Grp->Open ? Txt_Group_X_open :
Txt_Group_X_closed,
Grp->GrpName));
Str_FreeStrMsg ();
HTM_TD_End (); HTM_TD_End ();
/***** Group name *****/ /***** Group name *****/

View File

@ -141,23 +141,21 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
if (ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role] != ActUnk) if (ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role] != ActUnk)
{ {
/* Request my removing from this course */ /* Request my removing from this course */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_Remove_me_from_THE_COURSE_X,
Txt_Remove_me_from_THE_COURSE_X, Gbl.Hierarchy.Crs.ShrtName),
Gbl.Hierarchy.Crs.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role], ActionsRemoveMe[Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role],
Btn_REMOVE_BUTTON,Txt_Remove_me); Btn_REMOVE_BUTTON,Txt_Remove_me);
Str_FreeStrMsg ();
} }
} }
else // I do not belong to this course else // I do not belong to this course
{ {
/* Request my registration in this course */ /* Request my registration in this course */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_Register_me_in_X,
Txt_Register_me_in_X, Gbl.Hierarchy.Crs.ShrtName),
Gbl.Hierarchy.Crs.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActReqSignUp, ActReqSignUp,
Btn_CREATE_BUTTON,Txt_Sign_up); 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 Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs.Role == Rol_TCH) // I am a teacher in current course
{ {
/* Request students enrolment */ /* Request students enrolment */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_Register_students_in_COURSE_X,
Txt_Register_students_in_COURSE_X, Gbl.Hierarchy.Crs.ShrtName),
Gbl.Hierarchy.Crs.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActReqEnrSevStd, ActReqEnrSevStd,
Btn_CREATE_BUTTON,Txt_Register_students); Btn_CREATE_BUTTON,Txt_Register_students);
Str_FreeStrMsg ();
} }
if (Gbl.Action.Act != ActMyCrs) // I am not seeing the action to list my courses 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 if (Gbl.Hierarchy.Deg.DegCod > 0) // Degree selected
{ {
/* Select a course */ /* Select a course */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Level == Hie_CRS ? Txt_Select_create_course_in_X :
Gbl.Hierarchy.Level == Hie_CRS ? Txt_Select_create_course_in_X : Txt_Select_or_create_one_course_in_X,
Txt_Select_or_create_one_course_in_X, Gbl.Hierarchy.Deg.ShrtName),
Gbl.Hierarchy.Deg.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeCrs, ActSeeCrs,
Btn_CONFIRM_BUTTON,Txt_Courses); Btn_CONFIRM_BUTTON,Txt_Courses);
Str_FreeStrMsg ();
} }
else if (Gbl.Hierarchy.Ctr.CtrCod > 0) // Centre selected else if (Gbl.Hierarchy.Ctr.CtrCod > 0) // Centre selected
{ {
/* Select a degree */ /* Select a degree */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Deg.DegCod > 0 ? Txt_Select_or_create_another_degree_in_X :
Gbl.Hierarchy.Deg.DegCod > 0 ? Txt_Select_or_create_another_degree_in_X : Txt_Select_or_create_one_degree_in_X,
Txt_Select_or_create_one_degree_in_X, Gbl.Hierarchy.Ctr.ShrtName),
Gbl.Hierarchy.Ctr.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeDeg, ActSeeDeg,
Btn_CONFIRM_BUTTON,Txt_Degrees); Btn_CONFIRM_BUTTON,Txt_Degrees);
Str_FreeStrMsg ();
} }
else if (Gbl.Hierarchy.Ins.InsCod > 0) // Institution selected else if (Gbl.Hierarchy.Ins.InsCod > 0) // Institution selected
{ {
/* Select a centre */ /* Select a centre */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Ctr.CtrCod > 0 ? Txt_Select_or_create_another_centre_in_X :
Gbl.Hierarchy.Ctr.CtrCod > 0 ? Txt_Select_or_create_another_centre_in_X : Txt_Select_or_create_one_centre_in_X,
Txt_Select_or_create_one_centre_in_X, Gbl.Hierarchy.Ins.ShrtName),
Gbl.Hierarchy.Ins.ShrtName);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeCtr, ActSeeCtr,
Btn_CONFIRM_BUTTON,Txt_Centres); Btn_CONFIRM_BUTTON,Txt_Centres);
Str_FreeStrMsg ();
} }
else if (Gbl.Hierarchy.Cty.CtyCod > 0) // Country selected else if (Gbl.Hierarchy.Cty.CtyCod > 0) // Country selected
{ {
/* Select an institution */ /* Select an institution */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Gbl.Hierarchy.Ins.InsCod > 0 ? Txt_Select_or_create_another_institution_in_X :
Gbl.Hierarchy.Ins.InsCod > 0 ? Txt_Select_or_create_another_institution_in_X : Txt_Select_or_create_one_institution_in_X,
Txt_Select_or_create_one_institution_in_X, Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]),
Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActSeeIns, ActSeeIns,
Btn_CONFIRM_BUTTON,Txt_Institutions); Btn_CONFIRM_BUTTON,Txt_Institutions);
Str_FreeStrMsg ();
} }
else else
/* Select a country */ /* Select a country */
@ -247,12 +240,11 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Btn_CONFIRM_BUTTON,Txt_Log_in); Btn_CONFIRM_BUTTON,Txt_Log_in);
/* Sign up */ /* Sign up */
snprintf (Gbl.Title,sizeof (Gbl.Title), Hlp_ShowRowHelpWhatWouldYouLikeToDo (Str_BuildStrMsg (Txt_New_on_PLATFORM_Sign_up,
Txt_New_on_PLATFORM_Sign_up, Cfg_PLATFORM_SHORT_NAME),
Cfg_PLATFORM_SHORT_NAME);
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Title,
ActFrmMyAcc, ActFrmMyAcc,
Btn_CREATE_BUTTON,Txt_Create_account); Btn_CREATE_BUTTON,Txt_Create_account);
Str_FreeStrMsg ();
} }
/***** End table and box *****/ /***** End table and box *****/