From 7e7137d1bfb77ac833438e763969415abde875ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 3 Oct 2019 22:55:00 +0200 Subject: [PATCH] Version19.30.6 --- swad_attendance.c | 4 ++-- swad_changelog.h | 3 ++- swad_connected.c | 4 ++-- swad_date.c | 9 +++++---- swad_file_browser.c | 14 +++++++------- swad_follow.c | 5 +++-- swad_indicator.c | 2 +- swad_layout.c | 3 ++- swad_message.c | 8 ++++---- swad_profile.c | 9 +++++---- swad_statistic.c | 6 +++--- swad_test_import.c | 8 ++++---- swad_timetable.c | 3 ++- swad_user.c | 4 ++-- 14 files changed, 44 insertions(+), 38 deletions(-) diff --git a/swad_attendance.c b/swad_attendance.c index e0624f32c..5251fbc3b 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -3537,7 +3537,7 @@ static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat) /***** Write user's ID ******/ fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,"" "" "", UsrDat->FirstName); - fprintf (Gbl.F.Out,"
", UsrDat->Accepted ? "DAT_N" : @@ -3555,7 +3555,7 @@ static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat) fprintf (Gbl.F.Out,", %s
"); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); diff --git a/swad_changelog.h b/swad_changelog.h index 09e27df40..9a92eaaa1 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.30.5 (2019-10-03)" +#define Log_PLATFORM_VERSION "SWAD 19.30.6 (2019-10-03)" #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.30.6: Oct 03, 2019 Code refactoring in HTML tables. (246928 lines) Version 19.30.5: Oct 03, 2019 Code refactoring in HTML tables. (246922 lines) Version 19.30.4: Oct 03, 2019 Code refactoring in HTML tables. (246897 lines) Version 19.30.3: Oct 03, 2019 Changes in help links. (246895 lines) diff --git a/swad_connected.c b/swad_connected.c index 0877e1706..5d838077c 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -288,7 +288,7 @@ static void Con_ShowConnectedUsrsBelongingToLocation (void) Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (Rol_STD); if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (Rol_GST); - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); /***** Put link to register students *****/ Enr_CheckStdsAndPutButtonToRegisterStdsInCurrentCrs (); @@ -337,7 +337,7 @@ void Con_ShowConnectedUsrsBelongingToCurrentCrs (void) Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Rol_TCH); Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Rol_NET); Con_ShowConnectedUsrsWithARoleBelongingToCurrentCrsOnRightColumn (Rol_STD); - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); /***** End container *****/ fprintf (Gbl.F.Out,""); diff --git a/swad_date.c b/swad_date.c index d9bdaba58..9b5bacb61 100644 --- a/swad_date.c +++ b/swad_date.c @@ -37,6 +37,7 @@ #include "swad_global.h" #include "swad_parameter.h" #include "swad_setting.h" +#include "swad_table.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ @@ -549,7 +550,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id, /***** Start table *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,""); /***** Year *****/ @@ -665,7 +666,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id, /***** End table *****/ fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); /***** Hidden field with UTC time (seconds since 1970) used to send time *****/ fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,""); /***** Year *****/ @@ -895,7 +896,7 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear, /***** End table *****/ fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_file_browser.c b/swad_file_browser.c index fb8cb316a..f53fad27a 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3670,7 +3670,7 @@ static void Brw_ShowFileBrowser (void) false, // Tree not contracted Gbl.FileBrowser.Priv.PathRootFolder, Brw_RootFolderInternalNames[Gbl.FileBrowser.Type]); - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); /***** Show and store number of documents found *****/ Brw_ShowAndStoreSizeOfFileTree (); @@ -5591,7 +5591,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, fprintf (Gbl.F.Out,"", Gbl.RowEvenOdd); - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,""); /* Indent depending on level */ @@ -5629,7 +5629,7 @@ static bool Brw_WriteRowFileBrowser (unsigned Level,const char *RowId, /* End column */ fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); fprintf (Gbl.F.Out,""); if (AdminMarks) @@ -5819,7 +5819,7 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level, Brw_IconTree_t IconThisRow) { fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,""); Brw_IndentDependingOnLevel (Level); @@ -5855,7 +5855,7 @@ static void Brw_IndentAndWriteIconExpandContract (unsigned Level, fprintf (Gbl.F.Out,""); fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); fprintf (Gbl.F.Out,""); } @@ -8506,7 +8506,7 @@ static void Brw_PutFormToCreateALink (const char *FileNameToShow) FileNameToShow); /***** URL *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,"" "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Save_as,Txt_optional, Brw_MAX_CHARS_FOLDER); - fprintf (Gbl.F.Out,"
" "
"); + Tbl_EndTable (); /***** Send button and end box *****/ Box_EndBoxWithButton (Btn_CREATE_BUTTON,Txt_Create_link); diff --git a/swad_follow.c b/swad_follow.c index c36b14429..74b6eacc0 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -36,6 +36,7 @@ #include "swad_notification.h" #include "swad_privacy.h" #include "swad_profile.h" +#include "swad_table.h" #include "swad_user.h" /*****************************************************************************/ @@ -216,7 +217,7 @@ void Fol_SuggestUsrsToFollowMainZoneOnRightColumn (void) Frm_EndForm (); /***** Start table *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); @@ -241,7 +242,7 @@ void Fol_SuggestUsrsToFollowMainZoneOnRightColumn (void) Usr_UsrDataDestructor (&UsrDat); /***** End table *****/ - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); /***** End container *****/ fprintf (Gbl.F.Out,""); diff --git a/swad_indicator.c b/swad_indicator.c index 84ad9cc47..2cab4d4aa 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -1386,7 +1386,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat } /***** End table *****/ - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_layout.c b/swad_layout.c index 61db23b50..8475ecabe 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -52,6 +52,7 @@ #include "swad_parameter.h" #include "swad_setting.h" #include "swad_tab.h" +#include "swad_table.h" #include "swad_theme.h" #include "swad_timeline.h" @@ -1682,7 +1683,7 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto, /***** End table *****/ fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_message.c b/swad_message.c index 81337eedc..13c246c6b 100644 --- a/swad_message.c +++ b/swad_message.c @@ -3349,7 +3349,7 @@ static void Msg_WriteMsgFrom (struct UsrData *UsrDat,bool Deleted) char PhotoURL[PATH_MAX + 1]; /***** Put an icon to show if user has read the message *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,"" ""); - fprintf (Gbl.F.Out,"
" "" "
"); + Tbl_EndTable (); } /*****************************************************************************/ @@ -3475,7 +3475,7 @@ static void Msg_WriteMsgTo (long MsgCod) if (NumRecipientsTotal) { /***** Start table *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); /***** How many recipients will be shown? *****/ if (NumRecipientsKnown <= Msg_MAX_RECIPIENTS_TO_SHOW) @@ -3581,7 +3581,7 @@ static void Msg_WriteMsgTo (long MsgCod) Usr_UsrDataDestructor (&UsrDat); /***** End table *****/ - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); } /***** Free structure that stores the query result *****/ diff --git a/swad_profile.c b/swad_profile.c index d068ab1b1..4b0c6c0b1 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -44,6 +44,7 @@ #include "swad_role.h" #include "swad_role_type.h" #include "swad_setting.h" +#include "swad_table.h" #include "swad_theme.h" #include "swad_timeline.h" #include "swad_user.h" @@ -1537,7 +1538,7 @@ void Prf_ShowRankingFigure (MYSQL_RES **mysql_res,unsigned NumUsrs) /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); for (NumUsr = 1, Rank = 1, Gbl.RowEvenOdd = 0; NumUsr <= NumUsrs; @@ -1572,7 +1573,7 @@ void Prf_ShowRankingFigure (MYSQL_RES **mysql_res,unsigned NumUsrs) Figure); } - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); @@ -1706,7 +1707,7 @@ void Prf_GetAndShowRankingClicksPerDay (void) /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); for (NumUsr = 1, Rank = 1, Gbl.RowEvenOdd = 0; NumUsr <= NumUsrs; @@ -1738,7 +1739,7 @@ void Prf_GetAndShowRankingClicksPerDay (void) ""); } - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); /***** Free memory used for user's data *****/ Usr_UsrDataDestructor (&UsrDat); diff --git a/swad_statistic.c b/swad_statistic.c index 60a918eaf..9c616de41 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -381,11 +381,11 @@ void Sta_AskShowCrsHits (void) "", The_ClassFormInBox[Gbl.Prefs.Theme],Txt_Users, The_ClassFormInBox[Gbl.Prefs.Theme]); - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); Usr_ListUsersToSelect (Rol_TCH); Usr_ListUsersToSelect (Rol_NET); Usr_ListUsersToSelect (Rol_STD); - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); fprintf (Gbl.F.Out,"" ""); @@ -1470,7 +1470,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse) Sta_ShowNumHitsPerCourse (NumRows,mysql_res); break; } - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); /* End box and section */ Box_EndBox (); diff --git a/swad_test_import.c b/swad_test_import.c index e2ca422f7..deab6ac1e 100644 --- a/swad_test_import.c +++ b/swad_test_import.c @@ -1045,7 +1045,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, if (Gbl.Test.Tags.Num) { /***** Write the tags *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); for (NumTag = 0; NumTag < Gbl.Test.Tags.Num; NumTag++) @@ -1059,7 +1059,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, "", ClassData, ClassData,Gbl.Test.Tags.Txt[NumTag]); - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); } else // no tags for this question fprintf (Gbl.F.Out," (%s) ", @@ -1114,7 +1114,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, case Tst_ANS_UNIQUE_CHOICE: case Tst_ANS_MULTIPLE_CHOICE: case Tst_ANS_TEXT: - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); for (NumOpt = 0; NumOpt < Gbl.Test.Answer.NumOptions; NumOpt++) @@ -1186,7 +1186,7 @@ static void TsI_WriteRowImportedQst (struct XMLElement *StemElem, if (AnswerFeedbackLength) free ((void *) AnswerFeedback); } - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); break; default: break; diff --git a/swad_timetable.c b/swad_timetable.c index 8ad7cae0e..1cafc72e7 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -39,6 +39,7 @@ #include "swad_language.h" #include "swad_parameter.h" #include "swad_setting.h" +#include "swad_table.h" #include "swad_timetable.h" /*****************************************************************************/ @@ -1259,7 +1260,7 @@ static void TT_DrawTimeTable (void) TT_TimeTableDrawAdjustRow (); /***** End table *****/ - fprintf (Gbl.F.Out,""); + Tbl_EndTable (); } /*****************************************************************************/ diff --git a/swad_user.c b/swad_user.c index f3496b39b..7122c5054 100644 --- a/swad_user.c +++ b/swad_user.c @@ -7382,7 +7382,7 @@ void Usr_ListDataAdms (void) fprintf (Gbl.F.Out,""); /***** Heading row with column names *****/ - fprintf (Gbl.F.Out,""); + Tbl_StartTable (); fprintf (Gbl.F.Out,""); for (NumCol = 0; NumCol < Usr_NUM_MAIN_FIELDS_DATA_ADM; @@ -7415,7 +7415,7 @@ void Usr_ListDataAdms (void) Usr_UsrDataDestructor (&UsrDat); /***** End table *****/ - fprintf (Gbl.F.Out,"
"); + Tbl_EndTable (); } else // Gbl.Usrs.LstUsrs[Rol_DEG_ADM].NumUsrs == 0 /***** Show warning indicating no admins found *****/