Version 23.17.5: Sep 28, 2023 Code refactoring in scopes.

This commit is contained in:
acanas 2023-09-28 19:33:41 +02:00
parent c7591e9849
commit 236824244f
14 changed files with 51 additions and 77 deletions

View File

@ -1695,7 +1695,7 @@ int swad__findUsers (struct soap *soap,
if (Search.Str[0]) // Search some users if (Search.Str[0]) // Search some users
{ {
Gbl.Scope.Current = (Gbl.Hierarchy.Level == Hie_CRS) ? Hie_CRS : Gbl.Scope.Current = (Gbl.Hierarchy.Level == Hie_CRS) ? Hie_CRS :
Hie_SYS; Hie_SYS;
if (Sch_BuildSearchQuery (SearchQuery,&Search, if (Sch_BuildSearchQuery (SearchQuery,&Search,
"CONCAT_WS(' ',FirstName,Surname1,Surname2)", "CONCAT_WS(' ',FirstName,Surname1,Surname2)",
NULL,NULL)) NULL,NULL))

View File

@ -632,10 +632,11 @@ TODO: Francisco Javier Fern
Me sale este error, no si por no recordar yo la sintaxis apropiada para mandar a varios destinatarios. ¿No era así? Me sale este error, no si por no recordar yo la sintaxis apropiada para mandar a varios destinatarios. ¿No era así?
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.17.4 (2023-09-26)" #define Log_PLATFORM_VERSION "SWAD 23.17.5 (2023-09-28)"
#define CSS_FILE "swad23.16.1.css" #define CSS_FILE "swad23.16.1.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 23.17.5: Sep 28, 2023 Code refactoring in scopes. (336638 lines)
Version 23.17.4: Sep 26, 2023 Code refactoring in hierarchy. (336661 lines) Version 23.17.4: Sep 26, 2023 Code refactoring in hierarchy. (336661 lines)
Version 23.17.3: Sep 25, 2023 Code refactoring in hierarchy. (336679 lines) Version 23.17.3: Sep 25, 2023 Code refactoring in hierarchy. (336679 lines)
Version 23.17.2: Sep 25, 2023 Fixed bug in hierarchy. (336673 lines) Version 23.17.2: Sep 25, 2023 Fixed bug in hierarchy. (336673 lines)

View File

@ -100,8 +100,8 @@ void Con_ShowConnectedUsrs (void)
} }
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingStudents (); Sco_SetAllowedScopesForListingStudents ();
Sco_GetScope ("ScopeCon"); Sco_GetScope ("ScopeCon",Hie_CRS);
/***** Begin box *****/ /***** Begin box *****/
/* Current time */ /* Current time */
@ -236,17 +236,13 @@ void Con_ComputeConnectedUsrsBelongingToCurrentCrs (void)
(Gbl.Usrs.Me.IBelongToCurrentCrs || // I can view users (Gbl.Usrs.Me.IBelongToCurrentCrs || // I can view users
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)) Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM))
{ {
Gbl.Usrs.Connected.NumUsrs = 0; Gbl.Usrs.Connected.NumUsrs =
Gbl.Usrs.Connected.NumUsrsToList = 0; Gbl.Usrs.Connected.NumUsrsToList = 0;
Gbl.Scope.Current = Hie_CRS; Gbl.Scope.Current = Hie_CRS;
/***** Number of teachers *****/ /***** Number of teachers, non-editing teachers, and students *****/
Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_TCH); Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_TCH);
/***** Number of non-editing teachers *****/
Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_NET); Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_NET);
/***** Number of students *****/
Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_STD); Con_ComputeConnectedUsrsWithARoleBelongingToCurrentCrs (Rol_STD);
} }
} }

View File

@ -2134,8 +2134,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_CRS; Sco_GetScope ("ScopeEnr",Hie_CRS);
Sco_GetScope ("ScopeEnr");
/***** Begin box *****/ /***** Begin box *****/
Box_BoxBegin (NULL,Txt_Enrolment_requests, Box_BoxBegin (NULL,Txt_Enrolment_requests,

View File

@ -105,8 +105,7 @@ static void Fig_ReqShowFigure (Fig_FigureType_t SelectedFigureType)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_SYS; Sco_GetScope ("FigScope",Hie_SYS);
Sco_GetScope ("FigScope");
Sco_PutSelectorScope ("FigScope",HTM_DONT_SUBMIT_ON_CHANGE); Sco_PutSelectorScope ("FigScope",HTM_DONT_SUBMIT_ON_CHANGE);
HTM_LABEL_End (); HTM_LABEL_End ();
@ -148,8 +147,7 @@ void Fig_PutIconToShowFigure (Fig_FigureType_t FigureType)
struct Fig_Figures Figures; struct Fig_Figures Figures;
/***** Set default scope (used only if Gbl.Scope.Current is unknown) *****/ /***** Set default scope (used only if Gbl.Scope.Current is unknown) *****/
Gbl.Scope.Default = Hie_CRS; Sco_AdjustScope (Hie_CRS);
Sco_AdjustScope ();
/***** Put icon to show figure *****/ /***** Put icon to show figure *****/
Figures.Level = Gbl.Scope.Current; Figures.Level = Gbl.Scope.Current;

View File

@ -3232,7 +3232,6 @@ static void For_InsertThrInClipboard (long ThrCod)
For_DB_InsertThrInMyClipboard (ThrCod); For_DB_InsertThrInMyClipboard (ThrCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************** Show figures about forums ************************/ /************************** Show figures about forums ************************/
/*****************************************************************************/ /*****************************************************************************/
@ -3253,9 +3252,9 @@ void For_GetAndShowForumStats (void)
struct For_FiguresForum FiguresForum; struct For_FiguresForum FiguresForum;
/***** Reset total stats *****/ /***** Reset total stats *****/
FiguresForum.NumForums = 0; FiguresForum.NumForums = 0;
FiguresForum.NumThreads = 0; FiguresForum.NumThreads = 0;
FiguresForum.NumPosts = 0; FiguresForum.NumPosts = 0;
FiguresForum.NumUsrsToBeNotifiedByEMail = 0; FiguresForum.NumUsrsToBeNotifiedByEMail = 0;
/***** Begin box and table *****/ /***** Begin box and table *****/

View File

@ -95,7 +95,6 @@ struct Globals
struct struct
{ {
Hie_Level_t Current; Hie_Level_t Current;
Hie_Level_t Default;
unsigned Allowed; unsigned Allowed;
} Scope; } Scope;
struct struct

View File

@ -248,8 +248,7 @@ static void Ind_GetParsIndicators (struct Ind_Indicators *Indicators)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_CRS; Sco_GetScope ("ScopeInd",Hie_CRS);
Sco_GetScope ("ScopeInd");
/***** Get degree type code *****/ /***** Get degree type code *****/
Indicators->DegTypCod = (Gbl.Scope.Current == Hie_SYS) ? Indicators->DegTypCod = (Gbl.Scope.Current == Hie_SYS) ?

View File

@ -129,7 +129,7 @@ void Sco_PutParScope (const char *ParName,Hie_Level_t Level)
/*************************** Get parameter scope *****************************/ /*************************** Get parameter scope *****************************/
/*****************************************************************************/ /*****************************************************************************/
void Sco_GetScope (const char *ParName) void Sco_GetScope (const char *ParName,Hie_Level_t DefaultScope)
{ {
/***** Get parameter with scope *****/ /***** Get parameter with scope *****/
Gbl.Scope.Current = (Hie_Level_t) Gbl.Scope.Current = (Hie_Level_t)
@ -139,20 +139,20 @@ void Sco_GetScope (const char *ParName)
(unsigned long) Hie_UNK); (unsigned long) Hie_UNK);
/***** Adjust scope avoiding impossible or forbidden scopes *****/ /***** Adjust scope avoiding impossible or forbidden scopes *****/
Sco_AdjustScope (); Sco_AdjustScope (DefaultScope);
} }
/*****************************************************************************/ /*****************************************************************************/
/*********** Adjust scope avoiding impossible or forbidden scopes ************/ /*********** Adjust scope avoiding impossible or forbidden scopes ************/
/*****************************************************************************/ /*****************************************************************************/
void Sco_AdjustScope (void) void Sco_AdjustScope (Hie_Level_t DefaultScope)
{ {
Hie_Level_t Level; Hie_Level_t Level;
/***** Is scope is unknow, use default scope *****/ /***** Is scope is unknow, use default scope *****/
if (Gbl.Scope.Current == Hie_UNK) if (Gbl.Scope.Current == Hie_UNK)
Gbl.Scope.Current = Gbl.Scope.Default; Gbl.Scope.Current = DefaultScope;
/***** Avoid impossible scopes *****/ /***** Avoid impossible scopes *****/
for (Level = Hie_CRS; for (Level = Hie_CRS;
@ -170,17 +170,15 @@ void Sco_AdjustScope (void)
/****************** Set allowed scopes when listing guests *******************/ /****************** Set allowed scopes when listing guests *******************/
/*****************************************************************************/ /*****************************************************************************/
void Sco_SetScopesForListingGuests (void) void Sco_SetAllowedScopesForListingGuests (void)
{ {
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_SYS_ADM: case Rol_SYS_ADM:
Gbl.Scope.Allowed = 1 << Hie_SYS; Gbl.Scope.Allowed = 1 << Hie_SYS;
Gbl.Scope.Default = Hie_SYS;
break; break;
default: default:
Gbl.Scope.Allowed = 0; Gbl.Scope.Allowed = 0;
Gbl.Scope.Default = Hie_UNK;
break; break;
} }
} }
@ -189,9 +187,8 @@ void Sco_SetScopesForListingGuests (void)
/**************** Set allowed scopes when listing students *******************/ /**************** Set allowed scopes when listing students *******************/
/*****************************************************************************/ /*****************************************************************************/
void Sco_SetScopesForListingStudents (void) void Sco_SetAllowedScopesForListingStudents (void)
{ {
Gbl.Scope.Default = Hie_CRS;
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
{ {
case Rol_STD: case Rol_STD:
@ -224,7 +221,6 @@ void Sco_SetScopesForListingStudents (void)
break; break;
default: default:
Gbl.Scope.Allowed = 0; Gbl.Scope.Allowed = 0;
Gbl.Scope.Default = Hie_UNK;
break; break;
} }
} }

View File

@ -39,11 +39,11 @@
void Sco_PutSelectorScope (const char *ParName,HTM_SubmitOnChange_t SubmitOnChange); void Sco_PutSelectorScope (const char *ParName,HTM_SubmitOnChange_t SubmitOnChange);
void Sco_PutParCurrentScope (void *Level); void Sco_PutParCurrentScope (void *Level);
void Sco_PutParScope (const char *ParName,Hie_Level_t Level); void Sco_PutParScope (const char *ParName,Hie_Level_t Level);
void Sco_GetScope (const char *ParName); void Sco_GetScope (const char *ParName,Hie_Level_t DefaultScope);
void Sco_AdjustScope (void); void Sco_AdjustScope (Hie_Level_t DefaultScope);
void Sco_SetScopesForListingGuests (void); void Sco_SetAllowedScopesForListingGuests (void);
void Sco_SetScopesForListingStudents (void); void Sco_SetAllowedScopesForListingStudents (void);
Hie_Level_t Sco_GetScopeFromUnsignedStr (const char *UnsignedStr); Hie_Level_t Sco_GetScopeFromUnsignedStr (const char *UnsignedStr);
Hie_Level_t Hie_GetLevelFromDBStr (const char *LevelDBStr); Hie_Level_t Hie_GetLevelFromDBStr (const char *LevelDBStr);

View File

@ -177,8 +177,7 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Hie_Level_t DefaultScop
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = DefaultScope; Sco_GetScope ("ScopeSch",DefaultScope);
Sco_GetScope ("ScopeSch");
Sco_PutSelectorScope ("ScopeSch",HTM_DONT_SUBMIT_ON_CHANGE); Sco_PutSelectorScope ("ScopeSch",HTM_DONT_SUBMIT_ON_CHANGE);
HTM_LABEL_End (); HTM_LABEL_End ();
HTM_DIV_End (); HTM_DIV_End ();

View File

@ -548,8 +548,7 @@ static void Sta_PutFormGblHits (struct Sta_Stats *Stats)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_SYS; Sco_GetScope ("ScopeSta",Hie_SYS);
Sco_GetScope ("ScopeSta");
Sco_PutSelectorScope ("ScopeSta",HTM_DONT_SUBMIT_ON_CHANGE); Sco_PutSelectorScope ("ScopeSta",HTM_DONT_SUBMIT_ON_CHANGE);
HTM_TD_End (); HTM_TD_End ();
@ -827,8 +826,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_SYS; Sco_GetScope ("ScopeSta",Hie_SYS);
Sco_GetScope ("ScopeSta");
/***** Show form again *****/ /***** Show form again *****/
Sta_PutFormGblHits (&Stats); Sta_PutFormGblHits (&Stats);

View File

@ -98,7 +98,7 @@ static void Svy_SetAllowedAndHiddenScopes (unsigned *ScopesAllowed,
static void Svy_HideUnhideSurvey (HidVis_HiddenOrVisible_t HiddenOrVisible); static void Svy_HideUnhideSurvey (HidVis_HiddenOrVisible_t HiddenOrVisible);
static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy); static void Svy_SetAllowedScopes (struct Svy_Survey *Svy);
static void Svy_ShowLstGrpsToEditSurvey (long SvyCod); static void Svy_ShowLstGrpsToEditSurvey (long SvyCod);
static void Svy_CreateSurvey (struct Svy_Survey *Svy,const char *Txt); static void Svy_CreateSurvey (struct Svy_Survey *Svy,const char *Txt);
static void Svy_UpdateSurvey (struct Svy_Survey *Svy,const char *Txt); static void Svy_UpdateSurvey (struct Svy_Survey *Svy,const char *Txt);
@ -1668,8 +1668,8 @@ void Svy_ReqCreatOrEditSvy (void)
/* Data */ /* Data */
HTM_TD_Begin ("class=\"LT\""); HTM_TD_Begin ("class=\"LT\"");
Svy_SetDefaultAndAllowedScope (&Surveys.Svy); Svy_SetAllowedScopes (&Surveys.Svy);
Sco_GetScope ("ScopeSvy"); Sco_GetScope ("ScopeSvy",Surveys.Svy.Level);
Sco_PutSelectorScope ("ScopeSvy",HTM_DONT_SUBMIT_ON_CHANGE); Sco_PutSelectorScope ("ScopeSvy",HTM_DONT_SUBMIT_ON_CHANGE);
HTM_TD_End (); HTM_TD_End ();
@ -1754,15 +1754,14 @@ void Svy_ReqCreatOrEditSvy (void)
} }
/*****************************************************************************/ /*****************************************************************************/
/****** Set default and allowed scopes depending on logged user's role *******/ /************ Set allowed scopes depending on logged user's role *************/
/*****************************************************************************/ /*****************************************************************************/
static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy) static void Svy_SetAllowedScopes (struct Svy_Survey *Svy)
{ {
bool ICanEdit = false; bool ICanEdit = false;
/***** Set default scope *****/ /***** Set allowed scopes *****/
Gbl.Scope.Default = Hie_UNK;
Gbl.Scope.Allowed = 0; Gbl.Scope.Allowed = 0;
switch (Gbl.Usrs.Me.Role.Logged) switch (Gbl.Usrs.Me.Role.Logged)
@ -1774,7 +1773,6 @@ static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy)
Svy->Level = Hie_CRS; Svy->Level = Hie_CRS;
if (Svy->Level == Hie_CRS) if (Svy->Level == Hie_CRS)
{ {
Gbl.Scope.Default = Svy->Level;
Gbl.Scope.Allowed = 1 << Hie_CRS; Gbl.Scope.Allowed = 1 << Hie_CRS;
ICanEdit = true; ICanEdit = true;
} }
@ -1785,7 +1783,6 @@ static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy)
Svy->Level = Hie_DEG; Svy->Level = Hie_DEG;
if (Svy->Level == Hie_DEG) if (Svy->Level == Hie_DEG)
{ {
Gbl.Scope.Default = Svy->Level;
Gbl.Scope.Allowed = 1 << Hie_DEG; Gbl.Scope.Allowed = 1 << Hie_DEG;
ICanEdit = true; ICanEdit = true;
} }
@ -1795,7 +1792,6 @@ static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy)
Svy->Level = Hie_CTR; Svy->Level = Hie_CTR;
if (Svy->Level == Hie_CTR) if (Svy->Level == Hie_CTR)
{ {
Gbl.Scope.Default = Svy->Level;
Gbl.Scope.Allowed = 1 << Hie_CTR; Gbl.Scope.Allowed = 1 << Hie_CTR;
ICanEdit = true; ICanEdit = true;
} }
@ -1805,7 +1801,6 @@ static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy)
Svy->Level = Hie_INS; Svy->Level = Hie_INS;
if (Svy->Level == Hie_INS) if (Svy->Level == Hie_INS)
{ {
Gbl.Scope.Default = Svy->Level;
Gbl.Scope.Allowed = 1 << Hie_INS; Gbl.Scope.Allowed = 1 << Hie_INS;
ICanEdit = true; ICanEdit = true;
} }
@ -1815,7 +1810,6 @@ static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy)
Svy->Level = (Gbl.Hierarchy.Level < Hie_NUM_LEVELS && Svy->Level = (Gbl.Hierarchy.Level < Hie_NUM_LEVELS &&
Gbl.Hierarchy.Level != Hie_UNK) ? Gbl.Hierarchy.Level : Gbl.Hierarchy.Level != Hie_UNK) ? Gbl.Hierarchy.Level :
Hie_SYS; Hie_SYS;
Gbl.Scope.Default = Svy->Level;
Gbl.Scope.Allowed = 1 << Hie_SYS | Gbl.Scope.Allowed = 1 << Hie_SYS |
1 << Hie_CTY | 1 << Hie_CTY |
1 << Hie_INS | 1 << Hie_INS |
@ -1934,8 +1928,8 @@ void Svy_ReceiveFormSurvey (void)
} }
/***** Get scope *****/ /***** Get scope *****/
Svy_SetDefaultAndAllowedScope (&NewSvy); Svy_SetAllowedScopes (&NewSvy);
Sco_GetScope ("ScopeSvy"); Sco_GetScope ("ScopeSvy",NewSvy.Level);
switch (Gbl.Scope.Current) switch (Gbl.Scope.Current)
{ {
case Hie_SYS: case Hie_SYS:

View File

@ -4270,8 +4270,8 @@ void Usr_ListAllDataGsts (void)
Set_GetAndUpdatePrefsAboutUsrList (); Set_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingGuests (); Sco_SetAllowedScopesForListingGuests ();
Sco_GetScope ("ScopeUsr"); Sco_GetScope ("ScopeUsr",Hie_SYS);
/****** Get list of guests ******/ /****** Get list of guests ******/
Usr_GetGstsLst (Gbl.Scope.Current); Usr_GetGstsLst (Gbl.Scope.Current);
@ -4384,8 +4384,8 @@ void Usr_ListAllDataStds (void)
Set_GetAndUpdatePrefsAboutUsrList (); Set_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingStudents (); Sco_SetAllowedScopesForListingStudents ();
Sco_GetScope ("ScopeUsr"); Sco_GetScope ("ScopeUsr",Hie_CRS);
/***** If the scope is the current course... *****/ /***** If the scope is the current course... *****/
if (Gbl.Scope.Current == Hie_CRS) if (Gbl.Scope.Current == Hie_CRS)
@ -4642,8 +4642,7 @@ void Usr_ListAllDataTchs (void)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_CRS; Sco_GetScope ("ScopeUsr",Hie_CRS);
Sco_GetScope ("ScopeUsr");
/***** Get list of teachers *****/ /***** Get list of teachers *****/
Usr_GetListUsrs (Gbl.Scope.Current,Rol_NET); // Non-editing teachers Usr_GetListUsrs (Gbl.Scope.Current,Rol_NET); // Non-editing teachers
@ -4912,8 +4911,7 @@ void Usr_ListDataAdms (void)
1 << Hie_INS | 1 << Hie_INS |
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG; 1 << Hie_DEG;
Gbl.Scope.Default = Hie_DEG; Sco_GetScope ("ScopeUsr",Hie_DEG);
Sco_GetScope ("ScopeUsr");
/***** Get list of administrators *****/ /***** Get list of administrators *****/
Adm_GetAdmsLst (Gbl.Scope.Current); Adm_GetAdmsLst (Gbl.Scope.Current);
@ -5051,8 +5049,8 @@ void Usr_SeeGuests (void)
Set_GetAndUpdatePrefsAboutUsrList (); Set_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingGuests (); Sco_SetAllowedScopesForListingGuests ();
Sco_GetScope ("ScopeUsr"); Sco_GetScope ("ScopeUsr",Hie_SYS);
/***** Get list of guests in current scope *****/ /***** Get list of guests in current scope *****/
Usr_GetGstsLst (Gbl.Scope.Current); Usr_GetGstsLst (Gbl.Scope.Current);
@ -5185,8 +5183,8 @@ void Usr_SeeStudents (void)
Set_GetAndUpdatePrefsAboutUsrList (); Set_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingStudents (); Sco_SetAllowedScopesForListingStudents ();
Sco_GetScope ("ScopeUsr"); Sco_GetScope ("ScopeUsr",Hie_CRS);
/***** Get groups to show ******/ /***** Get groups to show ******/
if (Gbl.Scope.Current == Hie_CRS) if (Gbl.Scope.Current == Hie_CRS)
@ -5348,8 +5346,7 @@ void Usr_SeeTeachers (void)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_CRS; Sco_GetScope ("ScopeUsr",Hie_CRS);
Sco_GetScope ("ScopeUsr");
/***** Get groups to show ******/ /***** Get groups to show ******/
if (Gbl.Scope.Current == Hie_CRS) if (Gbl.Scope.Current == Hie_CRS)
@ -5929,8 +5926,8 @@ void Usr_SeeGstClassPhotoPrn (void)
Set_GetAndUpdatePrefsAboutUsrList (); Set_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingGuests (); // Sco_SetScopesForListingGuests ();
Sco_GetScope ("ScopeUsr"); Sco_GetScope ("ScopeUsr",Hie_SYS);
/***** Get list of guests *****/ /***** Get list of guests *****/
Usr_GetGstsLst (Gbl.Scope.Current); Usr_GetGstsLst (Gbl.Scope.Current);
@ -5964,8 +5961,8 @@ void Usr_SeeStdClassPhotoPrn (void)
Set_GetAndUpdatePrefsAboutUsrList (); Set_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/ /***** Get scope *****/
Sco_SetScopesForListingStudents (); Sco_SetAllowedScopesForListingStudents ();
Sco_GetScope ("ScopeUsr"); Sco_GetScope ("ScopeUsr",Hie_CRS);
/****** Get groups to show ******/ /****** Get groups to show ******/
Grp_GetParCodsSeveralGrpsToShowUsrs (); Grp_GetParCodsSeveralGrpsToShowUsrs ();
@ -6013,8 +6010,7 @@ void Usr_SeeTchClassPhotoPrn (void)
1 << Hie_CTR | 1 << Hie_CTR |
1 << Hie_DEG | 1 << Hie_DEG |
1 << Hie_CRS; 1 << Hie_CRS;
Gbl.Scope.Default = Hie_CRS; Sco_GetScope ("ScopeUsr",Hie_CRS);
Sco_GetScope ("ScopeUsr");
/****** Get groups to show ******/ /****** Get groups to show ******/
Grp_GetParCodsSeveralGrpsToShowUsrs (); Grp_GetParCodsSeveralGrpsToShowUsrs ();