From 0b36aa168c177492e677ec48b52b95487e2e14e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 2 May 2017 01:16:06 +0200 Subject: [PATCH] Version 16.199 --- swad_centre.c | 12 ++---------- swad_changelog.h | 3 ++- swad_course.c | 12 ++---------- swad_degree.c | 12 ++---------- swad_forum.c | 14 ++------------ swad_institution.c | 12 ++---------- swad_message.c | 34 ++++++++++++++-------------------- swad_message.h | 3 +-- swad_notification.c | 6 +----- 9 files changed, 28 insertions(+), 80 deletions(-) diff --git a/swad_centre.c b/swad_centre.c index edc7667d..6fddead7 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1572,11 +1572,7 @@ static void Ctr_ListCentresForEdition (void) UsrDat.UsrCod = Ctr->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /* Centre status */ @@ -2517,11 +2513,7 @@ static void Ctr_PutFormToCreateCentre (void) /***** Centre requester *****/ fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /***** Centre status *****/ diff --git a/swad_changelog.h b/swad_changelog.h index d631e282..1fef5817 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -223,13 +223,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.198.9 (2017-05-02)" +#define Log_PLATFORM_VERSION "SWAD 16.199 (2017-05-02)" #define CSS_FILE "swad16.195.8.css" #define JS_FILE "swad16.181.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.199: May 02, 2017 Code refactoring related to message author. (218291 lines) Version 16.198.9: May 02, 2017 Code refactoring related to message author. (218345 lines) Version 16.198.8: May 01, 2017 Code refactoring related to tables. (218323 lines) Version 16.198.7: May 01, 2017 Code refactoring related to tables. (218319 lines) diff --git a/swad_course.c b/swad_course.c index 240615e8..f7d8ea68 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1518,11 +1518,7 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) UsrDat.UsrCod = Crs->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /* Course status */ @@ -1696,11 +1692,7 @@ static void Crs_PutFormToCreateCourse (void) /***** Course requester *****/ fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /***** Course status *****/ diff --git a/swad_degree.c b/swad_degree.c index 64a6a38d..4d8d084d 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -818,11 +818,7 @@ static void Deg_ListDegreesForEdition (void) UsrDat.UsrCod = Deg->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /* Degree status */ @@ -1003,11 +999,7 @@ static void Deg_PutFormToCreateDegree (void) /***** Degree requester *****/ fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /***** Degree status *****/ diff --git a/swad_forum.c b/swad_forum.c index cd335e9d..535943e7 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1321,16 +1321,10 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod, Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,Enabled,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,Enabled,NULL); if (Enabled) - { /* Write number of posts from this user */ For_WriteNumberOfPosts (UsrDat.UsrCod); - } fprintf (Gbl.F.Out,""); /***** Write post content *****/ @@ -3410,11 +3404,7 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE], UsrDat.UsrCod = Thr.UsrCod[Order]; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); fprintf (Gbl.F.Out,"",Style,BgColor); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,Thr.Enabled[Order],BgColor); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,Thr.Enabled[Order],BgColor); fprintf (Gbl.F.Out,""); /* Write the date of first or last message (it's in YYYYMMDDHHMMSS format) */ diff --git a/swad_institution.c b/swad_institution.c index 6b897076..76738979 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1539,11 +1539,7 @@ static void Ins_ListInstitutionsForEdition (void) UsrDat.UsrCod = Ins->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /* Institution status */ @@ -2233,11 +2229,7 @@ static void Ins_PutFormToCreateInstitution (void) /***** Institution requester *****/ fprintf (Gbl.F.Out,""); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /***** Institution status *****/ diff --git a/swad_message.c b/swad_message.c index 4fdf3106..840c9663 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2961,11 +2961,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) fprintf (Gbl.F.Out,"", Open ? "MSG_AUT_BG" : "MSG_AUT_BG_NEW"); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /***** Write subject *****/ @@ -3169,19 +3165,19 @@ static void Msg_WriteSentOrReceivedMsgSubject (long MsgCod,const char *Subject,b /*****************************************************************************/ // Input: UsrDat must hold user's data -void Msg_WriteMsgAuthor (struct UsrData *UsrDat, - const char *Style,bool Enabled,const char *BgColor) +void Msg_WriteMsgAuthor (struct UsrData *UsrDat,bool Enabled,const char *BgColor) { extern const char *Txt_Unknown_or_without_photo; bool ShowPhoto = false; char PhotoURL[PATH_MAX + 1]; bool WriteAuthor = false; + /***** Start table *****/ + Lay_StartTable (2); + /***** Start first column *****/ - fprintf (Gbl.F.Out,"" + ""); @@ -3201,10 +3197,7 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat, fprintf (Gbl.F.Out,""); /***** Second column with user name (if author has a web page, put a link to it) *****/ - fprintf (Gbl.F.Out,"" @@ -3218,19 +3211,20 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat, " alt=\"%s\" title=\"%s\"" " class=\"PHOTO30x40\" />" "" - ""); } /***** End second column *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" + ""); + + /***** End table *****/ + Lay_EndTable (); } /*****************************************************************************/ diff --git a/swad_message.h b/swad_message.h index a97555dc..920dc9a3 100644 --- a/swad_message.h +++ b/swad_message.h @@ -99,8 +99,7 @@ void Msg_GetNotifMessage (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1], char **ContentStr,long MsgCod,bool GetContent); void Msg_WriteMsgNumber (unsigned long MsgNum,bool NewMsg); -void Msg_WriteMsgAuthor (struct UsrData *UsrDat, - const char *Style,bool Enabled,const char *BgColor); +void Msg_WriteMsgAuthor (struct UsrData *UsrDat,bool Enabled,const char *BgColor); bool Msg_WriteCrsOrgMsg (long CrsCod); void Msg_WriteListUsrsDstMsg (long MsgCod); void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassBackground); diff --git a/swad_notification.c b/swad_notification.c index 5c17d792..97e4f106 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -534,11 +534,7 @@ void Ntf_ShowMyNotifications (void) /* Write user (from) */ fprintf (Gbl.F.Out,"",ClassAuthorBg); - Lay_StartTable (2); - fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); - fprintf (Gbl.F.Out,""); - Lay_EndTable (); + Msg_WriteMsgAuthor (&UsrDat,true,NULL); fprintf (Gbl.F.Out,""); /* Write location */