Version19.31.21

This commit is contained in:
Antonio Cañas Vargas 2019-10-08 00:26:14 +02:00
parent 892b1a01e5
commit 82d003ba6d
5 changed files with 178 additions and 237 deletions

View File

@ -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.20 (2019-10-07)"
#define Log_PLATFORM_VERSION "SWAD 19.31.21 (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.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)
Version 19.31.19: Oct 07, 2019 Code refactoring in HTML tables. (247211 lines)
Version 19.31.18: Oct 07, 2019 Code refactoring in HTML tables. (247239 lines)

View File

@ -304,14 +304,12 @@ void Cht_ShowListOfChatRoomsWithUsrs (void)
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%s",
row[0]);
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%s",row[0]);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%s",
row[1]);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%s",row[1]);
Tbl_EndCell ();
Tbl_EndRow ();

View File

@ -143,31 +143,24 @@ void Cla_SeeClassrooms (void)
Tbl_StartRow ();
/* Short name */
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE %s\">"
"%s",
Gbl.ColorRows[RowEvenOdd],
Gbl.Classrooms.Lst[NumCla].ShrtName);
Tbl_EndRow ();
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE %s\"",Gbl.ColorRows[RowEvenOdd]);
fprintf (Gbl.F.Out,"%s",Gbl.Classrooms.Lst[NumCla].ShrtName);
Tbl_EndCell ();
/* Full name */
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE %s\">"
"%s",
Gbl.ColorRows[RowEvenOdd],
Gbl.Classrooms.Lst[NumCla].FullName);
Tbl_EndRow ();
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE %s\"",Gbl.ColorRows[RowEvenOdd]);
fprintf (Gbl.F.Out,"%s",Gbl.Classrooms.Lst[NumCla].FullName);
Tbl_EndCell ();
/* Capacity */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">",
Gbl.ColorRows[RowEvenOdd]);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",Gbl.ColorRows[RowEvenOdd]);
Cla_WriteCapacity (Gbl.Classrooms.Lst[NumCla].Capacity);
Tbl_EndCell ();
/* Location */
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE %s\">"
"%s",
Gbl.ColorRows[RowEvenOdd],
Gbl.Classrooms.Lst[NumCla].Location);
Tbl_EndRow ();
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE %s\"",Gbl.ColorRows[RowEvenOdd]);
fprintf (Gbl.F.Out,"%s",Gbl.Classrooms.Lst[NumCla].Location);
Tbl_EndCell ();
Tbl_EndRow ();
}
@ -486,9 +479,10 @@ static void Cla_ListClassroomsForEdition (void)
{
Cla = &Gbl.Classrooms.Lst[NumCla];
/* Put icon to remove classroom */
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"BM\">");
/* Put icon to remove classroom */
Tbl_StartCellAttr ("class=\"BM\"");
Frm_StartForm (ActRemCla);
Cla_PutParamClaCod (Cla->ClaCod);
Ico_PutIconRemove ();
@ -496,13 +490,12 @@ static void Cla_ListClassroomsForEdition (void)
Tbl_EndCell ();
/* Classroom code */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%ld",
Cla->ClaCod);
Tbl_EndRow ();
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%ld",Cla->ClaCod);
Tbl_EndCell ();
/* Classroom short name */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
Frm_StartForm (ActRenClaSho);
Cla_PutParamClaCod (Cla->ClaCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"ShortName\""
@ -514,7 +507,7 @@ static void Cla_ListClassroomsForEdition (void)
Tbl_EndCell ();
/* Classroom full name */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
Frm_StartForm (ActRenClaFul);
Cla_PutParamClaCod (Cla->ClaCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"FullName\""
@ -526,7 +519,7 @@ static void Cla_ListClassroomsForEdition (void)
Tbl_EndCell ();
/* Seating capacity */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
Frm_StartForm (ActChgClaMaxStd);
Cla_PutParamClaCod (Cla->ClaCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Capacity\""
@ -538,7 +531,7 @@ static void Cla_ListClassroomsForEdition (void)
Tbl_EndCell ();
/* Classroom location */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
Frm_StartForm (ActRenClaLoc);
Cla_PutParamClaCod (Cla->ClaCod);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Location\""
@ -548,6 +541,7 @@ static void Cla_ListClassroomsForEdition (void)
Cla_MAX_CHARS_LOCATION,Cla->Location,Gbl.Form.Id);
Frm_EndForm ();
Tbl_EndCell ();
Tbl_EndRow ();
}
@ -905,46 +899,46 @@ static void Cla_PutFormToCreateClassroom (void)
Tbl_StartRow ();
/***** Column to remove classroom, disabled here *****/
fprintf (Gbl.F.Out,"<td class=\"BM\">");
Tbl_EndRow ();
Tbl_StartCellAttr ("class=\"BM\"");
Tbl_EndCell ();
/***** Classroom code *****/
fprintf (Gbl.F.Out,"<td class=\"CODE\">");
Tbl_EndRow ();
Tbl_StartCellAttr ("class=\"CODE\"");
Tbl_EndCell ();
/***** Classroom short name *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"ShortName\""
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"ShortName\""
" size=\"10\" maxlength=\"%u\" value=\"%s\""
" class=\"INPUT_SHORT_NAME\""
" required=\"required\" />",
Cla_MAX_CHARS_SHRT_NAME,Cla_EditingCla->ShrtName);
Tbl_EndRow ();
Tbl_EndCell ();
/***** Classroom full name *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"FullName\""
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"FullName\""
" size=\"20\" maxlength=\"%u\" value=\"%s\""
" class=\"INPUT_FULL_NAME\""
" required=\"required\" />",
Cla_MAX_CHARS_FULL_NAME,Cla_EditingCla->FullName);
Tbl_EndRow ();
Tbl_EndCell ();
/***** Seating capacity *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"Capacity\""
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Capacity\""
" size=\"3\" maxlength=\"10\" value=\"");
Cla_WriteCapacity (Cla_EditingCla->Capacity);
fprintf (Gbl.F.Out,"\" />");
Tbl_EndRow ();
Tbl_EndCell ();
/***** Classroom location *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"Location\""
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Location\""
" size=\"15\" maxlength=\"%u\" value=\"%s\""
" class=\"INPUT_FULL_NAME\" />",
Cla_MAX_CHARS_LOCATION,Cla_EditingCla->Location);
Tbl_EndRow ();
Tbl_EndCell ();
Tbl_EndRow ();

View File

@ -358,12 +358,12 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (
if (Usrs.NumUsrs)
{
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td colspan=\"3\" class=\"CENTER_TOP\">"
"%u %s",
Tbl_StartCellAttr ("colspan=\"3\" class=\"CENTER_TOP\"");
fprintf (Gbl.F.Out,"%u %s",
Usrs.NumUsrs,
(Usrs.NumUsrs == 1) ? Txt_ROLES_SINGUL_abc[Role][Usrs.Sex] :
Txt_ROLES_PLURAL_abc[Role][Usrs.Sex]);
Tbl_EndRow ();
Tbl_EndCell ();
Tbl_EndRow ();
/***** I can see connected users *****/
@ -392,12 +392,14 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro
Gbl.Usrs.Connected.NumUsrsToList = Cfg_MAX_CONNECTED_SHOWN;
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td colspan=\"3\" class=\"CON_USR_NARROW_TIT\">"
"%u %s",
Tbl_StartCellAttr ("colspan=\"3\" class=\"CON_USR_NARROW_TIT\"");
fprintf (Gbl.F.Out,"%u %s",
NumUsrsThisRole,
(NumUsrsThisRole == 1) ? Txt_ROLES_SINGUL_abc[Role][UsrSex] :
Txt_ROLES_PLURAL_abc[Role][UsrSex]);
Tbl_EndRow ();
Tbl_EndCell ();
Tbl_EndRow ();
/***** I can see connected users *****/
@ -407,7 +409,8 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro
if (Gbl.Usrs.Connected.NumUsrsToList < Gbl.Usrs.Connected.NumUsrs)
{
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td colspan=\"3\" class=\"CENTER_TOP\">");
Tbl_StartCellAttr ("colspan=\"3\" class=\"CENTER_TOP\"");
Frm_StartFormUnique (ActLstCon); // Must be unique because
// the list of connected users
// is dynamically updated via AJAX
@ -420,6 +423,7 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Ro
Txt_Connected_users,Txt_Connected_users);
Frm_EndForm ();
Tbl_EndCell ();
Tbl_EndRow ();
}
}
@ -815,10 +819,10 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
UsrDat = &OtherUsrDat;
}
/***** Show photo *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"CON_PHOTO COLOR%u\">",
Gbl.RowEvenOdd);
/***** Show photo *****/
Tbl_StartCellAttr ("class=\"CON_PHOTO COLOR%u\"",Gbl.RowEvenOdd);
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (UsrDat,PhotoURL);
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
NULL,
@ -828,8 +832,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
/***** Write full name and link *****/
Font = (Gbl.Usrs.Connected.Lst[Gbl.Usrs.Connected.NumUsr].ThisCrs ? "CON_NAME_NARROW CON_CRS" :
"CON_NAME_NARROW CON_NO_CRS");
fprintf (Gbl.F.Out,"<td class=\"%s COLOR%u\">",
Font,Gbl.RowEvenOdd);
Tbl_StartCellAttr ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
// The form must be unique because
// the list of connected users
// is dynamically updated via AJAX
@ -859,8 +862,7 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
Font = (Gbl.Usrs.Connected.Lst[Gbl.Usrs.Connected.NumUsr].ThisCrs ? "CON_SINCE CON_CRS" :
"CON_SINCE CON_NO_CRS");
fprintf (Gbl.F.Out,"<td class=\"%s COLOR%u\">",
Font,Gbl.RowEvenOdd);
Tbl_StartCellAttr ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<div id=\"hm%u\">",
Gbl.Usrs.Connected.NumUsr); // Used for automatic update, only when displayed on right column
@ -1035,10 +1037,10 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
if (sscanf (row[2],"%ld",&TimeDiff) != 1)
TimeDiff = (time_t) 0;
/***** Show photo *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"CON_PHOTO COLOR%u\">",
Gbl.RowEvenOdd);
/***** Show photo *****/
Tbl_StartCellAttr ("class=\"CON_PHOTO COLOR%u\"",Gbl.RowEvenOdd);
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
@ -1048,8 +1050,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
/***** Write full name and link *****/
Font = (ThisCrs ? "CON_NAME_WIDE CON_CRS" :
"CON_NAME_WIDE CON_NO_CRS");
fprintf (Gbl.F.Out,"<td class=\"%s COLOR%u\">",
Font,Gbl.RowEvenOdd);
Tbl_StartCellAttr ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
if (PutLinkToRecord)
{
switch (Role)
@ -1080,10 +1081,10 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
/***** Write time from last access *****/
Font = (ThisCrs ? "CON_SINCE CON_CRS" :
"CON_SINCE CON_NO_CRS");
fprintf (Gbl.F.Out,"<td class=\"%s COLOR%u\">",
Font,Gbl.RowEvenOdd);
Tbl_StartCellAttr ("class=\"%s COLOR%u\"",Font,Gbl.RowEvenOdd);
Dat_WriteHoursMinutesSecondsFromSeconds (TimeDiff);
Tbl_EndCell ();
Tbl_EndRow ();
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;

View File

@ -185,8 +185,7 @@ void Cty_SeeCtyWithPendingInss (void)
Tbl_StartRow ();
/* Country map */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE %s\">",
BgColor);
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE %s\"",BgColor);
Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeIns,
"COUNTRY_SMALL",
"COUNTRY_MAP_SMALL",
@ -194,9 +193,8 @@ void Cty_SeeCtyWithPendingInss (void)
Tbl_EndCell ();
/* Number of pending institutions (row[1]) */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%s",
BgColor,row[1]);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%s",row[1]);
Tbl_EndCell ();
Tbl_EndRow ();
@ -328,13 +326,11 @@ static void Cty_Configuration (bool PrintView)
/***** Country name (an link to WWW if exists) *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Country);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Country);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT_N LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"DAT_N LEFT_MIDDLE\"");
if (!PrintView && Gbl.Hierarchy.Cty.WWW[Gbl.Prefs.Language][0])
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"DAT_N\">",
Gbl.Hierarchy.Cty.WWW[Gbl.Prefs.Language]);
@ -348,14 +344,12 @@ static void Cty_Configuration (bool PrintView)
/***** Link to the country inside platform *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Shortcut);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Shortcut);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"<a href=\"%s/%s?cty=%ld\" class=\"DAT\" target=\"_blank\">"
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<a href=\"%s/%s?cty=%ld\" class=\"DAT\" target=\"_blank\">"
"%s/%s?cty=%ld</a>",
Cfg_URL_SWAD_CGI,
Lan_STR_LANG_ID[Gbl.Prefs.Language],
@ -372,13 +366,11 @@ static void Cty_Configuration (bool PrintView)
/***** QR code with link to the country *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_QR_code);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_QR_code);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
QR_LinkTo (250,"cty",Gbl.Hierarchy.Cty.CtyCod);
Tbl_EndCell ();
@ -389,14 +381,12 @@ static void Cty_Configuration (bool PrintView)
/***** Number of users who claim to belong to this country *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Users_of_the_country);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Users_of_the_country);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%u",
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",
Usr_GetNumUsrsWhoClaimToBelongToCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_EndCell ();
@ -405,14 +395,12 @@ static void Cty_Configuration (bool PrintView)
/***** Number of institutions *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Institutions);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Institutions);
Tbl_EndCell ();
/* Form to go to see institutions of this country */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
Frm_StartFormGoTo (ActSeeIns);
Cty_PutParamCtyCod (Gbl.Hierarchy.Cty.CtyCod);
snprintf (Gbl.Title,sizeof (Gbl.Title),
@ -429,15 +417,12 @@ static void Cty_Configuration (bool PrintView)
/***** Number of centres *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Centres);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Centres);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%u",
Ctr_GetNumCtrsInCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Ctr_GetNumCtrsInCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_EndCell ();
Tbl_EndRow ();
@ -445,15 +430,13 @@ static void Cty_Configuration (bool PrintView)
/***** Number of degrees *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",
Txt_Degrees);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%u",
Deg_GetNumDegsInCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Deg_GetNumDegsInCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_EndCell ();
Tbl_EndRow ();
@ -461,15 +444,12 @@ static void Cty_Configuration (bool PrintView)
/***** Number of courses *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Txt_Courses);
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",Txt_Courses);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%u",
Crs_GetNumCrssInCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Crs_GetNumCrssInCty (Gbl.Hierarchy.Cty.CtyCod));
Tbl_EndCell ();
Tbl_EndRow ();
@ -509,15 +489,14 @@ static void Cty_ShowNumUsrsInCrssOfCty (Rol_Role_t Role)
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE\">"
"%s:",
The_ClassFormInBox[Gbl.Prefs.Theme],
Tbl_StartCellAttr ("class=\"%s RIGHT_MIDDLE\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:",
(Role == Rol_UNK) ? Txt_Users_in_courses :
Txt_ROLES_PLURAL_Abc[Role][Usr_SEX_UNKNOWN]);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%u",
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",
Usr_GetNumUsrsInCrssOfCty (Role,Gbl.Hierarchy.Cty.CtyCod));
Tbl_EndCell ();
@ -573,50 +552,43 @@ void Cty_ListCountries2 (void)
/***** Separation row *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td colspan=\"8\" class=\"DAT CENTER_MIDDLE\">"
"&nbsp;");
Tbl_StartCellAttr ("colspan=\"8\" class=\"DAT CENTER_MIDDLE\"");
fprintf (Gbl.F.Out,"&nbsp;");
Tbl_EndCell ();
Tbl_EndRow ();
/***** Write users and institutions in other countries *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%s",
Txt_Other_countries);
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%s",Txt_Other_countries);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Cty_GetNumUsrsWhoClaimToBelongToCty (0));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Cty_GetNumUsrsWhoClaimToBelongToCty (0));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Ins_GetNumInssInCty (0));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Ins_GetNumInssInCty (0));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Ctr_GetNumCtrsInCty (0));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Ctr_GetNumCtrsInCty (0));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Deg_GetNumDegsInCty (0));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Deg_GetNumDegsInCty (0));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Crs_GetNumCrssInCty (0));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Crs_GetNumCrssInCty (0));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Usr_GetNumUsrsInCrssOfCty (Rol_TCH,0));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Usr_GetNumUsrsInCrssOfCty (Rol_TCH,0));
Tbl_EndCell ();
Tbl_EndRow ();
@ -624,41 +596,35 @@ void Cty_ListCountries2 (void)
/***** Write users and institutions with unknown country *****/
Tbl_StartRow ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">");
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">"
"%s",
Txt_Country_unspecified);
Tbl_StartCellAttr ("class=\"DAT LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"%s",Txt_Country_unspecified);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Cty_GetNumUsrsWhoClaimToBelongToCty (-1L));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Cty_GetNumUsrsWhoClaimToBelongToCty (-1L));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Ins_GetNumInssInCty (-1L));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Ins_GetNumInssInCty (-1L));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Ctr_GetNumCtrsInCty (-1L));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Ctr_GetNumCtrsInCty (-1L));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Deg_GetNumDegsInCty (-1L));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Deg_GetNumDegsInCty (-1L));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%u",
Crs_GetNumCrssInCty (-1L));
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%u",Crs_GetNumCrssInCty (-1L));
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"0");
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"0");
Tbl_EndCell ();
Tbl_EndRow ();
@ -760,13 +726,12 @@ static void Cty_ListOneCountryForSeeing (struct Country *Cty,unsigned NumCty)
Tbl_StartRow ();
/***** Number of country in this list *****/
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,NumCty);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",NumCty);
Tbl_EndCell ();
/***** Country map (and link to WWW if exists) *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE %s\">",BgColor);
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE %s\"",BgColor);
Cty_DrawCountryMapAndNameWithLink (Cty,ActSeeIns,
"COUNTRY_SMALL",
"COUNTRY_MAP_SMALL",
@ -774,34 +739,28 @@ static void Cty_ListOneCountryForSeeing (struct Country *Cty,unsigned NumCty)
Tbl_EndCell ();
/* Write stats of this country */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,Cty->NumUsrsWhoClaimToBelongToCty);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",Cty->NumUsrsWhoClaimToBelongToCty);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,Cty->Inss.Num);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",Cty->Inss.Num);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,Cty->NumCtrs);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",Cty->NumCtrs);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,Cty->NumDegs);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",Cty->NumDegs);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,Cty->NumCrss);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",Cty->NumCrss);
Tbl_EndCell ();
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE %s\">"
"%u",
BgColor,Cty->NumUsrs);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE %s\"",BgColor);
fprintf (Gbl.F.Out,"%u",Cty->NumUsrs);
Tbl_EndCell ();
Tbl_EndRow ();
@ -1666,8 +1625,7 @@ static void Cty_ListCountriesForEdition (void)
Tbl_StartRow ();
/* Put icon to remove country */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"BT\">",
1 + Lan_NUM_LANGUAGES);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"BT\"",1 + Lan_NUM_LANGUAGES);
if (Cty->Inss.Num ||
Cty->NumUsrsWhoClaimToBelongToCty ||
Cty->NumUsrs) // Country has institutions or users ==> deletion forbidden
@ -1682,29 +1640,25 @@ static void Cty_ListCountriesForEdition (void)
Tbl_EndCell ();
/* Numerical country code (ISO 3166-1) */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%03ld",
1 + Lan_NUM_LANGUAGES,Cty->CtyCod);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"DAT RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"%03ld",Cty->CtyCod);
Tbl_EndCell ();
/* Alphabetic country code with 2 letters (ISO 3166-1) */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%s",
1 + Lan_NUM_LANGUAGES,Cty->Alpha2);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"DAT RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"%s",Cty->Alpha2);
Tbl_EndCell ();
Tbl_PutEmptyCells (3);
/* Number of users */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%u",
1 + Lan_NUM_LANGUAGES,Cty->NumUsrsWhoClaimToBelongToCty);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"DAT RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"%u",Cty->NumUsrsWhoClaimToBelongToCty);
Tbl_EndCell ();
/* Number of institutions */
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"%u",
1 + Lan_NUM_LANGUAGES,Cty->Inss.Num);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"DAT RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"%u",Cty->Inss.Num);
Tbl_EndCell ();
Tbl_EndRow ();
@ -1717,13 +1671,12 @@ static void Cty_ListCountriesForEdition (void)
Tbl_StartRow ();
/* Language */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"%s:",
Txt_STR_LANG_NAME[Lan]);
Tbl_StartCellAttr ("class=\"DAT RIGHT_MIDDLE\"");
fprintf (Gbl.F.Out,"%s:",Txt_STR_LANG_NAME[Lan]);
Tbl_EndCell ();
/* Name */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\">");
Tbl_StartCellAttr ("class=\"LEFT_TOP\"");
Frm_StartForm (ActRenCty);
Cty_PutParamOtherCtyCod (Cty->CtyCod);
Par_PutHiddenParamUnsigned ("Lan",(unsigned) Lan);
@ -1736,7 +1689,7 @@ static void Cty_ListCountriesForEdition (void)
Tbl_EndCell ();
/* WWW */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\">");
Tbl_StartCellAttr ("class=\"LEFT_TOP\"");
Frm_StartForm (ActChgCtyWWW);
Cty_PutParamOtherCtyCod (Cty->CtyCod);
Par_PutHiddenParamUnsigned ("Lan",(unsigned) Lan);
@ -2106,40 +2059,35 @@ static void Cty_PutFormToCreateCountry (void)
Tbl_StartRow ();
/***** Column to remove country, disabled here *****/
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"BT\">",
1 + Lan_NUM_LANGUAGES);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"BT\"",1 + Lan_NUM_LANGUAGES);
Tbl_EndCell ();
/***** Numerical country code (ISO 3166-1) *****/
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"RIGHT_TOP\">"
"<input type=\"text\" name=\"OthCtyCod\""
" size=\"3\" maxlength=\"10\" value=\"",
1 + Lan_NUM_LANGUAGES);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"OthCtyCod\""
" size=\"3\" maxlength=\"10\" value=\"");
if (Cty_EditingCty->CtyCod > 0)
fprintf (Gbl.F.Out,"%03ld",Cty_EditingCty->CtyCod);
fprintf (Gbl.F.Out,"\" required=\"required\" />");
Tbl_EndCell ();
/***** Alphabetic country code with 2 letters (ISO 3166-1) *****/
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"RIGHT_TOP\">"
"<input type=\"text\" name=\"Alpha2\""
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Alpha2\""
" size=\"2\" maxlength=\"2\" value=\"%s\""
" required=\"required\" />",
1 + Lan_NUM_LANGUAGES,Cty_EditingCty->Alpha2);
" required=\"required\" />",Cty_EditingCty->Alpha2);
Tbl_EndCell ();
Tbl_PutEmptyCells (3);
/***** Number of users *****/
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"0",
1 + Lan_NUM_LANGUAGES);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"DAT RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"0");
Tbl_EndCell ();
/***** Number of institutions *****/
fprintf (Gbl.F.Out,"<td rowspan=\"%u\" class=\"DAT RIGHT_TOP\">"
"0",
1 + Lan_NUM_LANGUAGES);
Tbl_StartCellAttr ("rowspan=\"%u\" class=\"DAT RIGHT_TOP\"",1 + Lan_NUM_LANGUAGES);
fprintf (Gbl.F.Out,"0");
Tbl_EndCell ();
Tbl_EndRow ();
@ -2152,14 +2100,13 @@ static void Cty_PutFormToCreateCountry (void)
Tbl_StartRow ();
/* Language */
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_TOP\">"
"%s",
Txt_STR_LANG_NAME[Lan]);
Tbl_StartCellAttr ("class=\"DAT RIGHT_TOP\"");
fprintf (Gbl.F.Out,"%s",Txt_STR_LANG_NAME[Lan]);
Tbl_EndCell ();
/* Name */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"Name_%s\""
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Name_%s\""
" size=\"15\" maxlength=\"%u\" value=\"%s\""
" required=\"required\" />",
Lan_STR_LANG_ID[Lan],
@ -2168,8 +2115,8 @@ static void Cty_PutFormToCreateCountry (void)
Tbl_EndCell ();
/* WWW */
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"url\" name=\"WWW_%s\""
Tbl_StartCellAttr ("class=\"LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<input type=\"url\" name=\"WWW_%s\""
" maxlength=\"%u\" value=\"%s\""
" class=\"INPUT_WWW\" />",
Lan_STR_LANG_ID[Lan],