Version 15.202.1

This commit is contained in:
Antonio Cañas Vargas 2016-04-23 13:30:59 +02:00
parent b60bdd77e7
commit cdab2d7f71
2 changed files with 6 additions and 27 deletions

View File

@ -137,13 +137,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.202 (2016-04-23)"
#define Log_PLATFORM_VERSION "SWAD 15.202.1 (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.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)
Version 15.201.9: Apr 22, 2016 Code refactoring in record card.

View File

@ -94,10 +94,7 @@ static void Rec_ShowNickname (struct UsrData *UsrDat,bool PutFormLinks);
static void Rec_ShowCountry (struct UsrData *UsrDat,bool ShowData);
static void Rec_ShowWebsAndSocialNets (struct UsrData *UsrDat,
Rec_RecordViewType_t TypeOfView);
static void Rec_ShowEmail (struct UsrData *UsrDat,
Rec_RecordViewType_t TypeOfView,
bool DataForm,
const char *ClassForm);
static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm);
static void Rec_ShowUsrIDs (struct UsrData *UsrDat,const char *ClassForm);
static void Rec_ShowRole (struct UsrData *UsrDat,
Rec_RecordViewType_t TypeOfView,
@ -2103,7 +2100,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
if (ShowIDRows)
{
/***** User's e-mail *****/
Rec_ShowEmail (UsrDat,TypeOfView,DataForm,ClassForm);
Rec_ShowEmail (UsrDat,ClassForm);
/***** User's ID *****/
Rec_ShowUsrIDs (UsrDat,ClassForm);
@ -2986,28 +2983,9 @@ static void Rec_ShowWebsAndSocialNets (struct UsrData *UsrDat,
/***************************** Show user's e-mail ****************************/
/*****************************************************************************/
static void Rec_ShowEmail (struct UsrData *UsrDat,
Rec_RecordViewType_t TypeOfView,
bool DataForm,
const char *ClassForm)
static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm)
{
extern const char *Txt_Email;
bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod);
bool ShowEmail = (ItsMe ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM ||
DataForm ||
TypeOfView == Rec_FORM_MY_COMMON_RECORD ||
TypeOfView == Rec_MY_COMMON_RECORD_CHECK ||
TypeOfView == Rec_FORM_MY_COURSE_RECORD_AS_STUDENT ||
TypeOfView == Rec_CHECK_MY_COURSE_RECORD_AS_STUDENT ||
(UsrDat->Accepted &&
(TypeOfView == Rec_FORM_MODIFY_RECORD_OTHER_EXISTING_USR ||
TypeOfView == Rec_CHECK_OTHER_USR_COMMON_RECORD ||
((TypeOfView == Rec_RECORD_LIST ||
TypeOfView == Rec_RECORD_PRINT) &&
(Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER ||
(Gbl.Usrs.Me.LoggedRole == Rol_STUDENT &&
Gbl.Usrs.Listing.RecsUsrs == Rec_RECORD_USERS_TEACHERS))))));
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_MIDDLE\""
@ -3020,7 +2998,7 @@ static void Rec_ShowEmail (struct UsrData *UsrDat,
Rec_C2_BOTTOM);
if (UsrDat->Email[0])
{
if (ShowEmail)
if (Mai_ICanSeeEmail (UsrDat))
{
fprintf (Gbl.F.Out,"<a href=\"mailto:%s\"",
UsrDat->Email);