From ba28858f22fded43fee27654eb2e9ad0188b216e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 29 Mar 2015 13:57:24 +0200 Subject: [PATCH] Version 14.104 --- swad_changelog.h | 3 +- swad_record.c | 1204 +++++++++++++++++++++++----------------------- swad_record.h | 16 +- 3 files changed, 617 insertions(+), 606 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index cafdc1688..c11ba56ea 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.103 (2015/03/28)" +#define Log_PLATFORM_VERSION "SWAD 14.104 (2015/03/29)" // 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 14.104: Mar 29, 2015 Changes in layout of record cards. (184021 lines) Version 14.103: Mar 29, 2015 New table to ban users out of ranking. (184014 lines) 1 change necessary in database: CREATE TABLE IF NOT EXISTS usr_banned (UsrCod INT NOT NULL,UNIQUE INDEX(UsrCod)); diff --git a/swad_record.c b/swad_record.c index fe179c2af..ee6328e26 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2025,6 +2025,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, extern const char *Txt_Surname_1; extern const char *Txt_Surname_2; extern const char *Txt_First_name; + 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; @@ -2037,10 +2038,9 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, extern const char *Txt_Family_address; extern const char *Txt_USER_comments; unsigned RecordWidth; - unsigned C1Width; - unsigned C2Width; - unsigned C3Width; - unsigned C4Width; + unsigned TopC1Width; + unsigned TopC2Width; + unsigned TopC3Width; char StrRecordWidth[10+1]; const char *ClassHead; const char *ClassForm; @@ -2105,7 +2105,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, ((TypeOfView == Rec_RECORD_LIST || TypeOfView == Rec_RECORD_PRINT) && UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER)); // He/she is a teacher in the current course - unsigned CommandsRowspan; Usr_Sex_t Sex; Rol_Role_t Role; Rol_Role_t DefaultRoleInCurrentCrs; @@ -2164,17 +2163,15 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, { case Rec_RECORD_PUBLIC: RecordWidth = Rec_RECORD_WIDTH_NARROW; - C1Width = Rec_C1_WIDTH_NARROW; - C2Width = Rec_C2_WIDTH_NARROW; - C3Width = Rec_C3_WIDTH_NARROW; - C4Width = Rec_C4_WIDTH_NARROW; + TopC1Width = Rec_C1_TOP_NARROW; + TopC2Width = Rec_C2_TOP_NARROW; + TopC3Width = Rec_C3_TOP_NARROW; break; default: RecordWidth = Rec_RECORD_WIDTH_WIDE; - C1Width = Rec_C1_WIDTH_WIDE; - C2Width = Rec_C2_WIDTH_WIDE; - C3Width = Rec_C3_WIDTH_WIDE; - C4Width = Rec_C4_WIDTH_WIDE; + TopC1Width = Rec_C1_TOP_WIDE; + TopC2Width = Rec_C2_TOP_WIDE; + TopC3Width = Rec_C3_TOP_WIDE; break; } @@ -2189,7 +2186,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, fprintf (Gbl.F.Out,"" "", - C1Width,C1Width); + TopC1Width,TopC1Width); if (UsrDat->InsCod > 0) { Ins.InsCod = UsrDat->InsCod; @@ -2211,10 +2208,10 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, } } fprintf (Gbl.F.Out,"" - "", - ClassHead,C2Width + C3Width,C1Width); + ClassHead,TopC2Width,TopC1Width); if (UsrDat->InsCod > 0) { /* Form to go to the institution */ @@ -2237,7 +2234,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL); fprintf (Gbl.F.Out,"", - C4Width); + TopC3Width); Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL : NULL, "PHOTO150x200",Pho_NO_ZOOM); @@ -2245,17 +2242,10 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, ""); /***** Commands *****/ - CommandsRowspan = 5; // Name + Nickname + Webs/social networks + Layout row + Country - if (ShowIDRows) - CommandsRowspan += 6; // Email, ID, Role, Surname1, Surname2, Firstname - if (ShowAddressRows) - CommandsRowspan += 7; // Origin place, Date of birth, Local address, Local phone - // Family address, Family phone, Common comments for all the courses - if (ShowTeacherRows) - CommandsRowspan += 5; // Institution, Centre, Department, Office, Phone fprintf (Gbl.F.Out,"" - "", - CommandsRowspan,C1Width); + "", + TopC1Width); if (PutFormLinks && Gbl.Usrs.Me.Logged) { @@ -2425,21 +2415,21 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, fprintf (Gbl.F.Out,""); /***** Full name *****/ - fprintf (Gbl.F.Out,"" "%s
%s
%s" "" "", - C2Width + C3Width, + TopC2Width, UsrDat->FirstName , UsrDat->Surname1, UsrDat->Surname2); /***** User's nickname *****/ - fprintf (Gbl.F.Out,"" "
", - C2Width + C3Width); + TopC2Width); if (UsrDat->Nickname[0]) { if (PutFormLinks) @@ -2464,167 +2454,147 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "" ""); - /***** Layout row *****/ - fprintf (Gbl.F.Out,"" - "" - "" - "" - "", - C2Width,C3Width,C4Width); - /***** Country *****/ fprintf (Gbl.F.Out,"" - "", - ClassData,C2Width + C3Width); - if (ShowData) + ClassData,TopC2Width); + if (ShowData && UsrDat->CtyCod > 0) { - 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_ONLY_COUNTRIES); - } - - fprintf (Gbl.F.Out,""); - } - else if (UsrDat->CtyCod > 0) - { - Cty_GetCountryName (UsrDat->CtyCod,CtyName); - fprintf (Gbl.F.Out,"%s",CtyName); - } + Cty_GetCountryName (UsrDat->CtyCod,CtyName); + fprintf (Gbl.F.Out,"%s",CtyName); } fprintf (Gbl.F.Out,""); /***** User's web and social networks *****/ fprintf (Gbl.F.Out,"" "
", - C4Width); + TopC3Width); Net_ShowWebsAndSocialNets (UsrDat); fprintf (Gbl.F.Out,"
" "" ""); - if (ShowIDRows) + if (ShowIDRows || + ShowAddressRows || + ShowTeacherRows) { - /***** User's e-mail *****/ fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - ClassForm,C2Width,Txt_Email, - ClassData,C3Width + C4Width); - if (UsrDat->Email[0]) - { - if (ShowEmail) - { - fprintf (Gbl.F.Out,"Email); - Str_LimitLengthHTMLStr (UsrDat->Email,36); - fprintf (Gbl.F.Out," class=\"%s\">%s", - ClassData,UsrDat->Email); - } - else - fprintf (Gbl.F.Out,"********"); - } - fprintf (Gbl.F.Out,"" - ""); + "" + ""); - /***** User's ID *****/ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /***** User's role or sex *****/ - if (RoleForm) + if (ShowIDRows) { + /***** User's e-mail *****/ fprintf (Gbl.F.Out,"" "" - "" + ""); - fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /***** User's role or sex *****/ + if (RoleForm) + { + fprintf (Gbl.F.Out,"" + "" + "" + ""); } - fprintf (Gbl.F.Out,"" - ""); - } - else if (SexForm) - { + else if (SexForm) + { + fprintf (Gbl.F.Out,"" + "" + "" + ""); + } + else // RoleForm == false, SexForm == false + fprintf (Gbl.F.Out,"" + "" + "" + "", + ClassForm,Rec_C1_BOTTOM_WIDE, + TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_Sex : + Txt_Role, + ClassData,Rec_C2_BOTTOM_WIDE, + TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_SEX_SINGULAR_Abc[UsrDat->Sex] : + Txt_ROLES_SINGUL_Abc[UsrDat->RoleInCurrentCrsDB][UsrDat->Sex]); + + /***** Name *****/ + /* Surname 1 */ fprintf (Gbl.F.Out,"" "" - "" ""); - } - else // RoleForm == false, SexForm == false + + /* Surname 2 */ fprintf (Gbl.F.Out,"" "" - "" - "", - ClassForm,C2Width, - TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_Sex : - Txt_Role, - ClassData,C3Width + C4Width, - TypeOfView == Rec_MY_COMMON_RECORD_CHECK ? Txt_SEX_SINGULAR_Abc[UsrDat->Sex] : - Txt_ROLES_SINGUL_Abc[UsrDat->RoleInCurrentCrsDB][UsrDat->Sex]); + "" + ""); - /***** Name *****/ - /* Surname 1 */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); + /* First name */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); - /* Surname 2 */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* First name */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - } - - if (ShowAddressRows) - { - /* Origin place */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* Date of birth */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* Local address */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* Local phone */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* Family address */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* Family phone */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - - /* Common comments for all the courses */ - fprintf (Gbl.F.Out,"" - "" - "" - ""); - } - - /***** Institution, centre, department, office, etc. *****/ - if (ShowTeacherRows) - { - /* Institution */ - fprintf (Gbl.F.Out,"" - "" - "" + "" + "" + ""); } } - fprintf (Gbl.F.Out,"" + + if (ShowAddressRows) + { + /* Origin place */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Date of birth */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Local address */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Local phone */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Family address */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Family phone */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Common comments for all the courses */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + } + + /***** Institution, centre, department, office, etc. *****/ + if (ShowTeacherRows) + { + /* Institution */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Centre */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Department */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Office */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + + /* Phone */ + fprintf (Gbl.F.Out,"" + "" + "" + ""); + } + + fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_ID, - ClassData,C3Width + C4Width); - ID_WriteUsrIDs (UsrDat,ShowID); - fprintf (Gbl.F.Out,"
" - "%s:" + "", - ClassForm,C2Width, - Txt_Role, - ClassData,C3Width + C4Width); - switch (TypeOfView) + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Email, + ClassData,Rec_C2_BOTTOM_WIDE); + if (UsrDat->Email[0]) { - case Rec_FORM_SIGN_UP: // I want to apply for enrollment - DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER : - Rol_ROLE_STUDENT; - fprintf (Gbl.F.Out,""); - break; - case Rec_FORM_MODIFY_RECORD_OTHER_EXISTING_USR: // The other user already exists in the platform - if (UsrDat->RoleInCurrentCrsDB < Rol_ROLE_STUDENT) // The other user does not belong to current course - { - /* If there is a request of this user, default role is the requested role */ - if ((DefaultRoleInCurrentCrs = Rol_GetRequestedRole (UsrDat->UsrCod)) == Rol_ROLE_UNKNOWN) - DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER : - Rol_ROLE_STUDENT; - } - else - DefaultRoleInCurrentCrs = UsrDat->RoleInCurrentCrsDB; + if (ShowEmail) + { + fprintf (Gbl.F.Out,"Email); + Str_LimitLengthHTMLStr (UsrDat->Email,36); + fprintf (Gbl.F.Out," class=\"%s\">%s", + ClassData,UsrDat->Email); + } + else + fprintf (Gbl.F.Out,"********"); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_ID, + ClassData,Rec_C2_BOTTOM_WIDE); + ID_WriteUsrIDs (UsrDat,ShowID); + fprintf (Gbl.F.Out,"
" + "%s:", + ClassForm,Rec_C1_BOTTOM_WIDE, + Txt_Role, + ClassData,Rec_C2_BOTTOM_WIDE); + switch (TypeOfView) + { + case Rec_FORM_SIGN_UP: // I want to apply for enrollment + DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER : + Rol_ROLE_STUDENT; + fprintf (Gbl.F.Out,""); + break; + case Rec_FORM_MODIFY_RECORD_OTHER_EXISTING_USR: // The other user already exists in the platform + if (UsrDat->RoleInCurrentCrsDB < Rol_ROLE_STUDENT) // The other user does not belong to current course + { + /* If there is a request of this user, default role is the requested role */ + if ((DefaultRoleInCurrentCrs = Rol_GetRequestedRole (UsrDat->UsrCod)) == Rol_ROLE_UNKNOWN) + DefaultRoleInCurrentCrs = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)) ? Rol_ROLE_TEACHER : + Rol_ROLE_STUDENT; + } + else + DefaultRoleInCurrentCrs = UsrDat->RoleInCurrentCrsDB; + + fprintf (Gbl.F.Out,""); - break; - case Rec_FORM_NEW_RECORD_OTHER_NEW_USR: // The other user does not exist in platform - fprintf (Gbl.F.Out,""); - break; - default: - break; + break; + default: // The rest of users can not register other users + break; + } + fprintf (Gbl.F.Out,""); + break; + case Rec_FORM_NEW_RECORD_OTHER_NEW_USR: // The other user does not exist in platform + fprintf (Gbl.F.Out,""); + break; + default: + break; + } + fprintf (Gbl.F.Out,"
" + "%s*:", + ClassForm,Rec_C1_BOTTOM_WIDE, + Txt_Sex, + ClassData,Rec_C2_BOTTOM_WIDE); + for (Sex = Usr_SEX_FEMALE; + Sex <= Usr_SEX_MALE; + Sex++) + { + fprintf (Gbl.F.Out,"" + "\"%s\""%s", + Gbl.Prefs.IconsURL,Usr_StringsSexDB[Sex], + Txt_SEX_SINGULAR_Abc[Sex], + Txt_SEX_SINGULAR_Abc[Sex]); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "" + "%s" + "
" - "%s*:" + "", - ClassForm,C2Width, - Txt_Sex, - ClassData,C3Width + C4Width); - for (Sex = Usr_SEX_FEMALE; - Sex <= Usr_SEX_MALE; - Sex++) - { - fprintf (Gbl.F.Out,"" - "\"%s\""%s", - Gbl.Prefs.IconsURL,Usr_StringsSexDB[Sex], - Txt_SEX_SINGULAR_Abc[Sex], - Txt_SEX_SINGULAR_Abc[Sex]); - } + ClassData,Rec_C2_BOTTOM_WIDE); + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, + UsrDat->Surname1); + else if (UsrDat->Surname1[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->Surname1); fprintf (Gbl.F.Out,"
" "%s:" "" - "%s" - "
", + ClassForm,Rec_C1_BOTTOM_WIDE, + Txt_Surname_2, + ClassData,Rec_C2_BOTTOM_WIDE); + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, + UsrDat->Surname2); + else if (UsrDat->Surname2[0]) + fprintf (Gbl.F.Out,"%s", + UsrDat->Surname2); + fprintf (Gbl.F.Out,"
" - "%s", - ClassForm,C2Width,Txt_Surname_1); - if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) - fprintf (Gbl.F.Out,"*"); - fprintf (Gbl.F.Out,":", - ClassData,C3Width + C4Width); - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, - UsrDat->Surname1); - else if (UsrDat->Surname1[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->Surname1); - fprintf (Gbl.F.Out,"
" + "%s", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_First_name); + if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) + fprintf (Gbl.F.Out,"*"); + fprintf (Gbl.F.Out,":", + ClassData,Rec_C2_BOTTOM_WIDE); + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, + UsrDat->FirstName); + else if (UsrDat->FirstName[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->FirstName); + fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width, - Txt_Surname_2, - ClassData,C3Width + C4Width); - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, - UsrDat->Surname2); - else if (UsrDat->Surname2[0]) - fprintf (Gbl.F.Out,"%s", - UsrDat->Surname2); - fprintf (Gbl.F.Out,"
" - "%s", - ClassForm,C2Width,Txt_First_name); - if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) - fprintf (Gbl.F.Out,"*"); - fprintf (Gbl.F.Out,":", - ClassData,C3Width + C4Width); - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Usr_MAX_LENGTH_USR_NAME_OR_SURNAME, - UsrDat->FirstName); - else if (UsrDat->FirstName[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->FirstName); - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Place_of_origin, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Cns_MAX_LENGTH_STRING, - UsrDat->OriginPlace); - else if (UsrDat->OriginPlace[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->OriginPlace); - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Date_of_birth, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - Dat_WriteFormDate (Gbl.Now.Date.Year - 99, - Gbl.Now.Date.Year - 16, - "DiaNac","MesNac","AnoNac", - &(UsrDat->Birthday), - false,false); - else if (UsrDat->StrBirthday[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->StrBirthday); - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Local_address, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Cns_MAX_LENGTH_STRING, - UsrDat->LocalAddress); - else if (UsrDat->LocalAddress[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->LocalAddress); - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Phone, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Usr_MAX_LENGTH_PHONE, - UsrDat->LocalPhone); - else if (UsrDat->LocalPhone[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->LocalPhone); - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Family_address, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Cns_MAX_LENGTH_STRING, - UsrDat->FamilyAddress); - else if (UsrDat->FamilyAddress[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->FamilyAddress); - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Phone, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - Usr_MAX_LENGTH_PHONE, - UsrDat->FamilyPhone); - else if (UsrDat->FamilyPhone[0]) - fprintf (Gbl.F.Out,"%s",UsrDat->FamilyPhone); - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_USER_comments, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (DataForm) - fprintf (Gbl.F.Out,"", - C3Width + C4Width - 60, - UsrDat->Comments); - else if (UsrDat->Comments[0]) - { - Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, - UsrDat->Comments,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to rigorous HTML - fprintf (Gbl.F.Out,"%s",UsrDat->Comments); - } - } - fprintf (Gbl.F.Out,"
" - "%s:" - "", - ClassForm,C2Width,Txt_Institution, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (UsrDat->InsCod > 0) + /* Country */ + if (CountryForm) { - if (Ins.WWW[0]) - fprintf (Gbl.F.Out,"", - Ins.WWW,ClassData); - fprintf (Gbl.F.Out,"%s",Ins.FullName); - if (Ins.WWW[0]) - fprintf (Gbl.F.Out,""); + /* 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_ONLY_COUNTRIES); + } + + fprintf (Gbl.F.Out,"
" + "%s", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Country); + if (TypeOfView == Rec_FORM_MY_COMMON_RECORD) + fprintf (Gbl.F.Out,"*"); + fprintf (Gbl.F.Out,":", + ClassData,Rec_C2_BOTTOM_WIDE); + + /* Selector of country */ + fprintf (Gbl.F.Out,""); + + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Place_of_origin, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Cns_MAX_LENGTH_STRING, + UsrDat->OriginPlace); + else if (UsrDat->OriginPlace[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->OriginPlace); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Date_of_birth, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + Dat_WriteFormDate (Gbl.Now.Date.Year - 99, + Gbl.Now.Date.Year - 16, + "DiaNac","MesNac","AnoNac", + &(UsrDat->Birthday), + false,false); + else if (UsrDat->StrBirthday[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->StrBirthday); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Local_address, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Cns_MAX_LENGTH_STRING, + UsrDat->LocalAddress); + else if (UsrDat->LocalAddress[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->LocalAddress); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Phone, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Usr_MAX_LENGTH_PHONE, + UsrDat->LocalPhone); + else if (UsrDat->LocalPhone[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->LocalPhone); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Family_address, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Cns_MAX_LENGTH_STRING, + UsrDat->FamilyAddress); + else if (UsrDat->FamilyAddress[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->FamilyAddress); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Phone, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + Usr_MAX_LENGTH_PHONE, + UsrDat->FamilyPhone); + else if (UsrDat->FamilyPhone[0]) + fprintf (Gbl.F.Out,"%s",UsrDat->FamilyPhone); + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_USER_comments, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (DataForm) + fprintf (Gbl.F.Out,"", + Rec_C2_BOTTOM_WIDE - 60, + UsrDat->Comments); + else if (UsrDat->Comments[0]) + { + Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, + UsrDat->Comments,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to rigorous HTML + fprintf (Gbl.F.Out,"%s",UsrDat->Comments); + } + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Institution, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (UsrDat->InsCod > 0) + { + if (Ins.WWW[0]) + fprintf (Gbl.F.Out,"", + Ins.WWW,ClassData); + fprintf (Gbl.F.Out,"%s",Ins.FullName); + if (Ins.WWW[0]) + fprintf (Gbl.F.Out,""); + } + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Centre, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (UsrDat->Tch.CtrCod > 0) + { + Ctr.CtrCod = UsrDat->Tch.CtrCod; + Ctr_GetDataOfCentreByCod (&Ctr); + if (Ctr.WWW[0]) + fprintf (Gbl.F.Out,"", + Ctr.WWW,ClassData); + fprintf (Gbl.F.Out,"%s",Ctr.FullName); + if (Ctr.WWW[0]) + fprintf (Gbl.F.Out,""); + } + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Department, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + { + if (UsrDat->Tch.DptCod > 0) + { + Dpt.DptCod = UsrDat->Tch.DptCod; + Dpt_GetDataOfDepartmentByCod (&Dpt); + if (Dpt.WWW[0]) + fprintf (Gbl.F.Out,"", + Dpt.WWW,ClassData); + fprintf (Gbl.F.Out,"%s",Dpt.FullName); + if (Dpt.WWW[0]) + fprintf (Gbl.F.Out,""); + } + } + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Office, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + fprintf (Gbl.F.Out,"%s",UsrDat->Tch.Office); + fprintf (Gbl.F.Out,"
" + "%s:" + "", + ClassForm,Rec_C1_BOTTOM_WIDE,Txt_Phone, + ClassData,Rec_C2_BOTTOM_WIDE); + if (ShowData) + fprintf (Gbl.F.Out,"%s",UsrDat->Tch.OfficePhone); + fprintf (Gbl.F.Out,"
" + "" ""); - - /* Centre */ - fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - ClassForm,C2Width,Txt_Centre, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (UsrDat->Tch.CtrCod > 0) - { - Ctr.CtrCod = UsrDat->Tch.CtrCod; - Ctr_GetDataOfCentreByCod (&Ctr); - if (Ctr.WWW[0]) - fprintf (Gbl.F.Out,"", - Ctr.WWW,ClassData); - fprintf (Gbl.F.Out,"%s",Ctr.FullName); - if (Ctr.WWW[0]) - fprintf (Gbl.F.Out,""); - } - } - fprintf (Gbl.F.Out,"" - ""); - - /* Department */ - fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - ClassForm,C2Width,Txt_Department, - ClassData,C3Width + C4Width); - if (ShowData) - { - if (UsrDat->Tch.DptCod > 0) - { - Dpt.DptCod = UsrDat->Tch.DptCod; - Dpt_GetDataOfDepartmentByCod (&Dpt); - if (Dpt.WWW[0]) - fprintf (Gbl.F.Out,"", - Dpt.WWW,ClassData); - fprintf (Gbl.F.Out,"%s",Dpt.FullName); - if (Dpt.WWW[0]) - fprintf (Gbl.F.Out,""); - } - } - fprintf (Gbl.F.Out,"" - ""); - - /* Office */ - fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - ClassForm,C2Width,Txt_Office, - ClassData,C3Width + C4Width); - if (ShowData) - fprintf (Gbl.F.Out,"%s",UsrDat->Tch.Office); - fprintf (Gbl.F.Out,"" - ""); - - /* Phone */ - fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - ClassForm,C2Width,Txt_Phone, - ClassData,C3Width + C4Width); - if (ShowData) - fprintf (Gbl.F.Out,"%s",UsrDat->Tch.OfficePhone); - fprintf (Gbl.F.Out,"" - ""); } /***** End frame *****/ diff --git a/swad_record.h b/swad_record.h index f845f38e2..d9aa8b202 100644 --- a/swad_record.h +++ b/swad_record.h @@ -36,16 +36,16 @@ /*****************************************************************************/ #define Rec_RECORD_WIDTH_WIDE 560 -#define Rec_C1_WIDTH_WIDE 52 -#define Rec_C2_WIDTH_WIDE 144 -#define Rec_C3_WIDTH_WIDE 210 -#define Rec_C4_WIDTH_WIDE 154 +#define Rec_C1_TOP_WIDE 52 +#define Rec_C2_TOP_WIDE 354 +#define Rec_C3_TOP_WIDE 154 +#define Rec_C1_BOTTOM_WIDE (160-2) +#define Rec_C2_BOTTOM_WIDE (400-2) #define Rec_RECORD_WIDTH_NARROW 460 -#define Rec_C1_WIDTH_NARROW 52 -#define Rec_C2_WIDTH_NARROW 94 -#define Rec_C3_WIDTH_NARROW 160 -#define Rec_C4_WIDTH_NARROW 154 +#define Rec_C1_TOP_NARROW 52 +#define Rec_C2_TOP_NARROW 254 +#define Rec_C3_TOP_NARROW 154 #define Rec_MAX_LENGTH_NAME_FIELD 255 #define Rec_MIN_LINES_IN_EDITION_FIELD 1