From bb62f262639d91513522a93c8dd27e11a6a30e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 23 Apr 2016 13:58:20 +0200 Subject: [PATCH] Version 15.202.5 --- swad_changelog.h | 3 +- swad_record.c | 126 +++++++++++++++++++++++++---------------------- 2 files changed, 69 insertions(+), 60 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 5bd395a92..3e44d7a9e 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -134,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.202.4 (2016-04-23)" +#define Log_PLATFORM_VERSION "SWAD 15.202.5 (2016-04-23)" #define CSS_FILE "swad15.202.css" #define JS_FILE "swad15.197.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.202.5: Apr 23, 2016 Code refactoring in record card. (200934 lines) Version 15.202.4: Apr 23, 2016 Code refactoring in record card. (200926 lines) Version 15.202.3: Apr 23, 2016 Code refactoring in record card. (200911 lines) Version 15.202.2: Apr 23, 2016 Code refactoring in record card. (200899 lines) diff --git a/swad_record.c b/swad_record.c index 31e132acb..1b93b7c16 100644 --- a/swad_record.c +++ b/swad_record.c @@ -91,7 +91,7 @@ static void Rec_ShowCommands (struct UsrData *UsrDat, bool PutFormLinks); static void Rec_ShowFullName (struct UsrData *UsrDat); static void Rec_ShowNickname (struct UsrData *UsrDat,bool PutFormLinks); -static void Rec_ShowCountry (struct UsrData *UsrDat,bool ShowData); +static void Rec_ShowCountryInHead (struct UsrData *UsrDat,bool ShowData); static void Rec_ShowWebsAndSocialNets (struct UsrData *UsrDat, Rec_RecordViewType_t TypeOfView); static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm); @@ -110,6 +110,9 @@ static void Rec_ShowFirstName (struct UsrData *UsrDat, Rec_RecordViewType_t TypeOfView, bool DataForm, const char *ClassForm); +static void Rec_ShowCountry (struct UsrData *UsrDat, + Rec_RecordViewType_t TypeOfView, + const char *ClassForm); static void Rec_WriteLinkToDataProtectionClause (void); @@ -1972,8 +1975,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, struct UsrData *UsrDat) { extern const char *The_ClassForm[The_NUM_THEMES]; - extern const char *Txt_Country; - extern const char *Txt_Another_country; extern const char *Txt_Place_of_origin; extern const char *Txt_Date_of_birth; extern const char *Txt_Institution; @@ -2018,7 +2019,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, ((TypeOfView == Rec_RECORD_LIST || TypeOfView == Rec_RECORD_PRINT) && UsrDat->RoleInCurrentCrsDB == Rol_TEACHER)); // He/she is a teacher in the current course - unsigned NumCty; struct Institution Ins; struct Centre Ctr; struct Department Dpt; @@ -2071,7 +2071,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, /***** User's country, web and social networks *****/ fprintf (Gbl.F.Out,""); - Rec_ShowCountry (UsrDat,ShowData); + Rec_ShowCountryInHead (UsrDat,ShowData); Rec_ShowWebsAndSocialNets (UsrDat,TypeOfView); fprintf (Gbl.F.Out,""); @@ -2107,72 +2107,23 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, if (ShowIDRows) { - /***** User's e-mail *****/ + /***** E-mail *****/ Rec_ShowEmail (UsrDat,ClassForm); /***** User's ID *****/ Rec_ShowUsrIDs (UsrDat,ClassForm); - /***** User's role or sex *****/ + /***** Role or sex *****/ Rec_ShowRole (UsrDat,TypeOfView,ClassForm); /***** Name *****/ - /* Surname 1 */ Rec_ShowSurname1 (UsrDat,TypeOfView,DataForm,ClassForm); - - /* Surname 2 */ Rec_ShowSurname2 (UsrDat,DataForm,ClassForm); - - /* First name */ Rec_ShowFirstName (UsrDat,TypeOfView,DataForm,ClassForm); - /* Country */ + /***** Country *****/ if (CountryForm) - { - /* If list of countries is empty, try to get it */ - if (!Gbl.Ctys.Num) - { - Gbl.Ctys.SelectedOrderType = Cty_ORDER_BY_COUNTRY; - Cty_GetListCountries (Cty_GET_BASIC_DATA); - } - - fprintf (Gbl.F.Out,"" - "" - "%s", - ClassForm,Rec_C1_BOTTOM,Txt_Country); - if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) - fprintf (Gbl.F.Out,"*"); - fprintf (Gbl.F.Out,":" - "", - Rec_C2_BOTTOM); - - /* Selector of country */ - fprintf (Gbl.F.Out,"" - "" - ""); - } + Rec_ShowCountry (UsrDat,TypeOfView,ClassForm); } if (ShowAddressRows) @@ -2899,7 +2850,7 @@ static void Rec_ShowNickname (struct UsrData *UsrDat,bool PutFormLinks) /**************************** Show user's country ****************************/ /*****************************************************************************/ -static void Rec_ShowCountry (struct UsrData *UsrDat,bool ShowData) +static void Rec_ShowCountryInHead (struct UsrData *UsrDat,bool ShowData) { fprintf (Gbl.F.Out,"", @@ -3293,6 +3244,63 @@ static void Rec_ShowFirstName (struct UsrData *UsrDat, ""); } +/*****************************************************************************/ +/**************************** Show user's country ****************************/ +/*****************************************************************************/ + +static void Rec_ShowCountry (struct UsrData *UsrDat, + Rec_RecordViewType_t TypeOfView, + const char *ClassForm) + { + extern const char *Txt_Country; + extern const char *Txt_Another_country; + unsigned NumCty; + + /***** If list of countries is empty, try to get it *****/ + if (!Gbl.Ctys.Num) + { + Gbl.Ctys.SelectedOrderType = Cty_ORDER_BY_COUNTRY; + Cty_GetListCountries (Cty_GET_BASIC_DATA); + } + + fprintf (Gbl.F.Out,"" + "" + "%s", + ClassForm,Rec_C1_BOTTOM,Txt_Country); + if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) + fprintf (Gbl.F.Out,"*"); + fprintf (Gbl.F.Out,":" + "", + Rec_C2_BOTTOM); + + /***** Selector of country *****/ + fprintf (Gbl.F.Out,"" + "" + ""); + } + /*****************************************************************************/ /*********************** Write a link to netiquette rules ********************/ /*****************************************************************************/