From b106dea1dfbb265b90dbe9d47d2a2ac198b9fef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 2 Jan 2016 01:56:48 +0100 Subject: [PATCH] Version 15.89 --- swad_action.c | 65 ++++++--- swad_action.h | 311 ++++++++++++++++++++++--------------------- swad_changelog.h | 17 ++- swad_menu.c | 2 +- swad_profile.c | 2 +- swad_social.c | 333 +++++++++++++++++++++++++++++++++++------------ swad_social.h | 22 ++-- swad_text.c | 4 +- 8 files changed, 485 insertions(+), 271 deletions(-) diff --git a/swad_action.c b/swad_action.c index ea722cbe5..0018a2987 100644 --- a/swad_action.c +++ b/swad_action.c @@ -997,17 +997,25 @@ Users: 834. ActLstClk List last clicks in real time Social: - 835. ActSeeSocAct Show social activity (timeline) + 835. ActSeeSocTmlGbl Show social timeline (global) 836. ActReqPubPrf Request @nickname to show a public user's profile 837. ActSeeFor Show the level superior of the forums 838. ActSeeChtRms Show the chat rooms - 839. ActReqSocPst Write a public social post to be displayed in the timeline - 840. ActRcvSocPst Receive a public social post to be displayed in the timeline -NEW!!!!!!!!. ActShaSocPub Share a social publishing -NEW!!!!!!!!. ActUnsSocPub Unshare a previously shared social publishing - 841. ActReqRemSocPub Request the removal of a social publishing (only if it is a post) - 842. ActRemSocPub Remove a social publishing (only if it is a post) + 839. ActReqSocPstGbl Write a public social post to be displayed in the timeline (global) + 840. ActRcvSocPstGbl Receive a public social post to be displayed in the timeline (global) +NEW!!!!!!!!. ActShaSocPubGbl Share a social publishing in the timeline (global) +NEW!!!!!!!!. ActUnsSocPubGbl Unshare a previously shared social publishing in the timeline (global) + 841. ActReqRemSocPubGbl Request the removal of a social publishing in the timeline (global) + 842. ActRemSocPubGbl Remove a social publishing in the timeline (global) + +NEW!!!!!!!!. ActReqSocPstUsr Write a public social post to be displayed in the timeline (user) +NEW!!!!!!!!. ActRcvSocPstUsr Receive a public social post to be displayed in the timeline (user) +NEW!!!!!!!!. ActShaSocPubUsr Share a social publishing in the timeline (user) +NEW!!!!!!!!. ActUnsSocPubUsr Unshare a previously shared social publishing in the timeline (user) +NEW!!!!!!!!. ActReqRemSocPubUsr Request the removal of a social publishing in the timeline (user) +NEW!!!!!!!!. ActRemSocPubUsr Remove a social publishing in the timeline (user) + 843. ActSeePubPrf Show a public user's profile 844. ActCal1stClkTim Calculate first click time from log and store into user's figures 845. ActCalNumClk Calculate number of clicks from log and store into user's figures @@ -2310,17 +2318,24 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActLstClk */{ 989,-1,TabUsr,ActLstCon ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Con_ShowLastClicks ,NULL}, // TabSoc ****************************************************************** - /* ActSeeSocAct */{1490, 0,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShowFollowingTimeline ,"soc64x64.png" }, + /* ActSeeSocTmlGbl */{1490, 0,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShowTimelineGbl ,"soc64x64.png" }, /* ActReqPubPrf */{1401, 1,TabSoc,ActReqPubPrf ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Prf_RequestUserProfile ,"prf64x64.gif" }, /* ActSeeFor */{ 95, 2,TabSoc,ActSeeFor ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,For_ShowForumList ,"forum64x64.gif" }, /* ActSeeChtRms */{ 51, 3,TabSoc,ActSeeChtRms ,0x1FC,0x1FC,0x1FC,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Cht_ShowChatRooms ,"chat64x64.gif" }, - /* ActReqSocPst */{1491,-1,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_FormSocialPost ,NULL}, - /* ActRcvSocPst */{1492,-1,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ReceiveSocialPost ,NULL}, - /* ActShaSocPub */{1495,-1,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShareSocialPublishing ,NULL}, - /* ActUnsSocPub */{1496,-1,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_UnshareSocialPublishing ,NULL}, - /* ActReqRemSocPub */{1494,-1,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemovalSocialNote ,NULL}, - /* ActRemSocPub */{1493,-1,TabSoc,ActSeeSocAct ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialPublishing ,NULL}, + /* 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}, + /* ActShaSocPubGbl */{1495,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShareSocialPubGbl ,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}, + /* ActRemSocPubGbl */{1493,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialPubGbl ,NULL}, + + /* 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}, + /* ActShaSocPubUsr */{1499,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ShareSocialPubUsr ,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}, + /* ActRemSocPubUsr */{1502,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialPubUsr ,NULL}, /* ActSeePubPrf */{1402,-1,TabSoc,ActReqPubPrf ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Prf_GetUsrCodAndShowUserProfile,NULL}, /* ActCal1stClkTim */{1405,-1,TabSoc,ActReqPubPrf ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Prf_CalculateFirstClickTime ,NULL}, @@ -4158,13 +4173,19 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq ActChgMyTT1stDay, // #1487 ActAskRemOldBrf, // #1488 ActRemOldBrf, // #1489 - ActSeeSocAct, // #1490 - ActReqSocPst, // #1491 - ActRcvSocPst, // #1492 - ActRemSocPub, // #1493 - ActReqRemSocPub, // #1494 - ActShaSocPub, // #1495 - ActUnsSocPub, // #1496 + ActSeeSocTmlGbl, // #1490 + ActReqSocPstGbl, // #1491 + ActRcvSocPstGbl, // #1492 + ActRemSocPubGbl, // #1493 + ActReqRemSocPubGbl, // #1494 + ActShaSocPubGbl, // #1495 + ActUnsSocPubGbl, // #1496 + ActReqSocPstUsr, // #1497 + ActRcvSocPstUsr, // #1498 + ActShaSocPubUsr, // #1499 + ActUnsSocPubUsr, // #1500 + ActReqRemSocPubUsr, // #1501 + ActRemSocPubUsr, // #1502 }; /*****************************************************************************/ @@ -4440,6 +4461,8 @@ void Act_PutLinkToUpdateAction (Act_Action_t Action) fprintf (Gbl.F.Out,"
"); Act_FormStart (Action); + if (Gbl.Usrs.Other.UsrDat.UsrCod >= 0) // This update action requieres specify user + Usr_PutParamOtherUsrCodEncrypted (); Act_LinkFormSubmitAnimated (Txt_Update,The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutCalculateIconWithText (Txt_Update,Txt_Update); Act_FormEnd (); diff --git a/swad_action.h b/swad_action.h index fb78db030..a4030aaa9 100644 --- a/swad_action.h +++ b/swad_action.h @@ -71,9 +71,9 @@ typedef enum typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (7+52+15+90+72+67+205+183+143+153+36+27+82) +#define Act_NUM_ACTIONS (7+52+15+90+72+67+205+183+143+159+36+27+82) -#define Act_MAX_ACTION_COD 1496 +#define Act_MAX_ACTION_COD 1502 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20 @@ -1036,164 +1036,171 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica /******************************** Social tab *********************************/ /*****************************************************************************/ // Actions in menu -#define ActSeeSocAct (ActLstClk+ 1) +#define ActSeeSocTmlGbl (ActLstClk+ 1) #define ActReqPubPrf (ActLstClk+ 2) #define ActSeeFor (ActLstClk+ 3) #define ActSeeChtRms (ActLstClk+ 4) // Secondary actions -#define ActReqSocPst (ActLstClk+ 5) -#define ActRcvSocPst (ActLstClk+ 6) -#define ActShaSocPub (ActLstClk+ 7) -#define ActUnsSocPub (ActLstClk+ 8) -#define ActReqRemSocPub (ActLstClk+ 9) -#define ActRemSocPub (ActLstClk+ 10) +#define ActReqSocPstGbl (ActLstClk+ 5) +#define ActRcvSocPstGbl (ActLstClk+ 6) +#define ActShaSocPubGbl (ActLstClk+ 7) +#define ActUnsSocPubGbl (ActLstClk+ 8) +#define ActReqRemSocPubGbl (ActLstClk+ 9) +#define ActRemSocPubGbl (ActLstClk+ 10) -#define ActSeePubPrf (ActLstClk+ 11) -#define ActCal1stClkTim (ActLstClk+ 12) -#define ActCalNumClk (ActLstClk+ 13) -#define ActCalNumFilVie (ActLstClk+ 14) -#define ActCalNumForPst (ActLstClk+ 15) -#define ActCalNumMsgSnt (ActLstClk+ 16) +#define ActReqSocPstUsr (ActLstClk+ 11) +#define ActRcvSocPstUsr (ActLstClk+ 12) +#define ActShaSocPubUsr (ActLstClk+ 13) +#define ActUnsSocPubUsr (ActLstClk+ 14) +#define ActReqRemSocPubUsr (ActLstClk+ 15) +#define ActRemSocPubUsr (ActLstClk+ 16) -#define ActFolUsr (ActLstClk+ 17) -#define ActUnfUsr (ActLstClk+ 18) -#define ActSeeFlg (ActLstClk+ 19) -#define ActSeeFlr (ActLstClk+ 20) +#define ActSeePubPrf (ActLstClk+ 17) +#define ActCal1stClkTim (ActLstClk+ 18) +#define ActCalNumClk (ActLstClk+ 19) +#define ActCalNumFilVie (ActLstClk+ 20) +#define ActCalNumForPst (ActLstClk+ 21) +#define ActCalNumMsgSnt (ActLstClk+ 22) -#define ActSeeForCrsUsr (ActLstClk+ 21) -#define ActSeeForCrsTch (ActLstClk+ 22) -#define ActSeeForDegUsr (ActLstClk+ 23) -#define ActSeeForDegTch (ActLstClk+ 24) -#define ActSeeForCtrUsr (ActLstClk+ 25) -#define ActSeeForCtrTch (ActLstClk+ 26) -#define ActSeeForInsUsr (ActLstClk+ 27) -#define ActSeeForInsTch (ActLstClk+ 28) -#define ActSeeForGenUsr (ActLstClk+ 29) -#define ActSeeForGenTch (ActLstClk+ 30) -#define ActSeeForSWAUsr (ActLstClk+ 31) -#define ActSeeForSWATch (ActLstClk+ 32) -#define ActSeePstForCrsUsr (ActLstClk+ 33) -#define ActSeePstForCrsTch (ActLstClk+ 34) -#define ActSeePstForDegUsr (ActLstClk+ 35) -#define ActSeePstForDegTch (ActLstClk+ 36) -#define ActSeePstForCtrUsr (ActLstClk+ 37) -#define ActSeePstForCtrTch (ActLstClk+ 38) -#define ActSeePstForInsUsr (ActLstClk+ 39) -#define ActSeePstForInsTch (ActLstClk+ 40) -#define ActSeePstForGenUsr (ActLstClk+ 41) -#define ActSeePstForGenTch (ActLstClk+ 42) -#define ActSeePstForSWAUsr (ActLstClk+ 43) -#define ActSeePstForSWATch (ActLstClk+ 44) -#define ActRcvThrForCrsUsr (ActLstClk+ 45) -#define ActRcvThrForCrsTch (ActLstClk+ 46) -#define ActRcvThrForDegUsr (ActLstClk+ 47) -#define ActRcvThrForDegTch (ActLstClk+ 48) -#define ActRcvThrForCtrUsr (ActLstClk+ 49) -#define ActRcvThrForCtrTch (ActLstClk+ 50) -#define ActRcvThrForInsUsr (ActLstClk+ 51) -#define ActRcvThrForInsTch (ActLstClk+ 52) -#define ActRcvThrForGenUsr (ActLstClk+ 53) -#define ActRcvThrForGenTch (ActLstClk+ 54) -#define ActRcvThrForSWAUsr (ActLstClk+ 55) -#define ActRcvThrForSWATch (ActLstClk+ 56) -#define ActRcvRepForCrsUsr (ActLstClk+ 57) -#define ActRcvRepForCrsTch (ActLstClk+ 58) -#define ActRcvRepForDegUsr (ActLstClk+ 59) -#define ActRcvRepForDegTch (ActLstClk+ 60) -#define ActRcvRepForCtrUsr (ActLstClk+ 61) -#define ActRcvRepForCtrTch (ActLstClk+ 62) -#define ActRcvRepForInsUsr (ActLstClk+ 63) -#define ActRcvRepForInsTch (ActLstClk+ 64) -#define ActRcvRepForGenUsr (ActLstClk+ 65) -#define ActRcvRepForGenTch (ActLstClk+ 66) -#define ActRcvRepForSWAUsr (ActLstClk+ 67) -#define ActRcvRepForSWATch (ActLstClk+ 68) -#define ActReqDelThrCrsUsr (ActLstClk+ 69) -#define ActReqDelThrCrsTch (ActLstClk+ 70) -#define ActReqDelThrDegUsr (ActLstClk+ 71) -#define ActReqDelThrDegTch (ActLstClk+ 72) -#define ActReqDelThrCtrUsr (ActLstClk+ 73) -#define ActReqDelThrCtrTch (ActLstClk+ 74) -#define ActReqDelThrInsUsr (ActLstClk+ 75) -#define ActReqDelThrInsTch (ActLstClk+ 76) -#define ActReqDelThrGenUsr (ActLstClk+ 77) -#define ActReqDelThrGenTch (ActLstClk+ 78) -#define ActReqDelThrSWAUsr (ActLstClk+ 79) -#define ActReqDelThrSWATch (ActLstClk+ 80) -#define ActDelThrForCrsUsr (ActLstClk+ 81) -#define ActDelThrForCrsTch (ActLstClk+ 82) -#define ActDelThrForDegUsr (ActLstClk+ 83) -#define ActDelThrForDegTch (ActLstClk+ 84) -#define ActDelThrForCtrUsr (ActLstClk+ 85) -#define ActDelThrForCtrTch (ActLstClk+ 86) -#define ActDelThrForInsUsr (ActLstClk+ 87) -#define ActDelThrForInsTch (ActLstClk+ 88) -#define ActDelThrForGenUsr (ActLstClk+ 89) -#define ActDelThrForGenTch (ActLstClk+ 90) -#define ActDelThrForSWAUsr (ActLstClk+ 91) -#define ActDelThrForSWATch (ActLstClk+ 92) -#define ActCutThrForCrsUsr (ActLstClk+ 93) -#define ActCutThrForCrsTch (ActLstClk+ 94) -#define ActCutThrForDegUsr (ActLstClk+ 95) -#define ActCutThrForDegTch (ActLstClk+ 96) -#define ActCutThrForCtrUsr (ActLstClk+ 97) -#define ActCutThrForCtrTch (ActLstClk+ 98) -#define ActCutThrForInsUsr (ActLstClk+ 99) -#define ActCutThrForInsTch (ActLstClk+100) -#define ActCutThrForGenUsr (ActLstClk+101) -#define ActCutThrForGenTch (ActLstClk+102) -#define ActCutThrForSWAUsr (ActLstClk+103) -#define ActCutThrForSWATch (ActLstClk+104) -#define ActPasThrForCrsUsr (ActLstClk+105) -#define ActPasThrForCrsTch (ActLstClk+106) -#define ActPasThrForDegUsr (ActLstClk+107) -#define ActPasThrForDegTch (ActLstClk+108) -#define ActPasThrForCtrUsr (ActLstClk+109) -#define ActPasThrForCtrTch (ActLstClk+110) -#define ActPasThrForInsUsr (ActLstClk+111) -#define ActPasThrForInsTch (ActLstClk+112) -#define ActPasThrForGenUsr (ActLstClk+113) -#define ActPasThrForGenTch (ActLstClk+114) -#define ActPasThrForSWAUsr (ActLstClk+115) -#define ActPasThrForSWATch (ActLstClk+116) -#define ActDelPstForCrsUsr (ActLstClk+117) -#define ActDelPstForCrsTch (ActLstClk+118) -#define ActDelPstForDegUsr (ActLstClk+119) -#define ActDelPstForDegTch (ActLstClk+120) -#define ActDelPstForCtrUsr (ActLstClk+121) -#define ActDelPstForCtrTch (ActLstClk+122) -#define ActDelPstForInsUsr (ActLstClk+123) -#define ActDelPstForInsTch (ActLstClk+124) -#define ActDelPstForGenUsr (ActLstClk+125) -#define ActDelPstForGenTch (ActLstClk+126) -#define ActDelPstForSWAUsr (ActLstClk+127) -#define ActDelPstForSWATch (ActLstClk+128) -#define ActEnbPstForCrsUsr (ActLstClk+129) -#define ActEnbPstForCrsTch (ActLstClk+130) -#define ActEnbPstForDegUsr (ActLstClk+131) -#define ActEnbPstForDegTch (ActLstClk+132) -#define ActEnbPstForCtrUsr (ActLstClk+133) -#define ActEnbPstForCtrTch (ActLstClk+134) -#define ActEnbPstForInsUsr (ActLstClk+135) -#define ActEnbPstForInsTch (ActLstClk+136) -#define ActEnbPstForGenUsr (ActLstClk+137) -#define ActEnbPstForGenTch (ActLstClk+138) -#define ActEnbPstForSWAUsr (ActLstClk+139) -#define ActEnbPstForSWATch (ActLstClk+140) -#define ActDisPstForCrsUsr (ActLstClk+141) -#define ActDisPstForCrsTch (ActLstClk+142) -#define ActDisPstForDegUsr (ActLstClk+143) -#define ActDisPstForDegTch (ActLstClk+144) -#define ActDisPstForCtrUsr (ActLstClk+145) -#define ActDisPstForCtrTch (ActLstClk+146) -#define ActDisPstForInsUsr (ActLstClk+147) -#define ActDisPstForInsTch (ActLstClk+148) -#define ActDisPstForGenUsr (ActLstClk+149) -#define ActDisPstForGenTch (ActLstClk+150) -#define ActDisPstForSWAUsr (ActLstClk+151) -#define ActDisPstForSWATch (ActLstClk+152) +#define ActFolUsr (ActLstClk+ 23) +#define ActUnfUsr (ActLstClk+ 24) +#define ActSeeFlg (ActLstClk+ 25) +#define ActSeeFlr (ActLstClk+ 26) -#define ActCht (ActLstClk+153) +#define ActSeeForCrsUsr (ActLstClk+ 27) +#define ActSeeForCrsTch (ActLstClk+ 28) +#define ActSeeForDegUsr (ActLstClk+ 29) +#define ActSeeForDegTch (ActLstClk+ 30) +#define ActSeeForCtrUsr (ActLstClk+ 31) +#define ActSeeForCtrTch (ActLstClk+ 32) +#define ActSeeForInsUsr (ActLstClk+ 33) +#define ActSeeForInsTch (ActLstClk+ 34) +#define ActSeeForGenUsr (ActLstClk+ 35) +#define ActSeeForGenTch (ActLstClk+ 36) +#define ActSeeForSWAUsr (ActLstClk+ 37) +#define ActSeeForSWATch (ActLstClk+ 38) +#define ActSeePstForCrsUsr (ActLstClk+ 39) +#define ActSeePstForCrsTch (ActLstClk+ 40) +#define ActSeePstForDegUsr (ActLstClk+ 41) +#define ActSeePstForDegTch (ActLstClk+ 42) +#define ActSeePstForCtrUsr (ActLstClk+ 43) +#define ActSeePstForCtrTch (ActLstClk+ 44) +#define ActSeePstForInsUsr (ActLstClk+ 45) +#define ActSeePstForInsTch (ActLstClk+ 46) +#define ActSeePstForGenUsr (ActLstClk+ 47) +#define ActSeePstForGenTch (ActLstClk+ 48) +#define ActSeePstForSWAUsr (ActLstClk+ 49) +#define ActSeePstForSWATch (ActLstClk+ 50) +#define ActRcvThrForCrsUsr (ActLstClk+ 51) +#define ActRcvThrForCrsTch (ActLstClk+ 52) +#define ActRcvThrForDegUsr (ActLstClk+ 53) +#define ActRcvThrForDegTch (ActLstClk+ 54) +#define ActRcvThrForCtrUsr (ActLstClk+ 55) +#define ActRcvThrForCtrTch (ActLstClk+ 56) +#define ActRcvThrForInsUsr (ActLstClk+ 57) +#define ActRcvThrForInsTch (ActLstClk+ 58) +#define ActRcvThrForGenUsr (ActLstClk+ 59) +#define ActRcvThrForGenTch (ActLstClk+ 60) +#define ActRcvThrForSWAUsr (ActLstClk+ 61) +#define ActRcvThrForSWATch (ActLstClk+ 62) +#define ActRcvRepForCrsUsr (ActLstClk+ 63) +#define ActRcvRepForCrsTch (ActLstClk+ 64) +#define ActRcvRepForDegUsr (ActLstClk+ 65) +#define ActRcvRepForDegTch (ActLstClk+ 66) +#define ActRcvRepForCtrUsr (ActLstClk+ 67) +#define ActRcvRepForCtrTch (ActLstClk+ 68) +#define ActRcvRepForInsUsr (ActLstClk+ 69) +#define ActRcvRepForInsTch (ActLstClk+ 70) +#define ActRcvRepForGenUsr (ActLstClk+ 71) +#define ActRcvRepForGenTch (ActLstClk+ 72) +#define ActRcvRepForSWAUsr (ActLstClk+ 73) +#define ActRcvRepForSWATch (ActLstClk+ 74) +#define ActReqDelThrCrsUsr (ActLstClk+ 75) +#define ActReqDelThrCrsTch (ActLstClk+ 76) +#define ActReqDelThrDegUsr (ActLstClk+ 77) +#define ActReqDelThrDegTch (ActLstClk+ 78) +#define ActReqDelThrCtrUsr (ActLstClk+ 79) +#define ActReqDelThrCtrTch (ActLstClk+ 80) +#define ActReqDelThrInsUsr (ActLstClk+ 81) +#define ActReqDelThrInsTch (ActLstClk+ 82) +#define ActReqDelThrGenUsr (ActLstClk+ 83) +#define ActReqDelThrGenTch (ActLstClk+ 84) +#define ActReqDelThrSWAUsr (ActLstClk+ 85) +#define ActReqDelThrSWATch (ActLstClk+ 86) +#define ActDelThrForCrsUsr (ActLstClk+ 87) +#define ActDelThrForCrsTch (ActLstClk+ 88) +#define ActDelThrForDegUsr (ActLstClk+ 89) +#define ActDelThrForDegTch (ActLstClk+ 90) +#define ActDelThrForCtrUsr (ActLstClk+ 91) +#define ActDelThrForCtrTch (ActLstClk+ 92) +#define ActDelThrForInsUsr (ActLstClk+ 93) +#define ActDelThrForInsTch (ActLstClk+ 94) +#define ActDelThrForGenUsr (ActLstClk+ 95) +#define ActDelThrForGenTch (ActLstClk+ 96) +#define ActDelThrForSWAUsr (ActLstClk+ 97) +#define ActDelThrForSWATch (ActLstClk+ 98) +#define ActCutThrForCrsUsr (ActLstClk+ 99) +#define ActCutThrForCrsTch (ActLstClk+100) +#define ActCutThrForDegUsr (ActLstClk+101) +#define ActCutThrForDegTch (ActLstClk+102) +#define ActCutThrForCtrUsr (ActLstClk+103) +#define ActCutThrForCtrTch (ActLstClk+104) +#define ActCutThrForInsUsr (ActLstClk+105) +#define ActCutThrForInsTch (ActLstClk+106) +#define ActCutThrForGenUsr (ActLstClk+107) +#define ActCutThrForGenTch (ActLstClk+108) +#define ActCutThrForSWAUsr (ActLstClk+109) +#define ActCutThrForSWATch (ActLstClk+110) +#define ActPasThrForCrsUsr (ActLstClk+111) +#define ActPasThrForCrsTch (ActLstClk+112) +#define ActPasThrForDegUsr (ActLstClk+113) +#define ActPasThrForDegTch (ActLstClk+114) +#define ActPasThrForCtrUsr (ActLstClk+115) +#define ActPasThrForCtrTch (ActLstClk+116) +#define ActPasThrForInsUsr (ActLstClk+117) +#define ActPasThrForInsTch (ActLstClk+118) +#define ActPasThrForGenUsr (ActLstClk+119) +#define ActPasThrForGenTch (ActLstClk+120) +#define ActPasThrForSWAUsr (ActLstClk+121) +#define ActPasThrForSWATch (ActLstClk+122) +#define ActDelPstForCrsUsr (ActLstClk+123) +#define ActDelPstForCrsTch (ActLstClk+124) +#define ActDelPstForDegUsr (ActLstClk+125) +#define ActDelPstForDegTch (ActLstClk+126) +#define ActDelPstForCtrUsr (ActLstClk+127) +#define ActDelPstForCtrTch (ActLstClk+128) +#define ActDelPstForInsUsr (ActLstClk+129) +#define ActDelPstForInsTch (ActLstClk+130) +#define ActDelPstForGenUsr (ActLstClk+131) +#define ActDelPstForGenTch (ActLstClk+132) +#define ActDelPstForSWAUsr (ActLstClk+133) +#define ActDelPstForSWATch (ActLstClk+134) +#define ActEnbPstForCrsUsr (ActLstClk+135) +#define ActEnbPstForCrsTch (ActLstClk+136) +#define ActEnbPstForDegUsr (ActLstClk+137) +#define ActEnbPstForDegTch (ActLstClk+138) +#define ActEnbPstForCtrUsr (ActLstClk+139) +#define ActEnbPstForCtrTch (ActLstClk+140) +#define ActEnbPstForInsUsr (ActLstClk+141) +#define ActEnbPstForInsTch (ActLstClk+142) +#define ActEnbPstForGenUsr (ActLstClk+143) +#define ActEnbPstForGenTch (ActLstClk+144) +#define ActEnbPstForSWAUsr (ActLstClk+145) +#define ActEnbPstForSWATch (ActLstClk+146) +#define ActDisPstForCrsUsr (ActLstClk+147) +#define ActDisPstForCrsTch (ActLstClk+148) +#define ActDisPstForDegUsr (ActLstClk+149) +#define ActDisPstForDegTch (ActLstClk+150) +#define ActDisPstForCtrUsr (ActLstClk+151) +#define ActDisPstForCtrTch (ActLstClk+152) +#define ActDisPstForInsUsr (ActLstClk+153) +#define ActDisPstForInsTch (ActLstClk+154) +#define ActDisPstForGenUsr (ActLstClk+155) +#define ActDisPstForGenTch (ActLstClk+156) +#define ActDisPstForSWAUsr (ActLstClk+157) +#define ActDisPstForSWATch (ActLstClk+158) + +#define ActCht (ActLstClk+159) /*****************************************************************************/ /******************************* Messages tab ********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 6fd64e31a..de710a7c6 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -117,13 +117,28 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.88.3 (2016-01-01)" +#define Log_PLATFORM_VERSION "SWAD 15.89 (2016-01-02)" #define CSS_FILE "swad15.88.1.css" #define JS_FILE "swad15.77.7.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.89: Jan 02, 2016 Social timeline can be updated from user profile. (190084 lines) +UPDATE actions SET Txt='Ver actividad social (global)' WHERE ActCod='1490' AND Language='es'; +UPDATE actions SET Txt='Redactar comentario social (global)' WHERE ActCod='1491' AND Language='es'; +UPDATE actions SET Txt='Crear comentario social (global)' WHERE ActCod='1492' AND Language='es'; +UPDATE actions SET Txt='Eliminar comentario social (global)' WHERE ActCod='1493' AND Language='es'; +UPDATE actions SET Txt='Solicitar elim. coment. social (global)' WHERE ActCod='1494' AND Language='es'; +UPDATE actions SET Txt='Compartir comentario social (global)' WHERE ActCod='1495' AND Language='es'; +UPDATE actions SET Txt='Dejar de compartir coment. social (global)' WHERE ActCod='1496' AND Language='es'; +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1497','es','N','Redactar comentario social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1498','es','N','Crear comentario social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1502','es','N','Eliminar comentario social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1501','es','N','Solicitar elim. coment. social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1499','es','N','Compartir comentario social (usuario)'); +INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1500','es','N','Dejar de compartir coment. social (usuario)'); + Version 15.88.3: Jan 01, 2016 Changes in contextual options in social timeline. (189907 lines) Version 15.88.2: Jan 01, 2016 Messages translated. (189902 lines) Version 15.88.1: Jan 01, 2016 Changes in layout of social timeline. (189854 lines) diff --git a/swad_menu.c b/swad_menu.c index a94215a73..3ade3a296 100644 --- a/swad_menu.c +++ b/swad_menu.c @@ -155,7 +155,7 @@ const Act_Action_t Mnu_MenuActions[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB }, // TabSoc ********** { - ActSeeSocAct, + ActSeeSocTmlGbl, ActReqPubPrf, ActSeeFor, ActSeeChtRms, diff --git a/swad_profile.c b/swad_profile.c index 44021fc3b..116460cff 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -209,7 +209,7 @@ static void Prf_GetUsrDatAndShowUserProfile (void) } else /***** Show social activity (timeline) of this user *****/ - Soc_ShowUsrTimeline (Gbl.Usrs.Other.UsrDat.UsrCod); + Soc_ShowTimelineUsr (); } /*****************************************************************************/ diff --git a/swad_social.c b/swad_social.c index 52e69e982..13516e1d1 100644 --- a/swad_social.c +++ b/swad_social.c @@ -38,6 +38,7 @@ #include "swad_layout.h" #include "swad_notice.h" #include "swad_parameter.h" +#include "swad_profile.h" #include "swad_social.h" /*****************************************************************************/ @@ -77,7 +78,7 @@ static const Act_Action_t Soc_DefaultActions[Soc_NUM_SOCIAL_NOTES] = /* Users tab */ /* Social tab */ - ActSeeSocAct, // Soc_NOTE_SOCIAL_POST (action not used) + ActSeeSocTmlGbl, // Soc_NOTE_SOCIAL_POST (action not used) ActSeeFor, // Soc_NOTE_FORUM_POST /* Messages tab */ @@ -137,14 +138,16 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub, struct UsrData *UsrDat, bool PutIconRemove); static void Soc_WriteNoteDate (time_t TimeUTC); +static void Soc_GetAndWriteSocialPost (long PstCod); static void Soc_StartFormGoToAction (Soc_NoteType_t NoteType, long CrsCod,long Cod); static void Soc_GetNoteSummary (const struct SocialNote *SocNot, char *SummaryStr,unsigned MaxChars); static void Soc_PublishSocialNoteInTimeline (struct SocialPublishing *SocPub); -static void Soc_PutLinkToWriteANewPost (void); -static void Soc_GetAndWriteSocialPost (long PstCod); +static void Soc_PutLinkToWriteANewPost (Act_Action_t Action,void (*FuncParams) ()); +static void Soc_FormSocialPost (void); +static void Soc_ReceiveSocialPost (void); static void Soc_PutFormToShareSocialPublishing (long PubCod); static void Soc_PutFormToUnshareSocialPublishing (long PubCod); @@ -152,6 +155,12 @@ static void Soc_PutFormToRemoveSocialPublishing (long PubCod); static void Soc_PutHiddenParamPubCod (long NotCod); static long Soc_GetParamPubCod (void); +static void Soc_ShareSocialPublishing (void); +static void Soc_UnshareSocialPublishing (void); + +static void Soc_RequestRemovalSocialPublishing (void); +static void Soc_RemoveSocialPublishing (void); + static void Soc_DeleteASocialPublishingFromDB (const struct SocialPublishing *SocPub, const struct SocialNote *SocNot); @@ -166,39 +175,39 @@ static Soc_NoteType_t Soc_GetSocialNoteFromDB (const char *Str); /*********** Show social activity (timeline) of a selected user **************/ /*****************************************************************************/ -void Soc_ShowUsrTimeline (long UsrCod) +void Soc_ShowTimelineUsr (void) { char Query[512]; /***** Link to write a new social post (public comment) *****/ - if (UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod && // It's me - Gbl.CurrentAct != ActReqSocPst) // Not writing a new post - Soc_PutLinkToWriteANewPost (); + if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod && // It's me + Gbl.CurrentAct != ActReqSocPstUsr) // Not writing a new post + Soc_PutLinkToWriteANewPost (ActReqSocPstUsr,Usr_PutParamOtherUsrCodEncrypted); /***** Build query to show timeline with publishing of a unique user *****/ sprintf (Query,"SELECT PubCod,AuthorCod,PublisherCod,NotCod,UNIX_TIMESTAMP(TimePublish)" " FROM social_timeline" " WHERE PublisherCod='%ld'" " ORDER BY PubCod DESC LIMIT %u", - UsrCod, + Gbl.Usrs.Other.UsrDat.UsrCod, Soc_NUM_PUBS_IN_TIMELINE); /***** Show timeline *****/ - Soc_ShowTimeline (Query,ActSeeSocAct); + Soc_ShowTimeline (Query,ActSeePubPrf); } /*****************************************************************************/ /***** Show social activity (timeline) including all the users I follow ******/ /*****************************************************************************/ -void Soc_ShowFollowingTimeline (void) +void Soc_ShowTimelineGbl (void) { extern const char *Txt_You_dont_follow_any_user; char Query[512]; /***** Link to write a new social post (public comment) *****/ - if (Gbl.CurrentAct != ActReqSocPst) // Not writing a new post - Soc_PutLinkToWriteANewPost (); + if (Gbl.CurrentAct != ActReqSocPstGbl) // Not writing a new post + Soc_PutLinkToWriteANewPost (ActReqSocPstGbl,NULL); /***** If I follow someone... *****/ if (Fol_GetNumFollowing (Gbl.Usrs.Me.UsrDat.UsrCod)) @@ -230,7 +239,7 @@ void Soc_ShowFollowingTimeline (void) " ORDER BY PubCod DESC"); /***** Show timeline *****/ - Soc_ShowTimeline (Query,ActSeeSocAct); + Soc_ShowTimeline (Query,ActSeeSocTmlGbl); /***** Drop temporary table with publishing codes *****/ sprintf (Query,"DROP TEMPORARY TABLE IF EXISTS pub_cods"); @@ -245,7 +254,6 @@ void Soc_ShowFollowingTimeline (void) /*****************************************************************************/ /*********************** Show social activity (timeline) *********************/ /*****************************************************************************/ -// If UpdateAction == ActUnk ==> no form to update is displayed static void Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction) { @@ -272,8 +280,7 @@ static void Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction) Lay_StartRoundFrame ("560px",Txt_Public_activity); /***** Form to update timeline *****/ - if (UpdateAction != ActUnk) - Act_PutLinkToUpdateAction (UpdateAction); + Act_PutLinkToUpdateAction (UpdateAction); /***** Start list *****/ fprintf (Gbl.F.Out,"
"); } +/*****************************************************************************/ +/***************** Get from database and write public post *******************/ +/*****************************************************************************/ + +static void Soc_GetAndWriteSocialPost (long PstCod) + { + char Query[128]; + MYSQL_RES *mysql_res; + MYSQL_ROW row; + unsigned long NumRows; + char Content[Cns_MAX_BYTES_LONG_TEXT+1]; + + /***** Get social post from database *****/ + sprintf (Query,"SELECT Content FROM social_posts WHERE PstCod='%ld'", + PstCod); + NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get the content of a social post"); + + /***** Result should have a unique row *****/ + if (NumRows == 1) + { + /***** Get number of rows *****/ + row = mysql_fetch_row (mysql_res); + + /****** Get content (row[0]) *****/ + strncpy (Content,row[0],Cns_MAX_BYTES_LONG_TEXT); + Content[Cns_MAX_BYTES_LONG_TEXT] = '\0'; + } + else + Content[0] = '\0'; + + /***** Free structure that stores the query result *****/ + DB_FreeMySQLResult (&mysql_res); + + /***** Write content *****/ + Msg_WriteMsgContent (Content,Cns_MAX_BYTES_LONG_TEXT,true,false); + } + /*****************************************************************************/ /********* Put form to go to an action depending on the social note **********/ /*****************************************************************************/ @@ -721,12 +765,12 @@ static void Soc_PublishSocialNoteInTimeline (struct SocialPublishing *SocPub) /***************** Put contextual link to write a new post *******************/ /*****************************************************************************/ -static void Soc_PutLinkToWriteANewPost (void) +static void Soc_PutLinkToWriteANewPost (Act_Action_t Action,void (*FuncParams) ()) { extern const char *Txt_New_comment; fprintf (Gbl.F.Out,"
"); - Lay_PutContextualLink (ActReqSocPst,NULL,"write64x64.gif", + Lay_PutContextualLink (Action,FuncParams,"write64x64.gif", Txt_New_comment,Txt_New_comment); fprintf (Gbl.F.Out,"
"); } @@ -735,7 +779,31 @@ static void Soc_PutLinkToWriteANewPost (void) /****************** Form to write a new public comment ***********************/ /*****************************************************************************/ -void Soc_FormSocialPost (void) +void Soc_FormSocialPostGbl (void) + { + /***** Form to write a new public comment *****/ + Soc_FormSocialPost (); + + /***** Write current timeline (global) *****/ + Soc_ShowTimelineGbl (); + } + +void Soc_FormSocialPostUsr (void) + { + /***** Get user whom profile is displayed *****/ + Usr_GetParamOtherUsrCodEncryptedAndGetUsrData (); + + /***** Show user's profile *****/ + Prf_ShowUserProfile (); + + /***** Form to write a new public comment *****/ + Soc_FormSocialPost (); + + /***** Write current timeline (user) *****/ + Soc_ShowTimelineUsr (); + } + +static void Soc_FormSocialPost (void) { extern const char *Txt_New_comment; extern const char *Txt_Send_comment; @@ -745,7 +813,13 @@ void Soc_FormSocialPost (void) Lay_StartRoundFrame ("560px",Txt_New_comment); /* Start form to write the post */ - Act_FormStart (ActRcvSocPst); + if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) + { + Act_FormStart (ActRcvSocPstUsr); + Usr_PutParamOtherUsrCodEncrypted (); + } + else + Act_FormStart (ActRcvSocPstGbl); /* Content of new post */ fprintf (Gbl.F.Out,"