diff --git a/swad_account.c b/swad_account.c index 67d1ae2ea..6107ec09d 100644 --- a/swad_account.c +++ b/swad_account.c @@ -44,6 +44,7 @@ #include "swad_parameter.h" #include "swad_profile.h" #include "swad_report.h" +#include "swad_table.h" #include "swad_timeline.h" /*****************************************************************************/ @@ -277,8 +278,8 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct UsrD extern const char *Txt_Its_me; /***** Write number of user in the list *****/ - fprintf (Gbl.F.Out,"" - "" "%u" "", @@ -304,19 +305,19 @@ static void Acc_WriteRowEmptyAccount (unsigned NumUsr,const char *ID,struct UsrD Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Btn_PutCreateButtonInline (Txt_Its_me); Frm_EndForm (); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); /***** Courses of this user *****/ - fprintf (Gbl.F.Out,"" - "", + Tbl_StartRow (); + fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); UsrDat->Sex = Usr_SEX_UNKNOWN; Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_TCH); Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_NET); Crs_GetAndWriteCrssOfAUsr (UsrDat,Rol_STD); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); } /*****************************************************************************/ @@ -366,8 +367,8 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith NewNicknameWithoutArroba); else NewNicknameWithArroba[0] = '\0'; - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" @@ -375,17 +376,17 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith " size=\"18\" maxlength=\"%u\"" " placeholder=\"%s\" value=\"%s\"" " required=\"required\" />" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Nickname, 1 + Nck_MAX_CHARS_NICKNAME_WITHOUT_ARROBA, Txt_HELP_nickname, NewNicknameWithArroba); + Tbl_EndRow (); /***** Email *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" @@ -393,13 +394,13 @@ static void Acc_ShowFormRequestNewAccountWithParams (const char *NewNicknameWith " size=\"18\" maxlength=\"%u\"" " placeholder=\"%s\" value=\"%s\"" " required=\"required\" />" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Email, Cns_MAX_CHARS_EMAIL_ADDRESS, Txt_HELP_email, NewEmail); + Tbl_EndRow (); /***** Password *****/ Pwd_PutFormToGetNewPasswordOnce (); diff --git a/swad_agenda.c b/swad_agenda.c index ad18891a1..0ed3c319f 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -566,7 +566,7 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) Agd_Order_t Order; /***** Table head *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartRow (); for (Order = Agd_ORDER_BY_START_DATE; Order <= Agd_ORDER_BY_END_DATE; Order++) @@ -602,10 +602,10 @@ static void Agd_WriteHeaderListEvents (Agd_AgendaType_t AgendaType) "" "" "%s" - "" - "", + "", Txt_Event, Txt_Location); + Tbl_EndRow (); } /*****************************************************************************/ @@ -740,7 +740,7 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod) Frm_SetAnchorStr (AgdEvent.AgdCod,&Anchor); /***** Write first row of data of this event *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartRow (); /* Start/end date/time */ UniqueId++; @@ -781,11 +781,11 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod) "ASG_TITLE", AgdEvent.Location); - fprintf (Gbl.F.Out,""); + Tbl_EndRow (); /***** Write second row of data of this event *****/ - fprintf (Gbl.F.Out,"" - "", + Tbl_StartRow (); + fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); /* Forms to remove/edit this event */ @@ -808,12 +808,12 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod) Str_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links fprintf (Gbl.F.Out,"" "
%s
" - "" - "", + "", Gbl.RowEvenOdd, AgdEvent.Hidden ? "DAT_LIGHT" : "DAT", Txt); + Tbl_EndRow (); /***** Free anchor string *****/ Frm_FreeAnchorStr (Anchor); @@ -1500,42 +1500,42 @@ void Agd_RequestCreatOrEditEvent (void) Hlp_PROFILE_Agenda_edit_event,Box_NOT_CLOSABLE,2); /***** Event *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Event, Agd_MAX_CHARS_EVENT,AgdEvent.Event); + Tbl_EndRow (); /***** Location *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Location, Agd_MAX_CHARS_LOCATION,AgdEvent.Location); + Tbl_EndRow (); /***** Start and end dates *****/ Dat_PutFormStartEndClientLocalDateTimes (AgdEvent.TimeUTC, Dat_FORM_SECONDS_OFF); /***** Text *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" @@ -1546,8 +1546,8 @@ void Agd_RequestCreatOrEditEvent (void) if (!ItsANewEvent) fprintf (Gbl.F.Out,"%s",Txt); fprintf (Gbl.F.Out,"" - "" - ""); + ""); + Tbl_EndRow (); /***** End table, send button and end box *****/ if (ItsANewEvent) diff --git a/swad_announcement.c b/swad_announcement.c index 7e588d52c..9330fed3f 100644 --- a/swad_announcement.c +++ b/swad_announcement.c @@ -412,8 +412,8 @@ void Ann_ShowFormAnnouncement (void) Ann_PutSubjectMessage ("Content",Txt_MSG_Content,20); /***** Users' roles who can view the announcement *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "%s: " "" "", @@ -430,8 +430,8 @@ void Ann_ShowFormAnnouncement (void) 1 << Rol_NET | 1 << Rol_TCH, false,false); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); /***** End table, send button and end box *****/ Box_EndBoxTableWithButton (Btn_CREATE_BUTTON,Txt_Create_announcement); @@ -449,18 +449,18 @@ static void Ann_PutSubjectMessage (const char *Field,const char *Label, { extern const char *The_ClassFormInBox[The_NUM_THEMES]; - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" "" - "" - "", + "", Field,The_ClassFormInBox[Gbl.Prefs.Theme],Label, Field,Field,Rows); + Tbl_EndRow (); } /*****************************************************************************/ diff --git a/swad_assignment.c b/swad_assignment.c index 088545d99..8c5be15b7 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -202,8 +202,8 @@ static void Asg_PutHeadForSeeing (bool PrintView) extern const char *Txt_Folder; Dat_StartEndTime_t Order; - fprintf (Gbl.F.Out,"" - ""); // Column for contextual icons + Tbl_StartRow (); + fprintf (Gbl.F.Out,""); // Column for contextual icons for (Order = Dat_START_TIME; Order <= Dat_END_TIME; Order++) @@ -236,10 +236,10 @@ static void Asg_PutHeadForSeeing (bool PrintView) "" "" "%s" - "" - "", + "", Txt_Assignment, Txt_Folder); + Tbl_EndRow (); } /*****************************************************************************/ @@ -357,8 +357,8 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) /***** Write first row of data of this assignment *****/ /* Forms to remove/edit this assignment */ - fprintf (Gbl.F.Out,"" - ""); else @@ -412,12 +412,12 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) fprintf (Gbl.F.Out,"\">"); if (Asg.SendWork == Asg_SEND_WORK) Asg_WriteAssignmentFolder (&Asg,PrintView); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); /***** Write second row of data of this assignment *****/ - fprintf (Gbl.F.Out,"" - ""); @@ -441,11 +441,11 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (&Asg); fprintf (Gbl.F.Out,"
%s
" - "" - "", + "", Asg.Hidden ? "DAT_LIGHT" : "DAT", Txt); + Tbl_EndRow (); /***** Free anchor string *****/ Frm_FreeAnchorStr (Anchor); @@ -1158,25 +1158,25 @@ void Asg_RequestCreatOrEditAsg (void) /***** Assignment title *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Title, Asg_MAX_CHARS_ASSIGNMENT_TITLE,Asg.Title); + Tbl_EndRow (); /***** Assignment start and end dates *****/ Dat_PutFormStartEndClientLocalDateTimes (Asg.TimeUTC,Dat_FORM_SECONDS_ON); /***** Send work? *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "%s:" "" "" @@ -1184,16 +1184,16 @@ void Asg_RequestCreatOrEditAsg (void) "" "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Upload_files_QUESTION, Txt_Folder, Brw_MAX_CHARS_FOLDER,Asg.Folder); + Tbl_EndRow (); /***** Assignment text *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" @@ -1203,8 +1203,8 @@ void Asg_RequestCreatOrEditAsg (void) if (!ItsANewAssignment) fprintf (Gbl.F.Out,"%s",Txt); fprintf (Gbl.F.Out,"" - "" - ""); + ""); + Tbl_EndRow (); /***** Groups *****/ Asg_ShowLstGrpsToEditAssignment (Asg.AsgCod); @@ -1240,8 +1240,8 @@ static void Asg_ShowLstGrpsToEditAssignment (long AsgCod) if (Gbl.Crs.Grps.GrpTypes.Num) { /***** Start box and table *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "%s:" "" "", @@ -1251,8 +1251,8 @@ static void Asg_ShowLstGrpsToEditAssignment (long AsgCod) Hlp_USERS_Groups,Box_NOT_CLOSABLE,0); /***** First row: checkbox to select the whole course *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "" - "", + "", Txt_The_whole_course,Gbl.Hierarchy.Crs.ShrtName); + Tbl_EndRow (); /***** List the groups for each group type *****/ for (NumGrpTyp = 0; @@ -1274,8 +1274,8 @@ static void Asg_ShowLstGrpsToEditAssignment (long AsgCod) /***** End table and box *****/ Box_EndBoxTable (); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); } /***** Free list of groups types and groups in this course *****/ diff --git a/swad_attendance.c b/swad_attendance.c index 5251fbc3b..bfae516c2 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -238,8 +238,8 @@ static void Att_ShowAllAttEvents (void) { /***** Table head *****/ Tbl_StartTableWideMarginPadding (2); - fprintf (Gbl.F.Out,"" - ""); // Column for contextual icons + Tbl_StartRow (); + fprintf (Gbl.F.Out,""); // Column for contextual icons for (Order = Dat_START_TIME; Order <= Dat_END_TIME; Order++) @@ -264,10 +264,10 @@ static void Att_ShowAllAttEvents (void) "" "" "%s" - "" - "", + "", Txt_Event, Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + Tbl_EndRow (); /***** Write all the attendance events *****/ for (NumAttEvent = Pagination.FirstItemVisible, Gbl.RowEvenOdd = 0; @@ -387,8 +387,8 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt /***** Write first row of data of this attendance event *****/ /* Forms to remove/edit this attendance event */ - fprintf (Gbl.F.Out,"" - ""); @@ -447,13 +447,13 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out,"\">" "%u" - "" - "", + "", Att->NumStdsTotal); + Tbl_EndRow (); /***** Write second row of data of this attendance event *****/ - fprintf (Gbl.F.Out,"" - ""); @@ -481,8 +481,8 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt "DAT", Description); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); /***** Free anchor string *****/ Frm_FreeAnchorStr (Anchor); @@ -1094,25 +1094,25 @@ void Att_RequestCreatOrEditAttEvent (void) Hlp_USERS_Attendance_edit_event,Box_NOT_CLOSABLE,2); /***** Attendance event title *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Title, Att_MAX_CHARS_ATTENDANCE_EVENT_TITLE,Att.Title); + Tbl_EndRow (); /***** Assignment start and end dates *****/ Dat_PutFormStartEndClientLocalDateTimes (Att.TimeUTC,Dat_FORM_SECONDS_ON); /***** Visibility of comments *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" @@ -1132,12 +1132,12 @@ void Att_RequestCreatOrEditAttEvent (void) Txt_Visible_MALE_PLURAL); fprintf (Gbl.F.Out,"" - "" - ""); + ""); + Tbl_EndRow (); /***** Attendance event description *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "" "" @@ -1147,8 +1147,8 @@ void Att_RequestCreatOrEditAttEvent (void) if (!ItsANewAttEvent) fprintf (Gbl.F.Out,"%s",Description); fprintf (Gbl.F.Out,"" - "" - ""); + ""); + Tbl_EndRow (); /***** Groups *****/ Att_ShowLstGrpsToEditAttEvent (Att.AttCod); @@ -1184,8 +1184,8 @@ static void Att_ShowLstGrpsToEditAttEvent (long AttCod) if (Gbl.Crs.Grps.GrpTypes.Num) { /***** Start box and table *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "%s:" "" "", @@ -1194,8 +1194,8 @@ static void Att_ShowLstGrpsToEditAttEvent (long AttCod) NULL,Box_NOT_CLOSABLE,0); /***** First row: checkbox to select the whole course *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" - "" - "", + "", Txt_The_whole_course,Gbl.Hierarchy.Crs.ShrtName); + Tbl_EndRow (); /***** List the groups for each group type *****/ for (NumGrpTyp = 0; @@ -1217,8 +1217,8 @@ static void Att_ShowLstGrpsToEditAttEvent (long AttCod) /***** End table and box *****/ Box_EndBoxTable (); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndRow (); } /***** Free list of groups types and groups in this course *****/ @@ -1878,8 +1878,8 @@ static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att) Tbl_StartTableWideMarginPadding (2); /* Header */ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" ""); if (Gbl.Usrs.Listing.WithPhotos) @@ -1892,11 +1892,11 @@ static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att) "" "" "%s" - "" - "", + "", Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN], Txt_Student_comment, Txt_Teachers_comment); + Tbl_EndRow (); /* List of students (only me) */ Att_WriteRowUsrToCallTheRoll (1,&Gbl.Usrs.Me.UsrDat,Att); @@ -1965,8 +1965,8 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) Tbl_StartTableWideMarginPadding (2); /* Header */ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" ""); if (Gbl.Usrs.Listing.WithPhotos) @@ -1979,11 +1979,11 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) "" "" "%s" - "" - "", + "", Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN], Txt_Student_comment, Txt_Teachers_comment); + Tbl_EndRow (); /* List of students */ for (NumUsr = 0, Gbl.RowEvenOdd = 0; @@ -2079,8 +2079,8 @@ static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, Present = Att_CheckIfUsrIsPresentInAttEventAndGetComments (Att->AttCod,UsrDat->UsrCod,CommentStd,CommentTch); /***** Icon to show if the user is already present *****/ - fprintf (Gbl.F.Out,"" - "" + Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "