Version 15.102

This commit is contained in:
Antonio Cañas Vargas 2016-01-08 01:53:37 +01:00
parent 1e48956cfc
commit 1c3961f694
6 changed files with 668 additions and 301 deletions

View File

@ -1739,6 +1739,14 @@ a:hover img.CENTRE_PHOTO_SHOW
padding-left:4px;
vertical-align:bottom;
}
.SOCIAL_COMMENTS
{
padding-top:10px;
}
.SOCIAL_COMMENT
{
border-top:1px solid silver;
}
.SOCIAL_FORM_COMMENT
{
padding-top:10px;

View File

@ -1004,19 +1004,23 @@ Social:
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!!!!!!!!. ActComSocNotGbl Comment a social note in the timeline (global)
NEW!!!!!!!!. ActRcvSocComGbl Comment a social note in the timeline (global)
NEW!!!!!!!!. ActShaSocNotGbl 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!!!!!!!!. ActReqRemSocComGbl Request the removal of a comment in a social note (global)
NEW!!!!!!!!. ActRemSocComGbl Remove of a comment in a social note (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!!!!!!!!. ActComSocNotUsr Comment a social note in the timeline (user)
NEW!!!!!!!!. ActRcvSocComUsr Comment a social note in the timeline (user)
NEW!!!!!!!!. ActShaSocNotUsr Share a social note in the timeline (user)
NEW!!!!!!!!. ActUnsSocPubUsr Unshare a previously shared social note 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)
NEW!!!!!!!!. ActReqRemSocComUsr Request the removal of a comment in a social note (user)
NEW!!!!!!!!. ActRemSocComUsr Remove of a comment in a social note (user)
843. ActSeePubPrf Show a public user's profile
844. ActCal1stClkTim Calculate first click time from log and store into user's figures
@ -2327,19 +2331,23 @@ 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_ReceiveCommentGbl ,NULL},
/* ActRcvSocComUsr */{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},
/* ActRemSocPubGbl */{1493,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialNotGbl ,NULL},
/* ActReqRemSocPubGbl*/{1494,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemSocialNoteGbl ,NULL},
/* ActRemSocPubGbl */{1493,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialNoteGbl ,NULL},
/* ActReqRemSocComGbl*/{1505,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemSocialComGbl ,NULL},
/* ActRemSocComGbl */{1507,-1,TabSoc,ActSeeSocTmlGbl ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialComGbl ,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},
/* ActComSocNotUsr */{1504,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_ReceiveCommentUsr ,NULL},
/* ActRcvSocComUsr */{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},
/* ActRemSocPubUsr */{1502,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialNotUsr ,NULL},
/* ActReqRemSocPubUsr*/{1501,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemSocialNoteUsr ,NULL},
/* ActRemSocPubUsr */{1502,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialNoteUsr ,NULL},
/* ActReqRemSocComGbl*/{1506,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RequestRemSocialComUsr ,NULL},
/* ActRemSocComGbl */{1508,-1,TabSoc,ActReqPubPrf ,0x1FE,0x1FE,0x1FE,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Soc_RemoveSocialComUsr ,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},
@ -4190,8 +4198,12 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
ActUnsSocPubUsr, // #1500
ActReqRemSocPubUsr, // #1501
ActRemSocPubUsr, // #1502
ActComSocNotGbl, // #1503
ActComSocNotUsr, // #1504
ActRcvSocComGbl, // #1503
ActRcvSocComUsr, // #1504
ActReqRemSocComGbl, // #1505
ActReqRemSocComUsr, // #1506
ActRemSocComGbl, // #1507
ActRemSocComUsr, // #1508
};
/*****************************************************************************/

View File

@ -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+161+36+27+82)
#define Act_NUM_ACTIONS (7+52+15+90+72+67+205+183+143+165+36+27+82)
#define Act_MAX_ACTION_COD 1504
#define Act_MAX_ACTION_COD 1508
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 20
@ -1043,166 +1043,170 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
// Secondary actions
#define ActReqSocPstGbl (ActLstClk+ 5)
#define ActRcvSocPstGbl (ActLstClk+ 6)
#define ActComSocNotGbl (ActLstClk+ 7)
#define ActRcvSocComGbl (ActLstClk+ 7)
#define ActShaSocNotGbl (ActLstClk+ 8)
#define ActUnsSocPubGbl (ActLstClk+ 9)
#define ActReqRemSocPubGbl (ActLstClk+ 10)
#define ActRemSocPubGbl (ActLstClk+ 11)
#define ActReqRemSocComGbl (ActLstClk+ 12)
#define ActRemSocComGbl (ActLstClk+ 13)
#define ActReqSocPstUsr (ActLstClk+ 12)
#define ActRcvSocPstUsr (ActLstClk+ 13)
#define ActComSocNotUsr (ActLstClk+ 14)
#define ActShaSocNotUsr (ActLstClk+ 15)
#define ActUnsSocPubUsr (ActLstClk+ 16)
#define ActReqRemSocPubUsr (ActLstClk+ 17)
#define ActRemSocPubUsr (ActLstClk+ 18)
#define ActReqSocPstUsr (ActLstClk+ 14)
#define ActRcvSocPstUsr (ActLstClk+ 15)
#define ActRcvSocComUsr (ActLstClk+ 16)
#define ActShaSocNotUsr (ActLstClk+ 17)
#define ActUnsSocPubUsr (ActLstClk+ 18)
#define ActReqRemSocPubUsr (ActLstClk+ 19)
#define ActRemSocPubUsr (ActLstClk+ 20)
#define ActReqRemSocComUsr (ActLstClk+ 21)
#define ActRemSocComUsr (ActLstClk+ 22)
#define ActSeePubPrf (ActLstClk+ 19)
#define ActCal1stClkTim (ActLstClk+ 20)
#define ActCalNumClk (ActLstClk+ 21)
#define ActCalNumFilVie (ActLstClk+ 22)
#define ActCalNumForPst (ActLstClk+ 23)
#define ActCalNumMsgSnt (ActLstClk+ 24)
#define ActSeePubPrf (ActLstClk+ 23)
#define ActCal1stClkTim (ActLstClk+ 24)
#define ActCalNumClk (ActLstClk+ 25)
#define ActCalNumFilVie (ActLstClk+ 26)
#define ActCalNumForPst (ActLstClk+ 27)
#define ActCalNumMsgSnt (ActLstClk+ 28)
#define ActFolUsr (ActLstClk+ 25)
#define ActUnfUsr (ActLstClk+ 26)
#define ActSeeFlg (ActLstClk+ 27)
#define ActSeeFlr (ActLstClk+ 28)
#define ActFolUsr (ActLstClk+ 29)
#define ActUnfUsr (ActLstClk+ 30)
#define ActSeeFlg (ActLstClk+ 31)
#define ActSeeFlr (ActLstClk+ 32)
#define ActSeeForCrsUsr (ActLstClk+ 29)
#define ActSeeForCrsTch (ActLstClk+ 30)
#define ActSeeForDegUsr (ActLstClk+ 31)
#define ActSeeForDegTch (ActLstClk+ 32)
#define ActSeeForCtrUsr (ActLstClk+ 33)
#define ActSeeForCtrTch (ActLstClk+ 34)
#define ActSeeForInsUsr (ActLstClk+ 35)
#define ActSeeForInsTch (ActLstClk+ 36)
#define ActSeeForGenUsr (ActLstClk+ 37)
#define ActSeeForGenTch (ActLstClk+ 38)
#define ActSeeForSWAUsr (ActLstClk+ 39)
#define ActSeeForSWATch (ActLstClk+ 40)
#define ActSeePstForCrsUsr (ActLstClk+ 41)
#define ActSeePstForCrsTch (ActLstClk+ 42)
#define ActSeePstForDegUsr (ActLstClk+ 43)
#define ActSeePstForDegTch (ActLstClk+ 44)
#define ActSeePstForCtrUsr (ActLstClk+ 45)
#define ActSeePstForCtrTch (ActLstClk+ 46)
#define ActSeePstForInsUsr (ActLstClk+ 47)
#define ActSeePstForInsTch (ActLstClk+ 48)
#define ActSeePstForGenUsr (ActLstClk+ 49)
#define ActSeePstForGenTch (ActLstClk+ 50)
#define ActSeePstForSWAUsr (ActLstClk+ 51)
#define ActSeePstForSWATch (ActLstClk+ 52)
#define ActRcvThrForCrsUsr (ActLstClk+ 53)
#define ActRcvThrForCrsTch (ActLstClk+ 54)
#define ActRcvThrForDegUsr (ActLstClk+ 55)
#define ActRcvThrForDegTch (ActLstClk+ 56)
#define ActRcvThrForCtrUsr (ActLstClk+ 57)
#define ActRcvThrForCtrTch (ActLstClk+ 58)
#define ActRcvThrForInsUsr (ActLstClk+ 59)
#define ActRcvThrForInsTch (ActLstClk+ 60)
#define ActRcvThrForGenUsr (ActLstClk+ 61)
#define ActRcvThrForGenTch (ActLstClk+ 62)
#define ActRcvThrForSWAUsr (ActLstClk+ 63)
#define ActRcvThrForSWATch (ActLstClk+ 64)
#define ActRcvRepForCrsUsr (ActLstClk+ 65)
#define ActRcvRepForCrsTch (ActLstClk+ 66)
#define ActRcvRepForDegUsr (ActLstClk+ 67)
#define ActRcvRepForDegTch (ActLstClk+ 68)
#define ActRcvRepForCtrUsr (ActLstClk+ 69)
#define ActRcvRepForCtrTch (ActLstClk+ 70)
#define ActRcvRepForInsUsr (ActLstClk+ 71)
#define ActRcvRepForInsTch (ActLstClk+ 72)
#define ActRcvRepForGenUsr (ActLstClk+ 73)
#define ActRcvRepForGenTch (ActLstClk+ 74)
#define ActRcvRepForSWAUsr (ActLstClk+ 75)
#define ActRcvRepForSWATch (ActLstClk+ 76)
#define ActReqDelThrCrsUsr (ActLstClk+ 77)
#define ActReqDelThrCrsTch (ActLstClk+ 78)
#define ActReqDelThrDegUsr (ActLstClk+ 79)
#define ActReqDelThrDegTch (ActLstClk+ 80)
#define ActReqDelThrCtrUsr (ActLstClk+ 81)
#define ActReqDelThrCtrTch (ActLstClk+ 82)
#define ActReqDelThrInsUsr (ActLstClk+ 83)
#define ActReqDelThrInsTch (ActLstClk+ 84)
#define ActReqDelThrGenUsr (ActLstClk+ 85)
#define ActReqDelThrGenTch (ActLstClk+ 86)
#define ActReqDelThrSWAUsr (ActLstClk+ 87)
#define ActReqDelThrSWATch (ActLstClk+ 88)
#define ActDelThrForCrsUsr (ActLstClk+ 89)
#define ActDelThrForCrsTch (ActLstClk+ 90)
#define ActDelThrForDegUsr (ActLstClk+ 91)
#define ActDelThrForDegTch (ActLstClk+ 92)
#define ActDelThrForCtrUsr (ActLstClk+ 93)
#define ActDelThrForCtrTch (ActLstClk+ 94)
#define ActDelThrForInsUsr (ActLstClk+ 95)
#define ActDelThrForInsTch (ActLstClk+ 96)
#define ActDelThrForGenUsr (ActLstClk+ 97)
#define ActDelThrForGenTch (ActLstClk+ 98)
#define ActDelThrForSWAUsr (ActLstClk+ 99)
#define ActDelThrForSWATch (ActLstClk+100)
#define ActCutThrForCrsUsr (ActLstClk+101)
#define ActCutThrForCrsTch (ActLstClk+102)
#define ActCutThrForDegUsr (ActLstClk+103)
#define ActCutThrForDegTch (ActLstClk+104)
#define ActCutThrForCtrUsr (ActLstClk+105)
#define ActCutThrForCtrTch (ActLstClk+106)
#define ActCutThrForInsUsr (ActLstClk+107)
#define ActCutThrForInsTch (ActLstClk+108)
#define ActCutThrForGenUsr (ActLstClk+109)
#define ActCutThrForGenTch (ActLstClk+110)
#define ActCutThrForSWAUsr (ActLstClk+111)
#define ActCutThrForSWATch (ActLstClk+112)
#define ActPasThrForCrsUsr (ActLstClk+113)
#define ActPasThrForCrsTch (ActLstClk+114)
#define ActPasThrForDegUsr (ActLstClk+115)
#define ActPasThrForDegTch (ActLstClk+116)
#define ActPasThrForCtrUsr (ActLstClk+117)
#define ActPasThrForCtrTch (ActLstClk+118)
#define ActPasThrForInsUsr (ActLstClk+119)
#define ActPasThrForInsTch (ActLstClk+120)
#define ActPasThrForGenUsr (ActLstClk+121)
#define ActPasThrForGenTch (ActLstClk+122)
#define ActPasThrForSWAUsr (ActLstClk+123)
#define ActPasThrForSWATch (ActLstClk+124)
#define ActDelPstForCrsUsr (ActLstClk+125)
#define ActDelPstForCrsTch (ActLstClk+126)
#define ActDelPstForDegUsr (ActLstClk+127)
#define ActDelPstForDegTch (ActLstClk+128)
#define ActDelPstForCtrUsr (ActLstClk+129)
#define ActDelPstForCtrTch (ActLstClk+130)
#define ActDelPstForInsUsr (ActLstClk+131)
#define ActDelPstForInsTch (ActLstClk+132)
#define ActDelPstForGenUsr (ActLstClk+133)
#define ActDelPstForGenTch (ActLstClk+134)
#define ActDelPstForSWAUsr (ActLstClk+135)
#define ActDelPstForSWATch (ActLstClk+136)
#define ActEnbPstForCrsUsr (ActLstClk+137)
#define ActEnbPstForCrsTch (ActLstClk+138)
#define ActEnbPstForDegUsr (ActLstClk+139)
#define ActEnbPstForDegTch (ActLstClk+140)
#define ActEnbPstForCtrUsr (ActLstClk+141)
#define ActEnbPstForCtrTch (ActLstClk+142)
#define ActEnbPstForInsUsr (ActLstClk+143)
#define ActEnbPstForInsTch (ActLstClk+144)
#define ActEnbPstForGenUsr (ActLstClk+145)
#define ActEnbPstForGenTch (ActLstClk+146)
#define ActEnbPstForSWAUsr (ActLstClk+147)
#define ActEnbPstForSWATch (ActLstClk+148)
#define ActDisPstForCrsUsr (ActLstClk+149)
#define ActDisPstForCrsTch (ActLstClk+150)
#define ActDisPstForDegUsr (ActLstClk+151)
#define ActDisPstForDegTch (ActLstClk+152)
#define ActDisPstForCtrUsr (ActLstClk+153)
#define ActDisPstForCtrTch (ActLstClk+154)
#define ActDisPstForInsUsr (ActLstClk+155)
#define ActDisPstForInsTch (ActLstClk+156)
#define ActDisPstForGenUsr (ActLstClk+157)
#define ActDisPstForGenTch (ActLstClk+158)
#define ActDisPstForSWAUsr (ActLstClk+159)
#define ActDisPstForSWATch (ActLstClk+160)
#define ActSeeForCrsUsr (ActLstClk+ 33)
#define ActSeeForCrsTch (ActLstClk+ 34)
#define ActSeeForDegUsr (ActLstClk+ 35)
#define ActSeeForDegTch (ActLstClk+ 36)
#define ActSeeForCtrUsr (ActLstClk+ 37)
#define ActSeeForCtrTch (ActLstClk+ 38)
#define ActSeeForInsUsr (ActLstClk+ 39)
#define ActSeeForInsTch (ActLstClk+ 40)
#define ActSeeForGenUsr (ActLstClk+ 41)
#define ActSeeForGenTch (ActLstClk+ 42)
#define ActSeeForSWAUsr (ActLstClk+ 43)
#define ActSeeForSWATch (ActLstClk+ 44)
#define ActSeePstForCrsUsr (ActLstClk+ 45)
#define ActSeePstForCrsTch (ActLstClk+ 46)
#define ActSeePstForDegUsr (ActLstClk+ 47)
#define ActSeePstForDegTch (ActLstClk+ 48)
#define ActSeePstForCtrUsr (ActLstClk+ 49)
#define ActSeePstForCtrTch (ActLstClk+ 50)
#define ActSeePstForInsUsr (ActLstClk+ 51)
#define ActSeePstForInsTch (ActLstClk+ 52)
#define ActSeePstForGenUsr (ActLstClk+ 53)
#define ActSeePstForGenTch (ActLstClk+ 54)
#define ActSeePstForSWAUsr (ActLstClk+ 55)
#define ActSeePstForSWATch (ActLstClk+ 56)
#define ActRcvThrForCrsUsr (ActLstClk+ 57)
#define ActRcvThrForCrsTch (ActLstClk+ 58)
#define ActRcvThrForDegUsr (ActLstClk+ 59)
#define ActRcvThrForDegTch (ActLstClk+ 60)
#define ActRcvThrForCtrUsr (ActLstClk+ 61)
#define ActRcvThrForCtrTch (ActLstClk+ 62)
#define ActRcvThrForInsUsr (ActLstClk+ 63)
#define ActRcvThrForInsTch (ActLstClk+ 64)
#define ActRcvThrForGenUsr (ActLstClk+ 65)
#define ActRcvThrForGenTch (ActLstClk+ 66)
#define ActRcvThrForSWAUsr (ActLstClk+ 67)
#define ActRcvThrForSWATch (ActLstClk+ 68)
#define ActRcvRepForCrsUsr (ActLstClk+ 69)
#define ActRcvRepForCrsTch (ActLstClk+ 70)
#define ActRcvRepForDegUsr (ActLstClk+ 71)
#define ActRcvRepForDegTch (ActLstClk+ 72)
#define ActRcvRepForCtrUsr (ActLstClk+ 73)
#define ActRcvRepForCtrTch (ActLstClk+ 74)
#define ActRcvRepForInsUsr (ActLstClk+ 75)
#define ActRcvRepForInsTch (ActLstClk+ 76)
#define ActRcvRepForGenUsr (ActLstClk+ 77)
#define ActRcvRepForGenTch (ActLstClk+ 78)
#define ActRcvRepForSWAUsr (ActLstClk+ 79)
#define ActRcvRepForSWATch (ActLstClk+ 80)
#define ActReqDelThrCrsUsr (ActLstClk+ 81)
#define ActReqDelThrCrsTch (ActLstClk+ 82)
#define ActReqDelThrDegUsr (ActLstClk+ 83)
#define ActReqDelThrDegTch (ActLstClk+ 84)
#define ActReqDelThrCtrUsr (ActLstClk+ 85)
#define ActReqDelThrCtrTch (ActLstClk+ 86)
#define ActReqDelThrInsUsr (ActLstClk+ 87)
#define ActReqDelThrInsTch (ActLstClk+ 88)
#define ActReqDelThrGenUsr (ActLstClk+ 89)
#define ActReqDelThrGenTch (ActLstClk+ 90)
#define ActReqDelThrSWAUsr (ActLstClk+ 91)
#define ActReqDelThrSWATch (ActLstClk+ 92)
#define ActDelThrForCrsUsr (ActLstClk+ 93)
#define ActDelThrForCrsTch (ActLstClk+ 94)
#define ActDelThrForDegUsr (ActLstClk+ 95)
#define ActDelThrForDegTch (ActLstClk+ 96)
#define ActDelThrForCtrUsr (ActLstClk+ 97)
#define ActDelThrForCtrTch (ActLstClk+ 98)
#define ActDelThrForInsUsr (ActLstClk+ 99)
#define ActDelThrForInsTch (ActLstClk+100)
#define ActDelThrForGenUsr (ActLstClk+101)
#define ActDelThrForGenTch (ActLstClk+102)
#define ActDelThrForSWAUsr (ActLstClk+103)
#define ActDelThrForSWATch (ActLstClk+104)
#define ActCutThrForCrsUsr (ActLstClk+105)
#define ActCutThrForCrsTch (ActLstClk+106)
#define ActCutThrForDegUsr (ActLstClk+107)
#define ActCutThrForDegTch (ActLstClk+108)
#define ActCutThrForCtrUsr (ActLstClk+109)
#define ActCutThrForCtrTch (ActLstClk+110)
#define ActCutThrForInsUsr (ActLstClk+111)
#define ActCutThrForInsTch (ActLstClk+112)
#define ActCutThrForGenUsr (ActLstClk+113)
#define ActCutThrForGenTch (ActLstClk+114)
#define ActCutThrForSWAUsr (ActLstClk+115)
#define ActCutThrForSWATch (ActLstClk+116)
#define ActPasThrForCrsUsr (ActLstClk+117)
#define ActPasThrForCrsTch (ActLstClk+118)
#define ActPasThrForDegUsr (ActLstClk+119)
#define ActPasThrForDegTch (ActLstClk+120)
#define ActPasThrForCtrUsr (ActLstClk+121)
#define ActPasThrForCtrTch (ActLstClk+122)
#define ActPasThrForInsUsr (ActLstClk+123)
#define ActPasThrForInsTch (ActLstClk+124)
#define ActPasThrForGenUsr (ActLstClk+125)
#define ActPasThrForGenTch (ActLstClk+126)
#define ActPasThrForSWAUsr (ActLstClk+127)
#define ActPasThrForSWATch (ActLstClk+128)
#define ActDelPstForCrsUsr (ActLstClk+129)
#define ActDelPstForCrsTch (ActLstClk+130)
#define ActDelPstForDegUsr (ActLstClk+131)
#define ActDelPstForDegTch (ActLstClk+132)
#define ActDelPstForCtrUsr (ActLstClk+133)
#define ActDelPstForCtrTch (ActLstClk+134)
#define ActDelPstForInsUsr (ActLstClk+135)
#define ActDelPstForInsTch (ActLstClk+136)
#define ActDelPstForGenUsr (ActLstClk+137)
#define ActDelPstForGenTch (ActLstClk+138)
#define ActDelPstForSWAUsr (ActLstClk+139)
#define ActDelPstForSWATch (ActLstClk+140)
#define ActEnbPstForCrsUsr (ActLstClk+141)
#define ActEnbPstForCrsTch (ActLstClk+142)
#define ActEnbPstForDegUsr (ActLstClk+143)
#define ActEnbPstForDegTch (ActLstClk+144)
#define ActEnbPstForCtrUsr (ActLstClk+145)
#define ActEnbPstForCtrTch (ActLstClk+146)
#define ActEnbPstForInsUsr (ActLstClk+147)
#define ActEnbPstForInsTch (ActLstClk+148)
#define ActEnbPstForGenUsr (ActLstClk+149)
#define ActEnbPstForGenTch (ActLstClk+150)
#define ActEnbPstForSWAUsr (ActLstClk+151)
#define ActEnbPstForSWATch (ActLstClk+152)
#define ActDisPstForCrsUsr (ActLstClk+153)
#define ActDisPstForCrsTch (ActLstClk+154)
#define ActDisPstForDegUsr (ActLstClk+155)
#define ActDisPstForDegTch (ActLstClk+156)
#define ActDisPstForCtrUsr (ActLstClk+157)
#define ActDisPstForCtrTch (ActLstClk+158)
#define ActDisPstForInsUsr (ActLstClk+159)
#define ActDisPstForInsTch (ActLstClk+160)
#define ActDisPstForGenUsr (ActLstClk+161)
#define ActDisPstForGenTch (ActLstClk+162)
#define ActDisPstForSWAUsr (ActLstClk+163)
#define ActDisPstForSWATch (ActLstClk+164)
#define ActCht (ActLstClk+161)
#define ActCht (ActLstClk+165)
/*****************************************************************************/
/******************************* Messages tab ********************************/

View File

@ -124,13 +124,20 @@ En definitiva, se estar
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.101.3 (2016-01-07)"
#define CSS_FILE "swad15.101.3.css"
#define Log_PLATFORM_VERSION "SWAD 15.102 (2016-01-08)"
#define CSS_FILE "swad15.102.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.102: Jan 08, 2016 Remove a comment in social timeline. (191534 lines)
4 changes necessary in database:
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1505','es','N','Solicitar elim. coment. social (global)');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1506','es','N','Solicitar elim. coment. social (usuario)');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1507','es','N','Eliminar coment. social (global)');
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1508','es','N','Eliminar coment. social (usuario)');
Version 15.101.3: Jan 07, 2016 Changes in CSS related to social timeline. (191229 lines)
Version 15.101.2: Jan 07, 2016 Show social comments in social notes. (191229 lines)
Version 15.101.1: Jan 07, 2016 Show social comments in social notes. Not finished. (191181 lines)

View File

@ -117,6 +117,15 @@ struct SocialNote
unsigned NumShared; // Number of times (users) this note has been shared
};
struct SocialComment
{
long ComCod;
long UsrCod; // TODO: Rename as AuthorCod here and in database?
long NotCod; // Note code
time_t DateTimeUTC;
char Content[Cns_MAX_BYTES_LONG_TEXT];
};
/*****************************************************************************/
/************** External global variables from others modules ****************/
/*****************************************************************************/
@ -138,7 +147,9 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
const struct SocialNote *SocNot,
bool ShowAlone,
bool LastInList);
static void Soc_WriteNoteDate (time_t TimeUTC);
static void Soc_WriteSocialComment (struct SocialComment *SocCom,
bool ShowAlone);
static void Soc_WriteDateTime (time_t TimeUTC);
static void Soc_GetAndWriteSocialPost (long PstCod);
static void Soc_PutFormGoToAction (const struct SocialNote *SocNot);
static void Soc_GetNoteSummary (const struct SocialNote *SocNot,
@ -151,35 +162,49 @@ static void Soc_ReceiveSocialPost (void);
static void Soc_PutFormToCommentSocialNote (long NotCod);
static void Soc_WriteCommentsInSocialNote (long NotCod);
static void Soc_WriteCommentDate (time_t TimeUTC);
static void Soc_PutFormToRemoveComment (long ComCod);
static void Soc_PutHiddenFormToSendCommentToASocialNote (long NotCod);
static void Soc_PutDisabledIconShare (unsigned NumShared);
static void Soc_PutFormToShareSocialNote (long NotCod);
static void Soc_PutFormToUnshareSocialPublishing (long PubCod);
static void Soc_PutFormToRemoveSocialPublishing (long PubCod);
static void Soc_PutHiddenParamNotCod (long NotCod);
static void Soc_PutHiddenParamPubCod (long PubCod);
static void Soc_PutHiddenParamComCod (long ComCod);
static long Soc_GetParamNotCod (void);
static long Soc_GetParamPubCod (void);
static long Soc_GetParamComCod (void);
static void Soc_ReceiveComment (void);
static void Soc_ShareSocialNote (void);
static void Soc_UnshareSocialPublishing (void);
static void Soc_UnshareASocialPublishingFromDB (struct SocialNote *SocNot);
static void Soc_RequestRemovalSocialPublishing (void);
static void Soc_RequestRemovalSocialNote (void);
static void Soc_RemoveSocialNote (void);
static void Soc_RemoveASocialPublishingFromDB (struct SocialNote *SocNot);
static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot);
static void Soc_RequestRemovalSocialComment (void);
static void Soc_RemoveSocialComment (void);
static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom);
static bool Soc_CheckIfNoteIsPublishedInTimelineByUsr (long NotCod,long UsrCod);
static void Soc_UpdateNumTimesANoteHasBeenShared (struct SocialNote *SocNot);
static void Soc_ShowUsrsWhoHaveSharedSocialNote (const struct SocialNote *SocNot);
static void Soc_GetDataOfSocialPublishingByCod (struct SocialPublishing *SocPub);
static void Soc_GetDataOfSocialNoteByCod (struct SocialNote *SocNot);
static void Soc_GetDataOfSocialCommentByCod (struct SocialComment *SocCom);
static void Soc_GetDataOfSocialPublishingFromRow (MYSQL_ROW row,struct SocialPublishing *SocPub);
static void Soc_GetDataOfSocialNoteFromRow (MYSQL_ROW row,struct SocialNote *SocNot);
static Soc_NoteType_t Soc_GetNoteTypeFromStr (const char *Str);
static void Soc_GetDataOfSocialCommentFromRow (MYSQL_ROW row,struct SocialComment *SocCom);
static void Soc_ResetSocialPublishing (struct SocialPublishing *SocPub);
static void Soc_ResetSocialNote (struct SocialNote *SocNot);
static void Soc_ResetSocialComment (struct SocialComment *SocCom);
/*****************************************************************************/
/*********** Show social activity (timeline) of a selected user **************/
@ -337,28 +362,6 @@ static void Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction,
DB_FreeMySQLResult (&mysql_res);
}
/*****************************************************************************/
/************** Get data of social publishing using its code *****************/
/*****************************************************************************/
static void Soc_GetDataOfSocialPublishingFromRow (MYSQL_ROW row,struct SocialPublishing *SocPub)
{
/* Get social publishing code (row[0]) */
SocPub->PubCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get social note code (row[1]) */
SocPub->NotCod = Str_ConvertStrCodToLongCod (row[1]);
/* Get publisher's code (row[2]) */
SocPub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]);
/* Get author's code (row[3]) */
SocPub->AuthorCod = Str_ConvertStrCodToLongCod (row[3]);
/* Get time of the note (row[4]) */
SocPub->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[4]);
}
/*****************************************************************************/
/***************************** Write social note *****************************/
/*****************************************************************************/
@ -443,7 +446,7 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
UsrDat.FullName,UsrDat.Nickname);
/* Write date and time */
Soc_WriteNoteDate (SocNot->DateTimeUTC);
Soc_WriteDateTime (SocNot->DateTimeUTC);
/* Write content of the note */
if (SocNot->NoteType == Soc_NOTE_SOCIAL_POST)
@ -574,10 +577,8 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
/* Show who have shared this social note */
Soc_ShowUsrsWhoHaveSharedSocialNote (SocNot);
/* Put icon to remove */
if (IAmTheAuthor &&
IAmAPublisherOfThisSocNot)
/* Put icon to remove this publishing */
/* Put icon to remove this publishing */
if (IAmTheAuthor && !ShowAlone)
Soc_PutFormToRemoveSocialPublishing (SocPub->PubCod);
/* Show current comments */
@ -603,12 +604,103 @@ static void Soc_WriteSocialNote (const struct SocialPublishing *SocPub,
}
}
/*****************************************************************************/
/**************************** Write social comment ***************************/
/*****************************************************************************/
static void Soc_WriteSocialComment (struct SocialComment *SocCom,
bool ShowAlone) // Social comment is shown alone, not in a list
{
extern const char *Txt_Forum;
extern const char *Txt_Course;
extern const char *Txt_Degree;
extern const char *Txt_Centre;
extern const char *Txt_Institution;
struct UsrData UsrDat;
bool IAmTheAuthor;
bool ShowPhoto = false;
char PhotoURL[PATH_MAX+1];
if (ShowAlone)
{
Lay_StartRoundFrame (Soc_WIDTH_TIMELINE,NULL);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_LEFT_PHOTO\">"
"</div>"
"<div class=\"SOCIAL_RIGHT_CONTAINER\">"
"<ul class=\"LIST_LEFT\">");
}
/***** Start list item *****/
fprintf (Gbl.F.Out,"<li");
if (!ShowAlone)
fprintf (Gbl.F.Out," class=\"SOCIAL_COMMENT\"");
fprintf (Gbl.F.Out,">");
if (SocCom->ComCod <= 0 ||
SocCom->NotCod <= 0 ||
SocCom->UsrCod <= 0)
Lay_ShowAlert (Lay_ERROR,"Error in social comment.");
else
{
/***** Get author's data *****/
Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = SocCom->UsrCod;
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
IAmTheAuthor = (Gbl.Usrs.Me.Logged &&
UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Left: write author's photo *****/
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_PHOTO\">");
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO30x40",Pho_ZOOM);
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_RIGHT_CONTAINER\">");
/* Write author's full name and nickname */
Str_LimitLengthHTMLStr (UsrDat.FullName,12);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_RIGHT_AUTHOR\">"
"<span class=\"DAT_BOLD\">%s</span>"
"<span class=\"DAT_LIGHT\"> @%s</span>"
"</div>",
UsrDat.FullName,UsrDat.Nickname);
/* Write date and time */
Soc_WriteDateTime (SocCom->DateTimeUTC);
/* Write content of the social comment */
fprintf (Gbl.F.Out,"<div class=\"DAT\">");
Msg_WriteMsgContent (SocCom->Content,Cns_MAX_BYTES_LONG_TEXT,true,false);
fprintf (Gbl.F.Out,"</div>");
/* Put icon to remove this social comment */
if (IAmTheAuthor && !ShowAlone)
Soc_PutFormToRemoveComment (SocCom->ComCod);
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
/***** End list item *****/
fprintf (Gbl.F.Out,"</li>");
if (ShowAlone)
{
fprintf (Gbl.F.Out,"</ul>"
"</div>");
Lay_EndRoundFrame ();
}
}
/*****************************************************************************/
/**************** Write the date of creation of a social note ****************/
/*****************************************************************************/
// TimeUTC holds UTC date and time in UNIX format (seconds since 1970)
static void Soc_WriteNoteDate (time_t TimeUTC)
static void Soc_WriteDateTime (time_t TimeUTC)
{
extern const char *Txt_Today;
static unsigned UniqueId = 0;
@ -1185,16 +1277,11 @@ static void Soc_WriteCommentsInSocialNote (long NotCod)
MYSQL_ROW row;
unsigned long NumComments;
unsigned long NumCom;
long ComCod;
struct UsrData UsrDat;
bool ShowPhoto;
char PhotoURL[PATH_MAX+1];
bool IAmTheAuthor;
time_t DateTimeUTC;
char Content[Cns_MAX_BYTES_LONG_TEXT+1];
struct SocialComment SocCom;
/***** Get comments of this social note from database *****/
sprintf (Query,"SELECT social_comments.ComCod,social_comments.UsrCod,"
"social_comments.NotCod,"
"UNIX_TIMESTAMP(social_comments.TimeComment),"
"social_comments_content.Content"
" FROM social_comments,social_comments_content"
@ -1207,11 +1294,8 @@ static void Soc_WriteCommentsInSocialNote (long NotCod)
/***** List comments *****/
if (NumComments) // Comments to this social note found
{
/***** Initialize structure with user's data *****/
Usr_UsrDataConstructor (&UsrDat);
/***** Start list *****/
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT\">");
fprintf (Gbl.F.Out,"<ul class=\"LIST_LEFT SOCIAL_COMMENTS\">");
/***** List comments one by one *****/
for (NumCom = 0;
@ -1220,60 +1304,14 @@ static void Soc_WriteCommentsInSocialNote (long NotCod)
{
/* Get data of social comment */
row = mysql_fetch_row (mysql_res);
Soc_GetDataOfSocialCommentFromRow (row,&SocCom);
/* Get social code (row[0]) */
ComCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get (from) user code (row[1]) */
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[1]);
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
if (Gbl.Usrs.Me.Logged)
IAmTheAuthor = (UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
/* Get time of the note (row[2]) */
DateTimeUTC = Dat_GetUNIXTimeFromStr (row[2]);
/* Get content (row[3]) */
strncpy (Content,row[3],Cns_MAX_BYTES_LONG_TEXT);
Content[Cns_MAX_BYTES_LONG_TEXT] = '\0';
fprintf (Gbl.F.Out,"<li>");
/***** Left: write author's photo *****/
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_PHOTO\">");
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (&UsrDat,PhotoURL);
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
NULL,
"PHOTO30x40",Pho_ZOOM);
fprintf (Gbl.F.Out,"</div>");
/***** Right: author's name, time, summary and buttons *****/
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_RIGHT_CONTAINER\">");
/* Write author's full name and nickname */
Str_LimitLengthHTMLStr (UsrDat.FullName,12);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_COMMENT_RIGHT_AUTHOR\">"
"<span class=\"DAT_BOLD\">%s</span>"
"<span class=\"DAT_LIGHT\"> @%s</span>"
"</div>",
UsrDat.FullName,UsrDat.Nickname);
/* Write date and time */
Soc_WriteCommentDate (DateTimeUTC);
/* Write content of the comment */
fprintf (Gbl.F.Out,"<div class=\"DAT\">");
Msg_WriteMsgContent (Content,Cns_MAX_BYTES_LONG_TEXT,true,false);
fprintf (Gbl.F.Out,"</div>");
fprintf (Gbl.F.Out,"</li>");
/* Write social comment */
Soc_WriteSocialComment (&SocCom,false);
}
/***** End list *****/
fprintf (Gbl.F.Out,"</ul>");
/***** Free memory used for user's data *****/
Usr_UsrDataDestructor (&UsrDat);
}
/***** Free structure that stores the query result *****/
@ -1281,30 +1319,32 @@ static void Soc_WriteCommentsInSocialNote (long NotCod)
}
/*****************************************************************************/
/********* Write the date of creation of a comment to a social note **********/
/********************** Form to remove social comment ************************/
/*****************************************************************************/
// TimeUTC holds UTC date and time in UNIX format (seconds since 1970)
static void Soc_WriteCommentDate (time_t TimeUTC)
static void Soc_PutFormToRemoveComment (long ComCod)
{
extern const char *Txt_Today;
static unsigned UniqueId = 0;
extern const char *Txt_Remove;
UniqueId++;
/***** Start cell *****/
fprintf (Gbl.F.Out,"<div id=\"date_comment_%u\" class=\"SOCIAL_RIGHT_TIME DAT_LIGHT\""
" style=\"display:inline-block;\">",
UniqueId);
/***** Write date and time *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
"writeLocalDateTimeFromUTC('date_comment_%u',%ld,'&nbsp;','%s');"
"</script>",
UniqueId,(long) TimeUTC,Txt_Today);
/***** End cell *****/
fprintf (Gbl.F.Out,"</div>");
/***** Form to remove social publishing *****/
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActReqRemSocComUsr,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActReqRemSocComGbl);
Soc_PutHiddenParamComCod (ComCod);
fprintf (Gbl.F.Out,"<div class=\"SOCIAL_ICON_REMOVE ICON_HIGHLIGHT\">"
"<input type=\"image\""
" src=\"%s/remove-on64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON20x20\" />"
"</div>",
Gbl.Prefs.IconsURL,
Txt_Remove,
Txt_Remove);
Act_FormEnd ();
}
/*****************************************************************************/
@ -1324,13 +1364,13 @@ static void Soc_PutHiddenFormToSendCommentToASocialNote (long NotCod)
/***** Start form to write the post *****/
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActComSocNotUsr,"timeline");
Act_FormStartAnchor (ActRcvSocComUsr,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActComSocNotGbl);
Act_FormStart (ActRcvSocComGbl);
Soc_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<textarea name=\"Comment%ld\" cols=\"44\" rows=\"5\">"
fprintf (Gbl.F.Out,"<textarea name=\"Comment%ld\" cols=\"47\" rows=\"5\">"
"</textarea>",
NotCod);
@ -1475,6 +1515,15 @@ static void Soc_PutHiddenParamPubCod (long PubCod)
Par_PutHiddenParamLong ("PubCod",PubCod);
}
/*****************************************************************************/
/************* Put parameter with the code of a social comment ***************/
/*****************************************************************************/
static void Soc_PutHiddenParamComCod (long ComCod)
{
Par_PutHiddenParamLong ("ComCod",ComCod);
}
/*****************************************************************************/
/************** Get parameter with the code of a social note *****************/
/*****************************************************************************/
@ -1501,7 +1550,7 @@ static long Soc_GetParamPubCod (void)
char LongStr[1+10+1]; // String that holds the social publishing code
long PubCod;
/* Get social note code */
/* Get social punlishing code */
Par_GetParToText ("PubCod",LongStr,1+10);
if (sscanf (LongStr,"%ld",&PubCod) != 1)
Lay_ShowErrorAndExit ("Wrong code of social publishing.");
@ -1509,6 +1558,23 @@ static long Soc_GetParamPubCod (void)
return PubCod;
}
/*****************************************************************************/
/************* Get parameter with the code of a social comment ***************/
/*****************************************************************************/
static long Soc_GetParamComCod (void)
{
char LongStr[1+10+1]; // String that holds the social comment code
long ComCod;
/* Get social comment code */
Par_GetParToText ("ComCod",LongStr,1+10);
if (sscanf (LongStr,"%ld",&ComCod) != 1)
Lay_ShowErrorAndExit ("Wrong code of social comment.");
return ComCod;
}
/*****************************************************************************/
/*************************** Comment a social note ***************************/
/*****************************************************************************/
@ -1749,31 +1815,31 @@ static void Soc_UnshareASocialPublishingFromDB (struct SocialNote *SocNot)
}
/*****************************************************************************/
/**************** Request the removal of a social publishing *****************/
/******************* Request the removal of a social note ********************/
/*****************************************************************************/
void Soc_RequestRemSocialPubGbl (void)
void Soc_RequestRemSocialNoteGbl (void)
{
/***** Request the removal of social publishing *****/
Soc_RequestRemovalSocialPublishing ();
/***** Request the removal of social note *****/
Soc_RequestRemovalSocialNote ();
/***** Write timeline again (global) *****/
Soc_ShowTimelineGbl ();
}
void Soc_RequestRemSocialPubUsr (void)
void Soc_RequestRemSocialNoteUsr (void)
{
/***** Get user whom profile is displayed *****/
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
/***** Show user's profile *****/
/***** Show user's profile *****/
Prf_ShowUserProfile ();
/***** Start section *****/
fprintf (Gbl.F.Out,"<section id=\"timeline\">");
/***** Request the removal of social publishing *****/
Soc_RequestRemovalSocialPublishing ();
/***** Request the removal of social note *****/
Soc_RequestRemovalSocialNote ();
/***** Write timeline again (user) *****/
Soc_ShowTimelineUsr ();
@ -1782,7 +1848,7 @@ void Soc_RequestRemSocialPubUsr (void)
fprintf (Gbl.F.Out,"</section>");
}
static void Soc_RequestRemovalSocialPublishing (void)
static void Soc_RequestRemovalSocialNote (void)
{
extern const char *Txt_Do_you_really_want_to_remove_the_following_comment;
extern const char *Txt_Remove;
@ -1837,7 +1903,7 @@ static void Soc_RequestRemovalSocialPublishing (void)
/*************************** Remove a social note ****************************/
/*****************************************************************************/
void Soc_RemoveSocialNotGbl (void)
void Soc_RemoveSocialNoteGbl (void)
{
/***** Remove a social note *****/
Soc_RemoveSocialNote ();
@ -1846,7 +1912,7 @@ void Soc_RemoveSocialNotGbl (void)
Soc_ShowTimelineGbl ();
}
void Soc_RemoveSocialNotUsr (void)
void Soc_RemoveSocialNoteUsr (void)
{
/***** Get user whom profile is displayed *****/
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
@ -1891,7 +1957,7 @@ static void Soc_RemoveSocialNote (void)
if (ICanRemove)
{
/***** Delete social publishing from database *****/
Soc_RemoveASocialPublishingFromDB (&SocNot);
Soc_RemoveASocialNoteFromDB (&SocNot);
/***** Message of success *****/
Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Removed);
@ -1899,12 +1965,12 @@ static void Soc_RemoveSocialNote (void)
}
/*****************************************************************************/
/**************** Remove a social publishing from database *******************/
/******************* Remove a social note from database **********************/
/*****************************************************************************/
static void Soc_RemoveASocialPublishingFromDB (struct SocialNote *SocNot)
static void Soc_RemoveASocialNoteFromDB (struct SocialNote *SocNot)
{
char Query[128];
char Query[256];
/***** Remove all the social publishings of this note *****/
sprintf (Query,"DELETE FROM social_timeline"
@ -1931,10 +1997,188 @@ static void Soc_RemoveASocialPublishingFromDB (struct SocialNote *SocNot)
DB_QueryDELETE (Query,"can not remove a social post");
}
/***** Remove content of the comments of this social note *****/
sprintf (Query,"DELETE FROM social_comments_content"
" USING social_comments,social_comments_content"
" WHERE social_comments.NotCod='%ld'"
" AND social_comments.ComCod=social_comments_content.ComCod",
SocNot->NotCod);
DB_QueryDELETE (Query,"can not remove social comments");
/***** Remove comments of this social note *****/
sprintf (Query,"DELETE FROM social_comments"
" WHERE NotCod='%ld'",
SocNot->NotCod);
DB_QueryDELETE (Query,"can not remove social comments");
/***** Reset social note *****/
Soc_ResetSocialNote (SocNot);
}
/*****************************************************************************/
/************* Request the removal of a comment in a social note *************/
/*****************************************************************************/
void Soc_RequestRemSocialComGbl (void)
{
/***** Request the removal of comment in social note *****/
Soc_RequestRemovalSocialComment ();
/***** Write timeline again (global) *****/
Soc_ShowTimelineGbl ();
}
void Soc_RequestRemSocialComUsr (void)
{
/***** Get user whom profile is displayed *****/
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
/***** Show user's profile *****/
Prf_ShowUserProfile ();
/***** Start section *****/
fprintf (Gbl.F.Out,"<section id=\"timeline\">");
/***** Request the removal of comment in social note *****/
Soc_RequestRemovalSocialComment ();
/***** Write timeline again (user) *****/
Soc_ShowTimelineUsr ();
/***** End section *****/
fprintf (Gbl.F.Out,"</section>");
}
static void Soc_RequestRemovalSocialComment (void)
{
extern const char *Txt_Do_you_really_want_to_remove_the_following_comment;
extern const char *Txt_Remove;
struct SocialComment SocCom;
bool ICanRemove;
/***** Get the code of the social comment to remove *****/
SocCom.ComCod = Soc_GetParamComCod ();
/***** Get data of social comment *****/
Soc_GetDataOfSocialCommentByCod (&SocCom);
ICanRemove = (Gbl.Usrs.Me.Logged &&
SocCom.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
if (ICanRemove)
{
/***** Show warning and social comment *****/
/* Warning message */
Lay_ShowAlert (Lay_WARNING,Txt_Do_you_really_want_to_remove_the_following_comment);
/* Show social comment */
Soc_WriteSocialComment (&SocCom,true);
/***** Form to ask for confirmation to remove this social comment *****/
/* Start form */
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
{
Act_FormStartAnchor (ActRemSocComUsr,"timeline");
Usr_PutParamOtherUsrCodEncrypted ();
}
else
Act_FormStart (ActRemSocComGbl);
Soc_PutHiddenParamComCod (SocCom.ComCod);
/* End form */
Lay_PutRemoveButton (Txt_Remove);
Act_FormEnd ();
}
}
/*****************************************************************************/
/************************** Remove a social comment **************************/
/*****************************************************************************/
void Soc_RemoveSocialComGbl (void)
{
/***** Remove a social comment *****/
Soc_RemoveSocialComment ();
/***** Write updated timeline after removing (global) *****/
Soc_ShowTimelineGbl ();
}
void Soc_RemoveSocialComUsr (void)
{
/***** Get user whom profile is displayed *****/
Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ();
/***** Show user's profile *****/
Prf_ShowUserProfile ();
/***** Start section *****/
fprintf (Gbl.F.Out,"<section id=\"timeline\">");
/***** Remove a social comment *****/
Soc_RemoveSocialComment ();
/***** Write updated timeline after removing (user) *****/
Soc_ShowTimelineUsr ();
/***** End section *****/
fprintf (Gbl.F.Out,"</section>");
}
static void Soc_RemoveSocialComment (void)
{
extern const char *Txt_SOCIAL_PUBLISHING_Removed;
struct SocialComment SocCom;
struct SocialNote SocNot;
bool ICanRemove;
/***** Get the code of the social comment to remove *****/
SocCom.ComCod = Soc_GetParamComCod ();
/***** Get data of social comment *****/
Soc_GetDataOfSocialCommentByCod (&SocCom);
/***** Get data of social note *****/
SocNot.NotCod = SocCom.NotCod;
Soc_GetDataOfSocialNoteByCod (&SocNot);
ICanRemove = (Gbl.Usrs.Me.Logged &&
SocCom.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod);
if (ICanRemove)
{
/***** Delete social comment from database *****/
Soc_RemoveASocialCommentFromDB (&SocCom);
/***** Message of success *****/
Lay_ShowAlert (Lay_SUCCESS,Txt_SOCIAL_PUBLISHING_Removed);
}
}
/*****************************************************************************/
/****************** Remove a social comment from database ********************/
/*****************************************************************************/
static void Soc_RemoveASocialCommentFromDB (struct SocialComment *SocCom)
{
char Query[128];
/***** Remove content of this social comment *****/
sprintf (Query,"DELETE FROM social_comments_content"
" WHERE ComCod='%ld'",
SocCom->ComCod);
DB_QueryDELETE (Query,"can not remove a social comment");
/***** Remove this social comment *****/
sprintf (Query,"DELETE FROM social_comments"
" WHERE ComCod='%ld'"
" AND UsrCod='%ld'", // Extra check: I am the author
SocCom->ComCod,
Gbl.Usrs.Me.UsrDat.UsrCod);
DB_QueryDELETE (Query,"can not remove a social comment");
/***** Reset social comment *****/
Soc_ResetSocialComment (SocCom);
}
/*****************************************************************************/
/**************** Check if a user has published a social note ****************/
/*****************************************************************************/
@ -2097,7 +2341,59 @@ static void Soc_GetDataOfSocialNoteByCod (struct SocialNote *SocNot)
}
/*****************************************************************************/
/*************** Get data of social note using its code **********************/
/*************** Get data of social comment using its code *******************/
/*****************************************************************************/
static void Soc_GetDataOfSocialCommentByCod (struct SocialComment *SocCom)
{
char Query[512];
MYSQL_RES *mysql_res;
MYSQL_ROW row;
/***** Get data of social comment from database *****/
sprintf (Query,"SELECT social_comments.ComCod,social_comments.UsrCod,"
"social_comments.NotCod,"
"UNIX_TIMESTAMP(social_comments.TimeComment),"
"social_comments_content.Content"
" FROM social_comments,social_comments_content"
" WHERE social_comments.ComCod='%ld'"
" AND social_comments.ComCod=social_comments_content.ComCod",
SocCom->ComCod);
if (DB_QuerySELECT (Query,&mysql_res,"can not get data of social comment"))
{
/***** Get data of social comment *****/
row = mysql_fetch_row (mysql_res);
Soc_GetDataOfSocialCommentFromRow (row,SocCom);
}
else
/***** Reset fields of social comment *****/
Soc_ResetSocialComment (SocCom);
}
/*****************************************************************************/
/************** Get data of social publishing using its code *****************/
/*****************************************************************************/
static void Soc_GetDataOfSocialPublishingFromRow (MYSQL_ROW row,struct SocialPublishing *SocPub)
{
/* Get code of social publishing (row[0]) */
SocPub->PubCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get social note code (row[1]) */
SocPub->NotCod = Str_ConvertStrCodToLongCod (row[1]);
/* Get publisher's code (row[2]) */
SocPub->PublisherCod = Str_ConvertStrCodToLongCod (row[2]);
/* Get author's code (row[3]) */
SocPub->AuthorCod = Str_ConvertStrCodToLongCod (row[3]);
/* Get time of the note (row[4]) */
SocPub->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[4]);
}
/*****************************************************************************/
/******************** Get data of social note from row ***********************/
/*****************************************************************************/
static void Soc_GetDataOfSocialNoteFromRow (MYSQL_ROW row,struct SocialNote *SocNot)
@ -2139,6 +2435,29 @@ static Soc_NoteType_t Soc_GetNoteTypeFromStr (const char *Str)
return Soc_NOTE_UNKNOWN;
}
/*****************************************************************************/
/****************** Get data of social comment from row **********************/
/*****************************************************************************/
static void Soc_GetDataOfSocialCommentFromRow (MYSQL_ROW row,struct SocialComment *SocCom)
{
/* Get code of social comment (row[0]) */
SocCom->ComCod = Str_ConvertStrCodToLongCod (row[0]);
/* Get (from) user code (row[1]) */
SocCom->UsrCod = Str_ConvertStrCodToLongCod (row[1]);
/* Get code of social note (row[2]) */
SocCom->NotCod = Str_ConvertStrCodToLongCod (row[2]);
/* Get time of the note (row[3]) */
SocCom->DateTimeUTC = Dat_GetUNIXTimeFromStr (row[3]);
/* Get content (row[4]) */
strncpy (SocCom->Content,row[4],Cns_MAX_BYTES_LONG_TEXT);
SocCom->Content[Cns_MAX_BYTES_LONG_TEXT] = '\0';
}
/*****************************************************************************/
/******************** Reset fields of social publishing **********************/
/*****************************************************************************/
@ -2165,3 +2484,15 @@ static void Soc_ResetSocialNote (struct SocialNote *SocNot)
SocNot->DateTimeUTC = (time_t) 0;
SocNot->NumShared = 0;
}
/*****************************************************************************/
/********************** Reset fields of social comment ***********************/
/*****************************************************************************/
static void Soc_ResetSocialComment (struct SocialComment *SocCom)
{
SocCom->UsrCod = -1L;
SocCom->NotCod = -1L;
SocCom->DateTimeUTC = (time_t) 0;
SocCom->Content[0] = '\0';
}

View File

@ -103,9 +103,14 @@ void Soc_ShareSocialNoteUsr (void);
void Soc_UnshareSocialPubGbl (void);
void Soc_UnshareSocialPubUsr (void);
void Soc_RequestRemSocialPubGbl (void);
void Soc_RequestRemSocialPubUsr (void);
void Soc_RemoveSocialNotGbl (void);
void Soc_RemoveSocialNotUsr (void);
void Soc_RequestRemSocialNoteGbl (void);
void Soc_RequestRemSocialNoteUsr (void);
void Soc_RemoveSocialNoteGbl (void);
void Soc_RemoveSocialNoteUsr (void);
void Soc_RequestRemSocialComGbl (void);
void Soc_RequestRemSocialComUsr (void);
void Soc_RemoveSocialComGbl (void);
void Soc_RemoveSocialComUsr (void);
#endif