From 2a8042024221f7a21adf5a29fda260789838506d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 2 Jan 2016 02:33:23 +0100 Subject: [PATCH] Version 15.89.1 --- swad_changelog.h | 4 +++- swad_layout.c | 19 ++++++++++++++++-- swad_layout.h | 7 ++++++- swad_profile.c | 8 ++++++++ swad_social.c | 52 +++++++++++++++++++++++++++++++++++++++++------- 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index de710a7c6..b158bbfd5 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -117,14 +117,16 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.89 (2016-01-02)" +#define Log_PLATFORM_VERSION "SWAD 15.89.1 (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.1: Jan 02, 2016 Change in layout of user profile. (190137 lines) Version 15.89: Jan 02, 2016 Social timeline can be updated from user profile. (190084 lines) + 13 changes necessary in database: 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'; diff --git a/swad_layout.c b/swad_layout.c index c7deaf2db..59e200ca1 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -951,9 +951,21 @@ void Lay_PutFormToEdit (Act_Action_t Action) /***************** Show an icon with a link in contextual menu ***************/ /*****************************************************************************/ -void Lay_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), +void Lay_PutContextualLink (Act_Action_t NextAction, + void (*FuncParams) (), const char *Icon, const char *Title,const char *Text) + { + Lay_PutContextualLinkAnchor (NextAction,NULL, + FuncParams, + Icon, + Title,Text); + } + +void Lay_PutContextualLinkAnchor (Act_Action_t NextAction,const char *Anchor, + void (*FuncParams) (), + const char *Icon, + const char *Title,const char *Text) { extern const char *The_ClassFormBold[The_NUM_THEMES]; @@ -961,7 +973,10 @@ void Lay_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), fprintf (Gbl.F.Out," "); // This space is necessary to enable // jumping to the next line on narrow screens - Act_FormStart (NextAction); + if (Anchor) + Act_FormStartAnchor (NextAction,Anchor); + else + Act_FormStart (NextAction); if (FuncParams) FuncParams (); Lay_PutIconLink (Icon,Title,Text, diff --git a/swad_layout.h b/swad_layout.h index e1885c084..b5df15e84 100644 --- a/swad_layout.h +++ b/swad_layout.h @@ -73,9 +73,14 @@ void Lay_WriteTitle (const char *Title); void Lay_PutFormToView (Act_Action_t Action); void Lay_PutFormToEdit (Act_Action_t Action); -void Lay_PutContextualLink (Act_Action_t NextAction,void (*FuncParams) (), +void Lay_PutContextualLink (Act_Action_t NextAction, + void (*FuncParams) (), const char *Icon, const char *Title,const char *Text); +void Lay_PutContextualLinkAnchor (Act_Action_t NextAction,const char *Anchor, + void (*FuncParams) (), + const char *Icon, + const char *Title,const char *Text); void Lay_PutIconLink (const char *Icon,const char *Title,const char *Text, const char *LinkStyle); void Lay_PutIconWithText (const char *Icon,const char *Alt,const char *Text); diff --git a/swad_profile.c b/swad_profile.c index 116460cff..c75f96212 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -208,8 +208,16 @@ static void Prf_GetUsrDatAndShowUserProfile (void) Prf_RequestUserProfileWithDefaultNickname (""); } else + { + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Show social activity (timeline) of this user *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); + } } /*****************************************************************************/ diff --git a/swad_social.c b/swad_social.c index 13516e1d1..6c1cdf8fd 100644 --- a/swad_social.c +++ b/swad_social.c @@ -770,8 +770,10 @@ static void Soc_PutLinkToWriteANewPost (Act_Action_t Action,void (*FuncParams) ( extern const char *Txt_New_comment; fprintf (Gbl.F.Out,"
"); - Lay_PutContextualLink (Action,FuncParams,"write64x64.gif", - Txt_New_comment,Txt_New_comment); + Lay_PutContextualLinkAnchor (Action,"timeline", + FuncParams, + "write64x64.gif", + Txt_New_comment,Txt_New_comment); fprintf (Gbl.F.Out,"
"); } @@ -796,11 +798,17 @@ void Soc_FormSocialPostUsr (void) /***** Show user's profile *****/ Prf_ShowUserProfile (); + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Form to write a new public comment *****/ Soc_FormSocialPost (); /***** Write current timeline (user) *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); } static void Soc_FormSocialPost (void) @@ -815,7 +823,7 @@ static void Soc_FormSocialPost (void) /* Start form to write the post */ if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { - Act_FormStart (ActRcvSocPstUsr); + Act_FormStartAnchor (ActRcvSocPstUsr,"timeline"); Usr_PutParamOtherUsrCodEncrypted (); } else @@ -857,11 +865,17 @@ void Soc_ReceiveSocialPostUsr (void) /***** Show user's profile *****/ Prf_ShowUserProfile (); + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Receive and store social post *****/ Soc_ReceiveSocialPost (); /***** Write updated timeline after publishing (user) *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); } static void Soc_ReceiveSocialPost (void) @@ -895,7 +909,7 @@ static void Soc_PutFormToShareSocialPublishing (long PubCod) /***** Form to share social publishing *****/ if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { - Act_FormStart (ActShaSocPubUsr); + Act_FormStartAnchor (ActShaSocPubUsr,"timeline"); Usr_PutParamOtherUsrCodEncrypted (); } else @@ -924,7 +938,7 @@ static void Soc_PutFormToUnshareSocialPublishing (long PubCod) /***** Form to share social publishing *****/ if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { - Act_FormStart (ActUnsSocPubUsr); + Act_FormStartAnchor (ActUnsSocPubUsr,"timeline"); Usr_PutParamOtherUsrCodEncrypted (); } else @@ -953,7 +967,7 @@ static void Soc_PutFormToRemoveSocialPublishing (long PubCod) /***** Form to remove social publishing *****/ if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { - Act_FormStart (ActReqRemSocPubUsr); + Act_FormStartAnchor (ActReqRemSocPubUsr,"timeline"); Usr_PutParamOtherUsrCodEncrypted (); } else @@ -1018,11 +1032,17 @@ void Soc_ShareSocialPubUsr (void) /***** Show user's profile *****/ Prf_ShowUserProfile (); + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Share social publishing *****/ Soc_ShareSocialPublishing (); /***** Write updated timeline after sharing (user) *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); } static void Soc_ShareSocialPublishing (void) @@ -1077,11 +1097,17 @@ void Soc_UnshareSocialPubUsr (void) /***** Show user's profile *****/ Prf_ShowUserProfile (); + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Unshare a previously shared social publishing *****/ Soc_UnshareSocialPublishing (); /***** Write updated timeline after unsharing (user) *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); } static void Soc_UnshareSocialPublishing (void) @@ -1140,11 +1166,17 @@ void Soc_RequestRemSocialPubUsr (void) /***** Show user's profile *****/ Prf_ShowUserProfile (); + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Request the removal of social publishing *****/ Soc_RequestRemovalSocialPublishing (); /***** Write timeline again (user) *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); } static void Soc_RequestRemovalSocialPublishing (void) @@ -1178,7 +1210,7 @@ static void Soc_RequestRemovalSocialPublishing (void) /* Start form */ if (Gbl.Usrs.Other.UsrDat.UsrCod > 0) { - Act_FormStart (ActRemSocPubUsr); + Act_FormStartAnchor (ActRemSocPubUsr,"timeline"); Usr_PutParamOtherUsrCodEncrypted (); } else @@ -1223,11 +1255,17 @@ void Soc_RemoveSocialPubUsr (void) /***** Show user's profile *****/ Prf_ShowUserProfile (); + /***** Start section *****/ + fprintf (Gbl.F.Out,"
"); + /***** Remove a social publishing *****/ Soc_RemoveSocialPublishing (); /***** Write updated timeline after removing (user) *****/ Soc_ShowTimelineUsr (); + + /***** End section *****/ + fprintf (Gbl.F.Out,"
"); } static void Soc_RemoveSocialPublishing (void)