From c3ea8754683aa0d34775646d7a0fc581a268efa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 6 Feb 2017 01:23:33 +0100 Subject: [PATCH] Version 16.132.15 --- swad_action.c | 4 ++-- swad_changelog.h | 3 ++- swad_layout.c | 11 ++++++++--- swad_social.c | 37 +++++++++++++++---------------------- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/swad_action.c b/swad_action.c index 7dda0f697..c3f886b10 100644 --- a/swad_action.c +++ b/swad_action.c @@ -1452,8 +1452,8 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActHom */{ 844,-1,TabUnk,ActHom ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,NULL ,NULL}, /* ActMnu */{ 2,-1,TabUnk,ActMnu ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,NULL ,NULL}, /* ActRefCon */{ 845,-1,TabUnk,ActRefCon ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Lay_RefreshNotifsAndConnected ,NULL}, - /* ActRefLstClk */{ 994,-1,TabUnk,ActRefLstClk ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Lay_RefreshLastClicks ,NULL}, - /* ActRefNewSocPubGbl*/{1509,-1,TabUnk,ActRefNewSocPubGbl ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Soc_RefreshNewTimelineGbl ,NULL}, + /* ActRefLstClk */{ 994,-1,TabUnk,ActRefLstClk ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Lay_RefreshLastClicks ,NULL}, + /* ActRefNewSocPubGbl*/{1509,-1,TabUnk,ActRefNewSocPubGbl ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Soc_RefreshNewTimelineGbl ,NULL}, /* ActRefOldSocPubGbl*/{1510,-1,TabUnk,ActRefOldSocPubGbl ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Soc_RefreshOldTimelineGbl ,NULL}, /* ActRefOldSocPubUsr*/{1511,-1,TabUnk,ActRefOldSocPubUsr ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Soc_RefreshOldTimelineUsr ,NULL}, /* ActWebSvc */{ 892,-1,TabUnk,ActWebSvc ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Plg_WebService ,NULL}, diff --git a/swad_changelog.h b/swad_changelog.h index 184507138..ff3cf9b8f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -196,13 +196,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.132.14 (2017-02-05)" +#define Log_PLATFORM_VERSION "SWAD 16.132.15 (2017-02-06)" #define CSS_FILE "swad16.132.4.css" #define JS_FILE "swad16.123.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 16.132.15:Feb 06, 2017 Bug fixing related to AJAX and automatic refresh. (211916 lines) Version 16.132.14:Feb 05, 2017 Bug fixing related to AJAX and automatic refresh. (211916 lines) Version 16.132.13:Feb 01, 2017 Global connected in right column is shown only for system admins. (211904 lines) Version 16.132.12:Feb 01, 2017 Code refactoring and bug fixing in parameters related to users list type. (211900 lines) diff --git a/swad_layout.c b/swad_layout.c index 3b4935161..a56e3f4a2 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -1656,9 +1656,14 @@ void Lay_RefreshNotifsAndConnected (void) void Lay_RefreshLastClicks (void) { - // Send, before the HTML, the refresh time - fprintf (Gbl.F.Out,"%lu|",Cfg_TIME_TO_REFRESH_LAST_CLICKS); - Con_GetAndShowLastClicks (); + if (Gbl.Session.IsOpen) // If session has been closed, do not write anything + { + /***** Send, before the HTML, the refresh time *****/ + fprintf (Gbl.F.Out,"%lu|",Cfg_TIME_TO_REFRESH_LAST_CLICKS); + + /***** Get and show last clicks *****/ + Con_GetAndShowLastClicks (); + } /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true; diff --git a/swad_social.c b/swad_social.c index 9ab457596..3f11320b8 100644 --- a/swad_social.c +++ b/swad_social.c @@ -134,7 +134,6 @@ extern struct Globals Gbl; static void Soc_ShowTimelineGblHighlightingNot (long NotCod); static void Soc_ShowTimelineUsrHighlightingNot (long NotCod); -static void Soc_GetAndShowNewTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl); static void Soc_GetAndShowOldTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl); static void Soc_BuildQueryToGetTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl, @@ -398,32 +397,26 @@ static void Soc_ShowTimelineUsrHighlightingNot (long NotCod) /*****************************************************************************/ void Soc_RefreshNewTimelineGbl (void) - { - // Send, before the HTML, the refresh time - fprintf (Gbl.F.Out,"%lu|", - Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE); - - Soc_GetAndShowNewTimeline (Soc_TIMELINE_GBL); - } - -/*****************************************************************************/ -/****************** Get and show new publishings in timeline *****************/ -/*****************************************************************************/ - -static void Soc_GetAndShowNewTimeline (Soc_TimelineUsrOrGbl_t TimelineUsrOrGbl) { char Query[1024]; - /***** Build query to get timeline *****/ - Soc_BuildQueryToGetTimeline (TimelineUsrOrGbl, - Soc_GET_ONLY_NEW_PUBS, - Query); + if (Gbl.Session.IsOpen) // If session has been closed, do not write anything + { + /***** Send, before the HTML, the refresh time *****/ + fprintf (Gbl.F.Out,"%lu|", + Cfg_TIME_TO_REFRESH_SOCIAL_TIMELINE); - /***** Show new timeline *****/ - Soc_InsertNewPubsInTimeline (Query); + /***** Build query to get timeline *****/ + Soc_BuildQueryToGetTimeline (Soc_TIMELINE_GBL, + Soc_GET_ONLY_NEW_PUBS, + Query); - /***** Drop temporary tables *****/ - Soc_DropTemporaryTablesUsedToQueryTimeline (); + /***** Show new timeline *****/ + Soc_InsertNewPubsInTimeline (Query); + + /***** Drop temporary tables *****/ + Soc_DropTemporaryTablesUsedToQueryTimeline (); + } /***** All the output is made, so don't write anymore *****/ Gbl.Layout.DivsEndWritten = Gbl.Layout.HTMLEndWritten = true;