diff --git a/swad_changelog.h b/swad_changelog.h index 902368ae1..4cdaa5cdf 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -137,13 +137,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.201.2 (2016-04-22)" +#define Log_PLATFORM_VERSION "SWAD 15.201.3 (2016-04-22)" #define CSS_FILE "swad15.198.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.201.3: Apr 22, 2016 Code refactoring in record card. (200812 lines) Version 15.201.2: Apr 22, 2016 Code refactoring in record card. (200806 lines) Version 15.201.1: Apr 22, 2016 Code refactoring in record card. (200778 lines) Version 15.201: Apr 21, 2016 New private file zone for the teachers who belong to a course. (200768 lines) diff --git a/swad_record.c b/swad_record.c index 877fc5f99..7578e9ddd 100644 --- a/swad_record.c +++ b/swad_record.c @@ -89,6 +89,7 @@ static void Rec_ShowPhoto (struct UsrData *UsrDat); static void Rec_ShowCommands (struct UsrData *UsrDat, Rec_RecordViewType_t TypeOfView, bool PutFormLinks); +static void Rec_ShowFullName (struct UsrData *UsrDat); static void Rec_WriteLinkToDataProtectionClause (void); @@ -1979,7 +1980,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, extern const char *Txt_Confirm; char StrRecordWidth[10+1]; const char *ClassForm = "REC_DAT"; - char Name[Usr_MAX_BYTES_NAME+1]; // To shorten length of FirstName, Surname1, Surname2 bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod); bool IAmLoggedAsTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER); // My current role is teacher bool IAmLoggedAsSysAdm = (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); // My current role is superuser @@ -2047,6 +2047,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, struct Centre Ctr; struct Department Dpt; + /***** Initializations *****/ switch (TypeOfView) { case Rec_FORM_SIGN_UP: @@ -2069,55 +2070,25 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, PutFormLinks = !Gbl.Form.Inside && // Only if not inside another form Act_Actions[Gbl.Action.Act].BrowserWindow == Act_MAIN_WINDOW; // Only in main window + Ins.InsCod = UsrDat->InsCod; + if (Ins.InsCod > 0) + Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); + /***** Start frame *****/ sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH); Lay_StartRoundFrameTable (StrRecordWidth,2,NULL); /***** Institution and user's photo *****/ fprintf (Gbl.F.Out,""); - - /* Institution */ - Ins.InsCod = UsrDat->InsCod; - if (Ins.InsCod > 0) - Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA); Rec_ShowInstitution (&Ins,PutFormLinks); - - /* User's photo */ Rec_ShowPhoto (UsrDat); - fprintf (Gbl.F.Out,""); /***** Commands and full name *****/ fprintf (Gbl.F.Out,""); - - /* Commands */ Rec_ShowCommands (UsrDat,TypeOfView,PutFormLinks); - - /* Full name */ - fprintf (Gbl.F.Out,"", - Rec_C2_TOP); - - /* First name */ - strncpy (Name,UsrDat->FirstName,Usr_MAX_BYTES_NAME); - Name[Usr_MAX_BYTES_NAME] = '\0'; - Str_LimitLengthHTMLStr (Name,20); - fprintf (Gbl.F.Out,"%s
",Name); - - /* Surname 1 */ - strncpy (Name,UsrDat->Surname1,Usr_MAX_BYTES_NAME); - Name[Usr_MAX_BYTES_NAME] = '\0'; - Str_LimitLengthHTMLStr (Name,20); - fprintf (Gbl.F.Out,"%s
",Name); - - /* Surname 2 */ - strncpy (Name,UsrDat->Surname2,Usr_MAX_BYTES_NAME); - Name[Usr_MAX_BYTES_NAME] = '\0'; - Str_LimitLengthHTMLStr (Name,20); - fprintf (Gbl.F.Out,"%s",Name); - - fprintf (Gbl.F.Out,"" - ""); + Rec_ShowFullName (UsrDat); + fprintf (Gbl.F.Out,""); /***** User's nickname *****/ fprintf (Gbl.F.Out,""); } +/*****************************************************************************/ +/*************************** Show user's full name ***************************/ +/*****************************************************************************/ + +static void Rec_ShowFullName (struct UsrData *UsrDat) + { + char Name[Usr_MAX_BYTES_NAME+1]; // To shorten length of FirstName, Surname1, Surname2 + + fprintf (Gbl.F.Out,"", + Rec_C2_TOP); + + /***** First name *****/ + strncpy (Name,UsrDat->FirstName,Usr_MAX_BYTES_NAME); + Name[Usr_MAX_BYTES_NAME] = '\0'; + Str_LimitLengthHTMLStr (Name,20); + fprintf (Gbl.F.Out,"%s
",Name); + + /***** Surname 1 *****/ + strncpy (Name,UsrDat->Surname1,Usr_MAX_BYTES_NAME); + Name[Usr_MAX_BYTES_NAME] = '\0'; + Str_LimitLengthHTMLStr (Name,20); + fprintf (Gbl.F.Out,"%s
",Name); + + /***** Surname 2 *****/ + strncpy (Name,UsrDat->Surname2,Usr_MAX_BYTES_NAME); + Name[Usr_MAX_BYTES_NAME] = '\0'; + Str_LimitLengthHTMLStr (Name,20); + fprintf (Gbl.F.Out,"%s",Name); + + fprintf (Gbl.F.Out,""); + } + /*****************************************************************************/ /*********************** Write a link to netiquette rules ********************/ /*****************************************************************************/