From 89d2be20d558bdbac5697ccc896c474af6ff871a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 30 Dec 2015 18:43:58 +0100 Subject: [PATCH] Version 15.84.4 --- swad_action.c | 2 +- swad_changelog.h | 3 ++- swad_profile.c | 60 +++++++++++++++++++----------------------------- 3 files changed, 26 insertions(+), 39 deletions(-) diff --git a/swad_action.c b/swad_action.c index 7908ec8c..7dbc7583 100644 --- a/swad_action.c +++ b/swad_action.c @@ -4423,7 +4423,7 @@ void Act_LinkFormSubmitAnimated (const char *Title,const char *LinkStyle) } /*****************************************************************************/ -/***************** Adjust current action when no user's logged ***************/ +/******** Put contextual link with animated icon to update an action *********/ /*****************************************************************************/ void Act_PutLinkToUpdateAction (Act_Action_t Action) diff --git a/swad_changelog.h b/swad_changelog.h index 77c14d3e..d3542711 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -116,13 +116,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.84.3 (2015-12-30)" +#define Log_PLATFORM_VERSION "SWAD 15.84.4 (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.4: Dec 30, 2015 Code refactoring in profile. (189429 lines) 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) diff --git a/swad_profile.c b/swad_profile.c index c8da5f54..cbdb36fc 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -81,6 +81,7 @@ static void Prf_RequestUserProfileWithDefaultNickname (const char *DefaultNickna static void Prf_GetUsrDatAndShowUserProfile (void); static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat); +static void Prf_PutLinkToUpdateAction (Act_Action_t Action,const char *EncryptedUsrCod); static void Prf_GetUsrFigures (long UsrCod,struct UsrFigures *UsrFigures); @@ -299,7 +300,6 @@ void Prf_ChangeProfileVisibility (void) static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) { - extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_teachers_ABBREVIATION; extern const char *Txt_students_ABBREVIATION; @@ -311,7 +311,6 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) extern const char *Txt_From_TIME; extern const char *Txt_day; extern const char *Txt_days; - extern const char *Txt_Calculate; extern const char *Txt_Clicks; extern const char *Txt_clicks; extern const char *Txt_Downloads; @@ -406,14 +405,8 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) (long) UsrFigures.FirstClickTimeUTC); } else // First click time is unknown or user never logged - { /***** Button to fetch and store first click time *****/ - Act_FormStart (ActCal1stClkTim); - Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmitAnimated (Txt_Calculate,The_ClassForm[Gbl.Prefs.Theme]); - Lay_PutCalculateIconWithText (Txt_Calculate,Txt_Calculate); - Act_FormEnd (); - } + Prf_PutLinkToUpdateAction (ActCal1stClkTim,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** End of right list *****/ @@ -451,14 +444,8 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of clicks is unknown - { /***** Button to fetch and store number of clicks *****/ - Act_FormStart (ActCalNumClk); - Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmitAnimated (Txt_Calculate,The_ClassForm[Gbl.Prefs.Theme]); - Lay_PutCalculateIconWithText (Txt_Calculate,Txt_Calculate); - Act_FormEnd (); - } + Prf_PutLinkToUpdateAction (ActCalNumClk,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** Number of file views *****/ @@ -483,14 +470,8 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of file views is unknown - { /***** Button to fetch and store number of file views *****/ - Act_FormStart (ActCalNumFilVie); - Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmitAnimated (Txt_Calculate,The_ClassForm[Gbl.Prefs.Theme]); - Lay_PutCalculateIconWithText (Txt_Calculate,Txt_Calculate); - Act_FormEnd (); - } + Prf_PutLinkToUpdateAction (ActCalNumFilVie,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); /***** Number of posts in forums *****/ @@ -515,14 +496,9 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of forum posts is unknown - { /***** Button to fetch and store number of forum posts *****/ - Act_FormStart (ActCalNumForPst); - Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmitAnimated (Txt_Calculate,The_ClassForm[Gbl.Prefs.Theme]); - Lay_PutCalculateIconWithText (Txt_Calculate,Txt_Calculate); - Act_FormEnd (); - } + Prf_PutLinkToUpdateAction (ActCalNumForPst,UsrDat->EncryptedUsrCod); + fprintf (Gbl.F.Out,""); /***** Number of messages sent *****/ @@ -547,14 +523,8 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) } } else // Number of clicks is unknown - { /***** Button to fetch and store number of messages sent *****/ - Act_FormStart (ActCalNumMsgSnt); - Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); - Act_LinkFormSubmitAnimated (Txt_Calculate,The_ClassForm[Gbl.Prefs.Theme]); - Lay_PutCalculateIconWithText (Txt_Calculate,Txt_Calculate); - Act_FormEnd (); - } + Prf_PutLinkToUpdateAction (ActCalNumMsgSnt,UsrDat->EncryptedUsrCod); fprintf (Gbl.F.Out,""); } @@ -563,6 +533,22 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) ""); } +/*****************************************************************************/ +/******** Put contextual link with animated icon to update an action *********/ +/*****************************************************************************/ + +static void Prf_PutLinkToUpdateAction (Act_Action_t Action,const char *EncryptedUsrCod) + { + extern const char *The_ClassForm[The_NUM_THEMES]; + extern const char *Txt_Calculate; + + Act_FormStart (Action); + Usr_PutParamUsrCodEncrypted (EncryptedUsrCod); + Act_LinkFormSubmitAnimated (Txt_Calculate,The_ClassForm[Gbl.Prefs.Theme]); + Lay_PutCalculateIconWithText (Txt_Calculate,Txt_Calculate); + Act_FormEnd (); + } + /*****************************************************************************/ /********************** Select values on user's figures **********************/ /*****************************************************************************/