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,"