From c55d1064fc54a09a3af3a687cd03643fb6a312b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 4 Jan 2016 16:45:43 +0100 Subject: [PATCH] Version 15.97.3 --- swad_changelog.h | 3 ++- swad_network.c | 13 +++++++++++++ swad_network.h | 2 ++ swad_profile.c | 12 ++++++++++++ swad_record.c | 21 +++------------------ swad_record.h | 1 + 6 files changed, 33 insertions(+), 19 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index dd2ca4e2..72e861a7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -116,13 +116,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.97.2 (2016-01-04)" +#define Log_PLATFORM_VERSION "SWAD 15.97.3 (2016-01-04)" #define CSS_FILE "swad15.97.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.97.3: Jan 04, 2016 Link to user's privacy in my public profile. (190755 lines) Version 15.97.2: Jan 04, 2016 New option in user's privacy. (190743 lines) Version 15.97.1: Jan 04, 2016 User's timeline below user's profile visible only by logged users. (190719 lines) Version 15.97: Jan 04, 2016 Show list of some users who has shared a social note. (190718 lines) diff --git a/swad_network.c b/swad_network.c index c801a72a..711a7185 100644 --- a/swad_network.c +++ b/swad_network.c @@ -256,6 +256,19 @@ static void Net_ShowAWebOrSocialNet (const char *URL, Title,Title); } +/*****************************************************************************/ +/*********** Put a link to the action to edit my social networks *************/ +/*****************************************************************************/ + +void Net_PutLinkToChangeMySocialNetworks (void) + { + extern const char *Txt_Edit_my_webs_networks; + + /***** Link to edit my social networks *****/ + Lay_PutContextualLink (ActReqEdiMyNet,NULL,"earth64x64.gif", + Txt_Edit_my_webs_networks,Txt_Edit_my_webs_networks); + } + /*****************************************************************************/ /********************* Show form to edit my social networks ******************/ /*****************************************************************************/ diff --git a/swad_network.h b/swad_network.h index ae11feca..24dcaace 100644 --- a/swad_network.h +++ b/swad_network.h @@ -40,6 +40,8 @@ /*****************************************************************************/ void Net_ShowWebsAndSocialNets (const struct UsrData *UsrDat); + +void Net_PutLinkToChangeMySocialNetworks (void); void Net_ShowFormMyWebsAndSocialNets (void); void Net_UpdateMyWebsAndSocialNets (void); void Net_ShowWebAndSocialNetworksStats (void); diff --git a/swad_profile.c b/swad_profile.c index 5aa707a8..99e20912 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -31,6 +31,7 @@ #include "swad_database.h" #include "swad_follow.h" #include "swad_global.h" +#include "swad_network.h" #include "swad_nickname.h" #include "swad_parameter.h" #include "swad_privacy.h" @@ -236,6 +237,17 @@ bool Prf_ShowUserProfile (void) if (Pri_ShowIsAllowed (Gbl.Usrs.Other.UsrDat.ProfileVisibility, Gbl.Usrs.Other.UsrDat.UsrCod)) { + /***** Contextual links *****/ + if (Gbl.Usrs.Other.UsrDat.UsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // It's me + { + fprintf (Gbl.F.Out,"
"); + Rec_PutLinkToChangeMyInsCtrDpt (); // Put link (form) to change my institution, centre, department... + Net_PutLinkToChangeMySocialNetworks (); // Put link (form) to change my social networks + Pho_PutLinkToChangeMyPhoto (); // Put link (form) to change my photo + Pri_PutLinkToChangeMyPrivacy (); // Put link (form) to change my privacy + fprintf (Gbl.F.Out,"
"); + } + if (Gbl.CurrentCrs.Crs.CrsCod > 0) // Course selected { /* Get user's role in current course */ diff --git a/swad_record.c b/swad_record.c index 367fbcd7..ed4141ad 100644 --- a/swad_record.c +++ b/swad_record.c @@ -87,8 +87,6 @@ static void Rec_WriteLinkToDataProtectionClause (void); static void Rec_GetUsrExtraDataFromRecordForm (struct UsrData *UsrDat); static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat); -static void Rec_PutLinkToChangeMyInsCtrDpt (void); -static void Rec_PutLinkToChangeMySocialNetworks (void); /*****************************************************************************/ /*************** Create, edit and remove fields of records *******************/ @@ -1881,10 +1879,10 @@ void Rec_ShowFormMyCommRecord (void) !Gbl.Usrs.Me.UsrDat.Surname1[0]) Lay_ShowAlert (Lay_WARNING,Txt_Please_fill_in_your_record_card_including_your_name); - /***** Buttons for edition *****/ + /***** Contextual links *****/ fprintf (Gbl.F.Out,"
"); Rec_PutLinkToChangeMyInsCtrDpt (); // Put link (form) to change my institution, centre, department... - Rec_PutLinkToChangeMySocialNetworks (); // Put link (form) to change my social networks + Net_PutLinkToChangeMySocialNetworks (); // Put link (form) to change my social networks Pho_PutLinkToChangeMyPhoto (); // Put link (form) to change my photo Pri_PutLinkToChangeMyPrivacy (); // Put link (form) to change my privacy fprintf (Gbl.F.Out,"
"); @@ -3306,7 +3304,7 @@ static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat) /*** Put a link to the action to edit my institution, centre, department... **/ /*****************************************************************************/ -static void Rec_PutLinkToChangeMyInsCtrDpt (void) +void Rec_PutLinkToChangeMyInsCtrDpt (void) { extern const char *Txt_Edit_my_institution; @@ -3315,19 +3313,6 @@ static void Rec_PutLinkToChangeMyInsCtrDpt (void) Txt_Edit_my_institution,Txt_Edit_my_institution); } -/*****************************************************************************/ -/*********** Put a link to the action to edit my social networks *************/ -/*****************************************************************************/ - -static void Rec_PutLinkToChangeMySocialNetworks (void) - { - extern const char *Txt_Edit_my_webs_networks; - - /***** Link to edit my social networks *****/ - Lay_PutContextualLink (ActReqEdiMyNet,NULL,"earth64x64.gif", - Txt_Edit_my_webs_networks,Txt_Edit_my_webs_networks); - } - /*****************************************************************************/ /********* Show form to edit my institution, centre and department ***********/ /*****************************************************************************/ diff --git a/swad_record.h b/swad_record.h index fd532a6c..cc0ad483 100644 --- a/swad_record.h +++ b/swad_record.h @@ -152,6 +152,7 @@ void Rec_UpdateMyRecord (void); Rol_Role_t Rec_GetRoleFromRecordForm (void); void Rec_GetUsrNameFromRecordForm (struct UsrData *UsrDat); +void Rec_PutLinkToChangeMyInsCtrDpt (void); void Rec_ShowFormMyInsCtrDpt (void); void Rec_ChgCountryOfMyInstitution (void); void Rec_UpdateMyInstitution (void);