From 20e795fa210bc4266cf6343310f443ad81351709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 30 Dec 2015 18:36:10 +0100 Subject: [PATCH] Version 15.84.3 --- swad_action.c | 17 +++++++++++++++++ swad_action.h | 1 + swad_changelog.h | 3 ++- swad_enrollment.c | 2 +- swad_social.c | 21 +++++++++++++++------ 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/swad_action.c b/swad_action.c index c548fb359..7908ec8c2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -4426,6 +4426,23 @@ void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle) /***************** Adjust current action when no user's logged ***************/ /*****************************************************************************/ +void Act_PutLinkToUpdateAction (Act_Action_t Action) + { + extern const char *The_ClassFormBold[The_NUM_THEMES]; + extern const char *Txt_Update; + + Act_FormStart (Action); + fprintf (Gbl.F.Out,"
"); + Act_LinkFormSubmitAnimated (Txt_Update,The_ClassFormBold[Gbl.Prefs.Theme]); + Lay_PutCalculateIconWithText (Txt_Update,Txt_Update); + fprintf (Gbl.F.Out,"
"); + Act_FormEnd (); + } + +/*****************************************************************************/ +/***************** Adjust current action when no user's logged ***************/ +/*****************************************************************************/ + void Act_AdjustActionWhenNoUsrLogged (void) { if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected diff --git a/swad_action.h b/swad_action.h index cd02b740a..45e3bbd3c 100644 --- a/swad_action.h +++ b/swad_action.h @@ -1416,6 +1416,7 @@ void Act_FormEnd (void); void Act_LinkFormSubmit (const char *Title,const char *LinkStyle); void Act_LinkFormSubmitId (const char *Title,const char *LinkStyle,const char *Id); void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle); +void Act_PutLinkToUpdateAction (Act_Action_t Action); void Act_AdjustActionWhenNoUsrLogged (void); void Act_AdjustCurrentAction (void); diff --git a/swad_changelog.h b/swad_changelog.h index 3d4b85512..77c14d3e7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -116,13 +116,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.84.2 (2015-12-30)" +#define Log_PLATFORM_VERSION "SWAD 15.84.3 (2015-12-30)" #define CSS_FILE "swad15.84.2.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.84.3: Dec 30, 2015 Form to update timeline. (189444 lines) Version 15.84.2: Dec 30, 2015 Help about editor in new social post. (189422 lines) Version 15.84.1: Dec 30, 2015 Request confirmation before removing a social post. (189419 lines) Version 15.84: Dec 30, 2015 Remove social post. (189316 lines) diff --git a/swad_enrollment.c b/swad_enrollment.c index cd9059b6b..348c038cd 100644 --- a/swad_enrollment.c +++ b/swad_enrollment.c @@ -2249,8 +2249,8 @@ void Enr_ShowEnrollmentRequests (void) fprintf (Gbl.F.Out,"
"); Act_LinkFormSubmitAnimated (Txt_Update,The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutCalculateIconWithText (Txt_Update,Txt_Update); - Act_FormEnd (); fprintf (Gbl.F.Out,"
"); + Act_FormEnd (); /***** Build query *****/ switch (Gbl.Scope.Current) diff --git a/swad_social.c b/swad_social.c index 3f48a04b9..07dd9f1c1 100644 --- a/swad_social.c +++ b/swad_social.c @@ -120,7 +120,7 @@ extern struct Globals Gbl; /***************************** Private prototypes ****************************/ /*****************************************************************************/ -static unsigned long Soc_ShowTimeline (const char *Query); +static unsigned long Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction); static Soc_SocialEvent_t Soc_GetSocialEventFromDB (const char *Str); static void Soc_WriteSocialEvent (const struct SocialEvent *Soc, struct UsrData *UsrDat, @@ -158,7 +158,7 @@ void Soc_ShowUsrTimeline (long UsrCod) UsrCod); /***** Show timeline *****/ - Soc_ShowTimeline (Query); + Soc_ShowTimeline (Query,ActUnk); } /*****************************************************************************/ @@ -191,15 +191,16 @@ void Soc_ShowFollowingTimeline (void) Gbl.Usrs.Me.UsrDat.UsrCod); /***** Show timeline *****/ - if (!Soc_ShowTimeline (Query)) + if (!Soc_ShowTimeline (Query,ActSeeSocAct)) Lay_ShowAlert (Lay_INFO,"No hay actividad pública."); // Need translation!!! } /*****************************************************************************/ /*********************** Show social activity (timeline) *********************/ /*****************************************************************************/ +// UpdateAction == ActUnk ==> no form to update is displayed -static unsigned long Soc_ShowTimeline (const char *Query) +static unsigned long Soc_ShowTimeline (const char *Query,Act_Action_t UpdateAction) { extern const char *Txt_Public_activity; MYSQL_RES *mysql_res; @@ -218,8 +219,14 @@ static unsigned long Soc_ShowTimeline (const char *Query) /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); - /***** List start *****/ + /***** Start frame *****/ Lay_StartRoundFrame ("560px",Txt_Public_activity); + + /***** Form to update timeline *****/ + if (UpdateAction != ActUnk) + Act_PutLinkToUpdateAction (UpdateAction); + + /***** Start list *****/ fprintf (Gbl.F.Out,""); + + /***** End frame *****/ Lay_EndRoundFrame (); /***** Free memory used for user's data *****/