diff --git a/swad_action.c b/swad_action.c index afec41693..2be9426d2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -87,7 +87,7 @@ extern struct Globals Gbl; /************************ Internal global variables **************************/ /*****************************************************************************/ /* -1332 actions in one CGI: +1328 actions in one CGI: 0. ActAll Any action (used for statistics) 1. ActUnk Unknown action 2. ActMnu Show menu of a tab @@ -144,11 +144,7 @@ Start: 46. ActReqRemSocComUsr Request the removal of a comment in a social note (user) 47. ActRemSocComUsr Remove of a comment in a social note (user) - 48. ActCal1stClkTim Calculate first click time from log and store into user's figures - 49. ActCalNumClk Calculate number of clicks from log and store into user's figures - 50. ActCalNumFileViews Calculate number of file views and store into user's figures - 51. ActCalNumForPst Calculate number of forum posts and store into user's figures - 52. ActCalNumMsgSnt Calculate number of messages sent from log and store into user's figures + 48. ActCalFig Calculate user's figures and store into user's figures 53. ActFolUsr Follow another user 54. ActUnfUsr Unfollow another user @@ -1640,11 +1636,9 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActRemSocComGbl */{1508,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Soc_RemoveSocialComUsr ,NULL}, /* ActSeeOthPubPrf */{1402,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_GetUsrDatAndShowUserProfile,NULL}, - /* ActCal1stClkTim */{1405,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, - /* ActCalNumClk */{1406,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, - /* ActCalNumFilVie */{1409,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, - /* ActCalNumForPst */{1408,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, - /* ActCalNumMsgSnt */{1407,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, + + /* ActCalFig */{1405,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, +// /* ActCalNumMsgSnt */{1407,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,0x3C7,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Prf_CalculateFigures ,NULL}, /* ActFolUsr */{1410,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Fol_FollowUsr1 ,Fol_FollowUsr2 ,NULL}, /* ActUnfUsr */{1411,-1,TabUnk,ActSeeSocPrf ,0x3F8,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,0x3C6,Act_CONT_NORM,Act_BRW_1ST_TAB,Fol_UnfollowUsr1 ,Fol_UnfollowUsr2 ,NULL}, @@ -4542,11 +4536,11 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActSeeOthPubPrf, // #1402 -1, // #1403 (obsolete action) ActChgPriPrf, // #1404 - ActCal1stClkTim, // #1405 - ActCalNumClk, // #1406 - ActCalNumMsgSnt, // #1407 - ActCalNumForPst, // #1408 - ActCalNumFilVie, // #1409 + ActCalFig, // #1405 + -1, // #1406 (obsolete action) + -1, // #1407 (obsolete action) + -1, // #1408 (obsolete action) + -1, // #1409 (obsolete action) ActFolUsr, // #1410 ActUnfUsr, // #1411 ActSeeFlg, // #1412 diff --git a/swad_action.h b/swad_action.h index ea4f11f7b..be26df576 100644 --- a/swad_action.h +++ b/swad_action.h @@ -61,7 +61,7 @@ typedef enum typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action -#define Act_NUM_ACTIONS (1 + 8 + 59 + 38 + 12 + 42 + 36 + 19 + 110 + 157 + 437 + 165 + 168 + 15 + 65) +#define Act_NUM_ACTIONS (1 + 8 + 55 + 38 + 12 + 42 + 36 + 19 + 110 + 157 + 437 + 165 + 168 + 15 + 65) #define Act_MAX_ACTION_COD 1752 @@ -135,28 +135,24 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to #define ActRemSocComUsr (ActWebSvc + 39) #define ActSeeOthPubPrf (ActWebSvc + 40) -#define ActCal1stClkTim (ActWebSvc + 41) -#define ActCalNumClk (ActWebSvc + 42) -#define ActCalNumFilVie (ActWebSvc + 43) -#define ActCalNumForPst (ActWebSvc + 44) -#define ActCalNumMsgSnt (ActWebSvc + 45) +#define ActCalFig (ActWebSvc + 41) -#define ActFolUsr (ActWebSvc + 46) -#define ActUnfUsr (ActWebSvc + 47) -#define ActSeeFlg (ActWebSvc + 48) -#define ActSeeFlr (ActWebSvc + 49) +#define ActFolUsr (ActWebSvc + 42) +#define ActUnfUsr (ActWebSvc + 43) +#define ActSeeFlg (ActWebSvc + 44) +#define ActSeeFlr (ActWebSvc + 45) -#define ActPrnCal (ActWebSvc + 50) -#define ActChgCal1stDay (ActWebSvc + 51) +#define ActPrnCal (ActWebSvc + 46) +#define ActChgCal1stDay (ActWebSvc + 47) -#define ActSeeNewNtf (ActWebSvc + 52) -#define ActMrkNtfSee (ActWebSvc + 53) -#define ActSeeMai (ActWebSvc + 54) -#define ActEdiMai (ActWebSvc + 55) -#define ActNewMai (ActWebSvc + 56) -#define ActRemMai (ActWebSvc + 57) -#define ActRenMaiSho (ActWebSvc + 58) -#define ActRenMaiFul (ActWebSvc + 59) +#define ActSeeNewNtf (ActWebSvc + 48) +#define ActMrkNtfSee (ActWebSvc + 49) +#define ActSeeMai (ActWebSvc + 50) +#define ActEdiMai (ActWebSvc + 51) +#define ActNewMai (ActWebSvc + 52) +#define ActRemMai (ActWebSvc + 53) +#define ActRenMaiSho (ActWebSvc + 54) +#define ActRenMaiFul (ActWebSvc + 55) /*****************************************************************************/ /******************************** System tab *********************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 8391facea..ff8e0f682 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -428,10 +428,18 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.64.4 (2019-03-04)" +#define Log_PLATFORM_VERSION "SWAD 18.64.5 (2019-03-05)" #define CSS_FILE "swad18.64.css" #define JS_FILE "swad18.64.js" /* + Version 18.64.5: Mar 05, 2019 Changes writing floating point numbers. + For load speed issues, the number of publications by default in the timeline becomes 20 again. + The actions in buttons to calculate user's figures are merged in one. (238471 lines) + 2 changes necessary in database: + Calcular fecha del primer clic +UPDATE actions SET Txt='Calcular cifras de un usuario' WHERE ActCod='1405' AND Language='es'; +UPDATE actions SET Obsolete='Y' WHERE ActCod IN (1406,1407,1408,1409); + Version 18.64.4: Mar 04, 2019 Last database changes updated in swad.sql. (238473 lines) Version 18.64.3: Mar 04, 2019 Fixed bugs in media. (238467 lines) Version 18.64.2: Mar 04, 2019 Detect if a GIF image is animated. (238451 lines) diff --git a/swad_profile.c b/swad_profile.c index a412e4039..ce5e8d7fc 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -462,8 +462,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) (unsigned) Gbl.Prefs.DateFormat,Txt_Today); } else // First click time is unknown or user never logged - /***** Button to fetch and store first click time *****/ - Prf_PutLinkCalculateFigures (ActCal1stClkTim,UsrDat->EncryptedUsrCod); + /***** Button to fetch and store user's figures *****/ + Prf_PutLinkCalculateFigures (ActCalFig,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** End left list *****/ @@ -502,8 +502,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of clicks is unknown - /***** Button to fetch and store number of clicks *****/ - Prf_PutLinkCalculateFigures (ActCalNumClk,UsrDat->EncryptedUsrCod); + /***** Button to fetch and store user's figures *****/ + Prf_PutLinkCalculateFigures (ActCalFig,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** Number of file views *****/ @@ -529,8 +529,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of file views is unknown - /***** Button to fetch and store number of file views *****/ - Prf_PutLinkCalculateFigures (ActCalNumFilVie,UsrDat->EncryptedUsrCod); + /***** Button to fetch and store user's figures *****/ + Prf_PutLinkCalculateFigures (ActCalFig,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** Number of posts in forums *****/ @@ -556,9 +556,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of forum posts is unknown - /***** Button to fetch and store number of forum posts *****/ - Prf_PutLinkCalculateFigures (ActCalNumForPst,UsrDat->EncryptedUsrCod); - + /***** Button to fetch and store user's figures *****/ + Prf_PutLinkCalculateFigures (ActCalFig,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** Number of messages sent *****/ @@ -584,8 +583,8 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of messages sent is unknown - /***** Button to fetch and store number of messages sent *****/ - Prf_PutLinkCalculateFigures (ActCalNumMsgSnt,UsrDat->EncryptedUsrCod); + /***** Button to fetch and store user's figures *****/ + Prf_PutLinkCalculateFigures (ActCalFig,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); } diff --git a/swad_social.h b/swad_social.h index 179b157ea..fd3470d04 100644 --- a/swad_social.h +++ b/swad_social.h @@ -35,8 +35,8 @@ // Number of recent publishings got and shown the first time, before refreshing #define Soc_MAX_NEW_PUBS_TO_GET_AND_SHOW 10000 // Unlimited -#define Soc_MAX_REC_PUBS_TO_GET_AND_SHOW 50 // Recent publishings to show (first time) -#define Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW 50 // Old publishings are retrieved in packs of this size +#define Soc_MAX_REC_PUBS_TO_GET_AND_SHOW 20 // Recent publishings to show (first time) +#define Soc_MAX_OLD_PUBS_TO_GET_AND_SHOW 20 // Old publishings are retrieved in packs of this size // This constant is also used in JavaScript function readOldTimelineData /*****************************************************************************/ diff --git a/swad_string.c b/swad_string.c index 89884e9d2..0394c7d18 100644 --- a/swad_string.c +++ b/swad_string.c @@ -892,18 +892,20 @@ void Str_WriteFloatNum (FILE *FileDst,float Number) fprintf (FileDst,"%.0f",IntegerPart); else { - if (IntegerPart != 0.0 || FractionaryPart >= 0.1) - Format = "%.2f"; + if (IntegerPart != 0.0) + Format = "%.1f"; + else if (FractionaryPart >= 0.1) + Format = "%.1f"; else if (FractionaryPart >= 0.01) - Format = "%.3f"; + Format = "%.2f"; else if (FractionaryPart >= 0.001) - Format = "%.4f"; + Format = "%.3f"; else if (FractionaryPart >= 0.0001) - Format = "%.5f"; + Format = "%.4f"; else if (FractionaryPart >= 0.00001) - Format = "%.6f"; + Format = "%.5f"; else if (FractionaryPart >= 0.000001) - Format = "%.7f"; + Format = "%.6f"; else Format = "%e"; fprintf (FileDst,Format,Number);