Version 16.232.2

This commit is contained in:
Antonio Cañas Vargas 2017-05-31 23:08:19 +02:00
parent 3c84e615e8
commit e3ad05d77b
3 changed files with 14 additions and 9 deletions

View File

@ -5099,11 +5099,14 @@ void Act_AdjustCurrentAction (void)
return; 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, /***** If I haven't filled my institution,
or if I'm a teacher and I haven't filled my centre or department, 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 *****/ 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 || if (Gbl.Usrs.Me.UsrDat.InsCod < 0 ||
(IAmATeacher && (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0 || (IAmATeacher && (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0 ||
Gbl.Usrs.Me.UsrDat.Tch.DptCod < 0))) Gbl.Usrs.Me.UsrDat.Tch.DptCod < 0)))

View File

@ -233,13 +233,14 @@
/****************************** Public constants *****************************/ /****************************** 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 CSS_FILE "swad16.226.css"
#define JS_FILE "swad16.206.3.js" #define JS_FILE "swad16.206.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // 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.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.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. Version 16.231.4: May 31, 2017 Changes in layout of statistics about institutions.

View File

@ -3990,20 +3990,21 @@ void Rec_ShowFormMyInsCtrDpt (void)
unsigned NumIns; unsigned NumIns;
unsigned NumCtr; unsigned NumCtr;
unsigned NumDpt; unsigned NumDpt;
bool IAmTeacher; bool IAmATeacher;
/***** Get my roles if not yet got *****/ /***** Get my roles if not yet got *****/
Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat); Rol_GetRolesInAllCrssIfNotYetGot (&Gbl.Usrs.Me.UsrDat);
/***** Check if I am a teacher *****/ /***** 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 there is no country, institution, centre or department *****/
if (Gbl.Usrs.Me.UsrDat.InsCtyCod < 0) if (Gbl.Usrs.Me.UsrDat.InsCtyCod < 0)
Ale_ShowAlert (Ale_WARNING,Txt_Please_select_the_country_of_your_institution); Ale_ShowAlert (Ale_WARNING,Txt_Please_select_the_country_of_your_institution);
else if (Gbl.Usrs.Me.UsrDat.InsCod < 0) else if (Gbl.Usrs.Me.UsrDat.InsCod < 0)
Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_institution); 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) if (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0)
Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_centre); Ale_ShowAlert (Ale_WARNING,Txt_Please_fill_in_your_centre);
@ -4013,8 +4014,8 @@ void Rec_ShowFormMyInsCtrDpt (void)
/***** Start table *****/ /***** Start table *****/
Lay_StartRoundFrameTable ("800px", Lay_StartRoundFrameTable ("800px",
IAmTeacher ? Txt_Institution_centre_and_department : IAmATeacher ? Txt_Institution_centre_and_department :
Txt_Institution, Txt_Institution,
NULL,Hlp_PROFILE_Institution,2); NULL,Hlp_PROFILE_Institution,2);
/***** Country *****/ /***** Country *****/
@ -4104,7 +4105,7 @@ void Rec_ShowFormMyInsCtrDpt (void)
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
if (IAmTeacher) if (IAmATeacher)
{ {
/***** Centre *****/ /***** Centre *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"