diff --git a/swad_changelog.h b/swad_changelog.h index ab3b01d6c..b0161b3e6 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.31.22 (2019-10-08)" +#define Log_PLATFORM_VERSION "SWAD 19.31.23 (2019-10-08)" #define CSS_FILE "swad19.29.css" #define JS_FILE "swad19.30.js" /* @@ -495,6 +495,7 @@ ps2pdf source.ps destination.pdf // TODO: Un TFG preasignado sin 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.31.23: Oct 08, 2019 Code refactoring in HTML tables. (247076 lines) Version 19.31.22: Oct 08, 2019 Code refactoring in HTML tables. (247099 lines) Version 19.31.21: Oct 08, 2019 Code refactoring in HTML tables. (247124 lines) Version 19.31.20: Oct 07, 2019 Code refactoring in HTML tables. (247192 lines) diff --git a/swad_connected.c b/swad_connected.c index 6a484d049..f2a335de8 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -861,15 +861,13 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role) /***** Write time from last access *****/ Font = (Gbl.Usrs.Connected.Lst[Gbl.Usrs.Connected.NumUsr].ThisCrs ? "CON_SINCE CON_CRS" : "CON_SINCE CON_NO_CRS"); - Tbl_StartCellAttr ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd); - fprintf (Gbl.F.Out,"
", Gbl.Usrs.Connected.NumUsr); // Used for automatic update, only when displayed on right column Dat_WriteHoursMinutesSecondsFromSeconds (Gbl.Usrs.Connected.Lst[Gbl.Usrs.Connected.NumUsr].TimeDiff); fprintf (Gbl.F.Out,"
"); // Used for automatic update, only when displayed on right column - Tbl_EndCell (); + Tbl_EndRow (); if (!ItsMe) diff --git a/swad_date.c b/swad_date.c index 8aba614c4..0547ed424 100644 --- a/swad_date.c +++ b/swad_date.c @@ -430,14 +430,14 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000 Tbl_StartRow (); /***** Start date-time *****/ - fprintf (Gbl.F.Out,"" - "", + Tbl_StartCellAttr ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_START_END_TIME[Dat_START_TIME]); Tbl_EndCell (); /* Date-time */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\""); Dat_WriteFormClientLocalDateTimeFromTimeUTC ("Start", "Start", Gbl.DateRange.TimeUTC[0], @@ -450,8 +450,8 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000 Tbl_EndCell (); /***** "Yesterday" and "Today" buttons *****/ - fprintf (Gbl.F.Out,"" - "" "", @@ -463,14 +463,14 @@ void Dat_PutFormStartEndClientLocalDateTimesWithYesterdayToday (bool SetHMS00000 Tbl_StartRow (); /***** End date-time *****/ - fprintf (Gbl.F.Out,"" - "", + Tbl_StartCellAttr ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_START_END_TIME[Dat_END_TIME]); Tbl_EndCell (); /* Date-time */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\""); Dat_WriteFormClientLocalDateTimeFromTimeUTC ("End", "End", Gbl.DateRange.TimeUTC[1], @@ -508,13 +508,13 @@ void Dat_PutFormStartEndClientLocalDateTimes (time_t TimeUTC[2], /* Date-time */ Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "", + Tbl_StartCellAttr ("class=\"RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_START_END_TIME[StartEndTime]); Tbl_EndCell (); - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\""); Dat_WriteFormClientLocalDateTimeFromTimeUTC (Id[StartEndTime], Id[StartEndTime], TimeUTC[StartEndTime], @@ -561,8 +561,8 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id, Tbl_StartRow (); /***** Year *****/ - fprintf (Gbl.F.Out,"" - "" - "" - "" - "" - "", @@ -1008,8 +997,8 @@ static void Deg_PutFormToCreateDegree (void) Tbl_EndCell (); /***** Degree full name *****/ - fprintf (Gbl.F.Out,"" - "", @@ -1017,8 +1006,8 @@ static void Deg_PutFormToCreateDegree (void) Tbl_EndCell (); /***** Degree type *****/ - fprintf (Gbl.F.Out,"" - ""); for (NumDegTyp = 0; NumDegTyp < Gbl.DegTypes.Num; NumDegTyp++) @@ -1034,8 +1023,8 @@ static void Deg_PutFormToCreateDegree (void) Tbl_EndCell (); /***** Degree WWW *****/ - fprintf (Gbl.F.Out,"" - "", @@ -1043,17 +1032,17 @@ static void Deg_PutFormToCreateDegree (void) Tbl_EndCell (); /***** Current number of courses in this degree *****/ - fprintf (Gbl.F.Out,"" - "0"); + Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"0"); Tbl_EndCell (); /***** Degree requester *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT INPUT_REQUESTER LEFT_TOP\""); Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true,NULL); Tbl_EndCell (); /***** Degree status *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\""); Tbl_EndCell (); Tbl_EndRow (); @@ -1310,44 +1299,38 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg) Tbl_StartRow (); /***** Put tip if degree has courses *****/ - fprintf (Gbl.F.Out,"" - "%s", - TxtClassNormal,BgColor, - NumCrss ? Txt_DEGREE_With_courses : - Txt_DEGREE_Without_courses, - NumCrss ? "✓" : - " "); + Tbl_StartCellAttr ("class=\"%s CENTER_MIDDLE %s\" title=\"%s\"", + TxtClassNormal,BgColor, + NumCrss ? Txt_DEGREE_With_courses : + Txt_DEGREE_Without_courses); + fprintf (Gbl.F.Out,"%s",NumCrss ? "✓" : + " "); Tbl_EndCell (); /***** Number of degree in this list *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor, - NumDeg); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",NumDeg); Tbl_EndCell (); /***** Degree logo and name *****/ - fprintf (Gbl.F.Out,"",BgColor); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE %s\"",BgColor); Deg_DrawDegreeLogoAndNameWithLink (Deg,ActSeeCrs, TxtClassStrong,"CENTER_MIDDLE"); Tbl_EndCell (); /***** Type of degree *****/ - fprintf (Gbl.F.Out,"" - "%s", - TxtClassNormal,BgColor,DegTyp.DegTypName); + Tbl_StartCellAttr ("class=\"%s LEFT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%s",DegTyp.DegTypName); Tbl_EndCell (); /***** Current number of courses in this degree *****/ - fprintf (Gbl.F.Out,"" - "%u", - TxtClassNormal,BgColor,NumCrss); + Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE %s\"",TxtClassNormal,BgColor); + fprintf (Gbl.F.Out,"%u",NumCrss); Tbl_EndCell (); /***** Degree status *****/ StatusTxt = Deg_GetStatusTxtFromStatusBits (Deg->Status); - fprintf (Gbl.F.Out,"", - TxtClassNormal,BgColor); + Tbl_StartCellAttr ("class=\"%s LEFT_MIDDLE %s\"",TxtClassNormal,BgColor); if (StatusTxt != Deg_STATUS_ACTIVE) // If active ==> do not show anything fprintf (Gbl.F.Out,"%s",Txt_DEGREE_STATUS[StatusTxt]); Tbl_EndCell (); @@ -2549,19 +2532,18 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan) Tbl_StartRow (); /***** Indent *****/ - fprintf (Gbl.F.Out,"" - "\"\"", - Gbl.RowEvenOdd,Cfg_URL_ICON_PUBLIC, + Cfg_URL_ICON_PUBLIC, NumRow == NumRows ? "subend" : "submid"); Tbl_EndCell (); /***** Write institution, centre, degree *****/ - fprintf (Gbl.F.Out,"", - ColSpan - 1,Gbl.RowEvenOdd); + Tbl_StartCellAttr ("colspan=\"%u\" class=\"DAT_SMALL_NOBR LEFT_TOP COLOR%u\">", + ColSpan - 1,Gbl.RowEvenOdd); /* Get next institution, centre, degree */ row = mysql_fetch_row (mysql_res); diff --git a/swad_degree_type.c b/swad_degree_type.c index 0eeeb851c..4a9b657ac 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -330,23 +330,21 @@ static void DT_ListDegreeTypesForSeeing (void) Gbl.Hierarchy.Deg.DegTypCod) ? "LIGHT_BLUE" : Gbl.ColorRows[Gbl.RowEvenOdd]; - /* Number of degree type in this list */ Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "%u", - BgColor,NumDegTyp + 1); + + /* Number of degree type in this list */ + Tbl_StartCellAttr ("class=\"DAT_N RIGHT_MIDDLE %s\"",BgColor); + fprintf (Gbl.F.Out,"%u",NumDegTyp + 1); Tbl_EndCell (); /* Name of degree type */ - fprintf (Gbl.F.Out,"" - "%s", - BgColor,Gbl.DegTypes.Lst[NumDegTyp].DegTypName); + Tbl_StartCellAttr ("class=\"DAT_N LEFT_MIDDLE %s\"",BgColor); + fprintf (Gbl.F.Out,"%s",Gbl.DegTypes.Lst[NumDegTyp].DegTypName); Tbl_EndCell (); /* Number of degrees of this type */ - fprintf (Gbl.F.Out,"" - "%u", - BgColor,Gbl.DegTypes.Lst[NumDegTyp].NumDegs); + Tbl_StartCellAttr ("class=\"DAT_N RIGHT_MIDDLE %s\"",BgColor); + fprintf (Gbl.F.Out,"%u",Gbl.DegTypes.Lst[NumDegTyp].NumDegs); Tbl_EndCell (); Tbl_EndRow (); @@ -403,7 +401,7 @@ static void DT_ListDegreeTypesForEdition (void) Tbl_StartRow (); /* Put icon to remove degree type */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"BM\""); if (Gbl.DegTypes.Lst[NumDegTyp].NumDegs) // Degree type has degrees => deletion forbidden Ico_PutIconRemovalNotAllowed (); else @@ -416,13 +414,12 @@ static void DT_ListDegreeTypesForEdition (void) Tbl_EndCell (); /* Degree type code */ - fprintf (Gbl.F.Out,"" - "%ld", - Gbl.DegTypes.Lst[NumDegTyp].DegTypCod); + Tbl_StartCellAttr ("class=\"DAT CODE\""); + fprintf (Gbl.F.Out,"%ld",Gbl.DegTypes.Lst[NumDegTyp].DegTypCod); Tbl_EndCell (); /* Name of degree type */ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\""); Frm_StartForm (ActRenDegTyp); DT_PutParamOtherDegTypCod (Gbl.DegTypes.Lst[NumDegTyp].DegTypCod); fprintf (Gbl.F.Out,"" - "%u", - Gbl.DegTypes.Lst[NumDegTyp].NumDegs); + Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"%u",Gbl.DegTypes.Lst[NumDegTyp].NumDegs); Tbl_EndCell (); Tbl_EndRow (); @@ -479,24 +475,24 @@ static void DT_PutFormToCreateDegreeType (void) Tbl_StartRow (); /***** Column to remove degree type, disabled here *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"BM\""); Tbl_EndCell (); /***** Degree type code *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartCellAttr ("class=\"CODE\""); Tbl_EndCell (); /***** Degree type name *****/ - fprintf (Gbl.F.Out,"" - "", Deg_MAX_CHARS_DEGREE_TYPE_NAME,DT_EditingDegTyp->DegTypName); Tbl_EndCell (); /***** Number of degrees of this degree type ****/ - fprintf (Gbl.F.Out,"" - "0"); + Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\""); + fprintf (Gbl.F.Out,"0"); Tbl_EndCell (); Tbl_EndRow ();