From 309aa1a72c0883ebe5a9730660969443e826f19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Tue, 27 Dec 2016 11:45:06 +0100 Subject: [PATCH] Version 16.107.7 --- swad_changelog.h | 3 ++- swad_forum.c | 66 ++++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index bd93374b5..1eeb53bd3 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -189,13 +189,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.107.6 (2016-12-27)" +#define Log_PLATFORM_VERSION "SWAD 16.107.7 (2016-12-27)" #define CSS_FILE "swad16.106.5.css" #define JS_FILE "swad16.101.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.107.7: Dec 27, 2016 Code refactoring in forums. (211594 lines) Version 16.107.6: Dec 27, 2016 Changes in behaviour of labels in forms. (211593 lines) Version 16.107.5: Dec 26, 2016 Changes in behaviour of labels in forms. (211540 lines) Version 16.107.4: Dec 26, 2016 Code refactoring in announcements. (211532 lines) diff --git a/swad_forum.c b/swad_forum.c index 6bf85b332..4fc89081a 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -309,6 +309,8 @@ static unsigned For_GetNumOfUnreadPostsInThr (long ThrCod,unsigned NumPostsInThr static unsigned For_GetNumOfPostsInThrNewerThan (long ThrCod,const char *Time); static void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject); +static void For_PutSubjectContent (const char *Label,const char *Field, + unsigned NumRows,const char *Content); static void For_UpdateNumUsrsNotifiedByEMailAboutPost (long PstCod,unsigned NumUsrsToBeNotifiedByEMail); static void For_WriteNumberOfThrs (unsigned NumThrs,unsigned NumThrsWithNewPosts); @@ -3827,40 +3829,12 @@ static void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject) Act_FormStart (For_ActionsRecThrFor[Gbl.Forum.ForumType]); For_PutAllHiddenParamsForum (); - /***** Start table *****/ + /***** Subject and content *****/ + // If writing a reply to a message of an existing thread ==> write subject fprintf (Gbl.F.Out,""); - - /***** Post subject *****/ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /***** Post content *****/ - fprintf (Gbl.F.Out,"" - "" - "" - "", - The_ClassForm[Gbl.Prefs.Theme], - Txt_MSG_Message); - - /***** End table *****/ + For_PutSubjectContent (Txt_MSG_Subject,"Subject", 2,IsReply ? Subject : + NULL); + For_PutSubjectContent (Txt_MSG_Message,"Content",15,NULL); fprintf (Gbl.F.Out,"
" - "" - "" - "" - "
" - "" - "" - "" - "
"); /***** Help for text editor *****/ @@ -3879,6 +3853,32 @@ static void For_WriteFormForumPst (bool IsReply,long ThrCod,const char *Subject) Lay_EndRoundFrame (); } +/*****************************************************************************/ +/****************** Put form field for subject or content ********************/ +/*****************************************************************************/ + +static void For_PutSubjectContent (const char *Label,const char *Field, + unsigned NumRows,const char *Content) + { + extern const char *The_ClassForm[The_NUM_THEMES]; + + fprintf (Gbl.F.Out,"" + "" + "" + "" + "" + "" + "" + ""); + } + /*****************************************************************************/ /************************** Receive message of a forum ***********************/ /*****************************************************************************/