diff --git a/swad_centre.c b/swad_centre.c index 45369e288..edc7667d6 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1571,10 +1571,10 @@ static void Ctr_ListCentresForEdition (void) /* Centre requester */ UsrDat.UsrCod = Ctr->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); @@ -2516,10 +2516,10 @@ static void Ctr_PutFormToCreateCentre (void) ""); /***** Centre requester *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); diff --git a/swad_changelog.h b/swad_changelog.h index b95b32b02..d631e282d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -219,19 +219,18 @@ // TODO: Icon to view en "Fuente de información" // TODO: Print view of an assignment (suggested by Sandra Daniela Tazzioli Barroso). -// TODO: Buscar Msg_WriteMsgAuthor y ver si la tabla que hay alrededor se puede meter dentro de la función - /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.198.8 (2017-05-01)" +#define Log_PLATFORM_VERSION "SWAD 16.198.9 (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.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) Version 16.198.6: May 01, 2017 Code refactoring related to tables. (218312 lines) diff --git a/swad_course.c b/swad_course.c index d324d9cc6..240615e82 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1517,10 +1517,10 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year) /* Course requester */ UsrDat.UsrCod = Crs->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); @@ -1695,10 +1695,10 @@ static void Crs_PutFormToCreateCourse (void) ""); /***** Course requester *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); diff --git a/swad_degree.c b/swad_degree.c index 5a0a49ccd..64a6a38d5 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -817,10 +817,10 @@ static void Deg_ListDegreesForEdition (void) /* Degree requester */ UsrDat.UsrCod = Deg->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); @@ -1002,10 +1002,10 @@ static void Deg_PutFormToCreateDegree (void) ""); /***** Degree requester *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); diff --git a/swad_forum.c b/swad_forum.c index 952aed2a4..cd335e9d8 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -1318,21 +1318,19 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod, fprintf (Gbl.F.Out,""); /***** Write author *****/ - fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - Msg_WriteMsgAuthor (&UsrDat,"AUTHOR_TXT",Enabled,NULL); + Msg_WriteMsgAuthor (&UsrDat,NULL,Enabled,NULL); fprintf (Gbl.F.Out,""); + Lay_EndTable (); if (Enabled) { /* Write number of posts from this user */ - fprintf (Gbl.F.Out,""); For_WriteNumberOfPosts (UsrDat.UsrCod); - fprintf (Gbl.F.Out,""); } - Lay_EndTable (); fprintf (Gbl.F.Out,""); /***** Write post content *****/ @@ -1479,8 +1477,7 @@ static void For_WriteNumberOfPosts (long UsrCod) unsigned NumPsts; /***** Star table cell *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
"); /***** Get number of posts from database *****/ if (Gbl.Forum.ForumSelected.Location > 0) @@ -1502,7 +1499,7 @@ static void For_WriteNumberOfPosts (long UsrCod) fprintf (Gbl.F.Out,"[%u %s]",NumPsts,Txt_posts); /***** End table cell *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -2583,7 +2580,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted, Order <= For_LAST_MSG; Order++) { - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Act_FormStartAnchor (For_ActionsSeeFor[Gbl.Forum.ForumSelected.Type], For_ID_FORUM_THREADS_SECTION); For_PutAllHiddenParamsForum (Gbl.Forum.CurrentPageThrs, // Page of threads = current @@ -3412,7 +3409,13 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE], /* Write the author of first or last message */ UsrDat.UsrCod = Thr.UsrCod[Order]; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - Msg_WriteMsgAuthor (&UsrDat,Style,Thr.Enabled[Order],BgColor); + 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 (); + fprintf (Gbl.F.Out,""); /* Write the date of first or last message (it's in YYYYMMDDHHMMSS format) */ TimeUTC = Thr.WriteTime[Order]; @@ -3428,7 +3431,7 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE], } else for (Column = 1; - Column <= 3; + Column <= 2; Column++) fprintf (Gbl.F.Out,"" "", diff --git a/swad_institution.c b/swad_institution.c index b3ee67398..6b8970761 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -1538,10 +1538,10 @@ static void Ins_ListInstitutionsForEdition (void) /* Institution requester */ UsrDat.UsrCod = Ins->RequesterUsrCod; Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); @@ -2232,10 +2232,10 @@ static void Ins_PutFormToCreateInstitution (void) ""); /***** Institution requester *****/ - fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); Lay_StartTable (2); fprintf (Gbl.F.Out,""); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL); fprintf (Gbl.F.Out,""); Lay_EndTable (); fprintf (Gbl.F.Out,""); diff --git a/swad_message.c b/swad_message.c index a24592211..4fdf31068 100644 --- a/swad_message.c +++ b/swad_message.c @@ -2957,10 +2957,16 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) /***** Write message author *****/ Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat); - Msg_WriteMsgAuthor (&UsrDat, - Open ? "MSG_AUT_BG" : - "MSG_AUT_BG_NEW", // Style - true,NULL); + + 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 (); + fprintf (Gbl.F.Out,""); /***** Write subject *****/ Msg_WriteSentOrReceivedMsgSubject (MsgCod,Subject,Open,Expanded); @@ -2974,7 +2980,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod) if (Expanded) { fprintf (Gbl.F.Out,"" - ""); + ""); Lay_StartTable (2); /***** Write course origin of message *****/ @@ -3172,7 +3178,10 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat, bool WriteAuthor = false; /***** Start first column *****/ - fprintf (Gbl.F.Out,""); @@ -3192,7 +3201,10 @@ 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,"" @@ -3206,10 +3218,12 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat, " alt=\"%s\" title=\"%s\"" " class=\"PHOTO30x40\" />" "" - ""); diff --git a/swad_notification.c b/swad_notification.c index 243581979..5c17d792f 100644 --- a/swad_notification.c +++ b/swad_notification.c @@ -393,7 +393,7 @@ void Ntf_ShowMyNotifications (void) "" "%s" "" - "" + "" "%s" "" "" @@ -533,7 +533,13 @@ void Ntf_ShowMyNotifications (void) fprintf (Gbl.F.Out,""); /* Write user (from) */ - Msg_WriteMsgAuthor (&UsrDat,ClassAuthorBg,true,NULL); + fprintf (Gbl.F.Out,"",ClassAuthorBg); + Lay_StartTable (2); + fprintf (Gbl.F.Out,""); + Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL); + fprintf (Gbl.F.Out,""); + Lay_EndTable (); + fprintf (Gbl.F.Out,""); /* Write location */ fprintf (Gbl.F.Out,"", @@ -607,7 +613,7 @@ void Ntf_ShowMyNotifications (void) false); fprintf (Gbl.F.Out,"" "" - "" "%s" ""