From bae037c646db0771963b80764748d11f2e31c400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 7 Oct 2019 08:55:06 +0200 Subject: [PATCH] Version19.31.11 --- swad_changelog.h | 3 +- swad_degree.c | 7 ++- swad_department.c | 79 ++++++++++++++---------- swad_duplicate.c | 29 ++++++--- swad_enrolment.c | 51 ++++++++------- swad_exam.c | 154 +++++++++++++++++++++++++++++----------------- 6 files changed, 199 insertions(+), 124 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 7e885d1c4..c24204e62 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -487,12 +487,13 @@ 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.10 (2019-10-07)" +#define Log_PLATFORM_VERSION "SWAD 19.31.11 (2019-10-07)" #define CSS_FILE "swad19.29.css" #define JS_FILE "swad19.30.js" /* // TODO: Perico: poner un candado de bloqueo de creación/edición de proyectos (por ejemplo en asignaturas obsoletas) + Version 19.31.11: Oct 07, 2019 Code refactoring in HTML tables. (247111 lines) Version 19.31.10: Oct 07, 2019 Code refactoring in HTML tables. (247106 lines) Version 19.31.9: Oct 06, 2019 Code refactoring in HTML tables. (247097 lines) Version 19.31.8: Oct 05, 2019 Code refactoring in HTML tables. (247089 lines) diff --git a/swad_degree.c b/swad_degree.c index 42df2a738..b91cec4f7 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -419,12 +419,14 @@ static void Deg_Configuration (bool PrintView) /***** Degree short name *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_Short_name); - fprintf (Gbl.F.Out,"" - ""); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); if (!PrintView && Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) // Only centre admins, institution admins and system admins @@ -445,6 +447,7 @@ static void Deg_Configuration (bool PrintView) else // I can not edit degree short name fprintf (Gbl.F.Out,"%s",Gbl.Hierarchy.Deg.ShrtName); Tbl_EndCell (); + Tbl_EndRow (); /***** Degree WWW *****/ diff --git a/swad_department.c b/swad_department.c index 17b7f9fe1..4d687a339 100644 --- a/swad_department.c +++ b/swad_department.c @@ -147,17 +147,20 @@ void Dpt_SeeDepts (void) { /* Write data of this department */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" "" "%s" - "" - "" - "" - "%u" - "", + "", Gbl.Dpts.Lst[NumDpt].WWW, - Gbl.Dpts.Lst[NumDpt].FullName, + Gbl.Dpts.Lst[NumDpt].FullName); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%u", Gbl.Dpts.Lst[NumDpt].NumTchs); + Tbl_EndCell (); + Tbl_EndRow (); /* Update number of teachers from the current institution @@ -168,36 +171,43 @@ void Dpt_SeeDepts (void) /***** Separation row *****/ Tbl_StartRow (); fprintf (Gbl.F.Out,"" - " " - ""); + " "); + Tbl_EndCell (); Tbl_EndRow (); /***** Write teachers with other department *****/ NumTchsInOtherDpts = Usr_GetNumTchsCurrentInsInDepartment (0); Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%u" - "", - Txt_Other_departments,NumTchsInOtherDpts); + "%s", + Txt_Other_departments); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%u", + NumTchsInOtherDpts); + Tbl_EndCell (); + Tbl_EndRow (); NumTchsInsWithDpt += NumTchsInOtherDpts; /***** Write teachers with no department *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%u" - "", - Txt_Department_unspecified, + "%s", + Txt_Department_unspecified); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + "%u", Usr_GetTotalNumberOfUsersInCourses (Hie_INS, 1 << Rol_NET | 1 << Rol_TCH) - NumTchsInsWithDpt); + Tbl_EndCell (); + Tbl_EndRow (); /***** End table and box *****/ @@ -524,9 +534,9 @@ static void Dpt_ListDepartmentsForEdition (void) /* Department code */ fprintf (Gbl.F.Out,"" - "%ld " - "", + "%ld ", Dpt->DptCod); + Tbl_EndCell (); /* Institution */ fprintf (Gbl.F.Out,""); @@ -589,9 +599,10 @@ static void Dpt_ListDepartmentsForEdition (void) /* Number of teachers */ fprintf (Gbl.F.Out,"" - "%u" - "", + "%u", Dpt->NumTchs); + Tbl_EndCell (); + Tbl_EndRow (); } @@ -926,8 +937,9 @@ static void Dpt_PutFormToCreateDepartment (void) Txt_WWW); Tbl_EndRow (); - /***** Institution *****/ Tbl_StartRow (); + + /***** Institution *****/ fprintf (Gbl.F.Out,"" "" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); /***** Department short name *****/ fprintf (Gbl.F.Out,"" "" - "", + " required=\"required\" />", Hie_MAX_CHARS_SHRT_NAME,Dpt_EditingDpt->ShrtName); + Tbl_EndCell (); /***** Department full name *****/ fprintf (Gbl.F.Out,"" "" - "", + " required=\"required\" />", Hie_MAX_CHARS_FULL_NAME,Dpt_EditingDpt->FullName); + Tbl_EndCell (); /***** Department WWW *****/ fprintf (Gbl.F.Out,"" "" - "", + " required=\"required\" />", Cns_MAX_CHARS_WWW,Dpt_EditingDpt->WWW); + Tbl_EndCell (); + Tbl_EndRow (); /***** End table, send button and end box *****/ diff --git a/swad_duplicate.c b/swad_duplicate.c index 3d675d04f..5a1577a0d 100644 --- a/swad_duplicate.c +++ b/swad_duplicate.c @@ -186,10 +186,13 @@ void Dup_ListDuplicateUsrs (void) Usr_WriteRowUsrMainData (NumUsrs - NumUsr,&UsrDat,false,Rol_UNK); Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "", + Gbl.RowEvenOdd); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", - Gbl.RowEvenOdd, Usr_NUM_MAIN_FIELDS_DATA_USR-2, Gbl.RowEvenOdd); @@ -208,6 +211,7 @@ void Dup_ListDuplicateUsrs (void) Dup_PutButtonToRemoveFromListOfDupUsrs (&UsrDat); Tbl_EndCell (); + Tbl_EndRow (); Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; @@ -319,9 +323,12 @@ static void Dup_ListSimilarUsrs (void) Usr_WriteRowUsrMainData (NumUsrs - NumUsr,&UsrDat,false,Rol_UNK); Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "", - Gbl.RowEvenOdd, + + fprintf (Gbl.F.Out,"", + Gbl.RowEvenOdd); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", Usr_NUM_MAIN_FIELDS_DATA_USR-2, Gbl.RowEvenOdd); @@ -337,10 +344,13 @@ static void Dup_ListSimilarUsrs (void) Tbl_EndRow (); Tbl_StartRow (); - fprintf (Gbl.F.Out,"" - "", + Gbl.RowEvenOdd); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", - Gbl.RowEvenOdd, Usr_NUM_MAIN_FIELDS_DATA_USR-2, Gbl.RowEvenOdd); @@ -353,6 +363,7 @@ static void Dup_ListSimilarUsrs (void) Dup_PutButtonToRemoveFromListOfDupUsrs (&UsrDat); Tbl_EndCell (); + Tbl_EndRow (); Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; diff --git a/swad_enrolment.c b/swad_enrolment.c index 8d8aa9dc6..12c053eff 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -929,16 +929,19 @@ static void Enr_PutAreaToEnterUsrsIDs (void) /***** Text area for users' IDs *****/ Tbl_StartTableCenterPadding (2); Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme], Txt_List_of_nicks_emails_or_IDs); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"" + ""); + Tbl_EndCell (); + Tbl_EndRow (); Tbl_EndTable (); } @@ -2295,28 +2298,34 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /* Scope (whole platform, current centre, current degree or current course) */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Scope); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Sco_PutSelectorScope ("ScopeEnr",true); Tbl_EndCell (); + Tbl_EndRow (); /* Users' roles in listing */ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,""); Rol_WriteSelectorRoles (1 << Rol_STD | 1 << Rol_NET | 1 << Rol_TCH, RolesSelected, false,true); Tbl_EndCell (); + Tbl_EndRow (); /* End table and form */ @@ -2863,9 +2872,9 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /***** Number *****/ Tbl_StartRow (); fprintf (Gbl.F.Out,"" - "%lu" - "", + "%lu", NumReqs - NumReq); + Tbl_EndCell (); /***** Link to course *****/ Crs_GetDataOfCourseByCod (&Crs); @@ -2886,9 +2895,9 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected) /***** Number of teachers in the course *****/ fprintf (Gbl.F.Out,"" - "%u" - "", + "%u", Crs.NumUsrs[Rol_TCH]); + Tbl_EndCell (); /***** User photo *****/ fprintf (Gbl.F.Out,"" "
"); // Limited width Usr_WriteFirstNameBRSurnames (&UsrDat); - fprintf (Gbl.F.Out,"
" - ""); + fprintf (Gbl.F.Out,""); + Tbl_EndCell (); /***** Requested role (row[3]) *****/ fprintf (Gbl.F.Out,"" - "%s" - "", + "%s", Txt_ROLES_SINGUL_abc[DesiredRole][UsrDat.Sex]); + Tbl_EndCell (); /***** Request time (row[4]) *****/ Msg_WriteMsgDate (Dat_GetUNIXTimeFromStr (row[4]),"DAT"); diff --git a/swad_exam.c b/swad_exam.c index 6a8225b80..822690e2d 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -1052,11 +1052,11 @@ static void Exa_ShowExamAnnouncement (long ExaCod, fprintf (Gbl.F.Out,"", Ins.WWW,StyleTitle); Log_DrawLogo (Hie_INS,Ins.InsCod,Ins.FullName,64,NULL,true); - fprintf (Gbl.F.Out,"
%s%s" - "", + fprintf (Gbl.F.Out,"
%s%s", Ins.FullName, TypeViewExamAnnouncement == Exa_PRINT_VIEW ? "" : "
"); + Tbl_EndCell (); Tbl_EndRow (); /***** Degree *****/ @@ -1076,26 +1076,28 @@ static void Exa_ShowExamAnnouncement (long ExaCod, Tbl_StartRow (); fprintf (Gbl.F.Out,"" " 
" - "%s" - "", + "%s", StyleNormal,Txt_EXAM_ANNOUNCEMENT); + Tbl_EndCell (); Tbl_EndRow (); Tbl_StartRow (); fprintf (Gbl.F.Out,"" - " " - "", + " ", StyleNormal); + Tbl_EndCell (); Tbl_EndRow (); /***** Name of the course *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", StyleForm, - Txt_EXAM_ANNOUNCEMENT_Course, + Txt_EXAM_ANNOUNCEMENT_Course); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) { @@ -1107,16 +1109,19 @@ static void Exa_ShowExamAnnouncement (long ExaCod, fprintf (Gbl.F.Out,"%s", Gbl.ExamAnns.ExaDat.CrsFullName); Tbl_EndCell (); + Tbl_EndRow (); /***** Year/semester (N.A., 1º, 2º, 3º, 4º, 5º...) *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", StyleForm, - Txt_EXAM_ANNOUNCEMENT_Year_or_semester, + Txt_EXAM_ANNOUNCEMENT_Year_or_semester); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) { @@ -1139,16 +1144,19 @@ static void Exa_ShowExamAnnouncement (long ExaCod, fprintf (Gbl.F.Out,"%s", Txt_YEAR_OF_DEGREE[Gbl.ExamAnns.ExaDat.Year]); Tbl_EndCell (); + Tbl_EndRow (); /***** Exam session *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", StyleForm, - Txt_EXAM_ANNOUNCEMENT_Session, + Txt_EXAM_ANNOUNCEMENT_Session); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) fprintf (Gbl.F.Out,"" - "%s:" - "", + "%s:", StyleForm, Txt_EXAM_ANNOUNCEMENT_Exam_date); + Tbl_EndCell (); + if (TypeViewExamAnnouncement == Exa_FORM_VIEW) { fprintf (Gbl.F.Out,""); @@ -1182,20 +1193,22 @@ static void Exa_ShowExamAnnouncement (long ExaCod, Dat_ConvDateToDateStr (&Gbl.ExamAnns.ExaDat.ExamDate, StrExamDate); fprintf (Gbl.F.Out,"" - "%s" - "", + "%s", StyleNormal,StrExamDate); + Tbl_EndCell (); } Tbl_EndRow (); /***** Start time *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", StyleForm, - Txt_EXAM_ANNOUNCEMENT_Start_time, + Txt_EXAM_ANNOUNCEMENT_Start_time); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) { @@ -1232,16 +1245,19 @@ static void Exa_ShowExamAnnouncement (long ExaCod, Gbl.ExamAnns.ExaDat.StartTime.Hour, Gbl.ExamAnns.ExaDat.StartTime.Minute); Tbl_EndCell (); + Tbl_EndRow (); /***** Approximate duration of the exam *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "%s:" - "" - "", + "%s:", StyleForm, - Txt_EXAM_ANNOUNCEMENT_Approximate_duration, + Txt_EXAM_ANNOUNCEMENT_Approximate_duration); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) { @@ -1298,16 +1314,19 @@ static void Exa_ShowExamAnnouncement (long ExaCod, } } Tbl_EndCell (); + Tbl_EndRow (); /***** Place where the exam will be made *****/ Tbl_StartRow (); + fprintf (Gbl.F.Out,"" - "" - "" - "", + "", StyleForm, - Txt_EXAM_ANNOUNCEMENT_Place_of_exam, + Txt_EXAM_ANNOUNCEMENT_Place_of_exam); + Tbl_EndCell (); + + fprintf (Gbl.F.Out,"", StyleNormal); if (TypeViewExamAnnouncement == Exa_FORM_VIEW) fprintf (Gbl.F.Out,"