From e3ad05d77bb9f03da61a54b85bc83637ac80e863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 31 May 2017 23:08:19 +0200 Subject: [PATCH] Version 16.232.2 --- swad_action.c | 7 +++++-- swad_changelog.h | 3 ++- swad_record.c | 13 +++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/swad_action.c b/swad_action.c index ed8c0aeb0..07a4f94a2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -5099,11 +5099,14 @@ void Act_AdjustCurrentAction (void) return; } + /***** Check if I am a teacher *****/ + Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat); + IAmATeacher = (Gbl.Usrs.Me.UsrDat.Roles & ((1 << Rol_NET) | // I am a non-editing teacher... + (1 << Rol_TCH))); // ...or a teacher in any course + /***** If I haven't filled my institution, or if I'm a teacher and I haven't filled my centre or department, the only action possible is to show a form to change my common record *****/ - Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat); - IAmATeacher = (Gbl.Usrs.Me.UsrDat.Roles & (1 << Rol_TCH)); if (Gbl.Usrs.Me.UsrDat.InsCod < 0 || (IAmATeacher && (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0 || Gbl.Usrs.Me.UsrDat.Tch.DptCod < 0))) diff --git a/swad_changelog.h b/swad_changelog.h index 4bd538b2e..56af04f7d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -233,13 +233,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.232.1 (2017-05-31)" +#define Log_PLATFORM_VERSION "SWAD 16.232.2 (2017-05-31)" #define CSS_FILE "swad16.226.css" #define JS_FILE "swad16.206.3.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 16.232.2: May 31, 2017 Fixed bug in selection of user's centre and department. (221089 lines) Version 16.232.1: May 31, 2017 Improvements in selection of user's institution, centre and department. (221085 lines) Version 16.232: May 31, 2017 Fix bug in selection of user's centre. (221042 lines) Version 16.231.4: May 31, 2017 Changes in layout of statistics about institutions. diff --git a/swad_record.c b/swad_record.c index b9ec233ff..cc63338b7 100644 --- a/swad_record.c +++ b/swad_record.c @@ -3990,20 +3990,21 @@ void Rec_ShowFormMyInsCtrDpt (void) unsigned NumIns; unsigned NumCtr; unsigned NumDpt; - bool IAmTeacher; + bool IAmATeacher; /***** Get my roles if not yet got *****/ Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat); /***** Check if I am a teacher *****/ - IAmTeacher = (Gbl.Usrs.Me.UsrDat.Roles & (1 << Rol_TCH)); + IAmATeacher = (Gbl.Usrs.Me.UsrDat.Roles & ((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 ((Gbl.Usrs.Me.UsrDat.Roles & (1 << Rol_TCH))) + else if (IAmATeacher) { if (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0) Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_centre); @@ -4013,8 +4014,8 @@ void Rec_ShowFormMyInsCtrDpt (void) /***** Start table *****/ Lay_StartRoundFrameTable ("800px", - IAmTeacher ? Txt_Institution_centre_and_department : - Txt_Institution, + IAmATeacher ? Txt_Institution_centre_and_department : + Txt_Institution, NULL,Hlp_PROFILE_Institution,2); /***** Country *****/ @@ -4104,7 +4105,7 @@ void Rec_ShowFormMyInsCtrDpt (void) fprintf (Gbl.F.Out,"" ""); - if (IAmTeacher) + if (IAmATeacher) { /***** Centre *****/ fprintf (Gbl.F.Out,""