From 873b806d4835493750d6490e23318046f765b389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 23 Apr 2016 13:37:43 +0200 Subject: [PATCH] Version 15.202.2 --- swad_changelog.h | 6 ++--- swad_record.c | 63 ++++++++++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 29ab88204..ed8bd2df7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -122,9 +122,6 @@ // TODO: To avoid wrong email addresses, when a user fills his/her email address, check if the domain is in the white list of allowed domains. If not, ask for confirmation. // TODO: Filtering email addresses --> an email address can not finish in "." // TODO: Upload an image in social posts, in test questions, in forum posts, in private messages, etc. -// TODO: Important!!!! E-mail should not be visible for not logged users -// TODO: Do not show e-mails of administrators and teachers in lists openly -// TODO: FIX BUG: in marks, reported by Francisco Ocaņa // TODO: Change PhotoAttribution in table centres from TEXT to VARCHAR(255) (check maximum length first) // TODO: In social refreshing via AJAX, an error occurs when session expirates // TODO: Messages in msg_content_deleted older than a certain time should be deleted to ensure the protection of personal data @@ -137,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.202.1 (2016-04-23)" +#define Log_PLATFORM_VERSION "SWAD 15.202.2 (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.2: Apr 23, 2016 Code refactoring in record card. (200899 lines) Version 15.202.1: Apr 23, 2016 Code refactoring related to showing user's e-mail. (200887 lines) Version 15.202: Apr 23, 2016 User's IDs are show in green or red. Code refactoring and bug fixing related to showing user's ID and e-mail. (200908 lines) diff --git a/swad_record.c b/swad_record.c index 1e43e75b0..d2b32e109 100644 --- a/swad_record.c +++ b/swad_record.c @@ -99,6 +99,10 @@ static void Rec_ShowUsrIDs (struct UsrData *UsrDat,const char *ClassForm); static void Rec_ShowRole (struct UsrData *UsrDat, Rec_RecordViewType_t TypeOfView, const char *ClassForm); +static void Rec_ShowSurname1 (struct UsrData *UsrDat, + Rec_RecordViewType_t TypeOfView, + bool DataForm, + const char *ClassForm); static void Rec_WriteLinkToDataProtectionClause (void); @@ -1961,7 +1965,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, struct UsrData *UsrDat) { extern const char *The_ClassForm[The_NUM_THEMES]; - extern const char *Txt_Surname_1; extern const char *Txt_Surname_2; extern const char *Txt_First_name; extern const char *Txt_Country; @@ -2110,28 +2113,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, /***** Name *****/ /* Surname 1 */ - fprintf (Gbl.F.Out,"" - "" - "%s", - ClassForm,Rec_C1_BOTTOM,Txt_Surname_1); - if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) - fprintf (Gbl.F.Out,"*"); - fprintf (Gbl.F.Out,":" - "", - Rec_C2_BOTTOM); - if (DataForm) - fprintf (Gbl.F.Out,"", - Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, - UsrDat->Surname1, - Rec_C2_BOTTOM - 20); - else if (UsrDat->Surname1[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->Surname1); - fprintf (Gbl.F.Out,"" - ""); + Rec_ShowSurname1 (UsrDat,TypeOfView,DataForm,ClassForm); /* Surname 2 */ fprintf (Gbl.F.Out,"" @@ -3244,6 +3226,41 @@ static void Rec_ShowRole (struct UsrData *UsrDat, Txt_ROLES_SINGUL_Abc[UsrDat->RoleInCurrentCrsDB][UsrDat->Sex]); } +/*****************************************************************************/ +/*************************** Show user's surname 1 ***************************/ +/*****************************************************************************/ + +static void Rec_ShowSurname1 (struct UsrData *UsrDat, + Rec_RecordViewType_t TypeOfView, + bool DataForm, + const char *ClassForm) + { + extern const char *Txt_Surname_1; + + fprintf (Gbl.F.Out,"" + "" + "%s", + ClassForm,Rec_C1_BOTTOM,Txt_Surname_1); + if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) + fprintf (Gbl.F.Out,"*"); + fprintf (Gbl.F.Out,":" + "", + Rec_C2_BOTTOM); + if (DataForm) + fprintf (Gbl.F.Out,"", + Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, + UsrDat->Surname1, + Rec_C2_BOTTOM - 20); + else if (UsrDat->Surname1[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->Surname1); + fprintf (Gbl.F.Out,"" + ""); + } + /*****************************************************************************/ /*********************** Write a link to netiquette rules ********************/ /*****************************************************************************/