diff --git a/swad_agenda.c b/swad_agenda.c index 6067d8b6..c70a755a 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -567,11 +567,12 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) /***** Table head *****/ Tbl_TR_Begin (NULL); + for (Order = Agd_ORDER_BY_START_DATE; Order <= Agd_ORDER_BY_END_DATE; Order++) { - fprintf (Gbl.F.Out,""); + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); switch (AgendaType) { case Agd_MY_AGENDA_TODAY: @@ -595,16 +596,17 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "", - Txt_Event, - Txt_Location); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Event); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Location); + Tbl_TH_End (); + Tbl_TR_End (); } diff --git a/swad_assignment.c b/swad_assignment.c index e1d2943c..6af91833 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -203,12 +203,15 @@ static void Asg_PutHeadForSeeing (bool PrintView) Dat_StartEndTime_t Order; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,""); // Column for contextual icons + + Tbl_TH_Begin ("class=\"CONTEXT_COL\""); + Tbl_TH_End (); // Column for contextual icons + for (Order = Dat_START_TIME; Order <= Dat_END_TIME; Order++) { - fprintf (Gbl.F.Out,""); + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); if (!PrintView) { @@ -229,16 +232,15 @@ static void Asg_PutHeadForSeeing (bool PrintView) Frm_EndForm (); } - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "", - Txt_Assignment, - Txt_Folder); + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Assignment); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Folder); + Tbl_TH_End (); Tbl_TR_End (); } diff --git a/swad_attendance.c b/swad_attendance.c index c6cd2494..a693c3e7 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -239,12 +239,15 @@ static void Att_ShowAllAttEvents (void) /***** Table head *****/ Tbl_TABLE_BeginWideMarginPadding (2); Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,""); // Column for contextual icons + + Tbl_TH_Begin ("class=\"CONTEXT_COL\""); // Column for contextual icons + Tbl_TH_End (); + for (Order = Dat_START_TIME; Order <= Dat_END_TIME; Order++) { - fprintf (Gbl.F.Out,""); + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); Frm_StartForm (ActSeeAtt); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Pag_ATT_EVENTS,Gbl.AttEvents.CurrentPage); @@ -257,16 +260,17 @@ static void Att_ShowAllAttEvents (void) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "", - Txt_Event, - Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Event); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + Tbl_TH_End (); + Tbl_TR_End (); /***** Write all the attendance events *****/ @@ -1897,23 +1901,27 @@ static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att) /* Header */ Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" - ""); + + Tbl_TH_Empty (3); + if (Gbl.Usrs.Listing.WithPhotos) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "", - Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN], - Txt_Student_comment, - Txt_Teachers_comment); + { + Tbl_TH_Begin ("style=\"width:22px;\""); + Tbl_TH_End (); + } + + Tbl_TH_Begin ("colspan=\"2\" class=\"TIT_TBL LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Student_comment); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Teachers_comment); + Tbl_TH_End (); + Tbl_TR_End (); /* List of students (only me) */ @@ -1984,23 +1992,27 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) /* Header */ Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" - ""); + + Tbl_TH_Empty (3); + if (Gbl.Usrs.Listing.WithPhotos) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "", - Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN], - Txt_Student_comment, - Txt_Teachers_comment); + { + Tbl_TH_Begin ("style=\"width:22px;\""); + Tbl_TH_End (); + } + + Tbl_TH_Begin ("colspan=\"2\" class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Student_comment); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Teachers_comment); + Tbl_TH_End (); + Tbl_TR_End (); /* List of students */ @@ -3118,14 +3130,15 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView) /***** Heading row *****/ Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "", - Txt_Event, - Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + + Tbl_TH_Begin ("colspan=\"4\" class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Event); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + Tbl_TH_End (); + Tbl_TR_End (); /***** List the events *****/ @@ -3322,12 +3335,13 @@ static void Att_WriteTableHeadSeveralAttEvents (void) char StrNumAttEvent[10 + 1]; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "%s" - "", - Gbl.Usrs.Listing.WithPhotos ? 4 : - 3, - Txt_ROLES_SINGUL_Abc[Rol_USR][Usr_SEX_UNKNOWN]); + + Tbl_TH_Begin ("colspan=\"%u\" class=\"LEFT_MIDDLE\"", + Gbl.Usrs.Listing.WithPhotos ? 4 : + 3); + + fprintf (Gbl.F.Out,"%s",Txt_ROLES_SINGUL_Abc[Rol_USR][Usr_SEX_UNKNOWN]); + Tbl_TH_End (); for (NumAttEvent = 0; NumAttEvent < Gbl.AttEvents.Num; @@ -3338,8 +3352,8 @@ static void Att_WriteTableHeadSeveralAttEvents (void) Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]); /***** Put link to this attendance event *****/ - fprintf (Gbl.F.Out,"", - Gbl.AttEvents.Lst[NumAttEvent].Title); + Tbl_TH_Begin ("class=\"CENTER_MIDDLE\" title=\"%s\"", + Gbl.AttEvents.Lst[NumAttEvent].Title); snprintf (StrNumAttEvent,sizeof (StrNumAttEvent), "%u", NumAttEvent + 1); @@ -3347,13 +3361,13 @@ static void Att_WriteTableHeadSeveralAttEvents (void) Gbl.AttEvents.Lst[NumAttEvent].Title, StrNumAttEvent, NULL); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } - fprintf (Gbl.F.Out,"" - "%s" - "", - Txt_Attendance); + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Attendance); + Tbl_TH_End (); + Tbl_TR_End (); } diff --git a/swad_banner.c b/swad_banner.c index 127cfc4e..138946c6 100644 --- a/swad_banner.c +++ b/swad_banner.c @@ -933,18 +933,33 @@ static void Ban_PutHeadBanners (void) extern const char *Txt_WWW; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" - "%s" - "%s" - "%s" - "%s" - "%s", - Txt_Code, - Txt_Short_name, - Txt_Full_name, - Txt_Image, - Txt_WWW); + + Tbl_TH_Begin ("class=\"BM\""); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"BM\""); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Code); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Short_name); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Full_name); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Image); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_WWW); + Tbl_TH_End (); + Tbl_TR_End (); } diff --git a/swad_centre.c b/swad_centre.c index 0d23c95c..93b47732 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -181,14 +181,17 @@ void Ctr_SeeCtrWithPendingDegs (void) /***** Wrtie heading *****/ Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s" + "", + Txt_Centre); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s" "", - Txt_Centre, Txt_Degrees_ABBREVIATION); + Tbl_TR_End (); /***** List the centres *****/ @@ -2624,14 +2627,16 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable) Ctr_Order_t Order; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,""); + + Tbl_TH_Empty (1); + for (Order = Ctr_ORDER_BY_CENTRE; Order <= Ctr_ORDER_BY_NUM_TCHS; Order++) { - fprintf (Gbl.F.Out,"", - Order == Ctr_ORDER_BY_CENTRE ? "LEFT_MIDDLE" : - "RIGHT_MIDDLE"); + Tbl_TH_Begin ("class=\"%s\"", + Order == Ctr_ORDER_BY_CENTRE ? "LEFT_MIDDLE" : + "RIGHT_MIDDLE"); if (OrderSelectable) { Frm_StartForm (ActSeeCtr); @@ -2648,27 +2653,30 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable) fprintf (Gbl.F.Out,""); Frm_EndForm (); } - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s+
%s" - "" - "" - "", - Txt_Place, - Txt_Degrees_ABBREVIATION, - Txt_Courses_ABBREVIATION, + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Place); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Degrees_ABBREVIATION); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Courses_ABBREVIATION); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s+
%s", Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH], Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + Tbl_TH_End (); + Tbl_TR_End (); } @@ -2689,47 +2697,53 @@ static void Ctr_PutHeadCentresForEdition (void) extern const char *Txt_Requester; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" - "%s" - "" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "" - "%s+
%s" - "" - "" - "%s" - "" - "" + + Tbl_TH_Empty (1); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s" "", - Txt_Code, - Txt_Place, - Txt_Short_name_of_the_centre, - Txt_Full_name_of_the_centre, - Txt_WWW, - Txt_Users, - Txt_Degrees_ABBREVIATION, - Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH], - Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD], - Txt_Requester); + Txt_Code); + + Tbl_TH_Empty (1); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Place); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Short_name_of_the_centre); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Full_name_of_the_centre); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_WWW); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Users); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Degrees_ABBREVIATION); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s+
%s", + Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH], + Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + fprintf (Gbl.F.Out,"%s",Txt_Requester); + Tbl_TH_End (); + + Tbl_TH_Begin ("class=\"LEFT_MIDDLE\""); + Tbl_TH_End (); + Tbl_TR_End (); } diff --git a/swad_changelog.h b/swad_changelog.h index 5807aad4..73f9f50e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,7 +487,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.32 (2019-10-10)" +#define Log_PLATFORM_VERSION "SWAD 19.32.1 (2019-10-11)" #define CSS_FILE "swad19.29.css" #define JS_FILE "swad19.30.js" /* @@ -496,6 +496,7 @@ ps2pdf source.ps destination.pdf // TODO: En un TFG no preasignado con estudiante tiene que salir un triángulo amarillo // TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.) + Version 19.32.1: Oct 11, 2019 Code refactoring in HTML. (246668 lines) Version 19.32: Oct 10, 2019 Code refactoring in HTML. (246631 lines) Version 19.31.40: Oct 10, 2019 Code refactoring in HTML tables. (246669 lines) Version 19.31.39: Oct 10, 2019 Code refactoring in HTML tables. (246668 lines) diff --git a/swad_classroom.c b/swad_classroom.c index b03714c2..bd963904 100644 --- a/swad_classroom.c +++ b/swad_classroom.c @@ -131,7 +131,7 @@ void Cla_SeeClassrooms (void) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } Tbl_TR_End (); diff --git a/swad_country.c b/swad_country.c index eff7fc77..ff41ae53 100644 --- a/swad_country.c +++ b/swad_country.c @@ -661,7 +661,7 @@ static void Cty_PutHeadCountriesForSeeing (bool OrderSelectable) Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); for (Order = Cty_ORDER_BY_COUNTRY; Order <= Cty_ORDER_BY_NUM_USRS; Order++) @@ -685,7 +685,7 @@ static void Cty_PutHeadCountriesForSeeing (bool OrderSelectable) fprintf (Gbl.F.Out,""); Frm_EndForm (); } - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } fprintf (Gbl.F.Out,"" "%s" @@ -2155,9 +2155,11 @@ static void Cty_PutHeadCountriesForEdition (void) "" "" "%s" - "" - "" - "" + "", + Txt_Numeric_BR_code_BR_ISO_3166_1, + Txt_Alphabetic_BR_code_BR_ISO_3166_1); + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -2169,8 +2171,6 @@ static void Cty_PutHeadCountriesForEdition (void) "" "%s" "", - Txt_Numeric_BR_code_BR_ISO_3166_1, - Txt_Alphabetic_BR_code_BR_ISO_3166_1, Txt_Name, Txt_WWW, Txt_Users, diff --git a/swad_degree.c b/swad_degree.c index 7862cf15..71952f80 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -1065,9 +1065,9 @@ static void Deg_PutHeadDegreesForSeeing (void) extern const char *Txt_Courses_ABBREVIATION; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" - "" + fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -1102,9 +1102,10 @@ static void Deg_PutHeadDegreesForEdition (void) fprintf (Gbl.F.Out,"" "" "%s" - "" - "" - "" + "", + Txt_Code); + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -1124,7 +1125,6 @@ static void Deg_PutHeadDegreesForEdition (void) "" "" "", - Txt_Code, Txt_Short_name_of_the_degree, Txt_Full_name_of_the_degree, Txt_Type, diff --git a/swad_degree_type.c b/swad_degree_type.c index 5c15795c..038d1611 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -515,7 +515,7 @@ static void DT_PutHeadDegreeTypesForSeeing (Act_Action_t NextAction,DT_Order_t S DT_Order_t Order; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); for (Order = DT_ORDER_BY_DEGREE_TYPE; Order <= DT_ORDER_BY_NUM_DEGREES; Order++) @@ -542,7 +542,7 @@ static void DT_PutHeadDegreeTypesForSeeing (Act_Action_t NextAction,DT_Order_t S /* End form */ Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } } diff --git a/swad_department.c b/swad_department.c index 0c4957b2..af9b3ac7 100644 --- a/swad_department.c +++ b/swad_department.c @@ -136,7 +136,7 @@ void Dpt_SeeDepts (void) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } Tbl_TR_End (); diff --git a/swad_enrolment.c b/swad_enrolment.c index 02fd0669..e3f63357 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -2811,8 +2811,8 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /* Start table */ Tbl_TABLE_BeginCenterPadding (2); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -2826,14 +2826,13 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) "" "" "%s" - "" - "" - "", + "", Txt_Course, Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH], Txt_Requester, Txt_Role, Txt_Date); + Tbl_TH_Empty (2); Tbl_TR_End (); /* List requests */ diff --git a/swad_figure.c b/swad_figure.c index e404d91e..1920dcf3 100644 --- a/swad_figure.c +++ b/swad_figure.c @@ -620,8 +620,8 @@ static void Fig_WriteHeadHierarchy (void) extern const char *Txt_Courses; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "\"%s\"" @@ -1481,8 +1481,8 @@ static void Fig_ShowInss (MYSQL_RES **mysql_res,unsigned NumInss, case Usr_LIST_AS_LISTING: /***** Draw institutions as a list *****/ Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" diff --git a/swad_forum.c b/swad_forum.c index bf27335f..4206ace0 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -2586,7 +2586,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } fprintf (Gbl.F.Out,"" "%s" diff --git a/swad_game.c b/swad_game.c index 4800c579..2bd47bc3 100644 --- a/swad_game.c +++ b/swad_game.c @@ -233,7 +233,7 @@ static void Gam_ListAllGames (void) fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } fprintf (Gbl.F.Out,"%s",Txt_Matches); @@ -1645,8 +1645,8 @@ static void Gam_ListOneOrMoreQuestionsForEdition (long GamCod,unsigned NumQsts, /***** Write the heading *****/ Tbl_TABLE_BeginWideMarginPadding (2); Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" diff --git a/swad_holiday.c b/swad_holiday.c index 4e8dda39..787dbc1b 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -131,7 +131,7 @@ void Hld_SeeHolidays (void) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } fprintf (Gbl.F.Out,"" " %s " diff --git a/swad_indicator.c b/swad_indicator.c index 4706d211..ec358567 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -645,7 +645,7 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 Tbl_TR_Begin (NULL); if (PutForm) - fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); fprintf (Gbl.F.Out,"" "%s" "" diff --git a/swad_institution.c b/swad_institution.c index 88efb7cc..fdac36c3 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -871,7 +871,7 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable) Ins_Order_t Order; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); for (Order = Ins_ORDER_BY_INSTITUTION; Order <= Ins_ORDER_BY_NUM_USRS; Order++) @@ -895,7 +895,7 @@ static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable) fprintf (Gbl.F.Out,""); Frm_EndForm (); } - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } fprintf (Gbl.F.Out,"" "%s" @@ -2329,12 +2329,13 @@ static void Ins_PutHeadInstitutionsForEdition (void) extern const char *Txt_Requester; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" - "" - "" - "" + "", + Txt_Code); + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -2357,7 +2358,6 @@ static void Ins_PutHeadInstitutionsForEdition (void) "" "" "", - Txt_Code, Txt_Short_name_of_the_institution, Txt_Full_name_of_the_institution, Txt_WWW, diff --git a/swad_mail.c b/swad_mail.c index 00ac015d..47854c8c 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -144,7 +144,7 @@ void Mai_SeeMailDomains (void) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } Tbl_TR_End (); diff --git a/swad_match.c b/swad_match.c index 632cc8b0..05bf088f 100644 --- a/swad_match.c +++ b/swad_match.c @@ -434,7 +434,7 @@ static void Mch_ListOneOrMoreMatchesHeading (bool ICanEditMatches) /***** Column for icons *****/ if (ICanEditMatches) - fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); /***** The rest of columns *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_match_result.c b/swad_match_result.c index 13aebbd0..50c472ff 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -353,8 +353,7 @@ static void McR_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther) "" "" "%s
%s
%u" - "" - "", + "", Txt_User[MeOrOther == Usr_ME ? Gbl.Usrs.Me.UsrDat.Sex : Usr_SEX_UNKNOWN], Txt_START_END_TIME[Dat_START_TIME], @@ -365,6 +364,7 @@ static void McR_ShowHeaderMchResults (Usr_MeOrOther_t MeOrOther) Txt_Total_BR_score, Txt_Average_BR_score_BR_per_question_BR_from_0_to_1, Txt_Score,Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX); + Tbl_TH_Empty (1); Tbl_TR_End (); } diff --git a/swad_notification.c b/swad_notification.c index 3e1a6462..1d8683bd 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -1942,8 +1942,8 @@ void Ntf_PutFormChangeNotifSentByEMail (void) /***** List of notifications *****/ Tbl_TABLE_BeginCenterPadding (2); Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" diff --git a/swad_place.c b/swad_place.c index 4e830574..d2772156 100644 --- a/swad_place.c +++ b/swad_place.c @@ -130,7 +130,7 @@ void Plc_SeePlaces (void) fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } Tbl_TR_End (); diff --git a/swad_plugin.c b/swad_plugin.c index 1c0ef0f5..2c231a60 100644 --- a/swad_plugin.c +++ b/swad_plugin.c @@ -991,8 +991,8 @@ static void Plg_PutHeadPlugins (void) extern const char *Txt_IP; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" diff --git a/swad_project.c b/swad_project.c index 4f400b01..0f1c2833 100644 --- a/swad_project.c +++ b/swad_project.c @@ -738,7 +738,7 @@ static void Prj_ShowProjectsHead (Prj_ProjectView_t ProjectView) break; } - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } } diff --git a/swad_record.c b/swad_record.c index e95fef12..460c77d0 100644 --- a/swad_record.c +++ b/swad_record.c @@ -435,8 +435,8 @@ static void Rec_WriteHeadingRecordFields (void) extern const char *Txt_Visible_by_BR_the_student; Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" diff --git a/swad_survey.c b/swad_survey.c index bc35d29f..5b9f908e 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -267,7 +267,7 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst) fprintf (Gbl.F.Out,""); Frm_EndForm (); - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } fprintf (Gbl.F.Out,"" "%s" @@ -3226,7 +3226,7 @@ static void Svy_ListSvyQuestions (struct Survey *Svy, Tbl_TABLE_BeginWideMarginPadding (2); Tbl_TR_Begin (NULL); if (Svy->Status.ICanEdit) - fprintf (Gbl.F.Out,""); + Tbl_TH_Empty (1); fprintf (Gbl.F.Out,"" "%s" "" diff --git a/swad_table.c b/swad_table.c index 3a65822c..24034d93 100644 --- a/swad_table.c +++ b/swad_table.c @@ -56,6 +56,7 @@ extern struct Globals Gbl; /*****************************************************************************/ static void Tbl_TR_BeginWithoutAttr (void); +static void Tbl_TH_BeginWithoutAttr (void); static void Tbl_TD_BeginWithoutAttr (void); /*****************************************************************************/ @@ -199,6 +200,64 @@ void Tbl_TR_End (void) fprintf (Gbl.F.Out,""); } +/*****************************************************************************/ +/***************************** Table heading cells ***************************/ +/*****************************************************************************/ + +void Tbl_TH_Begin (const char *fmt,...) + { + va_list ap; + int NumBytesPrinted; + char *Attr; + + if (fmt) + { + if (fmt[0]) + { + va_start (ap,fmt); + NumBytesPrinted = vasprintf (&Attr,fmt,ap); + va_end (ap); + + if (NumBytesPrinted < 0) // If memory allocation wasn't possible, + // or some other error occurs, + // vasprintf will return -1 + Lay_NotEnoughMemoryExit (); + + /***** Print HTML *****/ + fprintf (Gbl.F.Out,"",Attr); + + free ((void *) Attr); + } + else + Tbl_TH_BeginWithoutAttr (); + } + else + Tbl_TH_BeginWithoutAttr (); + } + +static void Tbl_TH_BeginWithoutAttr (void) + { + fprintf (Gbl.F.Out,""); + } + +void Tbl_TH_End (void) + { + fprintf (Gbl.F.Out,""); + } + +void Tbl_TH_Empty (unsigned NumColumns) + { + unsigned NumCol; + + for (NumCol = 0; + NumCol < NumColumns; + NumCol++) + { + Tbl_TH_Begin (NULL); + Tbl_TH_End (); + } + } + /*****************************************************************************/ /********************************* Table cells *******************************/ /*****************************************************************************/ diff --git a/swad_table.h b/swad_table.h index f3a50d34..6e63322d 100644 --- a/swad_table.h +++ b/swad_table.h @@ -53,6 +53,10 @@ void Tbl_TABLE_End (void); void Tbl_TR_Begin (const char *fmt,...); void Tbl_TR_End (void); +void Tbl_TH_Begin (const char *fmt,...); +void Tbl_TH_End (void); +void Tbl_TH_Empty (unsigned NumColumns); + void Tbl_TD_Begin (const char *fmt,...); void Tbl_TD_End (void); void Tbl_TD_Empty (unsigned NumColumns); diff --git a/swad_test.c b/swad_test.c index 46142aff..def6d367 100644 --- a/swad_test.c +++ b/swad_test.c @@ -2828,8 +2828,8 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows, /***** Write the heading *****/ Tbl_TABLE_BeginWideMarginPadding (2); Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -2876,7 +2876,7 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows, fprintf (Gbl.F.Out,""); Frm_EndForm (); } - fprintf (Gbl.F.Out,""); + Tbl_TH_End (); } Tbl_TR_End (); @@ -3094,8 +3094,8 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows, /***** Write the heading *****/ Tbl_TABLE_BeginWideMarginPadding (2); Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -7726,8 +7726,7 @@ static void Tst_ShowHeaderTestResults (void) "" "" "%s
%s
%u" - "" - "", + "", Txt_User[Usr_SEX_UNKNOWN], Txt_Date, Txt_Questions, @@ -7735,6 +7734,7 @@ static void Tst_ShowHeaderTestResults (void) Txt_Total_BR_score, Txt_Average_BR_score_BR_per_question_BR_from_0_to_1, Txt_Score,Txt_out_of_PART_OF_A_SCORE,Tst_SCORE_MAX); + Tbl_TH_Empty (1); Tbl_TR_End (); } diff --git a/swad_test_import.c b/swad_test_import.c index 763263d0..acdfb916 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -959,8 +959,8 @@ static void TsI_WriteHeadingListImportedQst (void) /***** Write the heading *****/ Tbl_TR_Begin (NULL); - fprintf (Gbl.F.Out,"" - "" + Tbl_TH_Empty (1); + fprintf (Gbl.F.Out,"" "%s" "" ""