diff --git a/swad_changelog.h b/swad_changelog.h index 22131cfef..583753a2f 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -355,10 +355,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.3.5 (2018-10-09)" +#define Log_PLATFORM_VERSION "SWAD 18.3.6 (2018-10-09)" #define CSS_FILE "swad18.3.css" #define JS_FILE "swad17.17.1.js" /* + Version 18.3.6: Oct 09, 2018 Change in layout of user's record card. (234937 lines) Version 18.3.5: Oct 09, 2018 Change in layout of classphoto of degrees. (234939 lines) Version 18.3.4: Oct 09, 2018 Changes in form to remove account. (234938 lines) Version 18.3.3: Oct 09, 2018 Changes in form to remove account. (234932 lines) diff --git a/swad_record.c b/swad_record.c index 569b7111a..717f7e39e 100644 --- a/swad_record.c +++ b/swad_record.c @@ -101,7 +101,6 @@ static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, static void Rec_ShowMyCrsRecordUpdated (void); static bool Rec_CheckIfICanEditField (Rec_VisibilityRecordFields_t Visibility); -static void Rec_ShowFormMySharedRecord (void); static void Rec_PutIconsCommands (void); static void Rec_PutParamsWorks (void); static void Rec_PutParamsStudent (void); @@ -173,7 +172,7 @@ static void Rec_WriteLinkToDataProtectionClause (void); static void Rec_GetUsrExtraDataFromRecordForm (struct UsrData *UsrDat); static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat); -static void Rec_ShowFormMyInsCtrDpt (void); +static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher); /*****************************************************************************/ /*************** Create, edit and remove fields of records *******************/ @@ -2101,29 +2100,6 @@ void Rec_ShowFormSignUpInCrsWithMySharedRecord (void) Rec_ShowSharedUsrRecord (Rec_SHA_SIGN_UP_IN_CRS_FORM,&Gbl.Usrs.Me.UsrDat,NULL); } -/*****************************************************************************/ -/***************** Show form to edit my shared record card *******************/ -/*****************************************************************************/ - -static void Rec_ShowFormMySharedRecord (void) - { - extern const char *Txt_Please_fill_in_your_record_card_including_your_name; - extern const char *Txt_Please_fill_in_your_record_card_including_your_sex; - extern const char *Txt_Please_fill_in_your_record_card_including_your_country_nationality; - - /***** If user has no name and surname, sex... *****/ - if (!Gbl.Usrs.Me.UsrDat.FirstName[0] || - !Gbl.Usrs.Me.UsrDat.Surname1[0]) - Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_record_card_including_your_name); - else if (Gbl.Usrs.Me.UsrDat.Sex == Usr_SEX_UNKNOWN) - Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_record_card_including_your_sex); - else if (Gbl.Usrs.Me.UsrDat.CtyCod < 0) - Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_record_card_including_your_country_nationality); - - /***** My record *****/ - Rec_ShowSharedUsrRecord (Rec_SHA_MY_RECORD_FORM,&Gbl.Usrs.Me.UsrDat,NULL); - } - /*****************************************************************************/ /*************** Show form to edit the record of a new user ******************/ /*****************************************************************************/ @@ -3940,17 +3916,57 @@ static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat) void Rec_ShowMySharedRecordAndMore (void) { - /***** Start container for this user *****/ + extern const char *Txt_Please_fill_in_your_record_card_including_your_name; + extern const char *Txt_Please_fill_in_your_record_card_including_your_sex; + extern const char *Txt_Please_fill_in_your_record_card_including_your_country_nationality; + extern const char *Txt_Please_select_the_country_of_your_institution; + extern const char *Txt_Please_fill_in_your_institution; + extern const char *Txt_Please_fill_in_your_centre; + extern const char *Txt_Please_fill_in_your_department; + bool IAmATeacher; + + /***** Get my roles if not yet got *****/ + Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat); + + /***** Check if I am a teacher *****/ + IAmATeacher = (Gbl.Usrs.Me.UsrDat.Roles.InCrss & ((1 << Rol_NET) | // I am a non-editing teacher... + (1 << Rol_TCH))); // ...or a teacher in any course + + /***** If user has no name and surname, sex... *****/ + if (!Gbl.Usrs.Me.UsrDat.FirstName[0] || + !Gbl.Usrs.Me.UsrDat.Surname1[0]) // 1. No name + Ale_ShowAlert (Ale_WARNING, + Txt_Please_fill_in_your_record_card_including_your_name); + else if (Gbl.Usrs.Me.UsrDat.Sex == Usr_SEX_UNKNOWN) // 2. No sex + Ale_ShowAlert (Ale_WARNING, + Txt_Please_fill_in_your_record_card_including_your_sex); + else if (Gbl.Usrs.Me.UsrDat.CtyCod < 0) // 3. No country + Ale_ShowAlert (Ale_WARNING, + Txt_Please_fill_in_your_record_card_including_your_country_nationality); + else if (Gbl.Usrs.Me.UsrDat.InsCtyCod < 0) // 4. No institution country + Ale_ShowAlert (Ale_WARNING, + Txt_Please_select_the_country_of_your_institution); + else if (Gbl.Usrs.Me.UsrDat.InsCod < 0) // 5. No institution + Ale_ShowAlert (Ale_WARNING, + Txt_Please_fill_in_your_institution); + else if (IAmATeacher) + { + if (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0) // 6. No centre + Ale_ShowAlert (Ale_WARNING, + Txt_Please_fill_in_your_centre); + else if (Gbl.Usrs.Me.UsrDat.Tch.DptCod < 0) // 7. No deparment + Ale_ShowAlert (Ale_WARNING, + Txt_Please_fill_in_your_department); + } + + /***** Start container *****/ fprintf (Gbl.F.Out,"
"); /***** Left part *****/ fprintf (Gbl.F.Out,"
"); /* My shared record card */ - Rec_ShowFormMySharedRecord (); - - /* My institution, centre and department */ - Rec_ShowFormMyInsCtrDpt (); + Rec_ShowSharedUsrRecord (Rec_SHA_MY_RECORD_FORM,&Gbl.Usrs.Me.UsrDat,NULL); fprintf (Gbl.F.Out,"
"); @@ -3958,13 +3974,16 @@ void Rec_ShowMySharedRecordAndMore (void) /* Start container for right part */ fprintf (Gbl.F.Out,"
"); + /* My institution, centre and department */ + Rec_ShowFormMyInsCtrDpt (IAmATeacher); + /* My webs / social networks */ Net_ShowFormMyWebsAndSocialNets (); /* End container for right part */ fprintf (Gbl.F.Out,"
"); - /***** End container for this user *****/ + /***** End container *****/ fprintf (Gbl.F.Out,"
"); /***** Data protection clause *****/ @@ -3975,14 +3994,10 @@ void Rec_ShowMySharedRecordAndMore (void) /********* Show form to edit my institution, centre and department ***********/ /*****************************************************************************/ -static void Rec_ShowFormMyInsCtrDpt (void) +static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher) { extern const char *Hlp_PROFILE_Institution; extern const char *The_ClassForm[The_NUM_THEMES]; - extern const char *Txt_Please_select_the_country_of_your_institution; - extern const char *Txt_Please_fill_in_your_institution; - extern const char *Txt_Please_fill_in_your_centre; - extern const char *Txt_Please_fill_in_your_department; extern const char *Txt_Institution_centre_and_department; extern const char *Txt_Institution; extern const char *Txt_Country; @@ -3996,32 +4011,11 @@ static void Rec_ShowFormMyInsCtrDpt (void) unsigned NumCty; unsigned NumIns; unsigned NumCtr; - bool IAmATeacher; char StrRecordWidth[10 + 1]; /***** Start section *****/ Lay_StartSection (Rec_MY_INS_CTR_DPT_ID); - /***** Get my roles if not yet got *****/ - Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat); - - /***** Check if I am a teacher *****/ - IAmATeacher = (Gbl.Usrs.Me.UsrDat.Roles.InCrss & ((1 << Rol_NET) | // I am a non-editing teacher... - (1 << Rol_TCH))); // ...or a teacher in any course - - /***** If there is no country, institution, centre or department *****/ - if (Gbl.Usrs.Me.UsrDat.InsCtyCod < 0) - Ale_ShowAlert (Ale_WARNING,Txt_Please_select_the_country_of_your_institution); - else if (Gbl.Usrs.Me.UsrDat.InsCod < 0) - Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_institution); - else if (IAmATeacher) - { - if (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0) - Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_centre); - else if (Gbl.Usrs.Me.UsrDat.Tch.DptCod < 0) - Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_department); - } - /***** Start box and table *****/ sprintf (StrRecordWidth,"%upx",Rec_RECORD_WIDTH); Box_StartBoxTable (StrRecordWidth,