From 54849d19a19c9ddf05a393ee8ff09009943bddd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 7 Jan 2016 14:21:21 +0100 Subject: [PATCH] Version 15.100.4 --- swad_action.c | 4 ++-- swad_changelog.h | 4 +++- swad_social.c | 57 ++++++++++++++++++++++++++++++------------------ swad_social.h | 4 ++-- 4 files changed, 43 insertions(+), 26 deletions(-) diff --git a/swad_action.c b/swad_action.c index 27c3be839..07acbfbb9 100644 --- a/swad_action.c +++ b/swad_action.c @@ -2327,7 +2327,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqSocPstGbl */{1491,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_FormSocialPostGbl ,NULL}, /* ActRcvSocPstGbl */{1492,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ReceiveSocialPostGbl ,NULL}, - /* ActComSocNotUsr */{1503,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_CommentSocialNoteGbl ,NULL}, + /* ActComSocNotUsr */{1503,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ReceiveCommentGbl ,NULL}, /* ActShaSocNotGbl */{1495,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShareSocialNoteGbl ,NULL}, /* ActUnsSocPubGbl */{1496,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_UnshareSocialPubGbl ,NULL}, /* ActReqRemSocPubGbl*/{1494,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemSocialPubGbl ,NULL}, @@ -2335,7 +2335,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqSocPstUsr */{1497,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_FormSocialPostUsr ,NULL}, /* ActRcvSocPstUsr */{1498,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ReceiveSocialPostUsr ,NULL}, - /* ActComSocNotUsr */{1504,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_CommentSocialNoteUsr ,NULL}, + /* ActComSocNotUsr */{1504,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ReceiveCommentUsr ,NULL}, /* ActShaSocNotUsr */{1499,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShareSocialNoteUsr ,NULL}, /* ActUnsSocPubUsr */{1500,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_UnshareSocialPubUsr ,NULL}, /* ActReqRemSocPubUsr*/{1501,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemSocialPubUsr ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index f24f950ec..6f042e591 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -124,13 +124,15 @@ En definitiva, se estar /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.100.3 (2016-01-07)" +#define Log_PLATFORM_VERSION "SWAD 15.100.4 (2016-01-07)" #define CSS_FILE "swad15.100.2.css" #define JS_FILE "swad15.100.2.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 15.100.4: Jan 07, 2016 Fixed bug when sharing a social note. + Receive social comment. (191012 lines) Version 15.100.3: Jan 07, 2016 Fixed bug when sharing and unsharing a social note. (190999 lines) Version 15.100.2: Jan 07, 2016 Hidden form to reply a social note. (190983 lines) Version 15.100.1: Jan 07, 2016 New icon in social note to reply. (190937 lines) diff --git a/swad_social.c b/swad_social.c index 06fad003f..8ae03bf84 100644 --- a/swad_social.c +++ b/swad_social.c @@ -160,7 +160,7 @@ static void Soc_PutHiddenParamPubCod (long PubCod); static long Soc_GetParamNotCod (void); static long Soc_GetParamPubCod (void); -static void Soc_CommentSocialNote (void); +static void Soc_ReceiveComment (void); static void Soc_ShareSocialNote (void); static void Soc_UnshareSocialPublishing (void); static void Soc_UnshareASocialPublishingFromDB (struct SocialNote *SocNot); @@ -1153,15 +1153,7 @@ static void Soc_PutFormToCommentSocialNote (long NotCod) { extern const char *Txt_Comment; - /***** Form to comment a social note *****/ - if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) - { - Act_FormStartAnchor (ActComSocNotUsr,"timeline"); - Usr_PutParamOtherUsrCodEncrypted (); - } - else - Act_FormStart (ActComSocNotGbl); - Soc_PutHiddenParamNotCod (NotCod); + /***** Link to show/hide comment form in a social note *****/ fprintf (Gbl.F.Out,"
" "" "", NotCod); @@ -1383,16 +1375,16 @@ static long Soc_GetParamPubCod (void) /*************************** Comment a social note ***************************/ /*****************************************************************************/ -void Soc_CommentSocialNoteGbl (void) +void Soc_ReceiveCommentGbl (void) { - /***** Comment social note *****/ - Soc_CommentSocialNote (); + /***** Receive comment in a social note *****/ + Soc_ReceiveComment (); /***** Write updated timeline after commenting (global) *****/ Soc_ShowTimelineGbl (); } -void Soc_CommentSocialNoteUsr (void) +void Soc_ReceiveCommentUsr (void) { /***** Get user whom profile is displayed *****/ Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); @@ -1403,8 +1395,8 @@ void Soc_CommentSocialNoteUsr (void) /***** Start section *****/ fprintf (Gbl.F.Out,"
"); - /***** Comment social note *****/ - Soc_CommentSocialNote (); + /***** Receive comment in a social note *****/ + Soc_ReceiveComment (); /***** Write updated timeline after commenting (user) *****/ Soc_ShowTimelineUsr (); @@ -1413,9 +1405,32 @@ void Soc_CommentSocialNoteUsr (void) fprintf (Gbl.F.Out,"
"); } -static void Soc_CommentSocialNote (void) +static void Soc_ReceiveComment (void) { - Lay_ShowAlert (Lay_WARNING,"Not implemented."); + char Content[Cns_MAX_BYTES_LONG_TEXT+1]; + // char Query[128+Cns_MAX_BYTES_LONG_TEXT]; + struct SocialNote SocNot; + char ParamName[32]; + // long ComCod; + + /***** Get and store new comment *****/ + /* Get the code of the social note */ + SocNot.NotCod = Soc_GetParamNotCod (); + + /* Get the content of the comment */ + sprintf (ParamName,"Comment%ld",SocNot.NotCod); + Par_GetParAndChangeFormat (ParamName,Content,Cns_MAX_BYTES_LONG_TEXT, + Str_TO_RIGOROUS_HTML,true); + + /* Insert post content in the database */ + /* + sprintf (Query,"INSERT INTO social_comments (SocNot,UsrCod,Content,TimeComment)" + " VALUES ('%ld','%s',NOW())", + SocNot.NotCod,Content); + ComCod = DB_QueryINSERTandReturnCode (Query,"can not create comment"); + */ + + Lay_ShowAlert (Lay_INFO,Content); } /*****************************************************************************/ @@ -1461,8 +1476,8 @@ static void Soc_ShareSocialNote (void) bool IAmAPublisherOfThisSocNot; bool ICanShare; - /***** Get the code of the social publishing to unshare *****/ - SocPub.NotCod = Soc_GetParamNotCod (); + /***** Get the code of the social note to share *****/ + SocNot.NotCod = Soc_GetParamNotCod (); /***** Get data of social note *****/ Soc_GetDataOfSocialNoteByCod (&SocNot); diff --git a/swad_social.h b/swad_social.h index 62eecd35d..6ba407cb3 100644 --- a/swad_social.h +++ b/swad_social.h @@ -95,8 +95,8 @@ void Soc_FormSocialPostUsr (void); void Soc_ReceiveSocialPostGbl (void); void Soc_ReceiveSocialPostUsr (void); -void Soc_CommentSocialNoteGbl (void); -void Soc_CommentSocialNoteUsr (void); +void Soc_ReceiveCommentGbl (void); +void Soc_ReceiveCommentUsr (void); void Soc_ShareSocialNoteGbl (void); void Soc_ShareSocialNoteUsr (void);