diff --git a/swad_changelog.h b/swad_changelog.h
index 1fdf54ed3..795ee7233 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.13 (2019-10-07)"
+#define Log_PLATFORM_VERSION "SWAD 19.31.15 (2019-10-07)"
#define CSS_FILE "swad19.29.css"
#define JS_FILE "swad19.30.js"
/*
@@ -495,6 +495,8 @@ 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.15: Oct 07, 2019 Code refactoring in HTML tables. (247153 lines)
+ Version 19.31.14: Oct 07, 2019 Code refactoring in HTML tables. (247138 lines)
Version 19.31.13: Oct 07, 2019 Code refactoring in HTML tables. (247135 lines)
Version 19.31.12: Oct 07, 2019 Code refactoring in HTML tables. (247121 lines)
Version 19.31.11: Oct 07, 2019 Code refactoring in HTML tables. (247111 lines)
diff --git a/swad_institution.c b/swad_institution.c
index b6b4076ee..c6e94421c 100644
--- a/swad_institution.c
+++ b/swad_institution.c
@@ -210,9 +210,10 @@ void Ins_SeeInsWithPendingCtrs (void)
/* Number of pending centres (row[1]) */
fprintf (Gbl.F.Out,"
");
if (!PrintView &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
// Only system admins can move an institution to another country
@@ -393,18 +395,20 @@ static void Ins_Configuration (bool PrintView)
}
else // I can not move institution to another country
fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]);
-
Tbl_EndCell ();
+
Tbl_EndRow ();
/***** Institution full name *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
");
if (!PrintView &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
// Only system admins can edit institution full name
@@ -424,16 +428,19 @@ static void Ins_Configuration (bool PrintView)
else // I can not edit institution full name
fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Ins.FullName);
Tbl_EndCell ();
+
Tbl_EndRow ();
/***** Institution short name *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
");
if (!PrintView &&
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
// Only system admins can edit institution short name
@@ -453,16 +460,19 @@ static void Ins_Configuration (bool PrintView)
else // I can not edit institution short name
fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Ins.ShrtName);
Tbl_EndCell ();
+
Tbl_EndRow ();
/***** Institution WWW *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
");
QR_LinkTo (250,"ins",Gbl.Hierarchy.Ins.InsCod);
Tbl_EndCell ();
+
Tbl_EndRow ();
}
else
{
/***** Number of users who claim to belong to this institution *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
",
+ "%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Centres);
+ Tbl_EndCell ();
/* Form to go to see centres of this institution */
+ fprintf (Gbl.F.Out,"
"
+ "%u",
Usr_GetNumUsrsInCrssOfIns (Role,Gbl.Hierarchy.Ins.InsCod));
+ Tbl_EndCell ();
+
Tbl_EndRow ();
}
@@ -789,13 +821,14 @@ static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns)
BgColor = (Ins->InsCod == Gbl.Hierarchy.Ins.InsCod) ? "LIGHT_BLUE" :
Gbl.ColorRows[Gbl.RowEvenOdd];
- /***** Number of institution in this list *****/
Tbl_StartRow ();
+
+ /***** Number of institution in this list *****/
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,
NumIns);
+ Tbl_EndCell ();
/***** Institution logo and name *****/
fprintf (Gbl.F.Out,"
",BgColor);
@@ -806,39 +839,39 @@ static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns)
/***** Stats *****/
/* Number of users who claim to belong to this institution */
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,Ins->NumUsrsWhoClaimToBelongToIns);
+ Tbl_EndCell ();
/* Number of centres in this institution */
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,Ins->Ctrs.Num);
+ Tbl_EndCell ();
/* Number of degrees in this institution */
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,Ins->NumDegs);
+ Tbl_EndCell ();
/* Number of courses in this institution */
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,Ins->NumCrss);
+ Tbl_EndCell ();
/* Number of departments in this institution */
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,Ins->NumDpts);
+ Tbl_EndCell ();
/* Number of users in courses of this institution */
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
TxtClassNormal,BgColor,Ins->NumUsrs);
+ Tbl_EndCell ();
/***** Institution status *****/
StatusTxt = Ins_GetStatusTxtFromStatusBits (Ins->Status);
@@ -847,6 +880,7 @@ static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns)
if (StatusTxt != Ins_STATUS_ACTIVE) // If active ==> do not show anything
fprintf (Gbl.F.Out,"%s",Txt_INSTITUTION_STATUS[StatusTxt]);
Tbl_EndCell ();
+
Tbl_EndRow ();
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
@@ -1501,9 +1535,9 @@ static void Ins_ListInstitutionsForEdition (void)
/* Institution code */
fprintf (Gbl.F.Out,"
",
+ " required=\"required\" />",
Cns_MAX_CHARS_WWW,Ins_EditingIns->WWW);
+ Tbl_EndCell ();
/***** Number of users who claim to belong to this institution ****/
fprintf (Gbl.F.Out,"
"
- "0"
- "
");
+ "0");
+ Tbl_EndCell ();
/***** Number of centres *****/
fprintf (Gbl.F.Out,"
"
- "0"
- "
");
+ "0");
+ Tbl_EndCell ();
/***** Number of users in courses of this institution ****/
fprintf (Gbl.F.Out,"
");
}
/* Form to remove email */
@@ -1382,13 +1391,15 @@ static void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe,
/***** Form to enter new email *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
"
- ""
- "
"
- "
",
+ "",
The_ClassFormInBox[Gbl.Prefs.Theme],
NumEmails ? Txt_New_email : // A new email
Txt_Email); // The first email
+ Tbl_EndCell ();
+
+ fprintf (Gbl.F.Out,"
");
if (ItsMe)
Frm_StartFormAnchor (ActChgMyMai,Mai_EMAIL_SECTION_ID);
else
@@ -1418,6 +1429,7 @@ static void Mai_ShowFormChangeUsrEmail (const struct UsrData *UsrDat,bool ItsMe,
Txt_Save_changes); // User has no email address yet
Frm_EndForm ();
Tbl_EndCell ();
+
Tbl_EndRow ();
/***** End table *****/
diff --git a/swad_match.c b/swad_match.c
index a5cc4fd29..21035e221 100644
--- a/swad_match.c
+++ b/swad_match.c
@@ -563,11 +563,11 @@ static void Mch_ListOneOrMoreMatchesTimes (const struct Match *Match,unsigned Un
fprintf (Gbl.F.Out,""
- "
",
+ "",
(unsigned) StartEndTime,UniqueId,
Match->TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
+ Tbl_EndCell ();
}
}
@@ -661,10 +661,10 @@ static void Mch_ListOneOrMoreMatchesNumPlayers (const struct Match *Match)
{
/***** Number of players who have answered any question in the match ******/
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
Gbl.RowEvenOdd,
Mch_GetNumUsrsWhoHaveAnswerMch (Match->MchCod));
+ Tbl_EndCell ();
}
/*****************************************************************************/
@@ -1195,17 +1195,20 @@ static void Mch_PutFormNewMatch (struct Game *Game)
/***** Match title *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
",
+ "",
Txt_The_whole_course,Gbl.Hierarchy.Crs.ShrtName);
+ Tbl_EndCell ();
+
Tbl_EndRow ();
/***** List the groups for each group type *****/
@@ -3151,10 +3157,13 @@ static void Mch_DrawBarNumUsrs (unsigned NumAnswerersAns,unsigned NumAnswerersQs
for (i = 0;
i < 100;
i++)
- fprintf (Gbl.F.Out,"
",
+ {
+ fprintf (Gbl.F.Out,"
",
(i < BarWidth) ? (Correct ? "MATCH_RES_CORRECT" :
"MATCH_RES_WRONG") :
"MATCH_RES_VOID");
+ Tbl_EndCell ();
+ }
Tbl_EndRow ();
Tbl_EndTable ();
diff --git a/swad_match_result.c b/swad_match_result.c
index b7659dc37..299b8e617 100644
--- a/swad_match_result.c
+++ b/swad_match_result.c
@@ -206,11 +206,13 @@ void McR_SelUsrsToViewUsrsMchResults (void)
/***** Put list of users to select some of them *****/
Tbl_StartTableCenterPadding (2);
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
");
/* Start textarea with a '\n', that will be not visible in textarea.
When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"),
@@ -608,23 +617,26 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
else // It's not a reply
{
/* End message subject */
- fprintf (Gbl.F.Out,"%s
");
/* Start textarea with a '\n', that will be not visible in textarea.
When Content is "\nLorem ipsum" (a white line before "Lorem ipsum"),
@@ -632,8 +644,9 @@ static void Msg_WriteFormSubjectAndContentMsgToUsrs (char Content[Cns_MAX_BYTES_
by "Lorem", without the white line */
fprintf (Gbl.F.Out,"\n%s",Content);
}
- fprintf (Gbl.F.Out,"
");
@@ -3348,14 +3371,14 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted)
bool ShowPhoto;
char PhotoURL[PATH_MAX + 1];
- /***** Put an icon to show if user has read the message *****/
Tbl_StartTable ();
Tbl_StartRow ();
+
+ /***** Put an icon to show if user has read the message *****/
fprintf (Gbl.F.Out,"
");
/* Form to remove old nickname */
@@ -368,15 +371,17 @@ static void Nck_ShowFormChangeUsrNickname (const struct UsrData *UsrDat,bool Its
/***** Form to enter new nickname *****/
Tbl_StartRow ();
+
fprintf (Gbl.F.Out,"
"
""
- "
"
- "
",
+ "",
The_ClassFormInBox[Gbl.Prefs.Theme],
NumNicks ? Txt_New_nickname : // A new nickname
Txt_Nickname); // The first nickname
+ Tbl_EndCell ();
+
+ fprintf (Gbl.F.Out,"
");
if (ItsMe)
Frm_StartFormAnchor (ActChgMyNck,Nck_NICKNAME_SECTION_ID);
else
@@ -406,6 +411,7 @@ static void Nck_ShowFormChangeUsrNickname (const struct UsrData *UsrDat,bool Its
Txt_Save_changes); // I have no nickname yet);
Frm_EndForm ();
Tbl_EndCell ();
+
Tbl_EndRow ();
/***** End table and box *****/
diff --git a/swad_notification.c b/swad_notification.c
index 287b89bdb..4a256bad9 100644
--- a/swad_notification.c
+++ b/swad_notification.c
@@ -590,9 +590,10 @@ void Ntf_ShowMyNotifications (void)
/* Write status (sent by email / pending to be sent by email) */
fprintf (Gbl.F.Out,"
");
Frm_StartForm (ActSeePhoDeg);
Pho_PutHiddenParamTypeOfAvg ();
Pho_PutHiddenParamPhotoSize ();
@@ -1933,6 +1943,7 @@ static void Pho_PutSelectorForHowOrderDegrees (void)
fprintf (Gbl.F.Out,"");
Frm_EndForm ();
Tbl_EndCell ();
+
Tbl_EndRow ();
}
@@ -2238,12 +2249,13 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
/* Get data of degree */
Deg_GetDataOfDegreeByCod (&Deg);
- /***** Show logo and name of this degree *****/
Tbl_StartRow ();
+
+ /***** Show logo and name of this degree *****/
fprintf (Gbl.F.Out,"
"
- "%u"
- "
",
+ "%u",
Gbl.RowEvenOdd,++NumDegsNotEmpty);
+ Tbl_EndCell ();
/***** Show logo and name of this degree *****/
fprintf (Gbl.F.Out,"