mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-16 13:44:06 +02:00
Version 14.72.5
This commit is contained in:
parent
4e431a9be9
commit
965a877598
|
@ -836,8 +836,8 @@ void ID_ConfirmUsrID (long UsrCod,const char *UsrID)
|
||||||
|
|
||||||
bool ID_ICanSeeTeacherID (struct UsrData *UsrDat)
|
bool ID_ICanSeeTeacherID (struct UsrData *UsrDat)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM)
|
||||||
// If I am an administrator of current degree, I only can see the users' IDs from current degree
|
// If I am an administrator of current degree, I only can see the users' IDs from current degree
|
||||||
return Usr_CheckIfUsrBelongsToDeg (UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod);
|
return Usr_CheckIfUsrBelongsToDeg (UsrDat->UsrCod,Gbl.CurrentDeg.Deg.DegCod);
|
||||||
return (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
return (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
}
|
}
|
||||||
|
|
|
@ -587,10 +587,10 @@ bool Acc_CheckIfICanEliminateAccount (bool ItsMe)
|
||||||
// A user logged as superuser can eliminate any user except her/him
|
// A user logged as superuser can eliminate any user except her/him
|
||||||
// Other users only can eliminate themselves
|
// Other users only can eliminate themselves
|
||||||
return (( ItsMe && // It's me
|
return (( ItsMe && // It's me
|
||||||
(Gbl.Usrs.Me.AvailableRoles & (1 << Rol_ROLE_SUPERUSER)) == 0) // I can not be superuser
|
(Gbl.Usrs.Me.AvailableRoles & (1 << Rol_ROLE_SYS_ADM)) == 0) // I can not be superuser
|
||||||
||
|
||
|
||||||
(!ItsMe && // It's not me
|
(!ItsMe && // It's not me
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)); // I am logged as superuser
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)); // I am logged as superuser
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -2163,10 +2163,10 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
|
||||||
/* ActNewAdmIns */{1337,-1,TabUsr,ActReqMdfSevUsr ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToIns ,NULL},
|
/* ActNewAdmIns */{1337,-1,TabUsr,ActReqMdfSevUsr ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToIns ,NULL},
|
||||||
/* ActRemAdmIns */{1338,-1,TabUsr,ActReqMdfSevUsr ,0x180,0x180,0x180,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmIns ,NULL},
|
/* ActRemAdmIns */{1338,-1,TabUsr,ActReqMdfSevUsr ,0x180,0x180,0x180,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmIns ,NULL},
|
||||||
|
|
||||||
/* ActNewAdmCtr */{1339,-1,TabUsr,ActReqMdfSevUsr ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToCtr ,NULL},
|
/* ActNewAdmCtr */{1339,-1,TabUsr,ActReqMdfSevUsr ,0x180,0x180,0x180,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToCtr ,NULL},
|
||||||
/* ActRemAdmCtr */{1340,-1,TabUsr,ActReqMdfSevUsr ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmCtr ,NULL},
|
/* ActRemAdmCtr */{1340,-1,TabUsr,ActReqMdfSevUsr ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmCtr ,NULL},
|
||||||
|
|
||||||
/* ActNewAdmDeg */{ 586,-1,TabUsr,ActReqMdfSevUsr ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToDeg ,NULL},
|
/* ActNewAdmDeg */{ 586,-1,TabUsr,ActReqMdfSevUsr ,0x1C0,0x1C0,0x1C0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_AddAdmToDeg ,NULL},
|
||||||
/* ActRemAdmDeg */{ 584,-1,TabUsr,ActReqMdfSevUsr ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmDeg ,NULL},
|
/* ActRemAdmDeg */{ 584,-1,TabUsr,ActReqMdfSevUsr ,0x1E0,0x1E0,0x1E0,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_RemAdmDeg ,NULL},
|
||||||
|
|
||||||
/* ActRcvFrmMdfUsrCrs*/{ 799,-1,TabUsr,ActReqMdfSevUsr ,0x1F0,0x1E0,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReceiveFormUsrsCrs ,NULL},
|
/* ActRcvFrmMdfUsrCrs*/{ 799,-1,TabUsr,ActReqMdfSevUsr ,0x1F0,0x1E0,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Enr_ReceiveFormUsrsCrs ,NULL},
|
||||||
|
|
|
@ -77,7 +77,7 @@ void Ann_ShowAllAnnouncements (void)
|
||||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
||||||
|
|
||||||
/***** Put link (form) to create a new announcement *****/
|
/***** Put link (form) to create a new announcement *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActWriAnn);
|
Act_FormStart (ActWriAnn);
|
||||||
Act_LinkFormSubmit (Txt_New_announcement,The_ClassFormul[Gbl.Prefs.Theme]);
|
Act_LinkFormSubmit (Txt_New_announcement,The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
|
|
@ -99,7 +99,7 @@ void Asg_SeeAssignments (void)
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Asg_PutFormToCreateNewAsg ();
|
Asg_PutFormToCreateNewAsg ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -317,7 +317,7 @@ static void Asg_ShowOneAssignment (long AsgCod)
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden);
|
Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -578,7 +578,7 @@ void Asg_GetListAssignments (void)
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
HiddenSubQuery[0] = '\0';
|
HiddenSubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1785,12 +1785,12 @@ unsigned Asg_GetNumCoursesWithAssignments (Sco_Scope_t Scope)
|
||||||
/***** Get number of courses with assignments from database *****/
|
/***** Get number of courses with assignments from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM assignments"
|
" FROM assignments"
|
||||||
" WHERE CrsCod>'0'");
|
" WHERE CrsCod>'0'");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (assignments.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (assignments.CrsCod))"
|
||||||
" FROM centres,degrees,courses,assignments"
|
" FROM centres,degrees,courses,assignments"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -1800,7 +1800,7 @@ unsigned Asg_GetNumCoursesWithAssignments (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=assignments.CrsCod",
|
" AND courses.CrsCod=assignments.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (assignments.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (assignments.CrsCod))"
|
||||||
" FROM degrees,courses,assignments"
|
" FROM degrees,courses,assignments"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -1809,7 +1809,7 @@ unsigned Asg_GetNumCoursesWithAssignments (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=assignments.CrsCod",
|
" AND courses.CrsCod=assignments.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (assignments.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (assignments.CrsCod))"
|
||||||
" FROM courses,assignments"
|
" FROM courses,assignments"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -1817,7 +1817,7 @@ unsigned Asg_GetNumCoursesWithAssignments (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=assignments.CrsCod",
|
" AND courses.CrsCod=assignments.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM assignments"
|
" FROM assignments"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -1856,12 +1856,12 @@ unsigned Asg_GetNumAssignments (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
/***** Get number of assignments from database *****/
|
/***** Get number of assignments from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM assignments"
|
" FROM assignments"
|
||||||
" WHERE CrsCod>'0'");
|
" WHERE CrsCod>'0'");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(assignments.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(assignments.NumNotif)"
|
||||||
" FROM centres,degrees,courses,assignments"
|
" FROM centres,degrees,courses,assignments"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -1870,7 +1870,7 @@ unsigned Asg_GetNumAssignments (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=assignments.CrsCod",
|
" AND courses.CrsCod=assignments.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(assignments.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(assignments.NumNotif)"
|
||||||
" FROM degrees,courses,assignments"
|
" FROM degrees,courses,assignments"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -1878,14 +1878,14 @@ unsigned Asg_GetNumAssignments (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=assignments.CrsCod",
|
" AND courses.CrsCod=assignments.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(assignments.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(assignments.NumNotif)"
|
||||||
" FROM courses,assignments"
|
" FROM courses,assignments"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
" AND courses.CrsCod=assignments.CrsCod",
|
" AND courses.CrsCod=assignments.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM assignments"
|
" FROM assignments"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
|
|
@ -123,7 +123,7 @@ void Att_SeeAttEvents (void)
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Att_PutFormToCreateNewAttEvent ();
|
Att_PutFormToCreateNewAttEvent ();
|
||||||
Att_PutFormToListStds ();
|
Att_PutFormToListStds ();
|
||||||
break;
|
break;
|
||||||
|
@ -335,7 +335,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Att_PutFormsToRemEditOneAttEvent (Att->AttCod,Att->Hidden);
|
Att_PutFormsToRemEditOneAttEvent (Att->AttCod,Att->Hidden);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -563,7 +563,7 @@ static void Att_GetListAttEvents (Att_OrderTime_t Order)
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
HiddenSubQuery[0] = '\0';
|
HiddenSubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1714,12 +1714,12 @@ unsigned Att_GetNumCoursesWithAttEvents (Sco_Scope_t Scope)
|
||||||
/***** Get number of courses with attendance events from database *****/
|
/***** Get number of courses with attendance events from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod>'0'");
|
" WHERE CrsCod>'0'");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (att_events.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (att_events.CrsCod))"
|
||||||
" FROM centres,degrees,courses,att_events"
|
" FROM centres,degrees,courses,att_events"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -1729,7 +1729,7 @@ unsigned Att_GetNumCoursesWithAttEvents (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=att_events.CrsCod",
|
" AND courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (att_events.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (att_events.CrsCod))"
|
||||||
" FROM degrees,courses,att_events"
|
" FROM degrees,courses,att_events"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -1738,7 +1738,7 @@ unsigned Att_GetNumCoursesWithAttEvents (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=att_events.CrsCod",
|
" AND courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (att_events.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (att_events.CrsCod))"
|
||||||
" FROM courses,att_events"
|
" FROM courses,att_events"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -1746,7 +1746,7 @@ unsigned Att_GetNumCoursesWithAttEvents (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=att_events.CrsCod",
|
" AND courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -1785,12 +1785,12 @@ unsigned Att_GetNumAttEvents (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
/***** Get number of attendance events from database *****/
|
/***** Get number of attendance events from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod>'0'");
|
" WHERE CrsCod>'0'");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(att_events.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(att_events.NumNotif)"
|
||||||
" FROM centres,degrees,courses,att_events"
|
" FROM centres,degrees,courses,att_events"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -1799,7 +1799,7 @@ unsigned Att_GetNumAttEvents (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=att_events.CrsCod",
|
" AND courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(att_events.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(att_events.NumNotif)"
|
||||||
" FROM degrees,courses,att_events"
|
" FROM degrees,courses,att_events"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -1807,14 +1807,14 @@ unsigned Att_GetNumAttEvents (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=att_events.CrsCod",
|
" AND courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(att_events.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(att_events.NumNotif)"
|
||||||
" FROM courses,att_events"
|
" FROM courses,att_events"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
" AND courses.CrsCod=att_events.CrsCod",
|
" AND courses.CrsCod=att_events.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM att_events"
|
" FROM att_events"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -1876,7 +1876,7 @@ void Att_SeeOneAttEvent (void)
|
||||||
Att_ListAttOnlyMeAsStudent (&Att);
|
Att_ListAttOnlyMeAsStudent (&Att);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
/***** Show list of students *****/
|
/***** Show list of students *****/
|
||||||
Att_ListAttStudents (&Att);
|
Att_ListAttStudents (&Att);
|
||||||
break;
|
break;
|
||||||
|
@ -1963,7 +1963,7 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att)
|
||||||
Grp_ShowFormToSelectSeveralGroups (ActSeeOneAtt);
|
Grp_ShowFormToSelectSeveralGroups (ActSeeOneAtt);
|
||||||
|
|
||||||
/***** Get and order list of students in this course *****/
|
/***** Get and order list of students in this course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstStds.NumUsrs)
|
if (Gbl.Usrs.LstStds.NumUsrs)
|
||||||
{
|
{
|
||||||
|
@ -2294,7 +2294,7 @@ void Att_RegisterStudentsInAttEvent (void)
|
||||||
|
|
||||||
/***** 1. Get list of students in the groups selected: Gbl.Usrs.LstStds *****/
|
/***** 1. Get list of students in the groups selected: Gbl.Usrs.LstStds *****/
|
||||||
/* Get list of students in the groups selected */
|
/* Get list of students in the groups selected */
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstStds.NumUsrs) // If there are students in the groups selected...
|
if (Gbl.Usrs.LstStds.NumUsrs) // If there are students in the groups selected...
|
||||||
{
|
{
|
||||||
|
@ -2637,7 +2637,7 @@ void Usr_ReqListAttendanceStdsCrs (void)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActReqLstAttStd);
|
Usr_ShowFormsToSelectUsrListType (ActReqLstAttStd);
|
||||||
|
|
||||||
/***** Get and order lists of users from current course *****/
|
/***** Get and order lists of users from current course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstStds.NumUsrs)
|
if (Gbl.Usrs.LstStds.NumUsrs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@ void Ban_SeeBanners (void)
|
||||||
" ORDER BY ShortName");
|
" ORDER BY ShortName");
|
||||||
|
|
||||||
/***** Put banner (form) to edit banners *****/
|
/***** Put banner (form) to edit banners *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Ban_PutFormToEditBanners ();
|
Ban_PutFormToEditBanners ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
|
|
@ -113,7 +113,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
|
||||||
/***** Get centres with pending degrees *****/
|
/***** Get centres with pending degrees *****/
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_CTR_ADMIN:
|
case Rol_ROLE_CTR_ADM:
|
||||||
sprintf (Query,"SELECT degrees.CtrCod,COUNT(*)"
|
sprintf (Query,"SELECT degrees.CtrCod,COUNT(*)"
|
||||||
" FROM degrees,ctr_admin,centres"
|
" FROM degrees,ctr_admin,centres"
|
||||||
" WHERE (degrees.Status & %u)<>0"
|
" WHERE (degrees.Status & %u)<>0"
|
||||||
|
@ -122,7 +122,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
|
||||||
" GROUP BY degrees.CtrCod ORDER BY centres.ShortName",
|
" GROUP BY degrees.CtrCod ORDER BY centres.ShortName",
|
||||||
(unsigned) Deg_STATUS_BIT_PENDING,Gbl.Usrs.Me.UsrDat.UsrCod);
|
(unsigned) Deg_STATUS_BIT_PENDING,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT degrees.CtrCod,COUNT(*)"
|
sprintf (Query,"SELECT degrees.CtrCod,COUNT(*)"
|
||||||
" FROM degrees,centres"
|
" FROM degrees,centres"
|
||||||
" WHERE (degrees.Status & %u)<>0"
|
" WHERE (degrees.Status & %u)<>0"
|
||||||
|
@ -173,7 +173,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
|
||||||
" vertical-align:middle; background-color:%s;\">"
|
" vertical-align:middle; background-color:%s;\">"
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||||
BgColor,Ctr.WWW,Ctr.FullName);
|
BgColor,Ctr.WWW,Ctr.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Ctr.CtrCod,Ctr.ShortName,
|
Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -276,9 +276,9 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
Lay_PutLinkToPrintView2 ();
|
Lay_PutLinkToPrintView2 ();
|
||||||
|
|
||||||
/* Links to upload logo and photo */
|
/* Links to upload logo and photo */
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
{
|
{
|
||||||
Log_PutFormToChangeLogo (Sco_SCOPE_CENTRE);
|
Log_PutFormToChangeLogo (Sco_SCOPE_CTR);
|
||||||
Ctr_PutFormToChangeCtrPhoto (PhotoExists);
|
Ctr_PutFormToChangeCtrPhoto (PhotoExists);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
||||||
Gbl.CurrentCtr.Ctr.WWW,
|
Gbl.CurrentCtr.Ctr.WWW,
|
||||||
Gbl.CurrentCtr.Ctr.FullName);
|
Gbl.CurrentCtr.Ctr.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Gbl.CurrentCtr.Ctr.CtrCod,
|
Log_DrawLogo (Sco_SCOPE_CTR,Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Gbl.CurrentCtr.Ctr.ShortName,64,NULL,true);
|
Gbl.CurrentCtr.Ctr.ShortName,64,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"<br />%s",Gbl.CurrentCtr.Ctr.FullName);
|
fprintf (Gbl.F.Out,"<br />%s",Gbl.CurrentCtr.Ctr.FullName);
|
||||||
if (PutLink)
|
if (PutLink)
|
||||||
|
@ -331,7 +331,7 @@ static void Ctr_Configuration (bool PrintView)
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/* Photo attribution */
|
/* Photo attribution */
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER && !PrintView)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM && !PrintView)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"2\""
|
"<td colspan=\"2\""
|
||||||
|
@ -514,7 +514,7 @@ void Ctr_ShowCtrsOfCurrentIns (void)
|
||||||
Deg_WriteMenuAllCourses (ActSeeIns,ActSeeCtr,ActUnk,ActUnk);
|
Deg_WriteMenuAllCourses (ActSeeIns,ActSeeCtr,ActUnk,ActUnk);
|
||||||
|
|
||||||
/***** Put link (form) to edit centres in current institution *****/
|
/***** Put link (form) to edit centres in current institution *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST__)
|
||||||
Lay_PutFormToEdit (ActEdiCtr);
|
Lay_PutFormToEdit (ActEdiCtr);
|
||||||
|
|
||||||
/***** List centres *****/
|
/***** List centres *****/
|
||||||
|
@ -602,7 +602,7 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr)
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||||
TxtClass,BgColor,
|
TxtClass,BgColor,
|
||||||
Ctr->WWW,Ctr->FullName);
|
Ctr->WWW,Ctr->FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Ctr->CtrCod,Ctr->ShortName,
|
Log_DrawLogo (Sco_SCOPE_CTR,Ctr->CtrCod,Ctr->ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -1149,13 +1149,13 @@ static void Ctr_ListCentresForEdition (void)
|
||||||
fprintf (Gbl.F.Out,"<td title=\"%s\""
|
fprintf (Gbl.F.Out,"<td title=\"%s\""
|
||||||
" style=\"width:20px; text-align:left;\">",
|
" style=\"width:20px; text-align:left;\">",
|
||||||
Ctr->FullName);
|
Ctr->FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Ctr->CtrCod,Ctr->ShortName,16,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_CTR,Ctr->CtrCod,Ctr->ShortName,16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/* Institution */
|
/* Institution */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\""
|
fprintf (Gbl.F.Out,"<td class=\"DAT\""
|
||||||
" style=\"text-align:left; vertical-align:middle;\">");
|
" style=\"text-align:left; vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER) // I can select institution
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM) // I can select institution
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgCtrIns);
|
Act_FormStart (ActChgCtrIns);
|
||||||
Ctr_PutParamOtherCtrCod (Ctr->CtrCod);
|
Ctr_PutParamOtherCtrCod (Ctr->CtrCod);
|
||||||
|
@ -1283,7 +1283,7 @@ static void Ctr_ListCentresForEdition (void)
|
||||||
/* Centre status */
|
/* Centre status */
|
||||||
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status);
|
StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status);
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left; vertical-align:middle;\">");
|
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left; vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN &&
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM &&
|
||||||
StatusTxt == Ctr_STATUS_PENDING)
|
StatusTxt == Ctr_STATUS_PENDING)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgCtrSta);
|
Act_FormStart (ActChgCtrSta);
|
||||||
|
@ -1331,7 +1331,7 @@ static void Ctr_ListCentresForEdition (void)
|
||||||
|
|
||||||
static bool Ctr_CheckIfICanEdit (struct Centre *Ctr)
|
static bool Ctr_CheckIfICanEdit (struct Centre *Ctr)
|
||||||
{
|
{
|
||||||
return (bool) (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN || // I am an institution administrator or higher
|
return (bool) (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM || // I am an institution administrator or higher
|
||||||
((Ctr->Status & Ctr_STATUS_BIT_PENDING) != 0 && // Centre is not yet activated
|
((Ctr->Status & Ctr_STATUS_BIT_PENDING) != 0 && // Centre is not yet activated
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod)); // I am the requester
|
Gbl.Usrs.Me.UsrDat.UsrCod == Ctr->RequesterUsrCod)); // I am the requester
|
||||||
}
|
}
|
||||||
|
@ -1745,7 +1745,7 @@ void Ctr_ChangeCtrStatus (void)
|
||||||
|
|
||||||
void Ctr_RequestLogo (void)
|
void Ctr_RequestLogo (void)
|
||||||
{
|
{
|
||||||
Log_RequestLogo (Sco_SCOPE_CENTRE);
|
Log_RequestLogo (Sco_SCOPE_CTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1754,7 +1754,7 @@ void Ctr_RequestLogo (void)
|
||||||
|
|
||||||
void Ctr_ReceiveLogo (void)
|
void Ctr_ReceiveLogo (void)
|
||||||
{
|
{
|
||||||
Log_ReceiveLogo (Sco_SCOPE_CENTRE);
|
Log_ReceiveLogo (Sco_SCOPE_CTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1918,9 +1918,9 @@ static void Ctr_PutFormToCreateCentre (void)
|
||||||
Ctr = &Gbl.Ctrs.EditingCtr;
|
Ctr = &Gbl.Ctrs.EditingCtr;
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
Act_FormStart (ActNewCtr);
|
Act_FormStart (ActNewCtr);
|
||||||
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST)
|
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST__)
|
||||||
Act_FormStart (ActReqCtr);
|
Act_FormStart (ActReqCtr);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("You can not edit centres.");
|
Lay_ShowErrorAndExit ("You can not edit centres.");
|
||||||
|
@ -1946,7 +1946,7 @@ static void Ctr_PutFormToCreateCentre (void)
|
||||||
|
|
||||||
/***** Centre logo *****/
|
/***** Centre logo *****/
|
||||||
fprintf (Gbl.F.Out,"<td style=\"width:20px; text-align:left;\">");
|
fprintf (Gbl.F.Out,"<td style=\"width:20px; text-align:left;\">");
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,-1L,"",16,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_CTR,-1L,"",16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/***** Institution *****/
|
/***** Institution *****/
|
||||||
|
|
|
@ -39,11 +39,12 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 14.72.4 (2015/02/01)"
|
#define Log_PLATFORM_VERSION "SWAD 14.72.5 (2015/02/01)"
|
||||||
|
|
||||||
// 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 | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 14.72.5: Feb 01, 2015 Changed related to administrators. (176805 lines)
|
||||||
Version 14.72.4: Feb 01, 2015 Refactoring of registering and removing admins. (176787 lines)
|
Version 14.72.4: Feb 01, 2015 Refactoring of registering and removing admins. (176787 lines)
|
||||||
Version 14.72.3: Feb 01, 2015 Refactoring of registering and removing admins. (177139 lines)
|
Version 14.72.3: Feb 01, 2015 Refactoring of registering and removing admins. (177139 lines)
|
||||||
Version 14.72.2: Feb 01, 2015 Refactoring of registering and removing admins. (177496 lines)
|
Version 14.72.2: Feb 01, 2015 Refactoring of registering and removing admins. (177496 lines)
|
||||||
|
|
|
@ -81,7 +81,7 @@ void Cht_ShowChatRooms (void)
|
||||||
/***** List available chat rooms *****/
|
/***** List available chat rooms *****/
|
||||||
Cht_ShowListOfAvailableChatRooms ();
|
Cht_ShowListOfAvailableChatRooms ();
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Cht_ShowListOfChatRoomsWithUsrs ();
|
Cht_ShowListOfChatRoomsWithUsrs ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
sprintf (ThisRoomShortName,"%s",Deg.ShortName);
|
sprintf (ThisRoomShortName,"%s",Deg.ShortName);
|
||||||
sprintf (ThisRoomFullName,"%s %s",Txt_Degree,Deg.ShortName);
|
sprintf (ThisRoomFullName,"%s %s",Txt_Degree,Deg.ShortName);
|
||||||
Cht_WriteLinkToChat1 (ThisRoomCode,ThisRoomShortName,ThisRoomFullName,1,IsLastItemInLevel);
|
Cht_WriteLinkToChat1 (ThisRoomCode,ThisRoomShortName,ThisRoomFullName,1,IsLastItemInLevel);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,16,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,16,NULL,true);
|
||||||
Cht_WriteLinkToChat2 (ThisRoomCode,ThisRoomFullName);
|
Cht_WriteLinkToChat2 (ThisRoomCode,ThisRoomFullName);
|
||||||
|
|
||||||
/* Get my courses in this degree from database */
|
/* Get my courses in this degree from database */
|
||||||
|
|
110
swad_connected.c
110
swad_connected.c
|
@ -81,8 +81,8 @@ void Con_ShowConnectedUsrs (void)
|
||||||
/***** Put form to update connected users *****/
|
/***** Put form to update connected users *****/
|
||||||
Act_FormStart (ActLstCon);
|
Act_FormStart (ActLstCon);
|
||||||
/* Users connected belonging to the platform, current degree or current course */
|
/* Users connected belonging to the platform, current degree or current course */
|
||||||
Gbl.Scope.Current = Sco_SCOPE_COURSE;
|
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div class=\"%s\">%s: ",
|
fprintf (Gbl.F.Out,"<div class=\"%s\">%s: ",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
|
@ -335,8 +335,8 @@ void Con_ShowGlobalConnectedUsrs (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
WithoutCoursesTotal,
|
WithoutCoursesTotal,
|
||||||
(WithoutCoursesTotal == 1) ? Txt_ROLES_SINGULAR_abc[Rol_ROLE_GUEST][Usr_SEX_UNKNOWN] :
|
(WithoutCoursesTotal == 1) ? Txt_ROLES_SINGULAR_abc[Rol_ROLE_GUEST__][Usr_SEX_UNKNOWN] :
|
||||||
Txt_ROLES_PLURAL_abc [Rol_ROLE_GUEST][Usr_SEX_UNKNOWN]);
|
Txt_ROLES_PLURAL_abc [Rol_ROLE_GUEST__][Usr_SEX_UNKNOWN]);
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
fprintf (Gbl.F.Out,"</table>"
|
fprintf (Gbl.F.Out,"</table>"
|
||||||
|
@ -372,21 +372,21 @@ void Con_ShowConnectedUsrsBelongingToScope (void)
|
||||||
|
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show connected users in the whole platform
|
case Sco_SCOPE_SYS: // Show connected users in the whole platform
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show connected users in the current institution
|
case Sco_SCOPE_INS: // Show connected users in the current institution
|
||||||
if (Gbl.CurrentIns.Ins.InsCod <= 0) // There is no institution selected
|
if (Gbl.CurrentIns.Ins.InsCod <= 0) // There is no institution selected
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show connected users in the current centre
|
case Sco_SCOPE_CTR: // Show connected users in the current centre
|
||||||
if (Gbl.CurrentCtr.Ctr.CtrCod <= 0) // There is no centre selected
|
if (Gbl.CurrentCtr.Ctr.CtrCod <= 0) // There is no centre selected
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show connected users in the current degree
|
case Sco_SCOPE_DEG: // Show connected users in the current degree
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod <= 0) // There is no degree selected
|
if (Gbl.CurrentDeg.Deg.DegCod <= 0) // There is no degree selected
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show connected users in the current course
|
case Sco_SCOPE_CRS: // Show connected users in the current course
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod <= 0) // There is no course selected
|
if (Gbl.CurrentCrs.Crs.CrsCod <= 0) // There is no course selected
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
@ -398,19 +398,19 @@ void Con_ShowConnectedUsrsBelongingToScope (void)
|
||||||
/***** Number of connected users who belong to current course *****/
|
/***** Number of connected users who belong to current course *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show connected users in the whole platform
|
case Sco_SCOPE_SYS: // Show connected users in the whole platform
|
||||||
strcpy (LocationName,Cfg_PLATFORM_SHORT_NAME);
|
strcpy (LocationName,Cfg_PLATFORM_SHORT_NAME);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show connected users in the current institution
|
case Sco_SCOPE_INS: // Show connected users in the current institution
|
||||||
strcpy (LocationName,Gbl.CurrentIns.Ins.ShortName);
|
strcpy (LocationName,Gbl.CurrentIns.Ins.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show connected users in the current centre
|
case Sco_SCOPE_CTR: // Show connected users in the current centre
|
||||||
strcpy (LocationName,Gbl.CurrentCtr.Ctr.ShortName);
|
strcpy (LocationName,Gbl.CurrentCtr.Ctr.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show connected users in the current degree
|
case Sco_SCOPE_DEG: // Show connected users in the current degree
|
||||||
strcpy (LocationName,Gbl.CurrentDeg.Deg.ShortName);
|
strcpy (LocationName,Gbl.CurrentDeg.Deg.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show connected users in the current course
|
case Sco_SCOPE_CRS: // Show connected users in the current course
|
||||||
strcpy (LocationName,Gbl.CurrentCrs.Crs.ShortName);
|
strcpy (LocationName,Gbl.CurrentCrs.Crs.ShortName);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -472,7 +472,7 @@ void Con_ShowConnectedUsrsBelongingToScope (void)
|
||||||
|
|
||||||
static void Con_ComputeConnectedUsrsOfTypeBelongingToCurrentCrs (Rol_Role_t Role)
|
static void Con_ComputeConnectedUsrsOfTypeBelongingToCurrentCrs (Rol_Role_t Role)
|
||||||
{
|
{
|
||||||
Gbl.Scope.Current = Sco_SCOPE_COURSE;
|
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
||||||
|
|
||||||
/***** Get number of connected users who belong to current course *****/
|
/***** Get number of connected users who belong to current course *****/
|
||||||
switch (Role)
|
switch (Role)
|
||||||
|
@ -489,7 +489,7 @@ static void Con_ComputeConnectedUsrsOfTypeBelongingToCurrentCrs (Rol_Role_t Role
|
||||||
|
|
||||||
/***** List connected users belonging to this course *****/
|
/***** List connected users belonging to this course *****/
|
||||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
if (Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Con_ComputeConnectedUsrsWithARoleCurrentCrsOneByOne (Role);
|
Con_ComputeConnectedUsrsWithARoleCurrentCrsOneByOne (Role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,28 +519,28 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnMainZone (
|
||||||
/***** List connected users belonging to this location *****/
|
/***** List connected users belonging to this location *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show connected users in the whole platform
|
case Sco_SCOPE_SYS: // Show connected users in the whole platform
|
||||||
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SYS_ADM)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show connected users in the current institution
|
case Sco_SCOPE_INS: // Show connected users in the current institution
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADMIN ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show connected users in the current centre
|
case Sco_SCOPE_CTR: // Show connected users in the current centre
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADMIN ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show connected users in the current degree
|
case Sco_SCOPE_DEG: // Show connected users in the current degree
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show connected users in the current course
|
case Sco_SCOPE_CRS: // Show connected users in the current course
|
||||||
if (!(Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
if (!(Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -596,28 +596,28 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnRightColum
|
||||||
/***** List connected users belonging to this location *****/
|
/***** List connected users belonging to this location *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show connected users in the whole platform
|
case Sco_SCOPE_SYS: // Show connected users in the whole platform
|
||||||
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SYS_ADM)
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show connected users in the current institution
|
case Sco_SCOPE_INS: // Show connected users in the current institution
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADMIN ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show connected users in the current centre
|
case Sco_SCOPE_CTR: // Show connected users in the current centre
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADMIN ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show connected users in the current degree
|
case Sco_SCOPE_DEG: // Show connected users in the current degree
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show connected users in the current course
|
case Sco_SCOPE_CRS: // Show connected users in the current course
|
||||||
if (!(Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
if (!(Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -635,7 +635,7 @@ static void Con_ShowConnectedUsrsWithARoleBelongingToCurrentLocationOnRightColum
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"3\" style=\"text-align:center;\">");
|
"<td colspan=\"3\" style=\"text-align:center;\">");
|
||||||
Act_FormStartId (ActLstCon,Gbl.FormId);
|
Act_FormStartId (ActLstCon,Gbl.FormId);
|
||||||
Sco_PutParamScope (Sco_SCOPE_COURSE);
|
Sco_PutParamScope (Sco_SCOPE_CRS);
|
||||||
Act_LinkFormSubmitId (Txt_Connected_users,The_ClassConnected[Gbl.Prefs.Theme],Gbl.FormId);
|
Act_LinkFormSubmitId (Txt_Connected_users,The_ClassConnected[Gbl.Prefs.Theme],Gbl.FormId);
|
||||||
fprintf (Gbl.F.Out,"<img src=\"%s/ellipsis32x32.gif\""
|
fprintf (Gbl.F.Out,"<img src=\"%s/ellipsis32x32.gif\""
|
||||||
" alt=\"%s\" class=\"ICON32x32\" /></a>"
|
" alt=\"%s\" class=\"ICON32x32\" /></a>"
|
||||||
|
@ -696,7 +696,7 @@ static unsigned Con_GetConnectedGuestsTotal (void)
|
||||||
/***** Get number of connected users not belonging to any course *****/
|
/***** Get number of connected users not belonging to any course *****/
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM connected"
|
sprintf (Query,"SELECT COUNT(*) FROM connected"
|
||||||
" WHERE RoleInLastCrs='%u'",
|
" WHERE RoleInLastCrs='%u'",
|
||||||
(unsigned) Rol_ROLE_GUEST);
|
(unsigned) Rol_ROLE_GUEST__);
|
||||||
return (unsigned) DB_QueryCOUNT (Query,"can not get number of connected users who not belong to any course");
|
return (unsigned) DB_QueryCOUNT (Query,"can not get number of connected users who not belong to any course");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -752,7 +752,7 @@ static unsigned Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Ro
|
||||||
/***** Get number of connected users who belong to current course from database *****/
|
/***** Get number of connected users who belong to current course from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show connected users in the whole platform
|
case Sco_SCOPE_SYS: // Show connected users in the whole platform
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
||||||
" FROM connected,usr_data"
|
" FROM connected,usr_data"
|
||||||
|
@ -765,7 +765,7 @@ static unsigned Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Ro
|
||||||
" AND connected.UsrCod=usr_data.UsrCod",
|
" AND connected.UsrCod=usr_data.UsrCod",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show connected users in the current institution
|
case Sco_SCOPE_INS: // Show connected users in the current institution
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
||||||
" FROM centres,degrees,courses,crs_usr,connected,usr_data"
|
" FROM centres,degrees,courses,crs_usr,connected,usr_data"
|
||||||
|
@ -789,7 +789,7 @@ static unsigned Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Ro
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show connected users in the current centre
|
case Sco_SCOPE_CTR: // Show connected users in the current centre
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
||||||
" FROM degrees,courses,crs_usr,connected,usr_data"
|
" FROM degrees,courses,crs_usr,connected,usr_data"
|
||||||
|
@ -811,7 +811,7 @@ static unsigned Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Ro
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show connected users in the current degree
|
case Sco_SCOPE_DEG: // Show connected users in the current degree
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
||||||
" FROM courses,crs_usr,connected,usr_data"
|
" FROM courses,crs_usr,connected,usr_data"
|
||||||
|
@ -831,7 +831,7 @@ static unsigned Con_GetNumConnectedUsrsWithARoleBelongingCurrentLocation (Rol_Ro
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show connected users in the current course
|
case Sco_SCOPE_CRS: // Show connected users in the current course
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "any role"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
sprintf (Query,"SELECT COUNT(DISTINCT connected.UsrCod),COUNT(DISTINCT usr_data.Sex),MIN(usr_data.Sex)"
|
||||||
" FROM crs_usr,connected,usr_data"
|
" FROM crs_usr,connected,usr_data"
|
||||||
|
@ -1058,12 +1058,12 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
unsigned Minutes;
|
unsigned Minutes;
|
||||||
unsigned Seconds;
|
unsigned Seconds;
|
||||||
bool PutLinkToRecord = (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
|
bool PutLinkToRecord = (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
|
||||||
Gbl.Scope.Current == Sco_SCOPE_COURSE);
|
Gbl.Scope.Current == Sco_SCOPE_CRS);
|
||||||
|
|
||||||
/***** Get connected users who belong to current location from database *****/
|
/***** Get connected users who belong to current location from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show connected users in the whole platform
|
case Sco_SCOPE_SYS: // Show connected users in the whole platform
|
||||||
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
||||||
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
||||||
" FROM connected,crs_usr,usr_data"
|
" FROM connected,crs_usr,usr_data"
|
||||||
|
@ -1072,7 +1072,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
" AND connected.UsrCod=usr_data.UsrCod ORDER BY Dif",
|
" AND connected.UsrCod=usr_data.UsrCod ORDER BY Dif",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show connected users in the current institution
|
case Sco_SCOPE_INS: // Show connected users in the current institution
|
||||||
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
||||||
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
||||||
" FROM centres,degrees,courses,crs_usr,connected,usr_data"
|
" FROM centres,degrees,courses,crs_usr,connected,usr_data"
|
||||||
|
@ -1086,7 +1086,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show connected users in the current centre
|
case Sco_SCOPE_CTR: // Show connected users in the current centre
|
||||||
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
||||||
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
||||||
" FROM degrees,courses,crs_usr,connected,usr_data"
|
" FROM degrees,courses,crs_usr,connected,usr_data"
|
||||||
|
@ -1099,7 +1099,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show connected users in the current degree
|
case Sco_SCOPE_DEG: // Show connected users in the current degree
|
||||||
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
sprintf (Query,"SELECT DISTINCTROW connected.UsrCod,connected.LastCrsCod,"
|
||||||
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
||||||
" FROM courses,crs_usr,connected,usr_data"
|
" FROM courses,crs_usr,connected,usr_data"
|
||||||
|
@ -1111,7 +1111,7 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show connected users in the current course
|
case Sco_SCOPE_CRS: // Show connected users in the current course
|
||||||
sprintf (Query,"SELECT connected.UsrCod,connected.LastCrsCod,"
|
sprintf (Query,"SELECT connected.UsrCod,connected.LastCrsCod,"
|
||||||
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
"UNIX_TIMESTAMP()-UNIX_TIMESTAMP(connected.LastTime) AS Dif"
|
||||||
" FROM crs_usr,connected,usr_data"
|
" FROM crs_usr,connected,usr_data"
|
||||||
|
|
|
@ -99,7 +99,7 @@ void Cty_SeeCtyWithPendingInss (void)
|
||||||
/***** Get countries with pending institutions *****/
|
/***** Get countries with pending institutions *****/
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT institutions.CtyCod,COUNT(*)"
|
sprintf (Query,"SELECT institutions.CtyCod,COUNT(*)"
|
||||||
" FROM institutions,countries"
|
" FROM institutions,countries"
|
||||||
" WHERE (institutions.Status & %u)<>0"
|
" WHERE (institutions.Status & %u)<>0"
|
||||||
|
@ -287,7 +287,7 @@ static void Cty_Configuration (bool PrintView)
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
/* Map attribution */
|
/* Map attribution */
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER && !PrintView)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM && !PrintView)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"2\""
|
"<td colspan=\"2\""
|
||||||
|
@ -513,7 +513,7 @@ void Cty_ListCountries2 (void)
|
||||||
const char *BgColor;
|
const char *BgColor;
|
||||||
|
|
||||||
/***** Put link (form) to edit countries *****/
|
/***** Put link (form) to edit countries *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_PutFormToEdit (ActEdiCty);
|
Lay_PutFormToEdit (ActEdiCty);
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
@ -665,9 +665,9 @@ void Cty_ListCountries2 (void)
|
||||||
NumInssWithCountry += NumInssInOtherCtys;
|
NumInssWithCountry += NumInssInOtherCtys;
|
||||||
|
|
||||||
/***** Write institutions with no country *****/
|
/***** Write institutions with no country *****/
|
||||||
NumStds = Sta_GetTotalNumberOfUsers (Sco_SCOPE_PLATFORM,Rol_ROLE_STUDENT);
|
NumStds = Sta_GetTotalNumberOfUsers (Sco_SCOPE_SYS,Rol_ROLE_STUDENT);
|
||||||
NumTchs = Sta_GetTotalNumberOfUsers (Sco_SCOPE_PLATFORM,Rol_ROLE_TEACHER);
|
NumTchs = Sta_GetTotalNumberOfUsers (Sco_SCOPE_SYS,Rol_ROLE_TEACHER);
|
||||||
NumUsrs = Sta_GetTotalNumberOfUsers (Sco_SCOPE_PLATFORM,Rol_ROLE_UNKNOWN); // NumUsrs >= NumStds + NumTchs
|
NumUsrs = Sta_GetTotalNumberOfUsers (Sco_SCOPE_SYS,Rol_ROLE_UNKNOWN); // NumUsrs >= NumStds + NumTchs
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td></td>"
|
"<td></td>"
|
||||||
"<td class=\"DAT\" style=\"text-align:left;\">"
|
"<td class=\"DAT\" style=\"text-align:left;\">"
|
||||||
|
|
|
@ -189,7 +189,7 @@ static void Crs_Configuration (bool PrintView)
|
||||||
Lay_PutLinkToPrintView2 ();
|
Lay_PutLinkToPrintView2 ();
|
||||||
|
|
||||||
/* Link to request enrollment in the current course */
|
/* Link to request enrollment in the current course */
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_GUEST ||
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_GUEST__ ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_VISITOR)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_VISITOR)
|
||||||
Enr_PutLinkToRequestSignUp ();
|
Enr_PutLinkToRequestSignUp ();
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ static void Crs_Configuration (bool PrintView)
|
||||||
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
||||||
Gbl.CurrentDeg.Deg.WWW,
|
Gbl.CurrentDeg.Deg.WWW,
|
||||||
Gbl.CurrentDeg.Deg.FullName);
|
Gbl.CurrentDeg.Deg.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Gbl.CurrentDeg.Deg.DegCod,
|
Log_DrawLogo (Sco_SCOPE_DEG,Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentDeg.Deg.ShortName,64,NULL,true);
|
Gbl.CurrentDeg.Deg.ShortName,64,NULL,true);
|
||||||
if (PutLink)
|
if (PutLink)
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
@ -670,7 +670,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Ins_PutParamInsCod (Ins.InsCod);
|
Ins_PutParamInsCod (Ins.InsCod);
|
||||||
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt),
|
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt),
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins.InsCod,Ins.ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
Highlight = (Gbl.CurrentCtr.Ctr.CtrCod <= 0 &&
|
Highlight = (Gbl.CurrentCtr.Ctr.CtrCod <= 0 &&
|
||||||
Gbl.CurrentIns.Ins.InsCod == Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod == Ins.InsCod);
|
||||||
|
@ -708,7 +708,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Ctr_PutParamCtrCod (Ctr.CtrCod);
|
Ctr_PutParamCtrCod (Ctr.CtrCod);
|
||||||
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt),
|
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt),
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Ctr.CtrCod,Ctr.ShortName,
|
Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShortName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
Highlight = (Gbl.CurrentDeg.Deg.DegCod <= 0 &&
|
Highlight = (Gbl.CurrentDeg.Deg.DegCod <= 0 &&
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod == Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod == Ctr.CtrCod);
|
||||||
|
@ -746,7 +746,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
Deg_PutParamDegCod (Deg.DegCod);
|
Deg_PutParamDegCod (Deg.DegCod);
|
||||||
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt),
|
Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt),
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
Highlight = (Gbl.CurrentCrs.Crs.CrsCod <= 0 &&
|
Highlight = (Gbl.CurrentCrs.Crs.CrsCod <= 0 &&
|
||||||
Gbl.CurrentDeg.Deg.DegCod == Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod == Deg.DegCod);
|
||||||
|
@ -957,7 +957,7 @@ void Crs_ShowCrssOfCurrentDeg (void)
|
||||||
Deg_WriteMenuAllCourses (ActSeeIns,ActSeeCtr,ActSeeDeg,ActSeeCrs);
|
Deg_WriteMenuAllCourses (ActSeeIns,ActSeeCtr,ActSeeDeg,ActSeeCrs);
|
||||||
|
|
||||||
/***** Put link (form) to edit courses in current degree *****/
|
/***** Put link (form) to edit courses in current degree *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST__)
|
||||||
Lay_PutFormToEdit (ActEdiCrs);
|
Lay_PutFormToEdit (ActEdiCrs);
|
||||||
|
|
||||||
/***** Show list of courses *****/
|
/***** Show list of courses *****/
|
||||||
|
@ -1415,7 +1415,7 @@ static void Crs_ListCoursesForEdition (void)
|
||||||
/* Degree */
|
/* Degree */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
" vertical-align:middle;\">");
|
" vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgCrsDeg);
|
Act_FormStart (ActChgCrsDeg);
|
||||||
Crs_PutParamOtherCrsCod (Crs->CrsCod);
|
Crs_PutParamOtherCrsCod (Crs->CrsCod);
|
||||||
|
@ -1539,7 +1539,7 @@ static void Crs_ListCoursesForEdition (void)
|
||||||
StatusTxt = Crs_GetStatusTxtFromStatusBits (Crs->Status);
|
StatusTxt = Crs_GetStatusTxtFromStatusBits (Crs->Status);
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
" vertical-align:middle;\">");
|
" vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN &&
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM &&
|
||||||
StatusTxt == Crs_STATUS_PENDING)
|
StatusTxt == Crs_STATUS_PENDING)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgCrsSta);
|
Act_FormStart (ActChgCrsSta);
|
||||||
|
@ -1588,7 +1588,7 @@ static void Crs_ListCoursesForEdition (void)
|
||||||
|
|
||||||
static bool Crs_CheckIfICanEdit (struct Course *Crs)
|
static bool Crs_CheckIfICanEdit (struct Course *Crs)
|
||||||
{
|
{
|
||||||
return (bool) (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN || // I am a degree administrator or higher
|
return (bool) (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM || // I am a degree administrator or higher
|
||||||
((Crs->Status & Crs_STATUS_BIT_PENDING) != 0 && // Course is not yet activated
|
((Crs->Status & Crs_STATUS_BIT_PENDING) != 0 && // Course is not yet activated
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod == Crs->RequesterUsrCod)); // I am the requester
|
Gbl.Usrs.Me.UsrDat.UsrCod == Crs->RequesterUsrCod)); // I am the requester
|
||||||
}
|
}
|
||||||
|
@ -1651,9 +1651,9 @@ static void Crs_PutFormToCreateCourse (void)
|
||||||
unsigned Semester;
|
unsigned Semester;
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
Act_FormStart (ActNewCrs);
|
Act_FormStart (ActNewCrs);
|
||||||
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST)
|
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST__)
|
||||||
Act_FormStart (ActReqCrs);
|
Act_FormStart (ActReqCrs);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("You can not edit courses.");
|
Lay_ShowErrorAndExit ("You can not edit courses.");
|
||||||
|
@ -2520,11 +2520,11 @@ void Crs_ChangeCrsDegree (void)
|
||||||
Lay_ShowErrorAndExit ("Code of degree is missing.");
|
Lay_ShowErrorAndExit ("Code of degree is missing.");
|
||||||
|
|
||||||
/* Check if I have permission to change course to this degree */
|
/* Check if I have permission to change course to this degree */
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
ICanChangeCrsToNewDeg = true;
|
ICanChangeCrsToNewDeg = true;
|
||||||
else if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN)
|
else if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM)
|
||||||
ICanChangeCrsToNewDeg = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Me.UsrDat.UsrCod,
|
ICanChangeCrsToNewDeg = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Sco_SCOPE_DEGREE,
|
Sco_SCOPE_DEG,
|
||||||
NewDeg.DegCod);
|
NewDeg.DegCod);
|
||||||
else
|
else
|
||||||
ICanChangeCrsToNewDeg = false;
|
ICanChangeCrsToNewDeg = false;
|
||||||
|
@ -2996,7 +2996,7 @@ static void Crs_PutLinkToSearchCourses (void)
|
||||||
(Gbl.CurrentIns.Ins.InsCod > 0 ? ActInsReqSch :
|
(Gbl.CurrentIns.Ins.InsCod > 0 ? ActInsReqSch :
|
||||||
(Gbl.CurrentCty.Cty.CtyCod > 0 ? ActCtyReqSch :
|
(Gbl.CurrentCty.Cty.CtyCod > 0 ? ActCtyReqSch :
|
||||||
ActSysReqSch)))));
|
ActSysReqSch)))));
|
||||||
Sco_PutParamScope (Sco_SCOPE_PLATFORM);
|
Sco_PutParamScope (Sco_SCOPE_SYS);
|
||||||
Par_PutHiddenParamUnsigned ("WhatToSearch",(unsigned) Sch_SEARCH_COURSES);
|
Par_PutHiddenParamUnsigned ("WhatToSearch",(unsigned) Sch_SEARCH_COURSES);
|
||||||
Act_LinkFormSubmit (Txt_Search_courses,The_ClassFormul[Gbl.Prefs.Theme]);
|
Act_LinkFormSubmit (Txt_Search_courses,The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
Lay_PutSendIcon ("search",Txt_Search_courses,Txt_Search_courses);
|
Lay_PutSendIcon ("search",Txt_Search_courses,Txt_Search_courses);
|
||||||
|
@ -3313,7 +3313,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
|
||||||
Deg_PutParamDegCod (Deg.DegCod);
|
Deg_PutParamDegCod (Deg.DegCod);
|
||||||
sprintf (Gbl.Title,Txt_Go_to_X,row[2]);
|
sprintf (Gbl.Title,Txt_Go_to_X,row[2]);
|
||||||
Act_LinkFormSubmit (Gbl.Title,StyleNoBR);
|
Act_LinkFormSubmit (Gbl.Title,StyleNoBR);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s (%s)"
|
fprintf (Gbl.F.Out," %s (%s)"
|
||||||
"</a>"
|
"</a>"
|
||||||
|
|
|
@ -162,7 +162,7 @@ void Deg_SeeDegWithPendingCrss (void)
|
||||||
/***** Get degrees with pending courses *****/
|
/***** Get degrees with pending courses *****/
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
sprintf (Query,"SELECT courses.DegCod,COUNT(*)"
|
sprintf (Query,"SELECT courses.DegCod,COUNT(*)"
|
||||||
" FROM admin,courses,degrees"
|
" FROM admin,courses,degrees"
|
||||||
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
||||||
|
@ -172,7 +172,7 @@ void Deg_SeeDegWithPendingCrss (void)
|
||||||
" GROUP BY courses.DegCod ORDER BY degrees.ShortName",
|
" GROUP BY courses.DegCod ORDER BY degrees.ShortName",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) Crs_STATUS_BIT_PENDING);
|
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) Crs_STATUS_BIT_PENDING);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT courses.DegCod,COUNT(*)"
|
sprintf (Query,"SELECT courses.DegCod,COUNT(*)"
|
||||||
" FROM courses,degrees"
|
" FROM courses,degrees"
|
||||||
" WHERE (courses.Status & %u)<>0"
|
" WHERE (courses.Status & %u)<>0"
|
||||||
|
@ -224,7 +224,7 @@ void Deg_SeeDegWithPendingCrss (void)
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\""
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\""
|
||||||
" target=\"_blank\">",
|
" target=\"_blank\">",
|
||||||
BgColor,Deg.WWW,Deg.FullName);
|
BgColor,Deg.WWW,Deg.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -314,8 +314,8 @@ static void Deg_Configuration (bool PrintView)
|
||||||
Lay_PutLinkToPrintView2 ();
|
Lay_PutLinkToPrintView2 ();
|
||||||
|
|
||||||
/* Link to upload logo */
|
/* Link to upload logo */
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
Log_PutFormToChangeLogo (Sco_SCOPE_DEGREE);
|
Log_PutFormToChangeLogo (Sco_SCOPE_DEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
@ -332,7 +332,7 @@ static void Deg_Configuration (bool PrintView)
|
||||||
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
||||||
Gbl.CurrentDeg.Deg.WWW,
|
Gbl.CurrentDeg.Deg.WWW,
|
||||||
Gbl.CurrentDeg.Deg.FullName);
|
Gbl.CurrentDeg.Deg.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Gbl.CurrentDeg.Deg.DegCod,
|
Log_DrawLogo (Sco_SCOPE_DEG,Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentDeg.Deg.ShortName,64,NULL,true);
|
Gbl.CurrentDeg.Deg.ShortName,64,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"<br />%s",
|
fprintf (Gbl.F.Out,"<br />%s",
|
||||||
Gbl.CurrentDeg.Deg.FullName);
|
Gbl.CurrentDeg.Deg.FullName);
|
||||||
|
@ -739,15 +739,15 @@ void Deg_WriteBigNameCtyInsCtrDegCrs (void)
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod <= 0)
|
if (Gbl.CurrentCrs.Crs.CrsCod <= 0)
|
||||||
{
|
{
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Gbl.CurrentDeg.Deg.DegCod,
|
Log_DrawLogo (Sco_SCOPE_DEG,Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentDeg.Deg.ShortName,32,
|
Gbl.CurrentDeg.Deg.ShortName,32,
|
||||||
"vertical-align:top; margin-right:8px;",false);
|
"vertical-align:top; margin-right:8px;",false);
|
||||||
else if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
else if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Gbl.CurrentCtr.Ctr.CtrCod,
|
Log_DrawLogo (Sco_SCOPE_CTR,Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Gbl.CurrentCtr.Ctr.ShortName,32,
|
Gbl.CurrentCtr.Ctr.ShortName,32,
|
||||||
"vertical-align:top; margin-right:8px;",false);
|
"vertical-align:top; margin-right:8px;",false);
|
||||||
else if (Gbl.CurrentIns.Ins.InsCod > 0)
|
else if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Gbl.CurrentIns.Ins.InsCod,
|
Log_DrawLogo (Sco_SCOPE_INS,Gbl.CurrentIns.Ins.InsCod,
|
||||||
Gbl.CurrentIns.Ins.ShortName,32,
|
Gbl.CurrentIns.Ins.ShortName,32,
|
||||||
"vertical-align:top; margin-right:8px;",false);
|
"vertical-align:top; margin-right:8px;",false);
|
||||||
else if (Gbl.CurrentCty.Cty.CtyCod > 0)
|
else if (Gbl.CurrentCty.Cty.CtyCod > 0)
|
||||||
|
@ -949,7 +949,7 @@ void Deg_WriteSelectorDegTypes (void)
|
||||||
void Deg_SeeDegTypes (void)
|
void Deg_SeeDegTypes (void)
|
||||||
{
|
{
|
||||||
/***** Put link (form) to edit degree types *****/
|
/***** Put link (form) to edit degree types *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_PutFormToEdit (ActEdiDegTyp);
|
Lay_PutFormToEdit (ActEdiDegTyp);
|
||||||
|
|
||||||
/***** Get list of degree types *****/
|
/***** Get list of degree types *****/
|
||||||
|
@ -994,7 +994,7 @@ void Deg_ShowDegsOfCurrentCtr (void)
|
||||||
Deg_WriteMenuAllCourses (ActSeeIns,ActSeeCtr,ActSeeDeg,ActUnk);
|
Deg_WriteMenuAllCourses (ActSeeIns,ActSeeCtr,ActSeeDeg,ActUnk);
|
||||||
|
|
||||||
/***** Put link (form) to edit degrees of the current centre *****/
|
/***** Put link (form) to edit degrees of the current centre *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST__)
|
||||||
Lay_PutFormToEdit (ActEdiDeg);
|
Lay_PutFormToEdit (ActEdiDeg);
|
||||||
|
|
||||||
/***** Show list of degrees *****/
|
/***** Show list of degrees *****/
|
||||||
|
@ -1280,7 +1280,7 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||||
TxtClass,BgColor,
|
TxtClass,BgColor,
|
||||||
Deg->WWW,Deg->FullName);
|
Deg->WWW,Deg->FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg->DegCod,Deg->ShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg->DegCod,Deg->ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -1424,13 +1424,13 @@ static void Deg_ListDegreesForEdition (void)
|
||||||
fprintf (Gbl.F.Out,"<td title=\"%s\""
|
fprintf (Gbl.F.Out,"<td title=\"%s\""
|
||||||
" style=\"width:20px; text-align:left;\">",
|
" style=\"width:20px; text-align:left;\">",
|
||||||
Deg->FullName);
|
Deg->FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg->DegCod,Deg->ShortName,16,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg->DegCod,Deg->ShortName,16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/* Centre */
|
/* Centre */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\""
|
fprintf (Gbl.F.Out,"<td class=\"DAT\""
|
||||||
" style=\"text-align:left; vertical-align:middle;\">");
|
" style=\"text-align:left; vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN) // I can select centre
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM) // I can select centre
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgDegCtr);
|
Act_FormStart (ActChgDegCtr);
|
||||||
Deg_PutParamOtherDegCod (Deg->DegCod);
|
Deg_PutParamOtherDegCod (Deg->DegCod);
|
||||||
|
@ -1627,7 +1627,7 @@ static void Deg_ListDegreesForEdition (void)
|
||||||
StatusTxt = Deg_GetStatusTxtFromStatusBits (Deg->Status);
|
StatusTxt = Deg_GetStatusTxtFromStatusBits (Deg->Status);
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
" vertical-align:middle;\">");
|
" vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN &&
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM &&
|
||||||
StatusTxt == Deg_STATUS_PENDING)
|
StatusTxt == Deg_STATUS_PENDING)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgDegSta);
|
Act_FormStart (ActChgDegSta);
|
||||||
|
@ -1675,7 +1675,7 @@ static void Deg_ListDegreesForEdition (void)
|
||||||
|
|
||||||
static bool Deg_CheckIfICanEdit (struct Degree *Deg)
|
static bool Deg_CheckIfICanEdit (struct Degree *Deg)
|
||||||
{
|
{
|
||||||
return (bool) (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN || // I am a centre administrator or higher
|
return (bool) (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM || // I am a centre administrator or higher
|
||||||
((Deg->Status & Deg_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated
|
((Deg->Status & Deg_STATUS_BIT_PENDING) != 0 && // Degree is not yet activated
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod == Deg->RequesterUsrCod)); // I am the requester
|
Gbl.Usrs.Me.UsrDat.UsrCod == Deg->RequesterUsrCod)); // I am the requester
|
||||||
}
|
}
|
||||||
|
@ -1798,9 +1798,9 @@ static void Deg_PutFormToCreateDegree (void)
|
||||||
unsigned Year;
|
unsigned Year;
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
Act_FormStart (ActNewDeg);
|
Act_FormStart (ActNewDeg);
|
||||||
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST)
|
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST__)
|
||||||
Act_FormStart (ActReqDeg);
|
Act_FormStart (ActReqDeg);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("You can not edit degrees.");
|
Lay_ShowErrorAndExit ("You can not edit degrees.");
|
||||||
|
@ -1831,7 +1831,7 @@ static void Deg_PutFormToCreateDegree (void)
|
||||||
|
|
||||||
/***** Degree logo *****/
|
/***** Degree logo *****/
|
||||||
fprintf (Gbl.F.Out,"<td style=\"width:20px; text-align:left;\">");
|
fprintf (Gbl.F.Out,"<td style=\"width:20px; text-align:left;\">");
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,-1L,"",16,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_DEG,-1L,"",16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/***** Centre *****/
|
/***** Centre *****/
|
||||||
|
@ -2497,7 +2497,7 @@ void Deg_GetListDegsAdminByMe (void)
|
||||||
unsigned NumDeg;
|
unsigned NumDeg;
|
||||||
|
|
||||||
/***** Get degrees admin by me from database *****/
|
/***** Get degrees admin by me from database *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
sprintf (Query,"SELECT DegCod,CtrCod,DegTypCod,Status,RequesterUsrCod,"
|
sprintf (Query,"SELECT DegCod,CtrCod,DegTypCod,Status,RequesterUsrCod,"
|
||||||
"ShortName,FullName,FirstYear,LastYear,OptYear,WWW"
|
"ShortName,FullName,FirstYear,LastYear,OptYear,WWW"
|
||||||
" FROM degrees"
|
" FROM degrees"
|
||||||
|
@ -2505,7 +2505,7 @@ void Deg_GetListDegsAdminByMe (void)
|
||||||
" ORDER BY ShortName",
|
" ORDER BY ShortName",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
// TODO: put an if to select all degrees for admins of all degrees !!!!!!!!!!!!!
|
// TODO: put an if to select all degrees for admins of all degrees !!!!!!!!!!!!!
|
||||||
else // Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN
|
else // Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM
|
||||||
sprintf (Query,"SELECT degrees.DegCod,degrees.CtrCod,degrees.DegTypCod,degrees.Status,degrees.RequesterUsrCod,"
|
sprintf (Query,"SELECT degrees.DegCod,degrees.CtrCod,degrees.DegTypCod,degrees.Status,degrees.RequesterUsrCod,"
|
||||||
"degrees.ShortName,degrees.FullName,degrees.FirstYear,degrees.LastYear,degrees.OptYear,degrees.WWW"
|
"degrees.ShortName,degrees.FullName,degrees.FirstYear,degrees.LastYear,degrees.OptYear,degrees.WWW"
|
||||||
" FROM admin,degrees"
|
" FROM admin,degrees"
|
||||||
|
@ -3770,7 +3770,7 @@ void Deg_ChangeDegStatus (void)
|
||||||
|
|
||||||
void Deg_RequestLogo (void)
|
void Deg_RequestLogo (void)
|
||||||
{
|
{
|
||||||
Log_RequestLogo (Sco_SCOPE_DEGREE);
|
Log_RequestLogo (Sco_SCOPE_DEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3779,7 +3779,7 @@ void Deg_RequestLogo (void)
|
||||||
|
|
||||||
void Deg_ReceiveLogo (void)
|
void Deg_ReceiveLogo (void)
|
||||||
{
|
{
|
||||||
Log_ReceiveLogo (Sco_SCOPE_DEGREE);
|
Log_ReceiveLogo (Sco_SCOPE_DEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3951,7 +3951,7 @@ void Deg_GetAndWriteDegreesAdminBy (long UsrCod,unsigned ColSpan)
|
||||||
Deg_PutParamDegCod (DegCod);
|
Deg_PutParamDegCod (DegCod);
|
||||||
sprintf (Gbl.Title,Txt_Go_to_X,row[2]);
|
sprintf (Gbl.Title,Txt_Go_to_X,row[2]);
|
||||||
Act_LinkFormSubmit (Gbl.Title,"DAT_SMALL_NOBR");
|
Act_LinkFormSubmit (Gbl.Title,"DAT_SMALL_NOBR");
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,DegCod,row[1],
|
Log_DrawLogo (Sco_SCOPE_DEG,DegCod,row[1],
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s</a>"
|
fprintf (Gbl.F.Out," %s</a>"
|
||||||
"</form>",
|
"</form>",
|
||||||
|
|
|
@ -96,7 +96,7 @@ void Dpt_SeeDepts (void)
|
||||||
Dpt_GetListDepartments (Gbl.CurrentIns.Ins.InsCod);
|
Dpt_GetListDepartments (Gbl.CurrentIns.Ins.InsCod);
|
||||||
|
|
||||||
/***** Put link (form) to edit departments *****/
|
/***** Put link (form) to edit departments *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Dpt_PutFormToEditDpts ();
|
Dpt_PutFormToEditDpts ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
@ -178,7 +178,7 @@ void Dpt_SeeDepts (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Txt_Department_unspecified,
|
Txt_Department_unspecified,
|
||||||
Sta_GetTotalNumberOfUsers (Sco_SCOPE_INSTITUTION,
|
Sta_GetTotalNumberOfUsers (Sco_SCOPE_INS,
|
||||||
Rol_ROLE_TEACHER) - NumTchsInsWithDpt);
|
Rol_ROLE_TEACHER) - NumTchsInsWithDpt);
|
||||||
|
|
||||||
/***** Table end *****/
|
/***** Table end *****/
|
||||||
|
|
|
@ -452,7 +452,7 @@ void Enr_ReqAdminUsrs (void)
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_GUEST:
|
case Rol_ROLE_GUEST__:
|
||||||
case Rol_ROLE_VISITOR:
|
case Rol_ROLE_VISITOR:
|
||||||
case Rol_ROLE_STUDENT:
|
case Rol_ROLE_STUDENT:
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
|
@ -463,25 +463,25 @@ void Enr_ReqAdminUsrs (void)
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_CTR_ADMIN:
|
case Rol_ROLE_CTR_ADM:
|
||||||
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_INS_ADMIN:
|
case Rol_ROLE_INS_ADM:
|
||||||
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
||||||
Enr_ShowFormRegRemSeveralUsrs ();
|
Enr_ShowFormRegRemSeveralUsrs ();
|
||||||
else
|
else
|
||||||
|
@ -524,7 +524,7 @@ static void Enr_ShowFormRegRemSeveralUsrs (void)
|
||||||
Enr_PutFormToRemAllStdsThisCrs ();
|
Enr_PutFormToRemAllStdsThisCrs ();
|
||||||
|
|
||||||
/***** Put link to remove old users *****/
|
/***** Put link to remove old users *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Enr_PutFormToRemOldUsrs ();
|
Enr_PutFormToRemOldUsrs ();
|
||||||
|
|
||||||
/***** Form to send students to be enrolled / removed *****/
|
/***** Form to send students to be enrolled / removed *****/
|
||||||
|
@ -818,28 +818,22 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
{
|
{
|
||||||
/***** Check if the other user is administrator of the current institution *****/
|
/***** Check if the other user is administrator of the current institution *****/
|
||||||
if ((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADMIN && ItsMe) ||
|
UsrIsInsAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Sco_SCOPE_INS,
|
||||||
UsrIsInsAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
Sco_SCOPE_INSTITUTION,
|
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
|
||||||
|
|
||||||
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
{
|
{
|
||||||
/***** Check if the other user is administrator of the current centre *****/
|
/***** Check if the other user is administrator of the current centre *****/
|
||||||
if ((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADMIN && ItsMe) ||
|
UsrIsCtrAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Sco_SCOPE_CTR,
|
||||||
UsrIsCtrAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
Sco_SCOPE_CENTRE,
|
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
|
||||||
|
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
/***** Check if the other user is administrator of the current degree *****/
|
/***** Check if the other user is administrator of the current degree *****/
|
||||||
if ((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN && ItsMe) ||
|
UsrIsDegAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Sco_SCOPE_DEG,
|
||||||
UsrIsDegAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
Sco_SCOPE_DEGREE,
|
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -851,9 +845,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
|
|
||||||
/***** Register user in course / Modify user's data *****/
|
/***** Register user in course / Modify user's data *****/
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_TEACHER)
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
|
sprintf (Gbl.Message,UsrBelongsToCrs ? (ItsMe ? Txt_Modify_me_in_the_course_X :
|
||||||
Txt_Modify_user_in_the_course_X) :
|
Txt_Modify_user_in_the_course_X) :
|
||||||
|
@ -880,7 +872,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
/***** Register user as administrator of degree *****/
|
/***** Register user as administrator of degree *****/
|
||||||
if (!UsrIsDegAdmin &&
|
if (!UsrIsDegAdmin &&
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_Register_user_as_an_administrator_of_the_degree_X,
|
sprintf (Gbl.Message,Txt_Register_user_as_an_administrator_of_the_degree_X,
|
||||||
Gbl.CurrentDeg.Deg.ShortName);
|
Gbl.CurrentDeg.Deg.ShortName);
|
||||||
|
@ -899,7 +891,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
|
|
||||||
/***** Register user as administrator of centre *****/
|
/***** Register user as administrator of centre *****/
|
||||||
if (!UsrIsCtrAdmin &&
|
if (!UsrIsCtrAdmin &&
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_Register_user_as_an_administrator_of_the_centre_X,
|
sprintf (Gbl.Message,Txt_Register_user_as_an_administrator_of_the_centre_X,
|
||||||
Gbl.CurrentCtr.Ctr.ShortName);
|
Gbl.CurrentCtr.Ctr.ShortName);
|
||||||
|
@ -919,7 +911,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
|
|
||||||
/***** Register user as administrator of institution *****/
|
/***** Register user as administrator of institution *****/
|
||||||
if (!UsrIsInsAdmin &&
|
if (!UsrIsInsAdmin &&
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,Txt_Register_user_as_an_administrator_of_the_institution_X,
|
sprintf (Gbl.Message,Txt_Register_user_as_an_administrator_of_the_institution_X,
|
||||||
Gbl.CurrentIns.Ins.ShortName);
|
Gbl.CurrentIns.Ins.ShortName);
|
||||||
|
@ -964,8 +956,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
/***** Remove user as an administrator of the degree *****/
|
/***** Remove user as an administrator of the degree *****/
|
||||||
if (UsrIsDegAdmin &&
|
if (UsrIsDegAdmin &&
|
||||||
((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN && ItsMe) ||
|
(ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM))
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,
|
sprintf (Gbl.Message,
|
||||||
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_degree_X :
|
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_degree_X :
|
||||||
|
@ -986,8 +977,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
|
|
||||||
/***** Remove user as an administrator of the centre *****/
|
/***** Remove user as an administrator of the centre *****/
|
||||||
if (UsrIsCtrAdmin &&
|
if (UsrIsCtrAdmin &&
|
||||||
((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADMIN && ItsMe) ||
|
(ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM))
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,
|
sprintf (Gbl.Message,
|
||||||
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_centre_X :
|
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_centre_X :
|
||||||
|
@ -1009,8 +999,7 @@ static bool Enr_PutActionsRegRemOneUsr (bool ItsMe)
|
||||||
|
|
||||||
/***** Remove user as an administrator of the institution *****/
|
/***** Remove user as an administrator of the institution *****/
|
||||||
if (UsrIsInsAdmin &&
|
if (UsrIsInsAdmin &&
|
||||||
((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADMIN && ItsMe) ||
|
(ItsMe || Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,
|
sprintf (Gbl.Message,
|
||||||
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_institution_X :
|
ItsMe ? Txt_Remove_me_as_an_administrator_of_the_institution_X :
|
||||||
|
@ -1096,7 +1085,7 @@ static void Enr_PutActionsRegRemSeveralUsrs (void)
|
||||||
Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated);
|
Txt_Register_the_users_indicated_in_step_1_and_remove_the_users_not_indicated);
|
||||||
|
|
||||||
/***** Only for superusers *****/
|
/***** Only for superusers *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
fprintf (Gbl.F.Out,"<li>"
|
fprintf (Gbl.F.Out,"<li>"
|
||||||
"<input type=\"radio\" name=\"RegRemAction\" value=\"%u\" />"
|
"<input type=\"radio\" name=\"RegRemAction\" value=\"%u\" />"
|
||||||
"%s</li>",
|
"%s</li>",
|
||||||
|
@ -1169,8 +1158,8 @@ void Enr_ReceiveFormUsrsCrs (void)
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
switch (Gbl.Usrs.Me.LoggedRole) // Can I register/remove teachers?
|
switch (Gbl.Usrs.Me.LoggedRole) // Can I register/remove teachers?
|
||||||
{
|
{
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER: // Yes, I can
|
case Rol_ROLE_SYS_ADM: // Yes, I can
|
||||||
break;
|
break;
|
||||||
default: // No, I can not (TODO: teachers should be able to register/remove existing teachers)
|
default: // No, I can not (TODO: teachers should be able to register/remove existing teachers)
|
||||||
Lay_ShowErrorAndExit ("You are not allowed to perform this action."); // If user manipulated the form
|
Lay_ShowErrorAndExit ("You are not allowed to perform this action."); // If user manipulated the form
|
||||||
|
@ -1218,7 +1207,7 @@ void Enr_ReceiveFormUsrsCrs (void)
|
||||||
WhatToDo.RegisterUsrs = true;
|
WhatToDo.RegisterUsrs = true;
|
||||||
break;
|
break;
|
||||||
case Enr_ELIMINATE_USRS_FROM_PLATFORM:
|
case Enr_ELIMINATE_USRS_FROM_PLATFORM:
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
WhatToDo.RemoveUsrs = true;
|
WhatToDo.RemoveUsrs = true;
|
||||||
WhatToDo.RemoveSpecifiedUsrs = true;
|
WhatToDo.RemoveSpecifiedUsrs = true;
|
||||||
|
@ -1290,11 +1279,11 @@ void Enr_ReceiveFormUsrsCrs (void)
|
||||||
switch (RegRemRole)
|
switch (RegRemRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_STUDENT:
|
case Rol_ROLE_STUDENT:
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
LstCurrentUsrs = &Gbl.Usrs.LstStds;
|
LstCurrentUsrs = &Gbl.Usrs.LstStds;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_CRS,NULL,false);
|
||||||
LstCurrentUsrs = &Gbl.Usrs.LstTchs;
|
LstCurrentUsrs = &Gbl.Usrs.LstTchs;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1796,7 +1785,7 @@ unsigned Enr_RemAllStdsInCrs (struct Course *Crs)
|
||||||
|
|
||||||
/***** Get list of students in current course *****/
|
/***** Get list of students in current course *****/
|
||||||
Gbl.Usrs.ClassPhoto.AllGroups = true; // Get all the students of the current course
|
Gbl.Usrs.ClassPhoto.AllGroups = true; // Get all the students of the current course
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
NumStdsInCrs = Gbl.Usrs.LstStds.NumUsrs;
|
NumStdsInCrs = Gbl.Usrs.LstStds.NumUsrs;
|
||||||
|
|
||||||
/***** Remove all the students *****/
|
/***** Remove all the students *****/
|
||||||
|
@ -1832,7 +1821,7 @@ void Enr_ReqSignUpInCrs (void)
|
||||||
Gbl.CurrentCrs.Crs.FullName);
|
Gbl.CurrentCrs.Crs.FullName);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||||
}
|
}
|
||||||
else if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_GUEST ||
|
else if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_GUEST__ ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_VISITOR)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_VISITOR)
|
||||||
/***** Show form to modify only the user's role or the user's data *****/
|
/***** Show form to modify only the user's role or the user's data *****/
|
||||||
Rec_ShowFormSignUpWithMyCommonRecord ();
|
Rec_ShowFormSignUpWithMyCommonRecord ();
|
||||||
|
@ -2139,13 +2128,13 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td style=\"text-align:left; vertical-align:middle;\">",
|
"<td style=\"text-align:left; vertical-align:middle;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
Sco_PutSelectorScope (false);
|
Sco_PutSelectorScope (false);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
@ -2168,8 +2157,8 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
Roles = (1 << Rol_ROLE_STUDENT) | (1 << Rol_ROLE_TEACHER);
|
Roles = (1 << Rol_ROLE_STUDENT) | (1 << Rol_ROLE_TEACHER);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Roles = (1 << Rol_ROLE_TEACHER);
|
Roles = (1 << Rol_ROLE_TEACHER);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2187,7 +2176,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
/***** Build query *****/
|
/***** Build query *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM: // Show requesters for the whole platform
|
case Sco_SCOPE_SYS: // Show requesters for the whole platform
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
|
@ -2200,7 +2189,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM admin,courses,crs_usr_requests"
|
" FROM admin,courses,crs_usr_requests"
|
||||||
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
||||||
|
@ -2211,7 +2200,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT ReqCod,CrsCod,UsrCod,Role,DATE_FORMAT(RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT ReqCod,CrsCod,UsrCod,Role,DATE_FORMAT(RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM crs_usr_requests WHERE ((1<<Role)&%u)<>0"
|
" FROM crs_usr_requests WHERE ((1<<Role)&%u)<>0"
|
||||||
" ORDER BY RequestTime DESC",
|
" ORDER BY RequestTime DESC",
|
||||||
|
@ -2222,7 +2211,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION: // Show requesters for the current institution
|
case Sco_SCOPE_INS: // Show requesters for the current institution
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
|
@ -2240,7 +2229,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM admin,centres,degrees,courses,crs_usr_requests"
|
" FROM admin,centres,degrees,courses,crs_usr_requests"
|
||||||
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
||||||
|
@ -2255,7 +2244,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM centres,degrees,courses,crs_usr_requests"
|
" FROM centres,degrees,courses,crs_usr_requests"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -2272,7 +2261,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE: // Show requesters for the current centre
|
case Sco_SCOPE_CTR: // Show requesters for the current centre
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
|
@ -2289,7 +2278,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM admin,degrees,courses,crs_usr_requests"
|
" FROM admin,degrees,courses,crs_usr_requests"
|
||||||
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
" WHERE admin.UsrCod='%ld' AND admin.Scope='Deg'"
|
||||||
|
@ -2303,7 +2292,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM degrees,courses,crs_usr_requests"
|
" FROM degrees,courses,crs_usr_requests"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -2319,7 +2308,7 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE: // Show requesters for the current degree
|
case Sco_SCOPE_DEG: // Show requesters for the current degree
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
|
@ -2335,8 +2324,8 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Roles);
|
Roles);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT crs_usr_requests.ReqCod,crs_usr_requests.CrsCod,crs_usr_requests.UsrCod,crs_usr_requests.Role,DATE_FORMAT(crs_usr_requests.RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM courses,crs_usr_requests"
|
" FROM courses,crs_usr_requests"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -2351,12 +2340,12 @@ void Enr_ShowEnrollmentRequests (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE: // Show requesters for the current course
|
case Sco_SCOPE_CRS: // Show requesters for the current course
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT ReqCod,CrsCod,UsrCod,Role,DATE_FORMAT(RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
sprintf (Query,"SELECT ReqCod,CrsCod,UsrCod,Role,DATE_FORMAT(RequestTime,'%%Y%%m%%d%%H%%i%%S')"
|
||||||
" FROM crs_usr_requests"
|
" FROM crs_usr_requests"
|
||||||
" WHERE CrsCod='%ld'"
|
" WHERE CrsCod='%ld'"
|
||||||
|
@ -2597,7 +2586,7 @@ void Enr_ReqRegRemUsr (void)
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_GUEST:
|
case Rol_ROLE_GUEST__:
|
||||||
case Rol_ROLE_VISITOR:
|
case Rol_ROLE_VISITOR:
|
||||||
case Rol_ROLE_STUDENT:
|
case Rol_ROLE_STUDENT:
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
|
@ -2608,25 +2597,25 @@ void Enr_ReqRegRemUsr (void)
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_CTR_ADMIN:
|
case Rol_ROLE_CTR_ADM:
|
||||||
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_INS_ADMIN:
|
case Rol_ROLE_INS_ADM:
|
||||||
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
else
|
else
|
||||||
Enr_AskIfRegRemMe ();
|
Enr_AskIfRegRemMe ();
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
Enr_ReqAnotherUsrIDToRegisterRemove ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2846,7 +2835,7 @@ static void Enr_ShowFormToEditOtherUsr (void)
|
||||||
|
|
||||||
void Enr_AddAdmToIns (void)
|
void Enr_AddAdmToIns (void)
|
||||||
{
|
{
|
||||||
Enr_AddAdm (Sco_SCOPE_INSTITUTION,Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentIns.Ins.FullName);
|
Enr_AddAdm (Sco_SCOPE_INS,Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentIns.Ins.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2855,7 +2844,7 @@ void Enr_AddAdmToIns (void)
|
||||||
|
|
||||||
void Enr_AddAdmToCtr (void)
|
void Enr_AddAdmToCtr (void)
|
||||||
{
|
{
|
||||||
Enr_AddAdm (Sco_SCOPE_CENTRE,Gbl.CurrentCtr.Ctr.CtrCod,Gbl.CurrentCtr.Ctr.FullName);
|
Enr_AddAdm (Sco_SCOPE_CTR,Gbl.CurrentCtr.Ctr.CtrCod,Gbl.CurrentCtr.Ctr.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2864,7 +2853,7 @@ void Enr_AddAdmToCtr (void)
|
||||||
|
|
||||||
void Enr_AddAdmToDeg (void)
|
void Enr_AddAdmToDeg (void)
|
||||||
{
|
{
|
||||||
Enr_AddAdm (Sco_SCOPE_DEGREE,Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentDeg.Deg.FullName);
|
Enr_AddAdm (Sco_SCOPE_DEG,Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentDeg.Deg.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2874,16 +2863,20 @@ void Enr_AddAdmToDeg (void)
|
||||||
static void Enr_AddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
|
static void Enr_AddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
|
||||||
{
|
{
|
||||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||||
|
bool ICanRegister;
|
||||||
|
|
||||||
if (Cod > 0)
|
if (Cod > 0)
|
||||||
{
|
{
|
||||||
/***** Get plain user's ID of the user to add/modify *****/
|
/***** Get plain user's ID of the user to add/modify *****/
|
||||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||||
{
|
{
|
||||||
/* Check if it's allowed to register this administrator in degree */
|
/* Check if I am allowed to register user as administrator in institution/centre/degree */
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
ICanRegister = ((Scope == Sco_SCOPE_DEG && Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM) ||
|
||||||
|
(Scope == Sco_SCOPE_CTR && Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM) ||
|
||||||
|
(Scope == Sco_SCOPE_INS && Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM));
|
||||||
|
if (ICanRegister)
|
||||||
{
|
{
|
||||||
/***** Register administrator in current degree in database *****/
|
/***** Register administrator in current institution/centre/degree in database *****/
|
||||||
Enr_RegisterAdmin (&Gbl.Usrs.Other.UsrDat,Scope,
|
Enr_RegisterAdmin (&Gbl.Usrs.Other.UsrDat,Scope,
|
||||||
Cod,InsCtrDegName);
|
Cod,InsCtrDegName);
|
||||||
|
|
||||||
|
@ -2998,7 +2991,7 @@ static void Enr_ReqRemOrRemUsrFromCrs (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr)
|
||||||
|
|
||||||
static void Enr_ReqRemAdmOfIns (void)
|
static void Enr_ReqRemAdmOfIns (void)
|
||||||
{
|
{
|
||||||
Enr_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,Sco_SCOPE_INSTITUTION,
|
Enr_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,Sco_SCOPE_INS,
|
||||||
Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentIns.Ins.FullName);
|
Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentIns.Ins.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3008,7 +3001,7 @@ static void Enr_ReqRemAdmOfIns (void)
|
||||||
|
|
||||||
static void Enr_ReqRemAdmOfCtr (void)
|
static void Enr_ReqRemAdmOfCtr (void)
|
||||||
{
|
{
|
||||||
Enr_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,Sco_SCOPE_CENTRE,
|
Enr_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,Sco_SCOPE_CTR,
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,Gbl.CurrentCtr.Ctr.FullName);
|
Gbl.CurrentCtr.Ctr.CtrCod,Gbl.CurrentCtr.Ctr.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3018,7 +3011,7 @@ static void Enr_ReqRemAdmOfCtr (void)
|
||||||
|
|
||||||
static void Enr_ReqRemAdmOfDeg (void)
|
static void Enr_ReqRemAdmOfDeg (void)
|
||||||
{
|
{
|
||||||
Enr_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,Sco_SCOPE_DEGREE,
|
Enr_ReqRemOrRemAdm (Enr_REQUEST_REMOVE_USR,Sco_SCOPE_DEG,
|
||||||
Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentDeg.Deg.FullName);
|
Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentDeg.Deg.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3028,7 +3021,7 @@ static void Enr_ReqRemAdmOfDeg (void)
|
||||||
|
|
||||||
void Enr_RemAdmIns (void)
|
void Enr_RemAdmIns (void)
|
||||||
{
|
{
|
||||||
Enr_ReqRemOrRemAdm (Enr_REMOVE_USR,Sco_SCOPE_INSTITUTION,
|
Enr_ReqRemOrRemAdm (Enr_REMOVE_USR,Sco_SCOPE_INS,
|
||||||
Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentIns.Ins.FullName);
|
Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentIns.Ins.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3038,7 +3031,7 @@ void Enr_RemAdmIns (void)
|
||||||
|
|
||||||
void Enr_RemAdmCtr (void)
|
void Enr_RemAdmCtr (void)
|
||||||
{
|
{
|
||||||
Enr_ReqRemOrRemAdm (Enr_REMOVE_USR,Sco_SCOPE_CENTRE,
|
Enr_ReqRemOrRemAdm (Enr_REMOVE_USR,Sco_SCOPE_CTR,
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,Gbl.CurrentCtr.Ctr.FullName);
|
Gbl.CurrentCtr.Ctr.CtrCod,Gbl.CurrentCtr.Ctr.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3048,7 +3041,7 @@ void Enr_RemAdmCtr (void)
|
||||||
|
|
||||||
void Enr_RemAdmDeg (void)
|
void Enr_RemAdmDeg (void)
|
||||||
{
|
{
|
||||||
Enr_ReqRemOrRemAdm (Enr_REMOVE_USR,Sco_SCOPE_DEGREE,
|
Enr_ReqRemOrRemAdm (Enr_REMOVE_USR,Sco_SCOPE_DEG,
|
||||||
Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentDeg.Deg.FullName);
|
Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentDeg.Deg.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3069,16 +3062,17 @@ static void Enr_ReqRemOrRemAdm (Enr_ReqDelOrDelUsr_t ReqDelOrDelUsr,Sco_Scope_t
|
||||||
/***** Get user to be removed *****/
|
/***** Get user to be removed *****/
|
||||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||||
{
|
{
|
||||||
/* Check if it's forbidden remove that administrator */
|
/* Check if it's forbidden to remove an administrator */
|
||||||
// A superuser can remove any administrator
|
|
||||||
// An administrator only can remove itself
|
|
||||||
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod);
|
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||||
ICanRemove = (ItsMe || Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
ICanRemove = (ItsMe ||
|
||||||
|
(Scope == Sco_SCOPE_DEG && Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM) ||
|
||||||
|
(Scope == Sco_SCOPE_CTR && Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM) ||
|
||||||
|
(Scope == Sco_SCOPE_INS && Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM));
|
||||||
if (ICanRemove)
|
if (ICanRemove)
|
||||||
{
|
{
|
||||||
/* Check if the other user is and admin of the current institution */
|
/* Check if the other user is an admin of the current institution/centre/degree */
|
||||||
if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod))
|
if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod))
|
||||||
{ // The other user is an administrator of current degree ==> ask for removing or remove him
|
{ // The other user is an administrator of current institution/centre/degree ==> ask for removing or remove her/him
|
||||||
switch (ReqDelOrDelUsr)
|
switch (ReqDelOrDelUsr)
|
||||||
{
|
{
|
||||||
case Enr_REQUEST_REMOVE_USR: // Ask if remove administrator from current institution
|
case Enr_REQUEST_REMOVE_USR: // Ask if remove administrator from current institution
|
||||||
|
@ -3117,22 +3111,26 @@ static void Enr_ReqAddAdm (Sco_Scope_t Scope,long Cod,const char *InsCtrDegName)
|
||||||
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
extern const char *Txt_User_not_found_or_you_do_not_have_permission_;
|
||||||
static const Act_Action_t Enr_ActNewAdm[Sco_NUM_SCOPES] =
|
static const Act_Action_t Enr_ActNewAdm[Sco_NUM_SCOPES] =
|
||||||
{
|
{
|
||||||
ActUnk, // Sco_SCOPE_NONE
|
ActUnk, // Sco_SCOPE_UNK
|
||||||
ActUnk, // Sco_SCOPE_PLATFORM,
|
ActUnk, // Sco_SCOPE_SYS,
|
||||||
ActUnk, // Sco_SCOPE_COUNTRY,
|
ActUnk, // Sco_SCOPE_CTY,
|
||||||
ActNewAdmIns, // Sco_SCOPE_INSTITUTION,
|
ActNewAdmIns, // Sco_SCOPE_INS,
|
||||||
ActNewAdmCtr, // Sco_SCOPE_CENTRE,
|
ActNewAdmCtr, // Sco_SCOPE_CTR,
|
||||||
ActNewAdmDeg, // Sco_SCOPE_DEGREE,
|
ActNewAdmDeg, // Sco_SCOPE_DEG,
|
||||||
ActUnk, // Sco_SCOPE_COURSE,
|
ActUnk, // Sco_SCOPE_CRS,
|
||||||
};
|
};
|
||||||
|
bool ICanRegister;
|
||||||
|
|
||||||
if (Cod > 0)
|
if (Cod > 0)
|
||||||
{
|
{
|
||||||
/***** Get user's identificator of the user to register as admin *****/
|
/***** Get user's identificator of the user to register as admin *****/
|
||||||
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
if (Usr_GetParamOtherUsrCodEncryptedAndGetUsrData ())
|
||||||
{
|
{
|
||||||
/* Check if it's allowed to register this administrator in institution/centre/degree */
|
/* Check if I am allowed to register user as administrator in institution/centre/degree */
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
ICanRegister = ((Scope == Sco_SCOPE_DEG && Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM) ||
|
||||||
|
(Scope == Sco_SCOPE_CTR && Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM) ||
|
||||||
|
(Scope == Sco_SCOPE_INS && Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM));
|
||||||
|
if (ICanRegister)
|
||||||
{
|
{
|
||||||
if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod)) // User is yet an administrator of current institution/centre/degree
|
if (Usr_CheckIfUsrIsAdm (Gbl.Usrs.Other.UsrDat.UsrCod,Scope,Cod)) // User is yet an administrator of current institution/centre/degree
|
||||||
{
|
{
|
||||||
|
@ -3266,7 +3264,7 @@ void Enr_ModifAndShowUsrCardAndRegInCrsAndGrps (void)
|
||||||
switch ((RegRemAction = (Enr_RegRemOneUsrAction_t) UnsignedNum))
|
switch ((RegRemAction = (Enr_RegRemOneUsrAction_t) UnsignedNum))
|
||||||
{
|
{
|
||||||
case Enr_REGISTER_MODIFY_ONE_USR_IN_CRS:
|
case Enr_REGISTER_MODIFY_ONE_USR_IN_CRS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_TEACHER || ItsMe)
|
if (ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_TEACHER)
|
||||||
{
|
{
|
||||||
IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER); // I am logged as teacher
|
IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER); // I am logged as teacher
|
||||||
HeIsTeacher = (Gbl.Usrs.Other.UsrDat.Roles & (1 << Rol_ROLE_TEACHER)); // He/she is already a teacher in any course
|
HeIsTeacher = (Gbl.Usrs.Other.UsrDat.Roles & (1 << Rol_ROLE_TEACHER)); // He/she is already a teacher in any course
|
||||||
|
@ -3309,49 +3307,46 @@ void Enr_ModifAndShowUsrCardAndRegInCrsAndGrps (void)
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REGISTER_ONE_DEGREE_ADMIN:
|
case Enr_REGISTER_ONE_DEGREE_ADMIN:
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
Enr_ReqAddAdm (Sco_SCOPE_DEGREE,Gbl.CurrentDeg.Deg.DegCod,
|
Enr_ReqAddAdm (Sco_SCOPE_DEG,Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentDeg.Deg.FullName);
|
Gbl.CurrentDeg.Deg.FullName);
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REGISTER_ONE_CENTRE_ADMIN:
|
case Enr_REGISTER_ONE_CENTRE_ADMIN:
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
Enr_ReqAddAdm (Sco_SCOPE_CENTRE,Gbl.CurrentCtr.Ctr.CtrCod,
|
Enr_ReqAddAdm (Sco_SCOPE_CTR,Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Gbl.CurrentCtr.Ctr.FullName);
|
Gbl.CurrentCtr.Ctr.FullName);
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REGISTER_ONE_INSTITUTION_ADMIN:
|
case Enr_REGISTER_ONE_INSTITUTION_ADMIN:
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Enr_ReqAddAdm (Sco_SCOPE_INSTITUTION,Gbl.CurrentIns.Ins.InsCod,
|
Enr_ReqAddAdm (Sco_SCOPE_INS,Gbl.CurrentIns.Ins.InsCod,
|
||||||
Gbl.CurrentIns.Ins.FullName);
|
Gbl.CurrentIns.Ins.FullName);
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REMOVE_ONE_USR_FROM_CRS:
|
case Enr_REMOVE_ONE_USR_FROM_CRS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_TEACHER || ItsMe)
|
if (ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_TEACHER)
|
||||||
Enr_ReqRemUsrFromCrs ();
|
Enr_ReqRemUsrFromCrs ();
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REMOVE_ONE_DEGREE_ADMIN:
|
case Enr_REMOVE_ONE_DEGREE_ADMIN:
|
||||||
if ((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN && ItsMe) ||
|
if (ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
|
||||||
Enr_ReqRemAdmOfDeg ();
|
Enr_ReqRemAdmOfDeg ();
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REMOVE_ONE_CENTRE_ADMIN:
|
case Enr_REMOVE_ONE_CENTRE_ADMIN:
|
||||||
if ((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_CTR_ADMIN && ItsMe) ||
|
if (ItsMe || Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
|
||||||
Enr_ReqRemAdmOfCtr ();
|
Enr_ReqRemAdmOfCtr ();
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
break;
|
break;
|
||||||
case Enr_REMOVE_ONE_INSTITUTION_ADMIN:
|
case Enr_REMOVE_ONE_INSTITUTION_ADMIN:
|
||||||
if ((Gbl.Usrs.Me.LoggedRole == Rol_ROLE_INS_ADMIN && ItsMe) ||
|
if (ItsMe || Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
|
||||||
Enr_ReqRemAdmOfIns ();
|
Enr_ReqRemAdmOfIns ();
|
||||||
else
|
else
|
||||||
Error = true;
|
Error = true;
|
||||||
|
@ -3498,13 +3493,13 @@ static void Enr_AskIfRemAdm (bool ItsMe,Sco_Scope_t Scope,const char *InsCtrDegN
|
||||||
extern const char *Txt_Remove_user_as_an_administrator;
|
extern const char *Txt_Remove_user_as_an_administrator;
|
||||||
static const Act_Action_t Enr_ActRemAdm[Sco_NUM_SCOPES] =
|
static const Act_Action_t Enr_ActRemAdm[Sco_NUM_SCOPES] =
|
||||||
{
|
{
|
||||||
ActUnk, // Sco_SCOPE_NONE
|
ActUnk, // Sco_SCOPE_UNK
|
||||||
ActUnk, // Sco_SCOPE_PLATFORM,
|
ActUnk, // Sco_SCOPE_SYS,
|
||||||
ActUnk, // Sco_SCOPE_COUNTRY,
|
ActUnk, // Sco_SCOPE_CTY,
|
||||||
ActRemAdmIns, // Sco_SCOPE_INSTITUTION,
|
ActRemAdmIns, // Sco_SCOPE_INS,
|
||||||
ActRemAdmCtr, // Sco_SCOPE_CENTRE,
|
ActRemAdmCtr, // Sco_SCOPE_CTR,
|
||||||
ActRemAdmDeg, // Sco_SCOPE_DEGREE,
|
ActRemAdmDeg, // Sco_SCOPE_DEG,
|
||||||
ActUnk, // Sco_SCOPE_COURSE,
|
ActUnk, // Sco_SCOPE_CRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Usr_ChkIfUsrCodExists (Gbl.Usrs.Other.UsrDat.UsrCod))
|
if (Usr_ChkIfUsrCodExists (Gbl.Usrs.Other.UsrDat.UsrCod))
|
||||||
|
|
10
swad_exam.c
10
swad_exam.c
|
@ -442,8 +442,8 @@ static void Exa_ListExamAnnouncements (Exa_tTypeViewExamAnnouncement_t TypeViewE
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
||||||
Act_FormStart (ActEdiExaAnn);
|
Act_FormStart (ActEdiExaAnn);
|
||||||
Act_LinkFormSubmit (Txt_New_announcement_of_exam,The_ClassFormul[Gbl.Prefs.Theme]);
|
Act_LinkFormSubmit (Txt_New_announcement_of_exam,The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
@ -791,7 +791,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_
|
||||||
else
|
else
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"%s\">",
|
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"%s\">",
|
||||||
Ins.WWW,StyleTitle);
|
Ins.WWW,StyleTitle);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins.InsCod,Ins.FullName,64,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.FullName,64,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"<br />%s%s" \
|
fprintf (Gbl.F.Out,"<br />%s%s" \
|
||||||
"</td>" \
|
"</td>" \
|
||||||
"</tr>",
|
"</tr>",
|
||||||
|
@ -1197,8 +1197,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
/***** Create link to edit this exam announcement *****/
|
/***** Create link to edit this exam announcement *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>" \
|
fprintf (Gbl.F.Out,"<tr>" \
|
||||||
"<td style=\"text-align:left;\">");
|
"<td style=\"text-align:left;\">");
|
||||||
|
|
|
@ -882,14 +882,14 @@ static const Act_Action_t Brw_ActRecDatFile[Brw_NUM_TYPES_FILE_BROWSER] =
|
||||||
const unsigned long long Brw_MAX_QUOTA_BRIEF[Rol_NUM_ROLES] = // MaxRole is used
|
const unsigned long long Brw_MAX_QUOTA_BRIEF[Rol_NUM_ROLES] = // MaxRole is used
|
||||||
{
|
{
|
||||||
0, // Rol_ROLE_UNKNOWN
|
0, // Rol_ROLE_UNKNOWN
|
||||||
0, // Rol_ROLE_GUEST
|
0, // Rol_ROLE_GUEST__
|
||||||
0, // Rol_ROLE_VISITOR
|
0, // Rol_ROLE_VISITOR
|
||||||
32ULL*Brw_GiB, // Rol_ROLE_STUDENT
|
32ULL*Brw_GiB, // Rol_ROLE_STUDENT
|
||||||
64ULL*Brw_GiB, // Rol_ROLE_TEACHER
|
64ULL*Brw_GiB, // Rol_ROLE_TEACHER
|
||||||
0, // Rol_ROLE_DEG_ADMIN
|
0, // Rol_ROLE_DEG_ADM
|
||||||
0, // Rol_ROLE_CTR_ADMIN
|
0, // Rol_ROLE_CTR_ADM
|
||||||
0, // Rol_ROLE_INS_ADMIN
|
0, // Rol_ROLE_INS_ADM
|
||||||
0, // Rol_ROLE_SUPERUSER
|
0, // Rol_ROLE_SYS_ADM
|
||||||
};
|
};
|
||||||
#define Brw_MAX_FILES_BRIEF 5000
|
#define Brw_MAX_FILES_BRIEF 5000
|
||||||
#define Brw_MAX_FOLDS_BRIEF 1000
|
#define Brw_MAX_FOLDS_BRIEF 1000
|
||||||
|
@ -1362,7 +1362,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
||||||
{
|
{
|
||||||
/***** Documents of institution *****/
|
/***** Documents of institution *****/
|
||||||
case ActSeeAdmDocIns: // Access to a documents zone from menu
|
case ActSeeAdmDocIns: // Access to a documents zone from menu
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
/* These roles can edit documents of institution */
|
/* These roles can edit documents of institution */
|
||||||
Gbl.FileBrowser.Type = Brw_ADMI_DOCUM_INS;
|
Gbl.FileBrowser.Type = Brw_ADMI_DOCUM_INS;
|
||||||
else
|
else
|
||||||
|
@ -1405,7 +1405,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
||||||
|
|
||||||
/***** Documents of centre *****/
|
/***** Documents of centre *****/
|
||||||
case ActSeeAdmDocCtr: // Access to a documents zone from menu
|
case ActSeeAdmDocCtr: // Access to a documents zone from menu
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
/* These roles can edit documents of centre */
|
/* These roles can edit documents of centre */
|
||||||
Gbl.FileBrowser.Type = Brw_ADMI_DOCUM_CTR;
|
Gbl.FileBrowser.Type = Brw_ADMI_DOCUM_CTR;
|
||||||
else
|
else
|
||||||
|
@ -1448,7 +1448,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
||||||
|
|
||||||
/***** Documents of degree *****/
|
/***** Documents of degree *****/
|
||||||
case ActSeeAdmDocDeg: // Access to a documents zone from menu
|
case ActSeeAdmDocDeg: // Access to a documents zone from menu
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
/* These roles can edit documents of degree */
|
/* These roles can edit documents of degree */
|
||||||
Gbl.FileBrowser.Type = Brw_ADMI_DOCUM_DEG;
|
Gbl.FileBrowser.Type = Brw_ADMI_DOCUM_DEG;
|
||||||
else
|
else
|
||||||
|
@ -1495,7 +1495,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
/* These roles can edit documents of course/groups */
|
/* These roles can edit documents of course/groups */
|
||||||
Gbl.FileBrowser.Type = (Gbl.CurrentCrs.Grps.GrpCod > 0) ? Brw_ADMI_DOCUM_GRP :
|
Gbl.FileBrowser.Type = (Gbl.CurrentCrs.Grps.GrpCod > 0) ? Brw_ADMI_DOCUM_GRP :
|
||||||
Brw_ADMI_DOCUM_CRS;
|
Brw_ADMI_DOCUM_CRS;
|
||||||
|
@ -1892,7 +1892,7 @@ void Brw_GetParAndInitFileBrowser (void)
|
||||||
// If I belong to the current course or I am superuser, or file browser is briefcase ==> get whether show full tree from form
|
// If I belong to the current course or I am superuser, or file browser is briefcase ==> get whether show full tree from form
|
||||||
// Else ==> show full tree (only public files)
|
// Else ==> show full tree (only public files)
|
||||||
Gbl.FileBrowser.ShowOnlyPublicFiles = false;
|
Gbl.FileBrowser.ShowOnlyPublicFiles = false;
|
||||||
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SYS_ADM)
|
||||||
switch (Gbl.FileBrowser.Type)
|
switch (Gbl.FileBrowser.Type)
|
||||||
{
|
{
|
||||||
case Brw_SHOW_DOCUM_INS:
|
case Brw_SHOW_DOCUM_INS:
|
||||||
|
@ -2643,8 +2643,8 @@ void Brw_AskEditWorksCrs (void)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActReqAsgWrkCrs);
|
Usr_ShowFormsToSelectUsrListType (ActReqAsgWrkCrs);
|
||||||
|
|
||||||
/***** Get and order lists of users from this course *****/
|
/***** Get and order lists of users from this course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_CRS,NULL,false);
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
||||||
Gbl.Usrs.LstStds.NumUsrs)
|
Gbl.Usrs.LstStds.NumUsrs)
|
||||||
|
@ -3123,7 +3123,7 @@ static void Brw_ShowFileBrowser (void)
|
||||||
static void Brw_WriteTopBeforeShowingFileBrowser (void)
|
static void Brw_WriteTopBeforeShowingFileBrowser (void)
|
||||||
{
|
{
|
||||||
bool IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER );
|
bool IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER );
|
||||||
bool IAmSuperuser = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
bool IAmSuperuser = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
|
|
||||||
/***** Update last access to this file browser *****/
|
/***** Update last access to this file browser *****/
|
||||||
Brw_UpdateLastAccess ();
|
Brw_UpdateLastAccess ();
|
||||||
|
@ -3132,27 +3132,27 @@ static void Brw_WriteTopBeforeShowingFileBrowser (void)
|
||||||
switch (Gbl.FileBrowser.Type)
|
switch (Gbl.FileBrowser.Type)
|
||||||
{
|
{
|
||||||
case Brw_SHOW_DOCUM_INS:
|
case Brw_SHOW_DOCUM_INS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
Brw_PutFormToShowOrAdmin (Brw_ADMIN,ActAdmDocIns);
|
Brw_PutFormToShowOrAdmin (Brw_ADMIN,ActAdmDocIns);
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOCUM_INS:
|
case Brw_ADMI_DOCUM_INS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeDocIns);
|
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeDocIns);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_CTR:
|
case Brw_SHOW_DOCUM_CTR:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
Brw_PutFormToShowOrAdmin (Brw_ADMIN,ActAdmDocCtr);
|
Brw_PutFormToShowOrAdmin (Brw_ADMIN,ActAdmDocCtr);
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOCUM_CTR:
|
case Brw_ADMI_DOCUM_CTR:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_CTR_ADM)
|
||||||
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeDocCtr);
|
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeDocCtr);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_DEG:
|
case Brw_SHOW_DOCUM_DEG:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
Brw_PutFormToShowOrAdmin (Brw_ADMIN,ActAdmDocDeg);
|
Brw_PutFormToShowOrAdmin (Brw_ADMIN,ActAdmDocDeg);
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOCUM_DEG:
|
case Brw_ADMI_DOCUM_DEG:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeDocDeg);
|
Brw_PutFormToShowOrAdmin (Brw_SHOW,ActSeeDocDeg);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_CRS:
|
case Brw_SHOW_DOCUM_CRS:
|
||||||
|
@ -8463,15 +8463,15 @@ void Brw_ShowFileMetadata (void)
|
||||||
switch (Gbl.FileBrowser.Type)
|
switch (Gbl.FileBrowser.Type)
|
||||||
{
|
{
|
||||||
case Brw_SHOW_DOCUM_INS:
|
case Brw_SHOW_DOCUM_INS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_INS_ADM)
|
||||||
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_CTR:
|
case Brw_SHOW_DOCUM_CTR:
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_CTR_ADM)
|
||||||
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_DEG:
|
case Brw_SHOW_DOCUM_DEG:
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_DEG_ADM)
|
||||||
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_CRS:
|
case Brw_SHOW_DOCUM_CRS:
|
||||||
|
@ -8880,15 +8880,15 @@ void Brw_DownloadFile (void)
|
||||||
switch (Gbl.FileBrowser.Type)
|
switch (Gbl.FileBrowser.Type)
|
||||||
{
|
{
|
||||||
case Brw_SHOW_DOCUM_INS:
|
case Brw_SHOW_DOCUM_INS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_INS_ADM)
|
||||||
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_CTR:
|
case Brw_SHOW_DOCUM_CTR:
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_CTR_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_CTR_ADM)
|
||||||
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_DEG:
|
case Brw_SHOW_DOCUM_DEG:
|
||||||
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole < Rol_ROLE_DEG_ADM)
|
||||||
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
ICanView = !Brw_CheckIfFileOrFolderIsHidden (&FileMetadata);
|
||||||
break;
|
break;
|
||||||
case Brw_SHOW_DOCUM_CRS:
|
case Brw_SHOW_DOCUM_CRS:
|
||||||
|
@ -9026,7 +9026,7 @@ static bool Brw_CheckIfICanEditFileMetadata (long PublisherUsrCod)
|
||||||
else // The file has no publisher
|
else // The file has no publisher
|
||||||
{
|
{
|
||||||
ZoneUsrCod = Brw_GetZoneUsrCodForFiles ();
|
ZoneUsrCod = Brw_GetZoneUsrCodForFiles ();
|
||||||
if ((ZoneUsrCod <= 0 && Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER) || // It's a zone without owner and I am a superuser (I may be the future owner)
|
if ((ZoneUsrCod <= 0 && Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM) || // It's a zone without owner and I am a superuser (I may be the future owner)
|
||||||
ZoneUsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // I am the owner
|
ZoneUsrCod == Gbl.Usrs.Me.UsrDat.UsrCod) // I am the owner
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -10209,8 +10209,8 @@ static bool Brw_CheckIfIHavePermissionFileOrFolderCommon (void)
|
||||||
|
|
||||||
return (Gbl.Usrs.Me.UsrDat.UsrCod == PublisherUsrCod); // Am I the publisher of subtree?
|
return (Gbl.Usrs.Me.UsrDat.UsrCod == PublisherUsrCod); // Am I the publisher of subtree?
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -10604,7 +10604,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
||||||
Deg_PutParamDegCod (InsCod);
|
Deg_PutParamDegCod (InsCod);
|
||||||
sprintf (Gbl.Title,Txt_Go_to_X,InsShortName);
|
sprintf (Gbl.Title,Txt_Go_to_X,InsShortName);
|
||||||
Act_LinkFormSubmit (Gbl.Title,"DAT");
|
Act_LinkFormSubmit (Gbl.Title,"DAT");
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,InsCod,InsShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,InsCod,InsShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s</a>"
|
fprintf (Gbl.F.Out," %s</a>"
|
||||||
"</form>",
|
"</form>",
|
||||||
|
@ -10622,7 +10622,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
||||||
Deg_PutParamDegCod (CtrCod);
|
Deg_PutParamDegCod (CtrCod);
|
||||||
sprintf (Gbl.Title,Txt_Go_to_X,CtrShortName);
|
sprintf (Gbl.Title,Txt_Go_to_X,CtrShortName);
|
||||||
Act_LinkFormSubmit (Gbl.Title,"DAT");
|
Act_LinkFormSubmit (Gbl.Title,"DAT");
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,CtrCod,CtrShortName,
|
Log_DrawLogo (Sco_SCOPE_CTR,CtrCod,CtrShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s</a>"
|
fprintf (Gbl.F.Out," %s</a>"
|
||||||
"</form>",
|
"</form>",
|
||||||
|
@ -10640,7 +10640,7 @@ static void Brw_WriteRowDocData (unsigned *NumDocsNotHidden,MYSQL_ROW row)
|
||||||
Deg_PutParamDegCod (DegCod);
|
Deg_PutParamDegCod (DegCod);
|
||||||
sprintf (Gbl.Title,Txt_Go_to_X,DegShortName);
|
sprintf (Gbl.Title,Txt_Go_to_X,DegShortName);
|
||||||
Act_LinkFormSubmit (Gbl.Title,"DAT");
|
Act_LinkFormSubmit (Gbl.Title,"DAT");
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,DegCod,DegShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,DegCod,DegShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s</a>"
|
fprintf (Gbl.F.Out," %s</a>"
|
||||||
"</form>",
|
"</form>",
|
||||||
|
|
60
swad_forum.c
60
swad_forum.c
|
@ -859,7 +859,7 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
|
||||||
long PstCod;
|
long PstCod;
|
||||||
bool NewPst = false;
|
bool NewPst = false;
|
||||||
bool ICanModerateForum = false;
|
bool ICanModerateForum = false;
|
||||||
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
|
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // If I have permission to move threads...
|
||||||
|
|
||||||
/***** Get data of the thread *****/
|
/***** Get data of the thread *****/
|
||||||
Thr.ThrCod = ThrCod;
|
Thr.ThrCod = ThrCod;
|
||||||
|
@ -937,20 +937,20 @@ static void For_ShowThreadPosts (long ThrCod,char *LastSubject)
|
||||||
case For_FORUM_SWAD_USRS: case For_FORUM_SWAD_TCHS:
|
case For_FORUM_SWAD_USRS: case For_FORUM_SWAD_TCHS:
|
||||||
case For_FORUM_GLOBAL_USRS: case For_FORUM_GLOBAL_TCHS:
|
case For_FORUM_GLOBAL_USRS: case For_FORUM_GLOBAL_TCHS:
|
||||||
case For_FORUM_CENTRE_USRS: case For_FORUM_CENTRE_TCHS:
|
case For_FORUM_CENTRE_USRS: case For_FORUM_CENTRE_TCHS:
|
||||||
ICanModerateForum = Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER;
|
ICanModerateForum = Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM;
|
||||||
break;
|
break;
|
||||||
case For_FORUM_INSTITUTION_USRS: case For_FORUM_INSTITUTION_TCHS:
|
case For_FORUM_INSTITUTION_USRS: case For_FORUM_INSTITUTION_TCHS:
|
||||||
ICanModerateForum = Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER;
|
ICanModerateForum = Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM;
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_USRS: case For_FORUM_DEGREE_TCHS:
|
case For_FORUM_DEGREE_USRS: case For_FORUM_DEGREE_TCHS:
|
||||||
case For_FORUM_COURSE_TCHS:
|
case For_FORUM_COURSE_TCHS:
|
||||||
ICanModerateForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
ICanModerateForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_COURSE_USRS:
|
case For_FORUM_COURSE_USRS:
|
||||||
ICanModerateForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
ICanModerateForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1519,35 +1519,35 @@ void For_SetForumTypeAndRestrictAccess (void)
|
||||||
switch (Gbl.Forum.ForumType)
|
switch (Gbl.Forum.ForumType)
|
||||||
{
|
{
|
||||||
case For_FORUM_COURSE_USRS:
|
case For_FORUM_COURSE_USRS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_STUDENT);
|
Rol_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_STUDENT);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_COURSE_TCHS:
|
case For_FORUM_COURSE_TCHS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyRoleInCrs (Gbl.Forum.Crs.CrsCod) >= Rol_ROLE_TEACHER);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_USRS:
|
case For_FORUM_DEGREE_USRS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_STUDENT);
|
Rol_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_STUDENT);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_TCHS:
|
case For_FORUM_DEGREE_TCHS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyMaxRoleInDeg (Gbl.Forum.Deg.DegCod) >= Rol_ROLE_TEACHER);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_CENTRE_USRS:
|
case For_FORUM_CENTRE_USRS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_STUDENT);
|
Rol_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_STUDENT);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_CENTRE_TCHS:
|
case For_FORUM_CENTRE_TCHS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyMaxRoleInCtr (Gbl.Forum.Ctr.CtrCod) >= Rol_ROLE_TEACHER);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_INSTITUTION_USRS:
|
case For_FORUM_INSTITUTION_USRS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_STUDENT);
|
Rol_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_STUDENT);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_INSTITUTION_TCHS:
|
case For_FORUM_INSTITUTION_TCHS:
|
||||||
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyMaxRoleInIns (Gbl.Forum.Ins.InsCod) >= Rol_ROLE_TEACHER);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_GLOBAL_USRS:
|
case For_FORUM_GLOBAL_USRS:
|
||||||
|
@ -1571,7 +1571,7 @@ void For_ShowForumList (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ClassFormul[The_NUM_THEMES];
|
extern const char *The_ClassFormul[The_NUM_THEMES];
|
||||||
extern const char *Txt_Forums;
|
extern const char *Txt_Forums;
|
||||||
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
|
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // If I have permission to move threads...
|
||||||
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
|
bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS];
|
||||||
unsigned NumMyIns;
|
unsigned NumMyIns;
|
||||||
MYSQL_RES *mysql_resCtr;
|
MYSQL_RES *mysql_resCtr;
|
||||||
|
@ -1616,7 +1616,7 @@ void For_ShowForumList (void)
|
||||||
switch (Gbl.Forum.WhichForums)
|
switch (Gbl.Forum.WhichForums)
|
||||||
{
|
{
|
||||||
case For_ONLY_CURRENT_FORUMS:
|
case For_ONLY_CURRENT_FORUMS:
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
ICanSeeInsForum = true;
|
ICanSeeInsForum = true;
|
||||||
else
|
else
|
||||||
ICanSeeInsForum = Usr_CheckIfIBelongToIns (Gbl.CurrentIns.Ins.InsCod);
|
ICanSeeInsForum = Usr_CheckIfIBelongToIns (Gbl.CurrentIns.Ins.InsCod);
|
||||||
|
@ -1626,7 +1626,7 @@ void For_ShowForumList (void)
|
||||||
|
|
||||||
if (ICanSeeInsForum)
|
if (ICanSeeInsForum)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
ICanSeeCtrForum = true;
|
ICanSeeCtrForum = true;
|
||||||
else
|
else
|
||||||
ICanSeeCtrForum = Usr_CheckIfIBelongToCtr (Gbl.CurrentCtr.Ctr.CtrCod);
|
ICanSeeCtrForum = Usr_CheckIfIBelongToCtr (Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
@ -1635,7 +1635,7 @@ void For_ShowForumList (void)
|
||||||
if (For_WriteLinksToInsForums (Gbl.CurrentIns.Ins.InsCod,true,IsLastItemInLevel) > 0)
|
if (For_WriteLinksToInsForums (Gbl.CurrentIns.Ins.InsCod,true,IsLastItemInLevel) > 0)
|
||||||
if (ICanSeeCtrForum)
|
if (ICanSeeCtrForum)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
ICanSeeDegForum = true;
|
ICanSeeDegForum = true;
|
||||||
else
|
else
|
||||||
ICanSeeDegForum = Usr_CheckIfIBelongToDeg (Gbl.CurrentDeg.Deg.DegCod);
|
ICanSeeDegForum = Usr_CheckIfIBelongToDeg (Gbl.CurrentDeg.Deg.DegCod);
|
||||||
|
@ -1646,7 +1646,7 @@ void For_ShowForumList (void)
|
||||||
/***** Links to forums of current degree *****/
|
/***** Links to forums of current degree *****/
|
||||||
if (For_WriteLinksToDegForums (Gbl.CurrentDeg.Deg.DegCod,true,IsLastItemInLevel) > 0)
|
if (For_WriteLinksToDegForums (Gbl.CurrentDeg.Deg.DegCod,true,IsLastItemInLevel) > 0)
|
||||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
if (Gbl.Usrs.Me.IBelongToCurrentCrs ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
/***** Links to forums of current degree *****/
|
/***** Links to forums of current degree *****/
|
||||||
For_WriteLinksToCrsForums (Gbl.CurrentCrs.Crs.CrsCod,true,IsLastItemInLevel);
|
For_WriteLinksToCrsForums (Gbl.CurrentCrs.Crs.CrsCod,true,IsLastItemInLevel);
|
||||||
}
|
}
|
||||||
|
@ -1817,7 +1817,7 @@ static void For_WriteLinksToGblForums (bool IsLastItemInLevel[1+For_FORUM_MAX_LE
|
||||||
|
|
||||||
static void For_WriteLinksToPlatformForums (bool IsLastForum,bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS])
|
static void For_WriteLinksToPlatformForums (bool IsLastForum,bool IsLastItemInLevel[1+For_FORUM_MAX_LEVELS])
|
||||||
{
|
{
|
||||||
bool ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
bool ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Gbl.Usrs.Me.UsrDat.Roles >= (1 << Rol_ROLE_TEACHER));
|
Gbl.Usrs.Me.UsrDat.Roles >= (1 << Rol_ROLE_TEACHER));
|
||||||
|
|
||||||
/***** Link to forum of users about the platform *****/
|
/***** Link to forum of users about the platform *****/
|
||||||
|
@ -1843,7 +1843,7 @@ static long For_WriteLinksToInsForums (long InsCod,bool IsLastIns,bool IsLastIte
|
||||||
|
|
||||||
if (InsCod > 0)
|
if (InsCod > 0)
|
||||||
{
|
{
|
||||||
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInIns (InsCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyMaxRoleInIns (InsCod) >= Rol_ROLE_TEACHER);
|
||||||
|
|
||||||
/***** Get data of this institution *****/
|
/***** Get data of this institution *****/
|
||||||
|
@ -1876,7 +1876,7 @@ static long For_WriteLinksToCtrForums (long CtrCod,bool IsLastCtr,bool IsLastIte
|
||||||
|
|
||||||
if (CtrCod > 0)
|
if (CtrCod > 0)
|
||||||
{
|
{
|
||||||
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInCtr (CtrCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyMaxRoleInCtr (CtrCod) >= Rol_ROLE_TEACHER);
|
||||||
|
|
||||||
/***** Get data of this centre *****/
|
/***** Get data of this centre *****/
|
||||||
|
@ -1909,7 +1909,7 @@ static long For_WriteLinksToDegForums (long DegCod,bool IsLastDeg,bool IsLastIte
|
||||||
|
|
||||||
if (DegCod > 0)
|
if (DegCod > 0)
|
||||||
{
|
{
|
||||||
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyMaxRoleInDeg (DegCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyMaxRoleInDeg (DegCod) >= Rol_ROLE_TEACHER);
|
||||||
|
|
||||||
/***** Get data of this degree *****/
|
/***** Get data of this degree *****/
|
||||||
|
@ -1942,7 +1942,7 @@ static long For_WriteLinksToCrsForums (long CrsCod,bool IsLastCrs,bool IsLastIte
|
||||||
|
|
||||||
if (CrsCod > 0)
|
if (CrsCod > 0)
|
||||||
{
|
{
|
||||||
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
ICanSeeTeacherForum = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
Rol_GetMyRoleInCrs (CrsCod) >= Rol_ROLE_TEACHER);
|
Rol_GetMyRoleInCrs (CrsCod) >= Rol_ROLE_TEACHER);
|
||||||
|
|
||||||
/***** Get data of this course *****/
|
/***** Get data of this course *****/
|
||||||
|
@ -2148,17 +2148,17 @@ static void For_WriteLinkToForum (For_ForumType_t ForumType,Act_Action_t NextAct
|
||||||
{
|
{
|
||||||
case For_FORUM_INSTITUTION_USRS:
|
case For_FORUM_INSTITUTION_USRS:
|
||||||
case For_FORUM_INSTITUTION_TCHS:
|
case For_FORUM_INSTITUTION_TCHS:
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Gbl.Forum.Ins.InsCod,ForumName,
|
Log_DrawLogo (Sco_SCOPE_INS,Gbl.Forum.Ins.InsCod,ForumName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_CENTRE_USRS:
|
case For_FORUM_CENTRE_USRS:
|
||||||
case For_FORUM_CENTRE_TCHS:
|
case For_FORUM_CENTRE_TCHS:
|
||||||
Log_DrawLogo (Sco_SCOPE_CENTRE,Gbl.Forum.Ctr.CtrCod,ForumName,
|
Log_DrawLogo (Sco_SCOPE_CTR,Gbl.Forum.Ctr.CtrCod,ForumName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_USRS:
|
case For_FORUM_DEGREE_USRS:
|
||||||
case For_FORUM_DEGREE_TCHS:
|
case For_FORUM_DEGREE_TCHS:
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Gbl.Forum.Deg.DegCod,ForumName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Gbl.Forum.Deg.DegCod,ForumName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2360,7 +2360,7 @@ void For_ShowForumThrs (void)
|
||||||
For_ForumOrderType_t Order;
|
For_ForumOrderType_t Order;
|
||||||
long ThrCods[Pag_ITEMS_PER_PAGE];
|
long ThrCods[Pag_ITEMS_PER_PAGE];
|
||||||
struct Pagination PaginationThrs;
|
struct Pagination PaginationThrs;
|
||||||
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
|
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // If I have permission to move threads...
|
||||||
|
|
||||||
/***** Get if there is a thread ready to be moved *****/
|
/***** Get if there is a thread ready to be moved *****/
|
||||||
if (ICanMoveThreads)
|
if (ICanMoveThreads)
|
||||||
|
@ -3110,7 +3110,7 @@ void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],struct Pagination *Pagi
|
||||||
const char *DateTime;
|
const char *DateTime;
|
||||||
struct Pagination PaginationPsts;
|
struct Pagination PaginationPsts;
|
||||||
const char *Style;
|
const char *Style;
|
||||||
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // If I have permission to move threads...
|
bool ICanMoveThreads = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // If I have permission to move threads...
|
||||||
long ThreadInMyClipboard = -1L;
|
long ThreadInMyClipboard = -1L;
|
||||||
bool ThisThreadIsInMyClipboard;
|
bool ThisThreadIsInMyClipboard;
|
||||||
unsigned Column;
|
unsigned Column;
|
||||||
|
|
|
@ -403,7 +403,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Stat.RowsPerPage = 50;
|
Gbl.Stat.RowsPerPage = 50;
|
||||||
Gbl.Stat.UseStatType = Sta_DEGREES_AND_COURSES;
|
Gbl.Stat.UseStatType = Sta_DEGREES_AND_COURSES;
|
||||||
|
|
||||||
Gbl.Scope.Current = Sco_SCOPE_COURSE;
|
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
||||||
|
|
||||||
Gbl.Usrs.Connected.TimeToRefreshInMs = Con_MAX_TIME_TO_REFRESH_CONNECTED_IN_MS;
|
Gbl.Usrs.Connected.TimeToRefreshInMs = Con_MAX_TIME_TO_REFRESH_CONNECTED_IN_MS;
|
||||||
|
|
||||||
|
|
|
@ -1519,7 +1519,7 @@ void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrS
|
||||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||||
}
|
}
|
||||||
if (!(IBelongToThisGroup ||
|
if (!(IBelongToThisGroup ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||||
fprintf (Gbl.F.Out," onclick=\"uncheckParent(this,'WholeCrs')\" /></td>");
|
fprintf (Gbl.F.Out," onclick=\"uncheckParent(this,'WholeCrs')\" /></td>");
|
||||||
|
|
||||||
|
@ -1545,7 +1545,7 @@ void Grp_ReqRegisterInGrps (void)
|
||||||
|
|
||||||
/***** Put link (form) to edit groups *****/
|
/***** Put link (form) to edit groups *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_PutFormToEdit (ActReqEdiGrp);
|
Lay_PutFormToEdit (ActReqEdiGrp);
|
||||||
|
|
||||||
/***** Check if this course has groups *****/
|
/***** Check if this course has groups *****/
|
||||||
|
@ -1799,7 +1799,7 @@ static void Grp_ListGrpsToAddOrRemUsrs (struct GroupType *GrpTyp,long UsrCod)
|
||||||
if (UsrBelongsToThisGroup)
|
if (UsrBelongsToThisGroup)
|
||||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||||
if (!(IBelongToThisGroup ||
|
if (!(IBelongToThisGroup ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||||
fprintf (Gbl.F.Out," /></td>");
|
fprintf (Gbl.F.Out," /></td>");
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ void Hld_SeeHolidays (void)
|
||||||
Hld_GetListHolidays ();
|
Hld_GetListHolidays ();
|
||||||
|
|
||||||
/***** Put link (form) to edit holidays *****/
|
/***** Put link (form) to edit holidays *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Hld_PutFormToEditHlds ();
|
Hld_PutFormToEditHlds ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
|
|
@ -101,13 +101,13 @@ void Ind_ReqIndicatorsCourses (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td style=\"text-align:left; vertical-align:middle;\">",
|
"<td style=\"text-align:left; vertical-align:middle;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
Sco_PutSelectorScope (false);
|
Sco_PutSelectorScope (false);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
@ -213,17 +213,17 @@ void Ind_ShowIndicatorsCourses (void)
|
||||||
unsigned NumCrss;
|
unsigned NumCrss;
|
||||||
|
|
||||||
/***** Get users range for statistics of courses *****/
|
/***** Get users range for statistics of courses *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
|
||||||
/***** Get degree type code *****/
|
/***** Get degree type code *****/
|
||||||
Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_PLATFORM) ? Deg_GetParamOtherDegTypCod () :
|
Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_SYS) ? Deg_GetParamOtherDegTypCod () :
|
||||||
-1L;
|
-1L;
|
||||||
|
|
||||||
/***** Get department code *****/
|
/***** Get department code *****/
|
||||||
|
@ -266,7 +266,7 @@ static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res)
|
||||||
|
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
if (Gbl.Stat.DptCod > 0)
|
if (Gbl.Stat.DptCod > 0)
|
||||||
{
|
{
|
||||||
if (Gbl.Stat.DegTypCod > 0)
|
if (Gbl.Stat.DegTypCod > 0)
|
||||||
|
@ -310,7 +310,7 @@ static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res)
|
||||||
" ORDER BY degrees.FullName,courses.FullName");
|
" ORDER BY degrees.FullName,courses.FullName");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (Gbl.Stat.DptCod > 0)
|
if (Gbl.Stat.DptCod > 0)
|
||||||
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
|
@ -334,7 +334,7 @@ static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res)
|
||||||
" ORDER BY degrees.FullName,courses.FullName",
|
" ORDER BY degrees.FullName,courses.FullName",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (Gbl.Stat.DptCod > 0)
|
if (Gbl.Stat.DptCod > 0)
|
||||||
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
|
@ -356,7 +356,7 @@ static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res)
|
||||||
" ORDER BY degrees.FullName,courses.FullName",
|
" ORDER BY degrees.FullName,courses.FullName",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (Gbl.Stat.DptCod > 0)
|
if (Gbl.Stat.DptCod > 0)
|
||||||
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
|
@ -378,7 +378,7 @@ static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res)
|
||||||
" ORDER BY degrees.FullName,courses.FullName",
|
" ORDER BY degrees.FullName,courses.FullName",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (Gbl.Stat.DptCod > 0)
|
if (Gbl.Stat.DptCod > 0)
|
||||||
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
sprintf (Query,"SELECT DISTINCTROW degrees.FullName,courses.FullName,courses.CrsCod,courses.InsCrsCod"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
|
|
|
@ -325,7 +325,7 @@ void Inf_ShowInfo (void)
|
||||||
Inf_PutFormToConfirmIHaveReadInfo (InfoType);
|
Inf_PutFormToConfirmIHaveReadInfo (InfoType);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
/* Put link (form) to edit this course info */
|
/* Put link (form) to edit this course info */
|
||||||
Inf_PutFormToEditInfo (InfoType);
|
Inf_PutFormToEditInfo (InfoType);
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ void Inf_ShowInfo (void)
|
||||||
// TODO: Remove the following lines, here only for debug purposes
|
// TODO: Remove the following lines, here only for debug purposes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
char QueryDebug[512*1024];
|
char QueryDebug[512*1024];
|
||||||
char *HTMLBuffer;
|
char *HTMLBuffer;
|
||||||
|
@ -382,7 +382,7 @@ void Inf_ShowInfo (void)
|
||||||
// TODO: Remove the following lines, here only for debug purposes
|
// TODO: Remove the following lines, here only for debug purposes
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
char QueryDebug[512*1024];
|
char QueryDebug[512*1024];
|
||||||
char *HTMLBuffer;
|
char *HTMLBuffer;
|
||||||
|
|
|
@ -103,7 +103,7 @@ void Ins_SeeInsWithPendingCtrs (void)
|
||||||
/***** Get institutions with pending centres *****/
|
/***** Get institutions with pending centres *****/
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_INS_ADMIN:
|
case Rol_ROLE_INS_ADM:
|
||||||
sprintf (Query,"SELECT centres.InsCod,COUNT(*)"
|
sprintf (Query,"SELECT centres.InsCod,COUNT(*)"
|
||||||
" FROM centres,ins_admin,institutions"
|
" FROM centres,ins_admin,institutions"
|
||||||
" WHERE (centres.Status & %u)<>0"
|
" WHERE (centres.Status & %u)<>0"
|
||||||
|
@ -112,7 +112,7 @@ void Ins_SeeInsWithPendingCtrs (void)
|
||||||
" GROUP BY centres.InsCod ORDER BY institutions.ShortName",
|
" GROUP BY centres.InsCod ORDER BY institutions.ShortName",
|
||||||
(unsigned) Ctr_STATUS_BIT_PENDING,Gbl.Usrs.Me.UsrDat.UsrCod);
|
(unsigned) Ctr_STATUS_BIT_PENDING,Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
sprintf (Query,"SELECT centres.InsCod,COUNT(*)"
|
sprintf (Query,"SELECT centres.InsCod,COUNT(*)"
|
||||||
" FROM centres,institutions"
|
" FROM centres,institutions"
|
||||||
" WHERE (centres.Status & %u)<>0"
|
" WHERE (centres.Status & %u)<>0"
|
||||||
|
@ -163,7 +163,7 @@ void Ins_SeeInsWithPendingCtrs (void)
|
||||||
" vertical-align:middle; background-color:%s;\">"
|
" vertical-align:middle; background-color:%s;\">"
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||||
BgColor,Ins.WWW,Ins.FullName);
|
BgColor,Ins.WWW,Ins.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins.InsCod,Ins.ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -255,8 +255,8 @@ static void Ins_Configuration (bool PrintView)
|
||||||
Lay_PutLinkToPrintView2 ();
|
Lay_PutLinkToPrintView2 ();
|
||||||
|
|
||||||
/* Link to upload logo */
|
/* Link to upload logo */
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADMIN)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_INS_ADM)
|
||||||
Log_PutFormToChangeLogo (Sco_SCOPE_INSTITUTION);
|
Log_PutFormToChangeLogo (Sco_SCOPE_INS);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
@ -273,7 +273,7 @@ static void Ins_Configuration (bool PrintView)
|
||||||
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
" class=\"TITLE_LOCATION\" title=\"%s\">",
|
||||||
Gbl.CurrentIns.Ins.WWW,
|
Gbl.CurrentIns.Ins.WWW,
|
||||||
Gbl.CurrentIns.Ins.FullName);
|
Gbl.CurrentIns.Ins.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Gbl.CurrentIns.Ins.InsCod,
|
Log_DrawLogo (Sco_SCOPE_INS,Gbl.CurrentIns.Ins.InsCod,
|
||||||
Gbl.CurrentIns.Ins.ShortName,64,NULL,true);
|
Gbl.CurrentIns.Ins.ShortName,64,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"<br />%s",Gbl.CurrentIns.Ins.FullName);
|
fprintf (Gbl.F.Out,"<br />%s",Gbl.CurrentIns.Ins.FullName);
|
||||||
if (PutLink)
|
if (PutLink)
|
||||||
|
@ -468,7 +468,7 @@ void Ins_ShowInssOfCurrentCty (void)
|
||||||
Deg_WriteMenuAllCourses (ActSeeIns,ActUnk,ActUnk,ActUnk);
|
Deg_WriteMenuAllCourses (ActSeeIns,ActUnk,ActUnk,ActUnk);
|
||||||
|
|
||||||
/***** Put link (form) to edit institutions *****/
|
/***** Put link (form) to edit institutions *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST)
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_GUEST__)
|
||||||
Lay_PutFormToEdit (ActEdiIns);
|
Lay_PutFormToEdit (ActEdiIns);
|
||||||
|
|
||||||
/***** List institutions *****/
|
/***** List institutions *****/
|
||||||
|
@ -536,7 +536,7 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu
|
||||||
"<a href=\"%s\" target=\"_blank\" title=\"%s\">",
|
"<a href=\"%s\" target=\"_blank\" title=\"%s\">",
|
||||||
BgColor,
|
BgColor,
|
||||||
Ins->WWW,Ins->FullName);
|
Ins->WWW,Ins->FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins->InsCod,Ins->ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->ShortName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -1124,14 +1124,14 @@ static void Ins_ListInstitutionsForEdition (void)
|
||||||
fprintf (Gbl.F.Out,"<td title=\"%s\""
|
fprintf (Gbl.F.Out,"<td title=\"%s\""
|
||||||
" style=\"width:20px; text-align:left;\">",
|
" style=\"width:20px; text-align:left;\">",
|
||||||
Ins->FullName);
|
Ins->FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins->InsCod,Ins->ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->ShortName,
|
||||||
16,NULL,true);
|
16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/* Country */
|
/* Country */
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
" vertical-align:middle;\">");
|
" vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgInsCty);
|
Act_FormStart (ActChgInsCty);
|
||||||
Ins_PutParamOtherInsCod (Ins->InsCod);
|
Ins_PutParamOtherInsCod (Ins->InsCod);
|
||||||
|
@ -1235,7 +1235,7 @@ static void Ins_ListInstitutionsForEdition (void)
|
||||||
StatusTxt = Ins_GetStatusTxtFromStatusBits (Ins->Status);
|
StatusTxt = Ins_GetStatusTxtFromStatusBits (Ins->Status);
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
|
||||||
" vertical-align:middle;\">");
|
" vertical-align:middle;\">");
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER &&
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM &&
|
||||||
StatusTxt == Ins_STATUS_PENDING)
|
StatusTxt == Ins_STATUS_PENDING)
|
||||||
{
|
{
|
||||||
Act_FormStart (ActChgInsSta);
|
Act_FormStart (ActChgInsSta);
|
||||||
|
@ -1285,7 +1285,7 @@ static void Ins_ListInstitutionsForEdition (void)
|
||||||
|
|
||||||
static bool Ins_CheckIfICanEdit (struct Institution *Ins)
|
static bool Ins_CheckIfICanEdit (struct Institution *Ins)
|
||||||
{
|
{
|
||||||
return (bool) (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER || // I am a superuser
|
return (bool) (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM || // I am a superuser
|
||||||
((Ins->Status & Ins_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated
|
((Ins->Status & Ins_STATUS_BIT_PENDING) != 0 && // Institution is not yet activated
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod == Ins->RequesterUsrCod)); // I am the requester
|
Gbl.Usrs.Me.UsrDat.UsrCod == Ins->RequesterUsrCod)); // I am the requester
|
||||||
}
|
}
|
||||||
|
@ -1698,7 +1698,7 @@ void Ins_ChangeInsStatus (void)
|
||||||
|
|
||||||
void Ins_RequestLogo (void)
|
void Ins_RequestLogo (void)
|
||||||
{
|
{
|
||||||
Log_RequestLogo (Sco_SCOPE_INSTITUTION);
|
Log_RequestLogo (Sco_SCOPE_INS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1707,7 +1707,7 @@ void Ins_RequestLogo (void)
|
||||||
|
|
||||||
void Ins_ReceiveLogo (void)
|
void Ins_ReceiveLogo (void)
|
||||||
{
|
{
|
||||||
Log_ReceiveLogo (Sco_SCOPE_INSTITUTION);
|
Log_ReceiveLogo (Sco_SCOPE_INS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1728,9 +1728,9 @@ static void Ins_PutFormToCreateInstitution (void)
|
||||||
Cty_GetListCountries (Cty_GET_ONLY_COUNTRIES);
|
Cty_GetListCountries (Cty_GET_ONLY_COUNTRIES);
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Act_FormStart (ActNewIns);
|
Act_FormStart (ActNewIns);
|
||||||
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST)
|
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_GUEST__)
|
||||||
Act_FormStart (ActReqIns);
|
Act_FormStart (ActReqIns);
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("You can not edit institutions.");
|
Lay_ShowErrorAndExit ("You can not edit institutions.");
|
||||||
|
@ -1756,7 +1756,7 @@ static void Ins_PutFormToCreateInstitution (void)
|
||||||
|
|
||||||
/***** Institution logo *****/
|
/***** Institution logo *****/
|
||||||
fprintf (Gbl.F.Out,"<td style=\"width:20px; text-align:left;\">");
|
fprintf (Gbl.F.Out,"<td style=\"width:20px; text-align:left;\">");
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,-1L,"",16,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_INS,-1L,"",16,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/***** Country *****/
|
/***** Country *****/
|
||||||
|
|
|
@ -619,7 +619,7 @@ static void Lay_WritePageTopHeading (void)
|
||||||
(Gbl.CurrentIns.Ins.InsCod > 0 ? ActInsSch :
|
(Gbl.CurrentIns.Ins.InsCod > 0 ? ActInsSch :
|
||||||
(Gbl.CurrentCty.Cty.CtyCod > 0 ? ActCtySch :
|
(Gbl.CurrentCty.Cty.CtyCod > 0 ? ActCtySch :
|
||||||
ActSysSch)))));
|
ActSysSch)))));
|
||||||
Sco_PutParamScope (Sco_SCOPE_PLATFORM);
|
Sco_PutParamScope (Sco_SCOPE_SYS);
|
||||||
Sch_PutFormToSearch (Gbl.Prefs.PathTheme);
|
Sch_PutFormToSearch (Gbl.Prefs.PathTheme);
|
||||||
fprintf (Gbl.F.Out,"</form>"
|
fprintf (Gbl.F.Out,"</form>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
@ -875,7 +875,7 @@ static void Lay_ShowRightColumn (void)
|
||||||
fprintf (Gbl.F.Out,"<div id=\"courseconnected\">"); // Used for AJAX based refresh
|
fprintf (Gbl.F.Out,"<div id=\"courseconnected\">"); // Used for AJAX based refresh
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // There is a course selected
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0) // There is a course selected
|
||||||
{
|
{
|
||||||
Gbl.Scope.Current = Sco_SCOPE_COURSE;
|
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
||||||
Con_ShowConnectedUsrsBelongingToScope ();
|
Con_ShowConnectedUsrsBelongingToScope ();
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</div>"); // Used for AJAX based refresh
|
fprintf (Gbl.F.Out,"</div>"); // Used for AJAX based refresh
|
||||||
|
@ -1163,7 +1163,7 @@ void Lay_RefreshNotifsAndConnected (void)
|
||||||
fprintf (Gbl.F.Out,"|");
|
fprintf (Gbl.F.Out,"|");
|
||||||
if (ShowConnected)
|
if (ShowConnected)
|
||||||
{
|
{
|
||||||
Gbl.Scope.Current = Sco_SCOPE_COURSE;
|
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
||||||
Con_ShowConnectedUsrsBelongingToScope ();
|
Con_ShowConnectedUsrsBelongingToScope ();
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"|");
|
fprintf (Gbl.F.Out,"|");
|
||||||
|
@ -1305,7 +1305,7 @@ void Lay_WriteHeaderClassPhoto (unsigned NumColumns,bool PrintView,bool DrawingC
|
||||||
{
|
{
|
||||||
if (!PrintView)
|
if (!PrintView)
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\">",Ins.WWW);
|
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\">",Ins.WWW);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins.InsCod,Ins.ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
||||||
Size,NULL,true);
|
Size,NULL,true);
|
||||||
if (!PrintView)
|
if (!PrintView)
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
@ -1355,7 +1355,7 @@ void Lay_WriteHeaderClassPhoto (unsigned NumColumns,bool PrintView,bool DrawingC
|
||||||
if (!PrintView)
|
if (!PrintView)
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"TIT_CLASSPHOTO\">",
|
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\" class=\"TIT_CLASSPHOTO\">",
|
||||||
Deg.WWW);
|
Deg.WWW);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,Size,NULL,true);
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,Size,NULL,true);
|
||||||
if (!PrintView)
|
if (!PrintView)
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ void Lnk_SeeLinks (void)
|
||||||
Lnk_GetListLinks ();
|
Lnk_GetListLinks ();
|
||||||
|
|
||||||
/***** Put link (form) to edit links *****/
|
/***** Put link (form) to edit links *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lnk_PutFormToEditLinks ();
|
Lnk_PutFormToEditLinks ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
|
24
swad_logo.c
24
swad_logo.c
|
@ -73,15 +73,15 @@ void Log_DrawLogo (Sco_Scope_t Scope,long Cod,const char *AltText,
|
||||||
/***** Set variables depending on scope *****/
|
/***** Set variables depending on scope *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
Folder = Cfg_FOLDER_INS;
|
Folder = Cfg_FOLDER_INS;
|
||||||
Icon = "ins";
|
Icon = "ins";
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
Folder = Cfg_FOLDER_CTR;
|
Folder = Cfg_FOLDER_CTR;
|
||||||
Icon = "ctr";
|
Icon = "ctr";
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
Folder = Cfg_FOLDER_DEG;
|
Folder = Cfg_FOLDER_DEG;
|
||||||
Icon = "deg";
|
Icon = "deg";
|
||||||
break;
|
break;
|
||||||
|
@ -145,19 +145,19 @@ void Log_PutFormToChangeLogo (Sco_Scope_t Scope)
|
||||||
/***** Set variables depending on scope *****/
|
/***** Set variables depending on scope *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
Action = ActReqInsLog;
|
Action = ActReqInsLog;
|
||||||
Cod = Gbl.CurrentIns.Ins.InsCod;
|
Cod = Gbl.CurrentIns.Ins.InsCod;
|
||||||
Folder = Cfg_FOLDER_INS;
|
Folder = Cfg_FOLDER_INS;
|
||||||
Icon = "ins";
|
Icon = "ins";
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
Action = ActReqCtrLog;
|
Action = ActReqCtrLog;
|
||||||
Cod = Gbl.CurrentCtr.Ctr.CtrCod;
|
Cod = Gbl.CurrentCtr.Ctr.CtrCod;
|
||||||
Folder = Cfg_FOLDER_CTR;
|
Folder = Cfg_FOLDER_CTR;
|
||||||
Icon = "ctr";
|
Icon = "ctr";
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
Action = ActReqDegLog;
|
Action = ActReqDegLog;
|
||||||
Cod = Gbl.CurrentDeg.Deg.DegCod;
|
Cod = Gbl.CurrentDeg.Deg.DegCod;
|
||||||
Folder = Cfg_FOLDER_DEG;
|
Folder = Cfg_FOLDER_DEG;
|
||||||
|
@ -199,13 +199,13 @@ void Log_RequestLogo (Sco_Scope_t Scope)
|
||||||
/***** Set action depending on scope *****/
|
/***** Set action depending on scope *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
Action = ActRecInsLog;
|
Action = ActRecInsLog;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
Action = ActRecCtrLog;
|
Action = ActRecCtrLog;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
Action = ActRecDegLog;
|
Action = ActRecDegLog;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -260,17 +260,17 @@ void Log_ReceiveLogo (Sco_Scope_t Scope)
|
||||||
/***** Set variables depending on scope *****/
|
/***** Set variables depending on scope *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
Cod = Gbl.CurrentIns.Ins.InsCod;
|
Cod = Gbl.CurrentIns.Ins.InsCod;
|
||||||
Folder = Cfg_FOLDER_INS;
|
Folder = Cfg_FOLDER_INS;
|
||||||
FunctionConfiguration = Ins_ShowConfiguration;
|
FunctionConfiguration = Ins_ShowConfiguration;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
Cod = Gbl.CurrentCtr.Ctr.CtrCod;
|
Cod = Gbl.CurrentCtr.Ctr.CtrCod;
|
||||||
Folder = Cfg_FOLDER_CTR;
|
Folder = Cfg_FOLDER_CTR;
|
||||||
FunctionConfiguration = Ctr_ShowConfiguration;
|
FunctionConfiguration = Ctr_ShowConfiguration;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
Cod = Gbl.CurrentDeg.Deg.DegCod;
|
Cod = Gbl.CurrentDeg.Deg.DegCod;
|
||||||
Folder = Cfg_FOLDER_DEG;
|
Folder = Cfg_FOLDER_DEG;
|
||||||
FunctionConfiguration = Deg_ShowConfiguration;
|
FunctionConfiguration = Deg_ShowConfiguration;
|
||||||
|
|
|
@ -97,7 +97,7 @@ void Mai_SeeMailDomains (void)
|
||||||
Mai_GetListMailDomainsAllowedForNotif ();
|
Mai_GetListMailDomainsAllowedForNotif ();
|
||||||
|
|
||||||
/***** Put link (form) to edit mail domains *****/
|
/***** Put link (form) to edit mail domains *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Mai_PutFormToEditMailDomains ();
|
Mai_PutFormToEditMailDomains ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
|
|
@ -135,7 +135,7 @@ void Msg_ListEMails (void)
|
||||||
Grp_ShowFormToSelectSeveralGroups (ActMaiStd);
|
Grp_ShowFormToSelectSeveralGroups (ActMaiStd);
|
||||||
|
|
||||||
/***** Get and order list of students in this course *****/
|
/***** Get and order list of students in this course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstStds.NumUsrs)
|
if (Gbl.Usrs.LstStds.NumUsrs)
|
||||||
{
|
{
|
||||||
|
@ -270,7 +270,7 @@ static void Msg_PutFormMsgUsrs (const char *Content)
|
||||||
|
|
||||||
/***** Get list of users belonging to the current course *****/
|
/***** Get list of users belonging to the current course *****/
|
||||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
/***** Get and update type of list, number of columns in class photo
|
/***** Get and update type of list, number of columns in class photo
|
||||||
and preference about view photos *****/
|
and preference about view photos *****/
|
||||||
|
@ -283,8 +283,8 @@ static void Msg_PutFormMsgUsrs (const char *Content)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr);
|
Usr_ShowFormsToSelectUsrListType (ActReqMsgUsr);
|
||||||
|
|
||||||
/***** Get and order lists of users from this course *****/
|
/***** Get and order lists of users from this course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_CRS,NULL,false);
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
||||||
Gbl.Usrs.LstStds.NumUsrs)
|
Gbl.Usrs.LstStds.NumUsrs)
|
||||||
|
@ -374,7 +374,7 @@ void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (bool IsReply)
|
||||||
" background-color:%s;\"",
|
" background-color:%s;\"",
|
||||||
VERY_LIGHT_BLUE);
|
VERY_LIGHT_BLUE);
|
||||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
fprintf (Gbl.F.Out," colspan=\"%u\">%s:",
|
fprintf (Gbl.F.Out," colspan=\"%u\">%s:",
|
||||||
Colspan,Txt_Other_recipients);
|
Colspan,Txt_Other_recipients);
|
||||||
else
|
else
|
||||||
|
@ -387,7 +387,7 @@ void Msg_WriteFormUsrsIDsOrNicksOtherRecipients (bool IsReply)
|
||||||
"<td",
|
"<td",
|
||||||
Txt_nicks_emails_or_IDs_separated_by_commas);
|
Txt_nicks_emails_or_IDs_separated_by_commas);
|
||||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
fprintf (Gbl.F.Out," colspan=\"%u\"",Colspan);
|
fprintf (Gbl.F.Out," colspan=\"%u\"",Colspan);
|
||||||
fprintf (Gbl.F.Out," style=\"text-align:left;\">"
|
fprintf (Gbl.F.Out," style=\"text-align:left;\">"
|
||||||
"<textarea name=\"OtherRecipients\" cols=\"72\" rows=\"2\">");
|
"<textarea name=\"OtherRecipients\" cols=\"72\" rows=\"2\">");
|
||||||
|
@ -1795,11 +1795,11 @@ unsigned Msg_GetNumMsgsSent (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
}
|
}
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM %s",
|
sprintf (Query,"SELECT COUNT(*) FROM %s",
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM centres,degrees,courses,%s"
|
" FROM centres,degrees,courses,%s"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -1810,7 +1810,7 @@ unsigned Msg_GetNumMsgsSent (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM degrees,courses,%s"
|
" FROM degrees,courses,%s"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -1820,7 +1820,7 @@ unsigned Msg_GetNumMsgsSent (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM courses,%s"
|
" FROM courses,%s"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -1829,7 +1829,7 @@ unsigned Msg_GetNumMsgsSent (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM %s"
|
" FROM %s"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -1863,11 +1863,11 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
"msg_rcv_deleted";
|
"msg_rcv_deleted";
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM %s",
|
sprintf (Query,"SELECT COUNT(*) FROM %s",
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM centres,degrees,courses,%s,msg_snt"
|
" FROM centres,degrees,courses,%s,msg_snt"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -1879,7 +1879,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM degrees,courses,%s,msg_snt"
|
" FROM degrees,courses,%s,msg_snt"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -1890,7 +1890,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM courses,%s,msg_snt"
|
" FROM courses,%s,msg_snt"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -1900,7 +1900,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Table);
|
Table);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM msg_snt,%s"
|
" FROM msg_snt,%s"
|
||||||
" WHERE msg_snt.CrsCod='%ld'"
|
" WHERE msg_snt.CrsCod='%ld'"
|
||||||
|
@ -1917,7 +1917,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
case Msg_STATUS_NOTIFIED:
|
case Msg_STATUS_NOTIFIED:
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT "
|
sprintf (Query,"SELECT "
|
||||||
"(SELECT COUNT(*)"
|
"(SELECT COUNT(*)"
|
||||||
" FROM msg_rcv"
|
" FROM msg_rcv"
|
||||||
|
@ -1927,7 +1927,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
" FROM msg_rcv_deleted"
|
" FROM msg_rcv_deleted"
|
||||||
" WHERE Notified='Y')");
|
" WHERE Notified='Y')");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT "
|
sprintf (Query,"SELECT "
|
||||||
"(SELECT COUNT(*)"
|
"(SELECT COUNT(*)"
|
||||||
" FROM centres,degrees,courses,msg_snt,msg_rcv"
|
" FROM centres,degrees,courses,msg_snt,msg_rcv"
|
||||||
|
@ -1949,7 +1949,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT "
|
sprintf (Query,"SELECT "
|
||||||
"(SELECT COUNT(*)"
|
"(SELECT COUNT(*)"
|
||||||
" FROM degrees,courses,msg_snt,msg_rcv"
|
" FROM degrees,courses,msg_snt,msg_rcv"
|
||||||
|
@ -1969,7 +1969,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT "
|
sprintf (Query,"SELECT "
|
||||||
"(SELECT COUNT(*)"
|
"(SELECT COUNT(*)"
|
||||||
" FROM courses,msg_snt,msg_rcv"
|
" FROM courses,msg_snt,msg_rcv"
|
||||||
|
@ -1987,7 +1987,7 @@ unsigned Msg_GetNumMsgsReceived (Sco_Scope_t Scope,Msg_Status_t MsgStatus)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT "
|
sprintf (Query,"SELECT "
|
||||||
"(SELECT COUNT(*)"
|
"(SELECT COUNT(*)"
|
||||||
" FROM msg_snt,msg_rcv"
|
" FROM msg_snt,msg_rcv"
|
||||||
|
|
|
@ -332,13 +332,13 @@ void Net_ShowWebAndSocialNetworksStats (void)
|
||||||
/***** Get number of users with a web / social network *****/
|
/***** Get number of users with a web / social network *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT Web,COUNT(*) AS N"
|
sprintf (Query,"SELECT Web,COUNT(*) AS N"
|
||||||
" FROM usr_webs"
|
" FROM usr_webs"
|
||||||
" GROUP BY Web"
|
" GROUP BY Web"
|
||||||
" ORDER BY N DESC,Web");
|
" ORDER BY N DESC,Web");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_webs"
|
" FROM centres,degrees,courses,crs_usr,usr_webs"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -350,7 +350,7 @@ void Net_ShowWebAndSocialNetworksStats (void)
|
||||||
" ORDER BY N DESC,usr_webs.Web",
|
" ORDER BY N DESC,usr_webs.Web",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
||||||
" FROM degrees,courses,crs_usr,usr_webs"
|
" FROM degrees,courses,crs_usr,usr_webs"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -361,7 +361,7 @@ void Net_ShowWebAndSocialNetworksStats (void)
|
||||||
" ORDER BY N DESC,usr_webs.Web",
|
" ORDER BY N DESC,usr_webs.Web",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
||||||
" FROM courses,crs_usr,usr_webs"
|
" FROM courses,crs_usr,usr_webs"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -371,7 +371,7 @@ void Net_ShowWebAndSocialNetworksStats (void)
|
||||||
" ORDER BY N DESC,usr_webs.Web",
|
" ORDER BY N DESC,usr_webs.Web",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
sprintf (Query,"SELECT usr_webs.Web,COUNT(DISTINCT usr_webs.UsrCod) AS N"
|
||||||
" FROM crs_usr,usr_webs"
|
" FROM crs_usr,usr_webs"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
|
|
@ -307,7 +307,7 @@ void Not_ShowNotices (Not_Listing_t TypeNoticesListing)
|
||||||
ICanEditNotices = (
|
ICanEditNotices = (
|
||||||
TypeNoticesListing == Not_LIST_FULL_NOTICES &&
|
TypeNoticesListing == Not_LIST_FULL_NOTICES &&
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
);
|
);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
||||||
|
@ -670,13 +670,13 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned
|
||||||
/***** Get number of notices from database *****/
|
/***** Get number of notices from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM notices"
|
" FROM notices"
|
||||||
" WHERE Status='%u'",
|
" WHERE Status='%u'",
|
||||||
NoticeStatus);
|
NoticeStatus);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)"
|
||||||
" FROM centres,degrees,courses,notices"
|
" FROM centres,degrees,courses,notices"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -687,7 +687,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
NoticeStatus);
|
NoticeStatus);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)"
|
||||||
" FROM degrees,courses,notices"
|
" FROM degrees,courses,notices"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -697,7 +697,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
NoticeStatus);
|
NoticeStatus);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(notices.NumNotif)"
|
||||||
" FROM courses,notices"
|
" FROM courses,notices"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -706,7 +706,7 @@ unsigned Not_GetNumNotices (Sco_Scope_t Scope,Not_Status_t NoticeStatus,unsigned
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
NoticeStatus);
|
NoticeStatus);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM notices"
|
" FROM notices"
|
||||||
" WHERE CrsCod='%ld'"
|
" WHERE CrsCod='%ld'"
|
||||||
|
@ -756,11 +756,11 @@ unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
/***** Get number of notices from database *****/
|
/***** Get number of notices from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM notices_deleted");
|
" FROM notices_deleted");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(notices_deleted.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(notices_deleted.NumNotif)"
|
||||||
" FROM centres,degrees,courses,notices_deleted"
|
" FROM centres,degrees,courses,notices_deleted"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -769,7 +769,7 @@ unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=notices_deleted.CrsCod",
|
" AND courses.CrsCod=notices_deleted.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(notices_deleted.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(notices_deleted.NumNotif)"
|
||||||
" FROM degrees,courses,notices_deleted"
|
" FROM degrees,courses,notices_deleted"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -777,14 +777,14 @@ unsigned Not_GetNumNoticesDeleted (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=notices_deleted.CrsCod",
|
" AND courses.CrsCod=notices_deleted.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(notices_deleted.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(notices_deleted.NumNotif)"
|
||||||
" FROM courses,notices_deleted"
|
" FROM courses,notices_deleted"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
" AND courses.CrsCod=notices_deleted.CrsCod",
|
" AND courses.CrsCod=notices_deleted.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM notices_deleted"
|
" FROM notices_deleted"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
|
|
@ -810,11 +810,11 @@ bool Pwd_CheckIfICanChangeOtherUsrPassword (long UsrCod)
|
||||||
/* Check if I have permission to change user's password */
|
/* Check if I have permission to change user's password */
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
/* If I am an administrator of current degree,
|
/* If I am an administrator of current degree,
|
||||||
I only can change the password of users from current degree */
|
I only can change the password of users from current degree */
|
||||||
return Usr_CheckIfUsrBelongsToDeg (UsrCod,Gbl.CurrentDeg.Deg.DegCod);
|
return Usr_CheckIfUsrBelongsToDeg (UsrCod,Gbl.CurrentDeg.Deg.DegCod);
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
10
swad_photo.c
10
swad_photo.c
|
@ -124,11 +124,11 @@ bool Pho_CheckIfICanChangeOtherUsrPhoto (long UsrCod)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
return Usr_CheckIfUsrBelongsToCrs (UsrCod,Gbl.CurrentCrs.Crs.CrsCod);
|
return Usr_CheckIfUsrBelongsToCrs (UsrCod,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
/* If I am an administrator of current degree,
|
/* If I am an administrator of current degree,
|
||||||
I only can change the photo of users from current degree */
|
I only can change the photo of users from current degree */
|
||||||
return Usr_CheckIfUsrBelongsToDeg (UsrCod,Gbl.CurrentDeg.Deg.DegCod);
|
return Usr_CheckIfUsrBelongsToDeg (UsrCod,Gbl.CurrentDeg.Deg.DegCod);
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -777,13 +777,13 @@ bool Pho_ShowUsrPhotoIsAllowed (struct UsrData *UsrDat,char *PhotoURL)
|
||||||
|
|
||||||
/***** Check if I can see the other's photo *****/
|
/***** Check if I can see the other's photo *****/
|
||||||
if (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod || // It's me
|
if (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod || // It's me
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
// I always can see my photo
|
// I always can see my photo
|
||||||
// A superuser always can see any user's photo
|
// A superuser always can see any user's photo
|
||||||
ICanSeePhoto = true;
|
ICanSeePhoto = true;
|
||||||
else if (Gbl.Usrs.Me.MaxRole == Rol_ROLE_STUDENT ||
|
else if (Gbl.Usrs.Me.MaxRole == Rol_ROLE_STUDENT ||
|
||||||
Gbl.Usrs.Me.MaxRole == Rol_ROLE_TEACHER ||
|
Gbl.Usrs.Me.MaxRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADMIN)
|
Gbl.Usrs.Me.LoggedRole >= Rol_ROLE_DEG_ADM)
|
||||||
{
|
{
|
||||||
// If the maximum role of both users is student
|
// If the maximum role of both users is student
|
||||||
if (Gbl.Usrs.Me.MaxRole == Rol_ROLE_STUDENT && // My maximum role is student
|
if (Gbl.Usrs.Me.MaxRole == Rol_ROLE_STUDENT && // My maximum role is student
|
||||||
|
@ -1982,7 +1982,7 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
|
||||||
if (SeeOrPrint == Pho_DEGREES_SEE)
|
if (SeeOrPrint == Pho_DEGREES_SEE)
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
fprintf (Gbl.F.Out,"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||||
Deg.WWW,Deg.FullName);
|
Deg.WWW,Deg.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s ",
|
fprintf (Gbl.F.Out," %s ",
|
||||||
Deg.ShortName);
|
Deg.ShortName);
|
||||||
|
|
|
@ -93,7 +93,7 @@ void Plc_SeePlaces (void)
|
||||||
Plc_GetListPlaces ();
|
Plc_GetListPlaces ();
|
||||||
|
|
||||||
/***** Put link (form) to edit places *****/
|
/***** Put link (form) to edit places *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Plc_PutFormToEditPlcs ();
|
Plc_PutFormToEditPlcs ();
|
||||||
|
|
||||||
/***** Table head *****/
|
/***** Table head *****/
|
||||||
|
|
|
@ -81,7 +81,7 @@ void Plg_ListPlugins (void)
|
||||||
struct Plugin *Plg;
|
struct Plugin *Plg;
|
||||||
char URL[Cns_MAX_LENGTH_WWW+Ses_LENGTH_SESSION_ID+1];
|
char URL[Cns_MAX_LENGTH_WWW+Ses_LENGTH_SESSION_ID+1];
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole != Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
Lay_ShowAlert (Lay_WARNING,Txt_Option_under_development);
|
Lay_ShowAlert (Lay_WARNING,Txt_Option_under_development);
|
||||||
return;
|
return;
|
||||||
|
@ -91,7 +91,7 @@ void Plg_ListPlugins (void)
|
||||||
Plg_GetListPlugins ();
|
Plg_GetListPlugins ();
|
||||||
|
|
||||||
/***** Put link (form) to edit plugins *****/
|
/***** Put link (form) to edit plugins *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Plg_PutFormToEditPlugins ();
|
Plg_PutFormToEditPlugins ();
|
||||||
|
|
||||||
/***** Table start *****/
|
/***** Table start *****/
|
||||||
|
|
|
@ -1530,7 +1530,7 @@ void Rec_ShowCrsRecord (Rec_RecordViewType_t TypeOfView,struct UsrData *UsrDat)
|
||||||
"<tr>"
|
"<tr>"
|
||||||
"<td style=\"width:%upx; text-align:left;\">",
|
"<td style=\"width:%upx; text-align:left;\">",
|
||||||
Rec_DEGREE_LOGO_SIZE);
|
Rec_DEGREE_LOGO_SIZE);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Gbl.CurrentDeg.Deg.DegCod,
|
Log_DrawLogo (Sco_SCOPE_DEG,Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Gbl.CurrentDeg.Deg.ShortName,Rec_DEGREE_LOGO_SIZE,NULL,true);
|
Gbl.CurrentDeg.Deg.ShortName,Rec_DEGREE_LOGO_SIZE,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"<td class=\"%s\" style=\"text-align:center;\">"
|
"<td class=\"%s\" style=\"text-align:center;\">"
|
||||||
|
@ -2024,8 +2024,8 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
char PhotoURL[PATH_MAX+1];
|
char PhotoURL[PATH_MAX+1];
|
||||||
bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod);
|
bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod);
|
||||||
bool IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER); // My current role is teacher
|
bool IAmTeacher = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER); // My current role is teacher
|
||||||
bool IAmDegAdmin = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN); // My current role is degree administrator
|
bool IAmDegAdmin = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM); // My current role is degree administrator
|
||||||
bool IAmSuperuser = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER); // My current role is superuser
|
bool IAmSuperuser = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM); // My current role is superuser
|
||||||
bool HeIsTeacher = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)); // He/she already is a teacher in any course
|
bool HeIsTeacher = (UsrDat->Roles & (1 << Rol_ROLE_TEACHER)); // He/she already is a teacher in any course
|
||||||
bool RoleForm = (TypeOfView == Rec_FORM_SIGN_UP ||
|
bool RoleForm = (TypeOfView == Rec_FORM_SIGN_UP ||
|
||||||
TypeOfView == Rec_FORM_MY_SHARE_RECORD ||
|
TypeOfView == Rec_FORM_MY_SHARE_RECORD ||
|
||||||
|
@ -2143,7 +2143,7 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
{
|
{
|
||||||
Ins.InsCod = UsrDat->InsCod;
|
Ins.InsCod = UsrDat->InsCod;
|
||||||
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
|
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA);
|
||||||
Log_DrawLogo (Sco_SCOPE_INSTITUTION,Ins.InsCod,Ins.ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
||||||
Rec_INSTITUTION_LOGO_SIZE,NULL,true);
|
Rec_INSTITUTION_LOGO_SIZE,NULL,true);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"<td class=\"%s\" style=\"text-align:left;"
|
"<td class=\"%s\" style=\"text-align:left;"
|
||||||
|
@ -2389,7 +2389,7 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
fprintf (Gbl.F.Out,"<select name=\"Role\">");
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_GUEST:
|
case Rol_ROLE_GUEST__:
|
||||||
case Rol_ROLE_VISITOR:
|
case Rol_ROLE_VISITOR:
|
||||||
case Rol_ROLE_STUDENT:
|
case Rol_ROLE_STUDENT:
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\" disabled=\"disabled\">%s</option>",
|
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\" disabled=\"disabled\">%s</option>",
|
||||||
|
@ -2410,8 +2410,8 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
Txt_ROLES_SINGULAR_Abc[Role][UsrDat->Sex]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
for (Role = Rol_ROLE_STUDENT;
|
for (Role = Rol_ROLE_STUDENT;
|
||||||
Role <= Rol_ROLE_TEACHER;
|
Role <= Rol_ROLE_TEACHER;
|
||||||
Role++)
|
Role++)
|
||||||
|
@ -2436,8 +2436,8 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>",
|
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>",
|
||||||
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]);
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN: // An administrator or a superuser can create students and teachers
|
case Rol_ROLE_DEG_ADM: // An administrator or a superuser can create students and teachers
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
|
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
|
||||||
"<option value=\"%u\">%s</option>",
|
"<option value=\"%u\">%s</option>",
|
||||||
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN],
|
(unsigned) Rol_ROLE_STUDENT,Txt_ROLES_SINGULAR_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN],
|
||||||
|
@ -2538,7 +2538,7 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
((TypeOfView == Rec_RECORD_LIST ||
|
((TypeOfView == Rec_RECORD_LIST ||
|
||||||
TypeOfView == Rec_RECORD_PRINT) &&
|
TypeOfView == Rec_RECORD_PRINT) &&
|
||||||
(IAmTeacher || IAmSuperuser) &&
|
(IAmTeacher || IAmSuperuser) &&
|
||||||
(UsrDat->RoleInCurrentCrsDB == Rol_ROLE_GUEST ||
|
(UsrDat->RoleInCurrentCrsDB == Rol_ROLE_GUEST__ ||
|
||||||
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT)))
|
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_STUDENT)))
|
||||||
{
|
{
|
||||||
/* Country */
|
/* Country */
|
||||||
|
@ -2761,7 +2761,7 @@ void Rec_ShowCommonRecord (Rec_RecordViewType_t TypeOfView,
|
||||||
(UsrDat->Roles & (1 << Rol_ROLE_TEACHER))) || // He/she (me, really) is a teacher in any course
|
(UsrDat->Roles & (1 << Rol_ROLE_TEACHER))) || // He/she (me, really) is a teacher in any course
|
||||||
((TypeOfView == Rec_RECORD_LIST ||
|
((TypeOfView == Rec_RECORD_LIST ||
|
||||||
TypeOfView == Rec_RECORD_PRINT) &&
|
TypeOfView == Rec_RECORD_PRINT) &&
|
||||||
(UsrDat->RoleInCurrentCrsDB == Rol_ROLE_GUEST ||
|
(UsrDat->RoleInCurrentCrsDB == Rol_ROLE_GUEST__ ||
|
||||||
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER))) // He/she is a teacher in the current course
|
UsrDat->RoleInCurrentCrsDB == Rol_ROLE_TEACHER))) // He/she is a teacher in the current course
|
||||||
{
|
{
|
||||||
/* Institution */
|
/* Institution */
|
||||||
|
|
18
swad_role.c
18
swad_role.c
|
@ -67,7 +67,7 @@ unsigned Rol_GetNumAvailableRoles (void)
|
||||||
Rol_Role_t Role;
|
Rol_Role_t Role;
|
||||||
unsigned NumAvailableRoles = 0;
|
unsigned NumAvailableRoles = 0;
|
||||||
|
|
||||||
for (Role = Rol_ROLE_GUEST;
|
for (Role = Rol_ROLE_GUEST__;
|
||||||
Role < Rol_NUM_ROLES;
|
Role < Rol_NUM_ROLES;
|
||||||
Role++)
|
Role++)
|
||||||
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
|
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
|
||||||
|
@ -86,7 +86,7 @@ Rol_Role_t Rol_GetMaxRole (unsigned Roles)
|
||||||
return Rol_ROLE_TEACHER;
|
return Rol_ROLE_TEACHER;
|
||||||
if (Roles & (1 << Rol_ROLE_STUDENT))
|
if (Roles & (1 << Rol_ROLE_STUDENT))
|
||||||
return Rol_ROLE_STUDENT;
|
return Rol_ROLE_STUDENT;
|
||||||
return Rol_ROLE_GUEST;
|
return Rol_ROLE_GUEST__;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -108,7 +108,7 @@ Rol_Role_t Rol_GetMyMaxRoleInIns (long InsCod)
|
||||||
NumMyIns++)
|
NumMyIns++)
|
||||||
if (Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].InsCod == InsCod)
|
if (Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].InsCod == InsCod)
|
||||||
return Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].MaxRole;
|
return Gbl.Usrs.Me.MyInstitutions.Inss[NumMyIns].MaxRole;
|
||||||
return Rol_ROLE_GUEST;
|
return Rol_ROLE_GUEST__;
|
||||||
}
|
}
|
||||||
return Rol_ROLE_UNKNOWN; // No degree
|
return Rol_ROLE_UNKNOWN; // No degree
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ Rol_Role_t Rol_GetMyMaxRoleInCtr (long CtrCod)
|
||||||
NumMyCtr++)
|
NumMyCtr++)
|
||||||
if (Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].CtrCod == CtrCod)
|
if (Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].CtrCod == CtrCod)
|
||||||
return Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].MaxRole;
|
return Gbl.Usrs.Me.MyCentres.Ctrs[NumMyCtr].MaxRole;
|
||||||
return Rol_ROLE_GUEST;
|
return Rol_ROLE_GUEST__;
|
||||||
}
|
}
|
||||||
return Rol_ROLE_UNKNOWN; // No centre
|
return Rol_ROLE_UNKNOWN; // No centre
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ Rol_Role_t Rol_GetMyMaxRoleInDeg (long DegCod)
|
||||||
NumMyDeg++)
|
NumMyDeg++)
|
||||||
if (Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].DegCod == DegCod)
|
if (Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].DegCod == DegCod)
|
||||||
return Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].MaxRole;
|
return Gbl.Usrs.Me.MyDegrees.Degs[NumMyDeg].MaxRole;
|
||||||
return Rol_ROLE_GUEST;
|
return Rol_ROLE_GUEST__;
|
||||||
}
|
}
|
||||||
return Rol_ROLE_UNKNOWN; // No degree
|
return Rol_ROLE_UNKNOWN; // No degree
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ Rol_Role_t Rol_GetMyRoleInCrs (long CrsCod)
|
||||||
NumMyCrs++)
|
NumMyCrs++)
|
||||||
if (Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].CrsCod == CrsCod)
|
if (Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].CrsCod == CrsCod)
|
||||||
return Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].Role;
|
return Gbl.Usrs.Me.MyCourses.Crss[NumMyCrs].Role;
|
||||||
return Rol_ROLE_GUEST;
|
return Rol_ROLE_GUEST__;
|
||||||
}
|
}
|
||||||
return Rol_ROLE_UNKNOWN; // No course
|
return Rol_ROLE_UNKNOWN; // No course
|
||||||
}
|
}
|
||||||
|
@ -301,7 +301,7 @@ void Rol_PutFormToChangeMyRole (bool FormInHead)
|
||||||
fprintf (Gbl.F.Out," style=\"width:%upx;\"",SelectorWidth[Gbl.Prefs.Layout]);
|
fprintf (Gbl.F.Out," style=\"width:%upx;\"",SelectorWidth[Gbl.Prefs.Layout]);
|
||||||
fprintf (Gbl.F.Out," onchange=\"javascript:document.getElementById('%s').submit();\">",
|
fprintf (Gbl.F.Out," onchange=\"javascript:document.getElementById('%s').submit();\">",
|
||||||
Gbl.FormId);
|
Gbl.FormId);
|
||||||
for (Role = Rol_ROLE_GUEST;
|
for (Role = Rol_ROLE_GUEST__;
|
||||||
Role < Rol_NUM_ROLES;
|
Role < Rol_NUM_ROLES;
|
||||||
Role++)
|
Role++)
|
||||||
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
|
if (Gbl.Usrs.Me.AvailableRoles & (1 << Role))
|
||||||
|
@ -423,8 +423,8 @@ static void Rol_PutOneRoleRegRemUsrsCrs (Rol_Role_t Role,bool Checked)
|
||||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||||
switch (Gbl.Usrs.Me.LoggedRole) // Can I select type of user?
|
switch (Gbl.Usrs.Me.LoggedRole) // Can I select type of user?
|
||||||
{
|
{
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER: // Yes, I can
|
case Rol_ROLE_SYS_ADM: // Yes, I can
|
||||||
break;
|
break;
|
||||||
default: // No, I can not
|
default: // No, I can not
|
||||||
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
fprintf (Gbl.F.Out," disabled=\"disabled\"");
|
||||||
|
|
18
swad_role.h
18
swad_role.h
|
@ -47,16 +47,16 @@
|
||||||
#define Rol_NUM_ROLES 9
|
#define Rol_NUM_ROLES 9
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
Rol_ROLE_UNKNOWN = 0, // User not logged in
|
Rol_ROLE_UNKNOWN = 0, // User not logged in
|
||||||
Rol_ROLE_GUEST = 1, // User not belonging to any course
|
Rol_ROLE_GUEST__ = 1, // User not belonging to any course
|
||||||
Rol_ROLE_VISITOR = 2, // Student or teacher in other courses...
|
Rol_ROLE_VISITOR = 2, // Student or teacher in other courses...
|
||||||
// ...but not belonging to the current course
|
// ...but not belonging to the current course
|
||||||
Rol_ROLE_STUDENT = 3, // Student in current course
|
Rol_ROLE_STUDENT = 3, // Student in current course
|
||||||
Rol_ROLE_TEACHER = 4, // Teacher in current course
|
Rol_ROLE_TEACHER = 4, // Teacher in current course
|
||||||
Rol_ROLE_DEG_ADMIN = 5, // Degree administrator
|
Rol_ROLE_DEG_ADM = 5, // Degree administrator
|
||||||
Rol_ROLE_CTR_ADMIN = 6, // Centre administrator
|
Rol_ROLE_CTR_ADM = 6, // Centre administrator
|
||||||
Rol_ROLE_INS_ADMIN = 7, // Institution administrator
|
Rol_ROLE_INS_ADM = 7, // Institution administrator
|
||||||
Rol_ROLE_SUPERUSER = 8, // Superuser
|
Rol_ROLE_SYS_ADM = 8, // System administrator (superuser)
|
||||||
} Rol_Role_t;
|
} Rol_Role_t;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
116
swad_scope.c
116
swad_scope.c
|
@ -36,13 +36,13 @@
|
||||||
|
|
||||||
const char *Sco_ScopeAdminDB[Sco_NUM_SCOPES] =
|
const char *Sco_ScopeAdminDB[Sco_NUM_SCOPES] =
|
||||||
{
|
{
|
||||||
NULL, // Sco_SCOPE_NONE
|
NULL, // Sco_SCOPE_UNK
|
||||||
NULL, // Sco_SCOPE_PLATFORM,
|
NULL, // Sco_SCOPE_SYS,
|
||||||
NULL, // Sco_SCOPE_COUNTRY,
|
NULL, // Sco_SCOPE_CTY,
|
||||||
"Ins", // Sco_SCOPE_INSTITUTION,
|
"Ins", // Sco_SCOPE_INS,
|
||||||
"Ctr", // Sco_SCOPE_CENTRE,
|
"Ctr", // Sco_SCOPE_CTR,
|
||||||
"Deg", // Sco_SCOPE_DEGREE,
|
"Deg", // Sco_SCOPE_DEG,
|
||||||
NULL, // Sco_SCOPE_COURSE,
|
NULL, // Sco_SCOPE_CRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -97,26 +97,26 @@ void Sco_PutSelectorScope (bool SendOnChange)
|
||||||
WriteScope = false;
|
WriteScope = false;
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
WriteScope = true;
|
WriteScope = true;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COUNTRY:
|
case Sco_SCOPE_CTY:
|
||||||
if (Gbl.CurrentCty.Cty.CtyCod > 0)
|
if (Gbl.CurrentCty.Cty.CtyCod > 0)
|
||||||
WriteScope = true;
|
WriteScope = true;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
WriteScope = true;
|
WriteScope = true;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
WriteScope = true;
|
WriteScope = true;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
WriteScope = true;
|
WriteScope = true;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
||||||
WriteScope = true;
|
WriteScope = true;
|
||||||
break;
|
break;
|
||||||
|
@ -134,31 +134,31 @@ void Sco_PutSelectorScope (bool SendOnChange)
|
||||||
fprintf (Gbl.F.Out,">");
|
fprintf (Gbl.F.Out,">");
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
fprintf (Gbl.F.Out,"%s: %s",
|
fprintf (Gbl.F.Out,"%s: %s",
|
||||||
Txt_System,Cfg_PLATFORM_PAGE_TITLE);
|
Txt_System,Cfg_PLATFORM_PAGE_TITLE);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COUNTRY:
|
case Sco_SCOPE_CTY:
|
||||||
fprintf (Gbl.F.Out,"%s: %s",
|
fprintf (Gbl.F.Out,"%s: %s",
|
||||||
Txt_Country,
|
Txt_Country,
|
||||||
Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]);
|
Gbl.CurrentCty.Cty.Name[Gbl.Prefs.Language]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
fprintf (Gbl.F.Out,"%s: %s",
|
fprintf (Gbl.F.Out,"%s: %s",
|
||||||
Txt_Institution,
|
Txt_Institution,
|
||||||
Gbl.CurrentIns.Ins.ShortName);
|
Gbl.CurrentIns.Ins.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
fprintf (Gbl.F.Out,"%s: %s",
|
fprintf (Gbl.F.Out,"%s: %s",
|
||||||
Txt_Centre,
|
Txt_Centre,
|
||||||
Gbl.CurrentCtr.Ctr.ShortName);
|
Gbl.CurrentCtr.Ctr.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
fprintf (Gbl.F.Out,"%s: %s",
|
fprintf (Gbl.F.Out,"%s: %s",
|
||||||
Txt_Degree,
|
Txt_Degree,
|
||||||
Gbl.CurrentDeg.Deg.ShortName);
|
Gbl.CurrentDeg.Deg.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
fprintf (Gbl.F.Out,"%s: %s",
|
fprintf (Gbl.F.Out,"%s: %s",
|
||||||
Txt_Course,
|
Txt_Course,
|
||||||
Gbl.CurrentCrs.Crs.ShortName);
|
Gbl.CurrentCrs.Crs.ShortName);
|
||||||
|
@ -201,24 +201,24 @@ void Sco_GetScope (void)
|
||||||
Gbl.Scope.Current = (Sco_Scope_t) UnsignedNum;
|
Gbl.Scope.Current = (Sco_Scope_t) UnsignedNum;
|
||||||
|
|
||||||
/***** Avoid impossible scopes *****/
|
/***** Avoid impossible scopes *****/
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE && Gbl.CurrentCrs.Crs.CrsCod <= 0)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS && Gbl.CurrentCrs.Crs.CrsCod <= 0)
|
||||||
Gbl.Scope.Current = Sco_SCOPE_DEGREE;
|
Gbl.Scope.Current = Sco_SCOPE_DEG;
|
||||||
|
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_DEGREE && Gbl.CurrentDeg.Deg.DegCod <= 0)
|
if (Gbl.Scope.Current == Sco_SCOPE_DEG && Gbl.CurrentDeg.Deg.DegCod <= 0)
|
||||||
Gbl.Scope.Current = Sco_SCOPE_CENTRE;
|
Gbl.Scope.Current = Sco_SCOPE_CTR;
|
||||||
|
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_CENTRE && Gbl.CurrentCtr.Ctr.CtrCod <= 0)
|
if (Gbl.Scope.Current == Sco_SCOPE_CTR && Gbl.CurrentCtr.Ctr.CtrCod <= 0)
|
||||||
Gbl.Scope.Current = Sco_SCOPE_INSTITUTION;
|
Gbl.Scope.Current = Sco_SCOPE_INS;
|
||||||
|
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_INSTITUTION && Gbl.CurrentIns.Ins.InsCod <= 0)
|
if (Gbl.Scope.Current == Sco_SCOPE_INS && Gbl.CurrentIns.Ins.InsCod <= 0)
|
||||||
Gbl.Scope.Current = Sco_SCOPE_COUNTRY;
|
Gbl.Scope.Current = Sco_SCOPE_CTY;
|
||||||
|
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COUNTRY && Gbl.CurrentCty.Cty.CtyCod <= 0)
|
if (Gbl.Scope.Current == Sco_SCOPE_CTY && Gbl.CurrentCty.Cty.CtyCod <= 0)
|
||||||
Gbl.Scope.Current = Sco_SCOPE_PLATFORM;
|
Gbl.Scope.Current = Sco_SCOPE_SYS;
|
||||||
|
|
||||||
/***** Avoid forbidden scopes *****/
|
/***** Avoid forbidden scopes *****/
|
||||||
if ((Gbl.Scope.Allowed & (1 << Gbl.Scope.Current)) == 0)
|
if ((Gbl.Scope.Allowed & (1 << Gbl.Scope.Current)) == 0)
|
||||||
Gbl.Scope.Current = Sco_SCOPE_NONE;
|
Gbl.Scope.Current = Sco_SCOPE_UNK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -229,25 +229,25 @@ void Sco_SetScopesForListingGuests (void)
|
||||||
{
|
{
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_CTR_ADMIN:
|
case Rol_ROLE_CTR_ADM:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_CENTRE;
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_CTR;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_CENTRE;
|
Gbl.Scope.Default = Sco_SCOPE_CTR;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_INS_ADMIN:
|
case Rol_ROLE_INS_ADM:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_INSTITUTION |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE;
|
1 << Sco_SCOPE_CTR;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_INSTITUTION;
|
Gbl.Scope.Default = Sco_SCOPE_INS;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE;
|
1 << Sco_SCOPE_CTR;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_INSTITUTION;
|
Gbl.Scope.Default = Sco_SCOPE_INS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Gbl.Scope.Allowed = 0;
|
Gbl.Scope.Allowed = 0;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_NONE;
|
Gbl.Scope.Default = Sco_SCOPE_UNK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -262,25 +262,25 @@ void Sco_SetScopesForListingStudents (void)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_STUDENT:
|
case Rol_ROLE_STUDENT:
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_COURSE;
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_DEGREE;
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_DEG;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_DEGREE;
|
Gbl.Scope.Default = Sco_SCOPE_DEG;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Gbl.Scope.Allowed = 0;
|
Gbl.Scope.Allowed = 0;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_NONE;
|
Gbl.Scope.Default = Sco_SCOPE_UNK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
swad_scope.h
14
swad_scope.h
|
@ -41,13 +41,13 @@
|
||||||
#define Sco_NUM_SCOPES 7
|
#define Sco_NUM_SCOPES 7
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
Sco_SCOPE_NONE,
|
Sco_SCOPE_UNK, // Unknown
|
||||||
Sco_SCOPE_PLATFORM,
|
Sco_SCOPE_SYS, // System
|
||||||
Sco_SCOPE_COUNTRY,
|
Sco_SCOPE_CTY, // Country
|
||||||
Sco_SCOPE_INSTITUTION,
|
Sco_SCOPE_INS, // Institution
|
||||||
Sco_SCOPE_CENTRE,
|
Sco_SCOPE_CTR, // Centre
|
||||||
Sco_SCOPE_DEGREE,
|
Sco_SCOPE_DEG, // Degree
|
||||||
Sco_SCOPE_COURSE,
|
Sco_SCOPE_CRS, // Course
|
||||||
} Sco_Scope_t;
|
} Sco_Scope_t;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -97,7 +97,7 @@ void Sch_ReqSysSearch (void)
|
||||||
|
|
||||||
/***** Search courses, teachers, documents... *****/
|
/***** Search courses, teachers, documents... *****/
|
||||||
Sch_GetParamWhatToSearch ();
|
Sch_GetParamWhatToSearch ();
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActSysSch,Sco_SCOPE_PLATFORM);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActSysSch,Sco_SCOPE_SYS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -116,7 +116,7 @@ void Sch_ReqCtySearch (void)
|
||||||
|
|
||||||
/***** Search courses, teachers, documents... *****/
|
/***** Search courses, teachers, documents... *****/
|
||||||
Sch_GetParamWhatToSearch ();
|
Sch_GetParamWhatToSearch ();
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtySch,Sco_SCOPE_COUNTRY);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtySch,Sco_SCOPE_CTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -135,7 +135,7 @@ void Sch_ReqInsSearch (void)
|
||||||
|
|
||||||
/***** Search courses, teachers, documents... *****/
|
/***** Search courses, teachers, documents... *****/
|
||||||
Sch_GetParamWhatToSearch ();
|
Sch_GetParamWhatToSearch ();
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActInsSch,Sco_SCOPE_INSTITUTION);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActInsSch,Sco_SCOPE_INS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -154,7 +154,7 @@ void Sch_ReqCtrSearch (void)
|
||||||
|
|
||||||
/***** Search courses, teachers, documents... *****/
|
/***** Search courses, teachers, documents... *****/
|
||||||
Sch_GetParamWhatToSearch ();
|
Sch_GetParamWhatToSearch ();
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtrSch,Sco_SCOPE_CENTRE);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtrSch,Sco_SCOPE_CTR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -173,7 +173,7 @@ void Sch_ReqDegSearch (void)
|
||||||
|
|
||||||
/***** Search courses, teachers, documents... *****/
|
/***** Search courses, teachers, documents... *****/
|
||||||
Sch_GetParamWhatToSearch ();
|
Sch_GetParamWhatToSearch ();
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActDegSch,Sco_SCOPE_DEGREE);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActDegSch,Sco_SCOPE_DEG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -192,7 +192,7 @@ void Sch_ReqCrsSearch (void)
|
||||||
|
|
||||||
/***** Search courses, teachers, documents... *****/
|
/***** Search courses, teachers, documents... *****/
|
||||||
Sch_GetParamWhatToSearch ();
|
Sch_GetParamWhatToSearch ();
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCrsSch,Sco_SCOPE_COURSE);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCrsSch,Sco_SCOPE_CRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -222,7 +222,7 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Act_Action_t Action,Sco
|
||||||
Txt_Courses, // Sch_SEARCH_COURSES
|
Txt_Courses, // Sch_SEARCH_COURSES
|
||||||
Txt_ROLES_PLURAL_Abc[Rol_ROLE_TEACHER][Usr_SEX_UNKNOWN],// Sch_SEARCH_TEACHERS
|
Txt_ROLES_PLURAL_Abc[Rol_ROLE_TEACHER][Usr_SEX_UNKNOWN],// Sch_SEARCH_TEACHERS
|
||||||
Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN],// Sch_SEARCH_STUDENTS
|
Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN],// Sch_SEARCH_STUDENTS
|
||||||
Txt_ROLES_PLURAL_Abc[Rol_ROLE_GUEST ][Usr_SEX_UNKNOWN],// Sch_SEARCH_GUESTS
|
Txt_ROLES_PLURAL_Abc[Rol_ROLE_GUEST__ ][Usr_SEX_UNKNOWN],// Sch_SEARCH_GUESTS
|
||||||
Txt_Open_documents, // Sch_SEARCH_OPEN_DOCUMENTS
|
Txt_Open_documents, // Sch_SEARCH_OPEN_DOCUMENTS
|
||||||
Txt_DOCUM_in_my_courses, // Sch_SEARCH_DOCUM_IN_MY_COURSES
|
Txt_DOCUM_in_my_courses, // Sch_SEARCH_DOCUM_IN_MY_COURSES
|
||||||
Txt_My_documents, // Sch_SEARCH_MY_DOCUMENTS
|
Txt_My_documents, // Sch_SEARCH_MY_DOCUMENTS
|
||||||
|
@ -240,12 +240,12 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Act_Action_t Action,Sco
|
||||||
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">"
|
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">"
|
||||||
"%s: ",
|
"%s: ",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = DefaultScope;
|
Gbl.Scope.Default = DefaultScope;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
Sco_PutSelectorScope (false);
|
Sco_PutSelectorScope (false);
|
||||||
|
@ -387,7 +387,7 @@ void Sch_SysSearch (void)
|
||||||
if (Gbl.Search.Str[0])
|
if (Gbl.Search.Str[0])
|
||||||
{
|
{
|
||||||
/***** Show search form again *****/
|
/***** Show search form again *****/
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActSysSch,Sco_SCOPE_PLATFORM);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActSysSch,Sco_SCOPE_SYS);
|
||||||
|
|
||||||
/***** Show results of search *****/
|
/***** Show results of search *****/
|
||||||
Sch_SearchInDB ();
|
Sch_SearchInDB ();
|
||||||
|
@ -406,7 +406,7 @@ void Sch_CtySearch (void)
|
||||||
if (Gbl.Search.Str[0])
|
if (Gbl.Search.Str[0])
|
||||||
{
|
{
|
||||||
/***** Show search form again *****/
|
/***** Show search form again *****/
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtySch,Sco_SCOPE_COUNTRY);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtySch,Sco_SCOPE_CTY);
|
||||||
|
|
||||||
/***** Show results of search *****/
|
/***** Show results of search *****/
|
||||||
Sch_SearchInDB ();
|
Sch_SearchInDB ();
|
||||||
|
@ -425,7 +425,7 @@ void Sch_InsSearch (void)
|
||||||
if (Gbl.Search.Str[0])
|
if (Gbl.Search.Str[0])
|
||||||
{
|
{
|
||||||
/***** Show search form again *****/
|
/***** Show search form again *****/
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActInsSch,Sco_SCOPE_INSTITUTION);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActInsSch,Sco_SCOPE_INS);
|
||||||
|
|
||||||
/***** Show results of search *****/
|
/***** Show results of search *****/
|
||||||
Sch_SearchInDB ();
|
Sch_SearchInDB ();
|
||||||
|
@ -444,7 +444,7 @@ void Sch_CtrSearch (void)
|
||||||
if (Gbl.Search.Str[0])
|
if (Gbl.Search.Str[0])
|
||||||
{
|
{
|
||||||
/***** Show search form again *****/
|
/***** Show search form again *****/
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtrSch,Sco_SCOPE_CENTRE);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCtrSch,Sco_SCOPE_CTR);
|
||||||
|
|
||||||
/***** Show results of search *****/
|
/***** Show results of search *****/
|
||||||
Sch_SearchInDB ();
|
Sch_SearchInDB ();
|
||||||
|
@ -464,7 +464,7 @@ void Sch_DegSearch (void)
|
||||||
if (Gbl.Search.Str[0])
|
if (Gbl.Search.Str[0])
|
||||||
{
|
{
|
||||||
/***** Show search form again *****/
|
/***** Show search form again *****/
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActDegSch,Sco_SCOPE_DEGREE);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActDegSch,Sco_SCOPE_DEG);
|
||||||
|
|
||||||
/***** Show results of search *****/
|
/***** Show results of search *****/
|
||||||
Sch_SearchInDB ();
|
Sch_SearchInDB ();
|
||||||
|
@ -483,7 +483,7 @@ void Sch_CrsSearch (void)
|
||||||
if (Gbl.Search.Str[0])
|
if (Gbl.Search.Str[0])
|
||||||
{
|
{
|
||||||
/***** Show search form again *****/
|
/***** Show search form again *****/
|
||||||
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCrsSch,Sco_SCOPE_COURSE);
|
Sch_PutFormToSearchWithWhatToSearchAndScope (ActCrsSch,Sco_SCOPE_CRS);
|
||||||
|
|
||||||
/***** Show results of search *****/
|
/***** Show results of search *****/
|
||||||
Sch_SearchInDB ();
|
Sch_SearchInDB ();
|
||||||
|
@ -506,28 +506,28 @@ static void Sch_SearchInDB (void)
|
||||||
/***** Select courses in all the degrees or in current degree *****/
|
/***** Select courses in all the degrees or in current degree *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_NONE:
|
case Sco_SCOPE_UNK:
|
||||||
// Not aplicable
|
// Not aplicable
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
RangeQuery[0] = '\0';
|
RangeQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COUNTRY:
|
case Sco_SCOPE_CTY:
|
||||||
sprintf (RangeQuery," AND institutions.CtyCod='%ld'",
|
sprintf (RangeQuery," AND institutions.CtyCod='%ld'",
|
||||||
Gbl.CurrentCty.Cty.CtyCod);
|
Gbl.CurrentCty.Cty.CtyCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (RangeQuery," AND institutions.InsCod='%ld'",
|
sprintf (RangeQuery," AND institutions.InsCod='%ld'",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (RangeQuery," AND centres.CtrCod='%ld'",
|
sprintf (RangeQuery," AND centres.CtrCod='%ld'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (RangeQuery," AND degrees.DegCod='%ld'",
|
sprintf (RangeQuery," AND degrees.DegCod='%ld'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (RangeQuery," AND courses.CrsCod='%ld'",
|
sprintf (RangeQuery," AND courses.CrsCod='%ld'",
|
||||||
Gbl.CurrentCrs.Crs.CrsCod);
|
Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
break;
|
break;
|
||||||
|
@ -542,7 +542,7 @@ static void Sch_SearchInDB (void)
|
||||||
NumResults += Sch_SearchCoursesInDB (RangeQuery);
|
NumResults += Sch_SearchCoursesInDB (RangeQuery);
|
||||||
NumResults += Sch_SearchUsrsInDB (Rol_ROLE_TEACHER);
|
NumResults += Sch_SearchUsrsInDB (Rol_ROLE_TEACHER);
|
||||||
NumResults += Sch_SearchUsrsInDB (Rol_ROLE_STUDENT);
|
NumResults += Sch_SearchUsrsInDB (Rol_ROLE_STUDENT);
|
||||||
NumResults += Sch_SearchUsrsInDB (Rol_ROLE_GUEST);
|
NumResults += Sch_SearchUsrsInDB (Rol_ROLE_GUEST__);
|
||||||
NumResults += Sch_SearchOpenDocumentsInDB (RangeQuery);
|
NumResults += Sch_SearchOpenDocumentsInDB (RangeQuery);
|
||||||
NumResults += Sch_SearchDocumentsInMyCoursesInDB (RangeQuery);
|
NumResults += Sch_SearchDocumentsInMyCoursesInDB (RangeQuery);
|
||||||
NumResults += Sch_SearchMyDocumentsInDB (RangeQuery);
|
NumResults += Sch_SearchMyDocumentsInDB (RangeQuery);
|
||||||
|
@ -566,7 +566,7 @@ static void Sch_SearchInDB (void)
|
||||||
NumResults = Sch_SearchUsrsInDB (Rol_ROLE_STUDENT);
|
NumResults = Sch_SearchUsrsInDB (Rol_ROLE_STUDENT);
|
||||||
break;
|
break;
|
||||||
case Sch_SEARCH_GUESTS:
|
case Sch_SEARCH_GUESTS:
|
||||||
NumResults = Sch_SearchUsrsInDB (Rol_ROLE_GUEST);
|
NumResults = Sch_SearchUsrsInDB (Rol_ROLE_GUEST__);
|
||||||
break;
|
break;
|
||||||
case Sch_SEARCH_OPEN_DOCUMENTS:
|
case Sch_SEARCH_OPEN_DOCUMENTS:
|
||||||
NumResults = Sch_SearchOpenDocumentsInDB (RangeQuery);
|
NumResults = Sch_SearchOpenDocumentsInDB (RangeQuery);
|
||||||
|
@ -595,9 +595,9 @@ static unsigned Sch_SearchInstitutionsInDB (const char *RangeQuery)
|
||||||
char Query[1024+Sch_MAX_LENGTH_SEARCH_QUERY*2];
|
char Query[1024+Sch_MAX_LENGTH_SEARCH_QUERY*2];
|
||||||
|
|
||||||
/***** Check scope *****/
|
/***** Check scope *****/
|
||||||
if (Gbl.Scope.Current != Sco_SCOPE_CENTRE &&
|
if (Gbl.Scope.Current != Sco_SCOPE_CTR &&
|
||||||
Gbl.Scope.Current != Sco_SCOPE_DEGREE &&
|
Gbl.Scope.Current != Sco_SCOPE_DEG &&
|
||||||
Gbl.Scope.Current != Sco_SCOPE_COURSE)
|
Gbl.Scope.Current != Sco_SCOPE_CRS)
|
||||||
/***** Check user's permission *****/
|
/***** Check user's permission *****/
|
||||||
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_INSTITUTIONS))
|
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_INSTITUTIONS))
|
||||||
/***** Split institutions string into words *****/
|
/***** Split institutions string into words *****/
|
||||||
|
@ -629,8 +629,8 @@ static unsigned Sch_SearchCentresInDB (const char *RangeQuery)
|
||||||
char Query[1024+Sch_MAX_LENGTH_SEARCH_QUERY*2];
|
char Query[1024+Sch_MAX_LENGTH_SEARCH_QUERY*2];
|
||||||
|
|
||||||
/***** Check scope *****/
|
/***** Check scope *****/
|
||||||
if (Gbl.Scope.Current != Sco_SCOPE_DEGREE &&
|
if (Gbl.Scope.Current != Sco_SCOPE_DEG &&
|
||||||
Gbl.Scope.Current != Sco_SCOPE_COURSE)
|
Gbl.Scope.Current != Sco_SCOPE_CRS)
|
||||||
/***** Check user's permission *****/
|
/***** Check user's permission *****/
|
||||||
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_CENTRES))
|
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_CENTRES))
|
||||||
/***** Split centre string into words *****/
|
/***** Split centre string into words *****/
|
||||||
|
@ -662,7 +662,7 @@ static unsigned Sch_SearchDegreesInDB (const char *RangeQuery)
|
||||||
char Query[1024+Sch_MAX_LENGTH_SEARCH_QUERY*2];
|
char Query[1024+Sch_MAX_LENGTH_SEARCH_QUERY*2];
|
||||||
|
|
||||||
/***** Check scope *****/
|
/***** Check scope *****/
|
||||||
if (Gbl.Scope.Current != Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current != Sco_SCOPE_CRS)
|
||||||
/***** Check user's permission *****/
|
/***** Check user's permission *****/
|
||||||
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_DEGREES))
|
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_DEGREES))
|
||||||
/***** Split degree string into words *****/
|
/***** Split degree string into words *****/
|
||||||
|
@ -839,7 +839,7 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
||||||
RangeQuery);
|
RangeQuery);
|
||||||
|
|
||||||
/***** Query database and list documents found *****/
|
/***** Query database and list documents found *****/
|
||||||
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query); */
|
Lay_ShowAlert (Lay_INFO,Query); */
|
||||||
return Brw_ListDocsFound (Query,Txt_Open_documents);
|
return Brw_ListDocsFound (Query,Txt_Open_documents);
|
||||||
}
|
}
|
||||||
|
@ -886,7 +886,7 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
||||||
(unsigned) Brw_ADMI_DOCUM_GRP,
|
(unsigned) Brw_ADMI_DOCUM_GRP,
|
||||||
(unsigned) Brw_ADMI_SHARE_GRP,
|
(unsigned) Brw_ADMI_SHARE_GRP,
|
||||||
(unsigned) Brw_ADMI_MARKS_GRP);
|
(unsigned) Brw_ADMI_MARKS_GRP);
|
||||||
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query); */
|
Lay_ShowAlert (Lay_INFO,Query); */
|
||||||
if (mysql_query (&Gbl.mysql,Query))
|
if (mysql_query (&Gbl.mysql,Query))
|
||||||
DB_ExitOnMySQLError ("can not create temporary table");
|
DB_ExitOnMySQLError ("can not create temporary table");
|
||||||
|
@ -944,7 +944,7 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
||||||
RangeQuery);
|
RangeQuery);
|
||||||
|
|
||||||
/***** Query database and list documents found *****/
|
/***** Query database and list documents found *****/
|
||||||
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query); */
|
Lay_ShowAlert (Lay_INFO,Query); */
|
||||||
NumDocs = Brw_ListDocsFound (Query,Txt_DOCUM_in_my_courses);
|
NumDocs = Brw_ListDocsFound (Query,Txt_DOCUM_in_my_courses);
|
||||||
|
|
||||||
|
@ -1095,7 +1095,7 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
||||||
(unsigned) Brw_ADMI_BRIEF_USR);
|
(unsigned) Brw_ADMI_BRIEF_USR);
|
||||||
|
|
||||||
/***** Query database and list documents found *****/
|
/***** Query database and list documents found *****/
|
||||||
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
/* if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query); */
|
Lay_ShowAlert (Lay_INFO,Query); */
|
||||||
return Brw_ListDocsFound (Query,Txt_My_documents);
|
return Brw_ListDocsFound (Query,Txt_My_documents);
|
||||||
}
|
}
|
||||||
|
|
264
swad_statistic.c
264
swad_statistic.c
|
@ -399,8 +399,8 @@ void Sta_AskSeeCrsAccesses (void)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActReqAccCrs);
|
Usr_ShowFormsToSelectUsrListType (ActReqAccCrs);
|
||||||
|
|
||||||
/***** Get and order the lists of users of this course *****/
|
/***** Get and order the lists of users of this course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_CRS,NULL,false);
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
||||||
Gbl.Usrs.LstStds.NumUsrs)
|
Gbl.Usrs.LstStds.NumUsrs)
|
||||||
|
@ -539,7 +539,7 @@ void Sta_AskSeeGblAccesses (void)
|
||||||
/***** Put form to go to test edition and configuration *****/
|
/***** Put form to go to test edition and configuration *****/
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER))
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM))
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div style=\"padding-bottom:10px; text-align:center;\">");
|
fprintf (Gbl.F.Out,"<div style=\"padding-bottom:10px; text-align:center;\">");
|
||||||
Sta_PutFormToRequestAccessesCrs ();
|
Sta_PutFormToRequestAccessesCrs ();
|
||||||
|
@ -586,13 +586,13 @@ void Sta_AskSeeGblAccesses (void)
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td style=\"text-align:left; vertical-align:middle;\">",
|
"<td style=\"text-align:left; vertical-align:middle;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_PLATFORM;
|
Gbl.Scope.Default = Sco_SCOPE_SYS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
Sco_PutSelectorScope (false);
|
Sco_PutSelectorScope (false);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
@ -929,19 +929,19 @@ static bool Sta_SeeAccesses (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Get users range for access statistics *****/
|
/***** Get users range for access statistics *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_PLATFORM;
|
Gbl.Scope.Default = Sco_SCOPE_SYS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Check if range of dates is forbidden for me *****/
|
/***** Check if range of dates is forbidden for me *****/
|
||||||
NumDays = Dat_GetNumDaysBetweenDates (&Gbl.DateRange.DateIni,&Gbl.DateRange.DateEnd);
|
NumDays = Dat_GetNumDaysBetweenDates (&Gbl.DateRange.DateIni,&Gbl.DateRange.DateEnd);
|
||||||
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER ||
|
if (!(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM ||
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER && StatsGlobalOrCourse == STAT_COURSE)))
|
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER && StatsGlobalOrCourse == STAT_COURSE)))
|
||||||
if (NumDays > Cfg_DAYS_IN_RECENT_LOG)
|
if (NumDays > Cfg_DAYS_IN_RECENT_LOG)
|
||||||
{
|
{
|
||||||
|
@ -1056,7 +1056,7 @@ static bool Sta_SeeAccesses (void)
|
||||||
{
|
{
|
||||||
case STAT_GLOBAL:
|
case STAT_GLOBAL:
|
||||||
/* Scope */
|
/* Scope */
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_INSTITUTION &&
|
if (Gbl.Scope.Current == Sco_SCOPE_INS &&
|
||||||
Gbl.CurrentIns.Ins.InsCod > 0)
|
Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
{
|
{
|
||||||
sprintf (QueryAux," AND %s.DegCod IN"
|
sprintf (QueryAux," AND %s.DegCod IN"
|
||||||
|
@ -1067,7 +1067,7 @@ static bool Sta_SeeAccesses (void)
|
||||||
LogTable,Gbl.CurrentIns.Ins.InsCod);
|
LogTable,Gbl.CurrentIns.Ins.InsCod);
|
||||||
strcat (Query,QueryAux);
|
strcat (Query,QueryAux);
|
||||||
}
|
}
|
||||||
else if (Gbl.Scope.Current == Sco_SCOPE_CENTRE &&
|
else if (Gbl.Scope.Current == Sco_SCOPE_CTR &&
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
{
|
{
|
||||||
sprintf (QueryAux," AND %s.DegCod"
|
sprintf (QueryAux," AND %s.DegCod"
|
||||||
|
@ -1077,14 +1077,14 @@ static bool Sta_SeeAccesses (void)
|
||||||
LogTable,Gbl.CurrentCtr.Ctr.CtrCod);
|
LogTable,Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
strcat (Query,QueryAux);
|
strcat (Query,QueryAux);
|
||||||
}
|
}
|
||||||
else if (Gbl.Scope.Current == Sco_SCOPE_DEGREE &&
|
else if (Gbl.Scope.Current == Sco_SCOPE_DEG &&
|
||||||
Gbl.CurrentDeg.Deg.DegCod > 0)
|
Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
{
|
{
|
||||||
sprintf (QueryAux," AND %s.DegCod='%ld'",
|
sprintf (QueryAux," AND %s.DegCod='%ld'",
|
||||||
LogTable,Gbl.CurrentDeg.Deg.DegCod);
|
LogTable,Gbl.CurrentDeg.Deg.DegCod);
|
||||||
strcat (Query,QueryAux);
|
strcat (Query,QueryAux);
|
||||||
}
|
}
|
||||||
else if (Gbl.Scope.Current == Sco_SCOPE_COURSE &&
|
else if (Gbl.Scope.Current == Sco_SCOPE_CRS &&
|
||||||
Gbl.CurrentCrs.Crs.CrsCod > 0)
|
Gbl.CurrentCrs.Crs.CrsCod > 0)
|
||||||
{
|
{
|
||||||
sprintf (QueryAux," AND %s.CrsCod='%ld'",
|
sprintf (QueryAux," AND %s.CrsCod='%ld'",
|
||||||
|
@ -1115,15 +1115,15 @@ static bool Sta_SeeAccesses (void)
|
||||||
break;
|
break;
|
||||||
case Sta_INS_ADMINS:
|
case Sta_INS_ADMINS:
|
||||||
sprintf (StrRole," AND %s.Role='%u'",
|
sprintf (StrRole," AND %s.Role='%u'",
|
||||||
LogTable,(unsigned) Rol_ROLE_INS_ADMIN);
|
LogTable,(unsigned) Rol_ROLE_INS_ADM);
|
||||||
break;
|
break;
|
||||||
case Sta_CTR_ADMINS:
|
case Sta_CTR_ADMINS:
|
||||||
sprintf (StrRole," AND %s.Role='%u'",
|
sprintf (StrRole," AND %s.Role='%u'",
|
||||||
LogTable,(unsigned) Rol_ROLE_CTR_ADMIN);
|
LogTable,(unsigned) Rol_ROLE_CTR_ADM);
|
||||||
break;
|
break;
|
||||||
case Sta_DEG_ADMINS:
|
case Sta_DEG_ADMINS:
|
||||||
sprintf (StrRole," AND %s.Role='%u'",
|
sprintf (StrRole," AND %s.Role='%u'",
|
||||||
LogTable,(unsigned) Rol_ROLE_DEG_ADMIN);
|
LogTable,(unsigned) Rol_ROLE_DEG_ADM);
|
||||||
break;
|
break;
|
||||||
case Sta_TEACHERS:
|
case Sta_TEACHERS:
|
||||||
sprintf (StrRole," AND %s.Role='%u'",
|
sprintf (StrRole," AND %s.Role='%u'",
|
||||||
|
@ -1139,7 +1139,7 @@ static bool Sta_SeeAccesses (void)
|
||||||
break;
|
break;
|
||||||
case Sta_GUESTS:
|
case Sta_GUESTS:
|
||||||
sprintf (StrRole," AND %s.Role='%u'",
|
sprintf (StrRole," AND %s.Role='%u'",
|
||||||
LogTable,(unsigned) Rol_ROLE_GUEST);
|
LogTable,(unsigned) Rol_ROLE_GUEST__);
|
||||||
break;
|
break;
|
||||||
case Sta_UNKNOWN_USRS:
|
case Sta_UNKNOWN_USRS:
|
||||||
sprintf (StrRole," AND %s.Role='%u'",
|
sprintf (StrRole," AND %s.Role='%u'",
|
||||||
|
@ -1264,7 +1264,7 @@ static bool Sta_SeeAccesses (void)
|
||||||
}
|
}
|
||||||
/***** Write query for debug *****/
|
/***** Write query for debug *****/
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query);
|
Lay_ShowAlert (Lay_INFO,Query);
|
||||||
*/
|
*/
|
||||||
/***** Make the query *****/
|
/***** Make the query *****/
|
||||||
|
@ -1302,22 +1302,22 @@ static bool Sta_SeeAccesses (void)
|
||||||
default:
|
default:
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
strcpy (Gbl.Message,Txt_Statistics_of_all_visits);
|
strcpy (Gbl.Message,Txt_Statistics_of_all_visits);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_institution_X,
|
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_institution_X,
|
||||||
Gbl.CurrentIns.Ins.ShortName);
|
Gbl.CurrentIns.Ins.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_centre_X,
|
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_centre_X,
|
||||||
Gbl.CurrentCtr.Ctr.ShortName);
|
Gbl.CurrentCtr.Ctr.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_degree_X,
|
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_degree_X,
|
||||||
Gbl.CurrentDeg.Deg.ShortName);
|
Gbl.CurrentDeg.Deg.ShortName);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_course_X,
|
sprintf (Gbl.Message,Txt_Statistics_of_visits_to_the_course_X,
|
||||||
Gbl.CurrentCrs.Crs.ShortName);
|
Gbl.CurrentCrs.Crs.ShortName);
|
||||||
break;
|
break;
|
||||||
|
@ -3490,7 +3490,7 @@ static void Sta_WriteDegree (long DegCod)
|
||||||
fprintf (Gbl.F.Out,"%s\">"
|
fprintf (Gbl.F.Out,"%s\">"
|
||||||
"<a href=\"%s\" class=\"LOG\" target=\"_blank\">",
|
"<a href=\"%s\" class=\"LOG\" target=\"_blank\">",
|
||||||
Deg.FullName,Deg.WWW);
|
Deg.FullName,Deg.WWW);
|
||||||
Log_DrawLogo (Sco_SCOPE_DEGREE,Deg.DegCod,Deg.ShortName,
|
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
|
||||||
16,"vertical-align:top;",true);
|
16,"vertical-align:top;",true);
|
||||||
fprintf (Gbl.F.Out," %s </a>",
|
fprintf (Gbl.F.Out," %s </a>",
|
||||||
Deg.ShortName);
|
Deg.ShortName);
|
||||||
|
@ -3637,13 +3637,13 @@ void Sta_ReqUseOfPlatform (void)
|
||||||
fprintf (Gbl.F.Out,"<div class=\"%s\">"
|
fprintf (Gbl.F.Out,"<div class=\"%s\">"
|
||||||
"%s: ",
|
"%s: ",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
The_ClassFormul[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_PLATFORM;
|
Gbl.Scope.Default = Sco_SCOPE_SYS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
Sco_PutSelectorScope (false);
|
Sco_PutSelectorScope (false);
|
||||||
|
|
||||||
|
@ -3859,7 +3859,7 @@ static void Sta_GetAndShowNumCtysInSWAD (void)
|
||||||
/***** Get number of countries *****/
|
/***** Get number of countries *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
NumCtysTotal = Cty_GetNumCtysTotal ();
|
NumCtysTotal = Cty_GetNumCtysTotal ();
|
||||||
NumCtysWithInss = Cty_GetNumCtysWithInss ("");
|
NumCtysWithInss = Cty_GetNumCtysWithInss ("");
|
||||||
NumCtysWithCtrs = Cty_GetNumCtysWithCtrs ("");
|
NumCtysWithCtrs = Cty_GetNumCtysWithCtrs ("");
|
||||||
|
@ -3869,7 +3869,7 @@ static void Sta_GetAndShowNumCtysInSWAD (void)
|
||||||
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,"");
|
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,"");
|
||||||
SubQuery[0] = '\0';
|
SubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
NumCtysTotal = 1;
|
NumCtysTotal = 1;
|
||||||
NumCtysWithInss = 1;
|
NumCtysWithInss = 1;
|
||||||
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
||||||
|
@ -3880,7 +3880,7 @@ static void Sta_GetAndShowNumCtysInSWAD (void)
|
||||||
NumCtysWithTchs = Cty_GetNumCtysWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCtysWithTchs = Cty_GetNumCtysWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
NumCtysTotal = 1;
|
NumCtysTotal = 1;
|
||||||
NumCtysWithInss = 1;
|
NumCtysWithInss = 1;
|
||||||
NumCtysWithCtrs = 1;
|
NumCtysWithCtrs = 1;
|
||||||
|
@ -3891,7 +3891,7 @@ static void Sta_GetAndShowNumCtysInSWAD (void)
|
||||||
NumCtysWithTchs = Cty_GetNumCtysWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCtysWithTchs = Cty_GetNumCtysWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
NumCtysTotal = 1;
|
NumCtysTotal = 1;
|
||||||
NumCtysWithInss = 1;
|
NumCtysWithInss = 1;
|
||||||
NumCtysWithCtrs = 1;
|
NumCtysWithCtrs = 1;
|
||||||
|
@ -3902,7 +3902,7 @@ static void Sta_GetAndShowNumCtysInSWAD (void)
|
||||||
NumCtysWithTchs = Cty_GetNumCtysWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCtysWithTchs = Cty_GetNumCtysWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCtysWithStds = Cty_GetNumCtysWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
NumCtysTotal = 1;
|
NumCtysTotal = 1;
|
||||||
NumCtysWithInss = 1;
|
NumCtysWithInss = 1;
|
||||||
NumCtysWithCtrs = 1;
|
NumCtysWithCtrs = 1;
|
||||||
|
@ -3973,7 +3973,7 @@ static void Sta_GetAndShowNumInssInSWAD (void)
|
||||||
/***** Get number of institutions *****/
|
/***** Get number of institutions *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
NumInssTotal = Ins_GetNumInssTotal ();
|
NumInssTotal = Ins_GetNumInssTotal ();
|
||||||
NumInssWithCtrs = Ins_GetNumInssWithCtrs ("");
|
NumInssWithCtrs = Ins_GetNumInssWithCtrs ("");
|
||||||
NumInssWithDegs = Ins_GetNumInssWithDegs ("");
|
NumInssWithDegs = Ins_GetNumInssWithDegs ("");
|
||||||
|
@ -3982,7 +3982,7 @@ static void Sta_GetAndShowNumInssInSWAD (void)
|
||||||
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,"");
|
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,"");
|
||||||
SubQuery[0] = '\0';
|
SubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
NumInssTotal = 1;
|
NumInssTotal = 1;
|
||||||
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
|
@ -3992,7 +3992,7 @@ static void Sta_GetAndShowNumInssInSWAD (void)
|
||||||
NumInssWithTchs = Ins_GetNumInssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumInssWithTchs = Ins_GetNumInssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
NumInssTotal = 1;
|
NumInssTotal = 1;
|
||||||
NumInssWithCtrs = 1;
|
NumInssWithCtrs = 1;
|
||||||
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
||||||
|
@ -4002,7 +4002,7 @@ static void Sta_GetAndShowNumInssInSWAD (void)
|
||||||
NumInssWithTchs = Ins_GetNumInssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumInssWithTchs = Ins_GetNumInssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
NumInssTotal = 1;
|
NumInssTotal = 1;
|
||||||
NumInssWithCtrs = 1;
|
NumInssWithCtrs = 1;
|
||||||
NumInssWithDegs = 1;
|
NumInssWithDegs = 1;
|
||||||
|
@ -4012,7 +4012,7 @@ static void Sta_GetAndShowNumInssInSWAD (void)
|
||||||
NumInssWithTchs = Ins_GetNumInssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumInssWithTchs = Ins_GetNumInssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumInssWithStds = Ins_GetNumInssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
NumInssTotal = 1;
|
NumInssTotal = 1;
|
||||||
NumInssWithCtrs = 1;
|
NumInssWithCtrs = 1;
|
||||||
NumInssWithDegs = 1;
|
NumInssWithDegs = 1;
|
||||||
|
@ -4078,7 +4078,7 @@ static void Sta_GetAndShowNumCtrsInSWAD (void)
|
||||||
/***** Get number of centres *****/
|
/***** Get number of centres *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
NumCtrsTotal = Ctr_GetNumCtrsTotal ();
|
NumCtrsTotal = Ctr_GetNumCtrsTotal ();
|
||||||
NumCtrsWithDegs = Ctr_GetNumCtrsWithDegs ("");
|
NumCtrsWithDegs = Ctr_GetNumCtrsWithDegs ("");
|
||||||
NumCtrsWithCrss = Ctr_GetNumCtrsWithCrss ("");
|
NumCtrsWithCrss = Ctr_GetNumCtrsWithCrss ("");
|
||||||
|
@ -4086,7 +4086,7 @@ static void Sta_GetAndShowNumCtrsInSWAD (void)
|
||||||
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,"");
|
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,"");
|
||||||
SubQuery[0] = '\0';
|
SubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
NumCtrsTotal = Ctr_GetNumCtrsInIns (Gbl.CurrentIns.Ins.InsCod);
|
NumCtrsTotal = Ctr_GetNumCtrsInIns (Gbl.CurrentIns.Ins.InsCod);
|
||||||
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
|
@ -4095,7 +4095,7 @@ static void Sta_GetAndShowNumCtrsInSWAD (void)
|
||||||
NumCtrsWithTchs = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCtrsWithTchs = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
NumCtrsTotal = 1;
|
NumCtrsTotal = 1;
|
||||||
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
@ -4104,7 +4104,7 @@ static void Sta_GetAndShowNumCtrsInSWAD (void)
|
||||||
NumCtrsWithTchs = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCtrsWithTchs = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
NumCtrsTotal = 1;
|
NumCtrsTotal = 1;
|
||||||
NumCtrsWithDegs = 1;
|
NumCtrsWithDegs = 1;
|
||||||
sprintf (SubQuery,"degrees.DegCod='%ld' AND ",
|
sprintf (SubQuery,"degrees.DegCod='%ld' AND ",
|
||||||
|
@ -4113,7 +4113,7 @@ static void Sta_GetAndShowNumCtrsInSWAD (void)
|
||||||
NumCtrsWithTchs = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCtrsWithTchs = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCtrsWithStds = Ctr_GetNumCtrsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
NumCtrsTotal = 1;
|
NumCtrsTotal = 1;
|
||||||
NumCtrsWithDegs = 1;
|
NumCtrsWithDegs = 1;
|
||||||
NumCtrsWithCrss = 1;
|
NumCtrsWithCrss = 1;
|
||||||
|
@ -4174,14 +4174,14 @@ static void Sta_GetAndShowNumDegsInSWAD (void)
|
||||||
/***** Get number of degrees *****/
|
/***** Get number of degrees *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
NumDegsTotal = Deg_GetNumDegsTotal ();
|
NumDegsTotal = Deg_GetNumDegsTotal ();
|
||||||
NumDegsWithCrss = Deg_GetNumDegsWithCrss ("");
|
NumDegsWithCrss = Deg_GetNumDegsWithCrss ("");
|
||||||
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,"");
|
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,"");
|
||||||
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,"");
|
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,"");
|
||||||
SubQuery[0] = '\0';
|
SubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
NumDegsTotal = Deg_GetNumDegsInIns (Gbl.CurrentIns.Ins.InsCod);
|
NumDegsTotal = Deg_GetNumDegsInIns (Gbl.CurrentIns.Ins.InsCod);
|
||||||
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
|
@ -4189,7 +4189,7 @@ static void Sta_GetAndShowNumDegsInSWAD (void)
|
||||||
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
NumDegsTotal = Deg_GetNumDegsInCtr (Gbl.CurrentCtr.Ctr.CtrCod);
|
NumDegsTotal = Deg_GetNumDegsInCtr (Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
@ -4197,7 +4197,7 @@ static void Sta_GetAndShowNumDegsInSWAD (void)
|
||||||
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
NumDegsTotal = 1;
|
NumDegsTotal = 1;
|
||||||
sprintf (SubQuery,"degrees.DegCod='%ld' AND ",
|
sprintf (SubQuery,"degrees.DegCod='%ld' AND ",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
|
@ -4205,7 +4205,7 @@ static void Sta_GetAndShowNumDegsInSWAD (void)
|
||||||
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumDegsWithTchs = Deg_GetNumDegsWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumDegsWithStds = Deg_GetNumDegsWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
NumDegsTotal = 1;
|
NumDegsTotal = 1;
|
||||||
NumDegsWithCrss = 1;
|
NumDegsWithCrss = 1;
|
||||||
sprintf (SubQuery,"courses.CrsCod='%ld' AND ",
|
sprintf (SubQuery,"courses.CrsCod='%ld' AND ",
|
||||||
|
@ -4261,34 +4261,34 @@ static void Sta_GetAndShowNumCrssInSWAD (void)
|
||||||
/***** Get number of degrees *****/
|
/***** Get number of degrees *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
NumCrssTotal = Crs_GetNumCrssTotal ();
|
NumCrssTotal = Crs_GetNumCrssTotal ();
|
||||||
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,"");
|
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,"");
|
||||||
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,"");
|
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,"");
|
||||||
SubQuery[0] = '\0';
|
SubQuery[0] = '\0';
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
NumCrssTotal = Crs_GetNumCrssInIns (Gbl.CurrentIns.Ins.InsCod);
|
NumCrssTotal = Crs_GetNumCrssInIns (Gbl.CurrentIns.Ins.InsCod);
|
||||||
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
sprintf (SubQuery,"institutions.InsCod='%ld' AND ",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
NumCrssTotal = Crs_GetNumCrssInCtr (Gbl.CurrentCtr.Ctr.CtrCod);
|
NumCrssTotal = Crs_GetNumCrssInCtr (Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
sprintf (SubQuery,"centres.CtrCod='%ld' AND ",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
NumCrssTotal = Crs_GetNumCrssInDeg (Gbl.CurrentDeg.Deg.DegCod);
|
NumCrssTotal = Crs_GetNumCrssInDeg (Gbl.CurrentDeg.Deg.DegCod);
|
||||||
sprintf (SubQuery,"degrees.DegCod='%ld' AND ",
|
sprintf (SubQuery,"degrees.DegCod='%ld' AND ",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
NumCrssWithTchs = Crs_GetNumCrssWithUsrs (Rol_ROLE_TEACHER,SubQuery);
|
||||||
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
NumCrssWithStds = Crs_GetNumCrssWithUsrs (Rol_ROLE_STUDENT,SubQuery);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
NumCrssTotal = 1;
|
NumCrssTotal = 1;
|
||||||
sprintf (SubQuery,"courses.CrsCod='%ld' AND ",
|
sprintf (SubQuery,"courses.CrsCod='%ld' AND ",
|
||||||
Gbl.CurrentCrs.Crs.CrsCod);
|
Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
|
@ -4336,7 +4336,7 @@ unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
||||||
/***** Get number of users from database *****/
|
/***** Get number of users from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data");
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data");
|
||||||
else
|
else
|
||||||
|
@ -4344,7 +4344,7 @@ unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
||||||
" FROM crs_usr WHERE Role='%u'",
|
" FROM crs_usr WHERE Role='%u'",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr"
|
" FROM centres,degrees,courses,crs_usr"
|
||||||
|
@ -4363,7 +4363,7 @@ unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
||||||
" AND crs_usr.Role='%u'",
|
" AND crs_usr.Role='%u'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,(unsigned) Role);
|
Gbl.CurrentIns.Ins.InsCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr"
|
" FROM degrees,courses,crs_usr"
|
||||||
|
@ -4380,7 +4380,7 @@ unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
||||||
" AND crs_usr.Role='%u'",
|
" AND crs_usr.Role='%u'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Role);
|
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM courses,crs_usr"
|
" FROM courses,crs_usr"
|
||||||
|
@ -4395,7 +4395,7 @@ unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
||||||
" AND crs_usr.Role='%u'",
|
" AND crs_usr.Role='%u'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Role);
|
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
if (Role == Rol_ROLE_UNKNOWN) // Here Rol_ROLE_UNKNOWN means "all users"
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT UsrCod) FROM crs_usr"
|
sprintf (Query,"SELECT COUNT(DISTINCT UsrCod) FROM crs_usr"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -4448,7 +4448,7 @@ static void Sta_GetAndShowUsersStats (void)
|
||||||
Txt_Average_number_of_users_belonging_to_a_course);
|
Txt_Average_number_of_users_belonging_to_a_course);
|
||||||
Usr_GetAndShowNumUsrsInPlatform (Rol_ROLE_STUDENT);
|
Usr_GetAndShowNumUsrsInPlatform (Rol_ROLE_STUDENT);
|
||||||
Usr_GetAndShowNumUsrsInPlatform (Rol_ROLE_TEACHER);
|
Usr_GetAndShowNumUsrsInPlatform (Rol_ROLE_TEACHER);
|
||||||
Usr_GetAndShowNumUsrsInPlatform (Rol_ROLE_GUEST); // Users not beloging to any course
|
Usr_GetAndShowNumUsrsInPlatform (Rol_ROLE_GUEST__); // Users not beloging to any course
|
||||||
|
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
}
|
}
|
||||||
|
@ -4726,7 +4726,7 @@ static void Sta_GetSizeOfFileZoneFromDB (Sco_Scope_t Scope,
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
/* Scope = the whole platform */
|
/* Scope = the whole platform */
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
{
|
{
|
||||||
case Brw_UNKNOWN:
|
case Brw_UNKNOWN:
|
||||||
|
@ -4796,7 +4796,7 @@ static void Sta_GetSizeOfFileZoneFromDB (Sco_Scope_t Scope,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* Scope = the current country */
|
/* Scope = the current country */
|
||||||
case Sco_SCOPE_COUNTRY:
|
case Sco_SCOPE_CTY:
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
{
|
{
|
||||||
case Brw_UNKNOWN:
|
case Brw_UNKNOWN:
|
||||||
|
@ -4899,7 +4899,7 @@ static void Sta_GetSizeOfFileZoneFromDB (Sco_Scope_t Scope,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* Scope = the current institution */
|
/* Scope = the current institution */
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
{
|
{
|
||||||
case Brw_UNKNOWN:
|
case Brw_UNKNOWN:
|
||||||
|
@ -4996,7 +4996,7 @@ static void Sta_GetSizeOfFileZoneFromDB (Sco_Scope_t Scope,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* Scope = the current centre */
|
/* Scope = the current centre */
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
{
|
{
|
||||||
case Brw_UNKNOWN:
|
case Brw_UNKNOWN:
|
||||||
|
@ -5087,7 +5087,7 @@ static void Sta_GetSizeOfFileZoneFromDB (Sco_Scope_t Scope,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* Scope = the current degree */
|
/* Scope = the current degree */
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
{
|
{
|
||||||
case Brw_UNKNOWN:
|
case Brw_UNKNOWN:
|
||||||
|
@ -5172,7 +5172,7 @@ static void Sta_GetSizeOfFileZoneFromDB (Sco_Scope_t Scope,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* Scope = the current course */
|
/* Scope = the current course */
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
{
|
{
|
||||||
case Brw_UNKNOWN:
|
case Brw_UNKNOWN:
|
||||||
|
@ -5376,14 +5376,14 @@ static void Sta_GetNumberOfOERsFromDB (Sco_Scope_t Scope,Brw_License_t License,u
|
||||||
/***** Get the size of a file browser *****/
|
/***** Get the size of a file browser *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT Public,COUNT(*)"
|
sprintf (Query,"SELECT Public,COUNT(*)"
|
||||||
" FROM files"
|
" FROM files"
|
||||||
" WHERE License='%u'"
|
" WHERE License='%u'"
|
||||||
" GROUP BY Public",
|
" GROUP BY Public",
|
||||||
(unsigned) License);
|
(unsigned) License);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
||||||
" FROM centres,degrees,courses,files"
|
" FROM centres,degrees,courses,files"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -5398,7 +5398,7 @@ static void Sta_GetNumberOfOERsFromDB (Sco_Scope_t Scope,Brw_License_t License,u
|
||||||
(unsigned) Brw_ADMI_SHARE_CRS,
|
(unsigned) Brw_ADMI_SHARE_CRS,
|
||||||
(unsigned) License);
|
(unsigned) License);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
||||||
" FROM degrees,courses,files"
|
" FROM degrees,courses,files"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -5412,7 +5412,7 @@ static void Sta_GetNumberOfOERsFromDB (Sco_Scope_t Scope,Brw_License_t License,u
|
||||||
(unsigned) Brw_ADMI_SHARE_CRS,
|
(unsigned) Brw_ADMI_SHARE_CRS,
|
||||||
(unsigned) License);
|
(unsigned) License);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
||||||
" FROM courses,files"
|
" FROM courses,files"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -5425,7 +5425,7 @@ static void Sta_GetNumberOfOERsFromDB (Sco_Scope_t Scope,Brw_License_t License,u
|
||||||
(unsigned) Brw_ADMI_SHARE_CRS,
|
(unsigned) Brw_ADMI_SHARE_CRS,
|
||||||
(unsigned) License);
|
(unsigned) License);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT Public,COUNT(*)"
|
sprintf (Query,"SELECT Public,COUNT(*)"
|
||||||
" FROM files"
|
" FROM files"
|
||||||
" WHERE CrsCod='%ld'"
|
" WHERE CrsCod='%ld'"
|
||||||
|
@ -5970,7 +5970,7 @@ static void Sta_GetAndShowForumStats (void)
|
||||||
/***** Write a row for each type of forum *****/
|
/***** Write a row for each type of forum *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_USRS ,-1L,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_USRS ,-1L,-1L,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_TCHS ,-1L,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_TCHS ,-1L,-1L,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_SWAD_USRS ,-1L,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_SWAD_USRS ,-1L,-1L,-1L,-1L,&StatsForum);
|
||||||
|
@ -5984,7 +5984,7 @@ static void Sta_GetAndShowForumStats (void)
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,-1L,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,-1L,-1L,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,-1L,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,-1L,-1L,-1L,-1L,&StatsForum);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
||||||
|
@ -5994,7 +5994,7 @@ static void Sta_GetAndShowForumStats (void)
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
||||||
|
@ -6002,13 +6002,13 @@ static void Sta_GetAndShowForumStats (void)
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum);
|
||||||
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum);
|
Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum);
|
||||||
break;
|
break;
|
||||||
|
@ -6370,12 +6370,12 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
|
||||||
/***** Get the number of users who have chosen this language from database *****/
|
/***** Get the number of users who have chosen this language from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*)"
|
sprintf (Query,"SELECT COUNT(*)"
|
||||||
" FROM usr_data WHERE Language='%s'",
|
" FROM usr_data WHERE Language='%s'",
|
||||||
Txt_STR_LANG_ID[Lan]);
|
Txt_STR_LANG_ID[Lan]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -6387,7 +6387,7 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Txt_STR_LANG_ID[Lan]);
|
Txt_STR_LANG_ID[Lan]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -6398,7 +6398,7 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Txt_STR_LANG_ID[Lan]);
|
Txt_STR_LANG_ID[Lan]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -6408,7 +6408,7 @@ static void Sta_GetAndShowNumUsrsPerLanguage (void)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Txt_STR_LANG_ID[Lan]);
|
Txt_STR_LANG_ID[Lan]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -6493,12 +6493,12 @@ static void Sta_GetAndShowNumUsrsPerLayout (void)
|
||||||
/***** Get number of users who have chosen this layout from database *****/
|
/***** Get number of users who have chosen this layout from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data"
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data"
|
||||||
" WHERE Layout='%u'",
|
" WHERE Layout='%u'",
|
||||||
(unsigned) Layout);
|
(unsigned) Layout);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -6509,7 +6509,7 @@ static void Sta_GetAndShowNumUsrsPerLayout (void)
|
||||||
" AND usr_data.Layout='%u'",
|
" AND usr_data.Layout='%u'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,(unsigned) Layout);
|
Gbl.CurrentIns.Ins.InsCod,(unsigned) Layout);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -6519,7 +6519,7 @@ static void Sta_GetAndShowNumUsrsPerLayout (void)
|
||||||
" AND usr_data.Layout='%u'",
|
" AND usr_data.Layout='%u'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Layout);
|
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Layout);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -6528,7 +6528,7 @@ static void Sta_GetAndShowNumUsrsPerLayout (void)
|
||||||
" AND usr_data.Layout='%u'",
|
" AND usr_data.Layout='%u'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Layout);
|
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Layout);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -6613,12 +6613,12 @@ static void Sta_GetAndShowNumUsrsPerTheme (void)
|
||||||
/***** Get number of users who have chosen this theme from database *****/
|
/***** Get number of users who have chosen this theme from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data"
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data"
|
||||||
" WHERE Theme='%s'",
|
" WHERE Theme='%s'",
|
||||||
The_ThemeId[Theme]);
|
The_ThemeId[Theme]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -6629,7 +6629,7 @@ static void Sta_GetAndShowNumUsrsPerTheme (void)
|
||||||
" AND usr_data.Theme='%s'",
|
" AND usr_data.Theme='%s'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,The_ThemeId[Theme]);
|
Gbl.CurrentIns.Ins.InsCod,The_ThemeId[Theme]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -6639,7 +6639,7 @@ static void Sta_GetAndShowNumUsrsPerTheme (void)
|
||||||
" AND usr_data.Theme='%s'",
|
" AND usr_data.Theme='%s'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,The_ThemeId[Theme]);
|
Gbl.CurrentCtr.Ctr.CtrCod,The_ThemeId[Theme]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -6648,7 +6648,7 @@ static void Sta_GetAndShowNumUsrsPerTheme (void)
|
||||||
" AND usr_data.Theme='%s'",
|
" AND usr_data.Theme='%s'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,The_ThemeId[Theme]);
|
Gbl.CurrentDeg.Deg.DegCod,The_ThemeId[Theme]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -6734,11 +6734,11 @@ static void Sta_GetAndShowNumUsrsPerIconSet (void)
|
||||||
/***** Get the number of users who have chosen this icon set from database *****/
|
/***** Get the number of users who have chosen this icon set from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE IconSet='%s'",
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE IconSet='%s'",
|
||||||
Ico_IconSetId[IconSet]);
|
Ico_IconSetId[IconSet]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -6749,7 +6749,7 @@ static void Sta_GetAndShowNumUsrsPerIconSet (void)
|
||||||
" AND usr_data.IconSet='%s'",
|
" AND usr_data.IconSet='%s'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,Ico_IconSetId[IconSet]);
|
Gbl.CurrentIns.Ins.InsCod,Ico_IconSetId[IconSet]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -6759,7 +6759,7 @@ static void Sta_GetAndShowNumUsrsPerIconSet (void)
|
||||||
" AND usr_data.IconSet='%s'",
|
" AND usr_data.IconSet='%s'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,Ico_IconSetId[IconSet]);
|
Gbl.CurrentCtr.Ctr.CtrCod,Ico_IconSetId[IconSet]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -6768,7 +6768,7 @@ static void Sta_GetAndShowNumUsrsPerIconSet (void)
|
||||||
" AND usr_data.IconSet='%s'",
|
" AND usr_data.IconSet='%s'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,Ico_IconSetId[IconSet]);
|
Gbl.CurrentDeg.Deg.DegCod,Ico_IconSetId[IconSet]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -6858,12 +6858,12 @@ static void Sta_GetAndShowNumUsrsPerMenu (void)
|
||||||
/***** Get number of users who have chosen this menu from database *****/
|
/***** Get number of users who have chosen this menu from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data"
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data"
|
||||||
" WHERE Menu='%u'",
|
" WHERE Menu='%u'",
|
||||||
(unsigned) Menu);
|
(unsigned) Menu);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -6874,7 +6874,7 @@ static void Sta_GetAndShowNumUsrsPerMenu (void)
|
||||||
" AND usr_data.Menu='%u'",
|
" AND usr_data.Menu='%u'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,(unsigned) Menu);
|
Gbl.CurrentIns.Ins.InsCod,(unsigned) Menu);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -6884,7 +6884,7 @@ static void Sta_GetAndShowNumUsrsPerMenu (void)
|
||||||
" AND usr_data.Menu='%u'",
|
" AND usr_data.Menu='%u'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Menu);
|
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Menu);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -6893,7 +6893,7 @@ static void Sta_GetAndShowNumUsrsPerMenu (void)
|
||||||
" AND usr_data.Menu='%u'",
|
" AND usr_data.Menu='%u'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Menu);
|
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Menu);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -6977,11 +6977,11 @@ static void Sta_GetAndShowNumUsrsPerSideColumns (void)
|
||||||
/***** Get the number of users who have chosen this layout of columns from database *****/
|
/***** Get the number of users who have chosen this layout of columns from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE SideCols='%u'",
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE SideCols='%u'",
|
||||||
SideCols);
|
SideCols);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -6992,7 +6992,7 @@ static void Sta_GetAndShowNumUsrsPerSideColumns (void)
|
||||||
" AND usr_data.SideCols='%u'",
|
" AND usr_data.SideCols='%u'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,SideCols);
|
Gbl.CurrentIns.Ins.InsCod,SideCols);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -7002,7 +7002,7 @@ static void Sta_GetAndShowNumUsrsPerSideColumns (void)
|
||||||
" AND usr_data.SideCols='%u'",
|
" AND usr_data.SideCols='%u'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,SideCols);
|
Gbl.CurrentCtr.Ctr.CtrCod,SideCols);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -7011,7 +7011,7 @@ static void Sta_GetAndShowNumUsrsPerSideColumns (void)
|
||||||
" AND usr_data.SideCols='%u'",
|
" AND usr_data.SideCols='%u'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,SideCols);
|
Gbl.CurrentDeg.Deg.DegCod,SideCols);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -7115,10 +7115,10 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
/***** Get total number of users who want to be notified by e-mail on some event, from database *****/
|
/***** Get total number of users who want to be notified by e-mail on some event, from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE EmailNtfEvents<>0");
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE EmailNtfEvents<>0");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -7129,7 +7129,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND usr_data.EmailNtfEvents<>0",
|
" AND usr_data.EmailNtfEvents<>0",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -7139,7 +7139,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND usr_data.EmailNtfEvents<>0",
|
" AND usr_data.EmailNtfEvents<>0",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -7148,7 +7148,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND usr_data.EmailNtfEvents<>0",
|
" AND usr_data.EmailNtfEvents<>0",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -7170,11 +7170,11 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
/***** Get the number of users who want to be notified by e-mail on this event, from database *****/
|
/***** Get the number of users who want to be notified by e-mail on this event, from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE ((EmailNtfEvents & %u)<>0)",
|
sprintf (Query,"SELECT COUNT(*) FROM usr_data WHERE ((EmailNtfEvents & %u)<>0)",
|
||||||
(1 << NotifyEvent));
|
(1 << NotifyEvent));
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr,usr_data"
|
" FROM centres,degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -7185,7 +7185,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND ((usr_data.EmailNtfEvents & %u)<>0)",
|
" AND ((usr_data.EmailNtfEvents & %u)<>0)",
|
||||||
Gbl.CurrentIns.Ins.InsCod,(1 << NotifyEvent));
|
Gbl.CurrentIns.Ins.InsCod,(1 << NotifyEvent));
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr,usr_data"
|
" FROM degrees,courses,crs_usr,usr_data"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -7195,7 +7195,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND ((usr_data.EmailNtfEvents & %u)<>0)",
|
" AND ((usr_data.EmailNtfEvents & %u)<>0)",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(1 << NotifyEvent));
|
Gbl.CurrentCtr.Ctr.CtrCod,(1 << NotifyEvent));
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM courses,crs_usr,usr_data"
|
" FROM courses,crs_usr,usr_data"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -7204,7 +7204,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND ((usr_data.EmailNtfEvents & %u)<>0)",
|
" AND ((usr_data.EmailNtfEvents & %u)<>0)",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(1 << NotifyEvent));
|
Gbl.CurrentDeg.Deg.DegCod,(1 << NotifyEvent));
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT usr_data.UsrCod)"
|
||||||
" FROM crs_usr,usr_data"
|
" FROM crs_usr,usr_data"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -7221,13 +7221,13 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
/***** Get number of notifications by e-mail from database *****/
|
/***** Get number of notifications by e-mail from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT SUM(NumEvents),SUM(NumMails)"
|
sprintf (Query,"SELECT SUM(NumEvents),SUM(NumMails)"
|
||||||
" FROM sta_notif"
|
" FROM sta_notif"
|
||||||
" WHERE NotifyEvent='%u'",
|
" WHERE NotifyEvent='%u'",
|
||||||
(unsigned) NotifyEvent);
|
(unsigned) NotifyEvent);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT SUM(sta_notif.NumEvents),SUM(sta_notif.NumMails)"
|
sprintf (Query,"SELECT SUM(sta_notif.NumEvents),SUM(sta_notif.NumMails)"
|
||||||
" FROM centres,degrees,sta_notif"
|
" FROM centres,degrees,sta_notif"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -7236,7 +7236,7 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND sta_notif.NotifyEvent='%u'",
|
" AND sta_notif.NotifyEvent='%u'",
|
||||||
Gbl.CurrentIns.Ins.InsCod,(unsigned) NotifyEvent);
|
Gbl.CurrentIns.Ins.InsCod,(unsigned) NotifyEvent);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT SUM(sta_notif.NumEvents),SUM(sta_notif.NumMails)"
|
sprintf (Query,"SELECT SUM(sta_notif.NumEvents),SUM(sta_notif.NumMails)"
|
||||||
" FROM degrees,sta_notif"
|
" FROM degrees,sta_notif"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -7244,14 +7244,14 @@ static void Sta_GetAndShowNumUsrsPerNotifyEvent (void)
|
||||||
" AND sta_notif.NotifyEvent='%u'",
|
" AND sta_notif.NotifyEvent='%u'",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) NotifyEvent);
|
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) NotifyEvent);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT SUM(NumEvents),SUM(NumMails)"
|
sprintf (Query,"SELECT SUM(NumEvents),SUM(NumMails)"
|
||||||
" FROM sta_notif"
|
" FROM sta_notif"
|
||||||
" WHERE DegCod='%ld'"
|
" WHERE DegCod='%ld'"
|
||||||
" AND NotifyEvent='%u'",
|
" AND NotifyEvent='%u'",
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(unsigned) NotifyEvent);
|
Gbl.CurrentDeg.Deg.DegCod,(unsigned) NotifyEvent);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT SUM(NumEvents),SUM(NumMails)"
|
sprintf (Query,"SELECT SUM(NumEvents),SUM(NumMails)"
|
||||||
" FROM sta_notif"
|
" FROM sta_notif"
|
||||||
" WHERE CrsCod='%ld'"
|
" WHERE CrsCod='%ld'"
|
||||||
|
|
|
@ -703,7 +703,7 @@ void Str_ChangeFormat (Str_ChangeFrom_t ChangeFrom,Str_ChangeTo_t ChangeTo,
|
||||||
char StrSpecialChar[256];
|
char StrSpecialChar[256];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,"Str_ChangeFormat ("%s")",Str);
|
sprintf (Gbl.Message,"Str_ChangeFormat ("%s")",Str);
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||||
|
|
|
@ -265,9 +265,9 @@ static bool Svy_CheckIfICanCreateSvy (void)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
return (Gbl.CurrentCrs.Crs.CrsCod > 0);
|
return (Gbl.CurrentCrs.Crs.CrsCod > 0);
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
return (Gbl.CurrentDeg.Deg.DegCod > 0);
|
return (Gbl.CurrentDeg.Deg.DegCod > 0);
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -825,7 +825,7 @@ void Svy_GetListSurveys (void)
|
||||||
{
|
{
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
HiddenSubQuery[0] = '\0'; // Show all surveys, visible or hidden
|
HiddenSubQuery[0] = '\0'; // Show all surveys, visible or hidden
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -840,12 +840,12 @@ void Svy_GetListSurveys (void)
|
||||||
OrderBySubQuery);
|
OrderBySubQuery);
|
||||||
}
|
}
|
||||||
else if ((Gbl.CurrentDeg.Deg.DegCod > 0 && Gbl.CurrentCrs.Crs.CrsCod < 0) || // If degree selected, but no course selected
|
else if ((Gbl.CurrentDeg.Deg.DegCod > 0 && Gbl.CurrentCrs.Crs.CrsCod < 0) || // If degree selected, but no course selected
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN) // or if I am a degree administrator
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM) // or if I am a degree administrator
|
||||||
{
|
{
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
HiddenSubQuery[0] = '\0'; // Show all surveys, visible or hidden
|
HiddenSubQuery[0] = '\0'; // Show all surveys, visible or hidden
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -862,12 +862,12 @@ void Svy_GetListSurveys (void)
|
||||||
OrderBySubQuery);
|
OrderBySubQuery);
|
||||||
}
|
}
|
||||||
else if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
|
else if (Gbl.CurrentCrs.Crs.CrsCod > 0 &&
|
||||||
Gbl.Usrs.Me.LoggedRole != Rol_ROLE_DEG_ADMIN)
|
Gbl.Usrs.Me.LoggedRole != Rol_ROLE_DEG_ADM)
|
||||||
{
|
{
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
HiddenSubQuery[0] = '\0'; // Show all surveys, visible or hidden
|
HiddenSubQuery[0] = '\0'; // Show all surveys, visible or hidden
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1048,13 +1048,13 @@ void Svy_GetDataOfSurveyByCod (struct Survey *Svy)
|
||||||
Svy->Status.ICanEdit = Svy->CrsCod > 0 &&
|
Svy->Status.ICanEdit = Svy->CrsCod > 0 &&
|
||||||
Svy->Status.IBelongToDegCrsGrps;
|
Svy->Status.IBelongToDegCrsGrps;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
Svy->Status.ICanViewResults = false;
|
Svy->Status.ICanViewResults = false;
|
||||||
Svy->Status.ICanEdit = Svy->DegCod > 0 &&
|
Svy->Status.ICanEdit = Svy->DegCod > 0 &&
|
||||||
Svy->CrsCod < 0 &&
|
Svy->CrsCod < 0 &&
|
||||||
Svy->Status.IBelongToDegCrsGrps;
|
Svy->Status.IBelongToDegCrsGrps;
|
||||||
break;
|
break;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Svy->Status.ICanViewResults = (Svy->NumQsts != 0);
|
Svy->Status.ICanViewResults = (Svy->NumQsts != 0);
|
||||||
Svy->Status.ICanEdit = true;
|
Svy->Status.ICanEdit = true;
|
||||||
break;
|
break;
|
||||||
|
@ -1721,7 +1721,7 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
|
|
||||||
static bool Svy_SetDefaultAndAllowedForEdition (void)
|
static bool Svy_SetDefaultAndAllowedForEdition (void)
|
||||||
{
|
{
|
||||||
Gbl.Scope.Default = Sco_SCOPE_NONE;
|
Gbl.Scope.Default = Sco_SCOPE_UNK;
|
||||||
Gbl.Scope.Allowed = 0;
|
Gbl.Scope.Allowed = 0;
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
|
@ -1729,27 +1729,27 @@ static bool Svy_SetDefaultAndAllowedForEdition (void)
|
||||||
case Rol_ROLE_TEACHER:
|
case Rol_ROLE_TEACHER:
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
||||||
{
|
{
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_COURSE;
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_CRS;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
{
|
{
|
||||||
Gbl.Scope.Default = Sco_SCOPE_DEGREE;
|
Gbl.Scope.Default = Sco_SCOPE_DEG;
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_DEGREE;
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_DEG;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
Gbl.Scope.Default = Sco_SCOPE_PLATFORM;
|
Gbl.Scope.Default = Sco_SCOPE_SYS;
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
// 1 << Sco_SCOPE_COUNTRY | // TODO: Add this scope
|
// 1 << Sco_SCOPE_CTY | // TODO: Add this scope
|
||||||
// 1 << Sco_SCOPE_INSTITUTION | // TODO: Add this scope
|
// 1 << Sco_SCOPE_INS | // TODO: Add this scope
|
||||||
// 1 << Sco_SCOPE_CENTRE | // TODO: Add this scope
|
// 1 << Sco_SCOPE_CTR | // TODO: Add this scope
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -1837,22 +1837,22 @@ void Svy_RecFormSurvey (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
// 1 << Sco_SCOPE_COUNTRY | // TODO: Add this scope
|
// 1 << Sco_SCOPE_CTY | // TODO: Add this scope
|
||||||
// 1 << Sco_SCOPE_INSTITUTION | // TODO: Add this scope
|
// 1 << Sco_SCOPE_INS | // TODO: Add this scope
|
||||||
// 1 << Sco_SCOPE_CENTRE | // TODO: Add this scope
|
// 1 << Sco_SCOPE_CTR | // TODO: Add this scope
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_PLATFORM;
|
Gbl.Scope.Default = Sco_SCOPE_SYS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
NewSvy.DegCod = -1L;
|
NewSvy.DegCod = -1L;
|
||||||
NewSvy.CrsCod = -1L;
|
NewSvy.CrsCod = -1L;
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
{
|
{
|
||||||
NewSvy.DegCod = Gbl.CurrentDeg.Deg.DegCod;
|
NewSvy.DegCod = Gbl.CurrentDeg.Deg.DegCod;
|
||||||
|
@ -1861,7 +1861,7 @@ void Svy_RecFormSurvey (void)
|
||||||
else
|
else
|
||||||
Lay_ShowErrorAndExit ("Wrong survey location.");
|
Lay_ShowErrorAndExit ("Wrong survey location.");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
||||||
{
|
{
|
||||||
NewSvy.DegCod = -1L; // DegCod doen't mind when CrsCod > 0
|
NewSvy.DegCod = -1L; // DegCod doen't mind when CrsCod > 0
|
||||||
|
@ -3508,12 +3508,12 @@ unsigned Svy_GetNumCoursesWithSurveys (Sco_Scope_t Scope)
|
||||||
/***** Get number of courses with surveys from database *****/
|
/***** Get number of courses with surveys from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM surveys"
|
" FROM surveys"
|
||||||
" WHERE CrsCod>'0'");
|
" WHERE CrsCod>'0'");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (surveys.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (surveys.CrsCod))"
|
||||||
" FROM centres,degrees,courses,surveys"
|
" FROM centres,degrees,courses,surveys"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -3522,7 +3522,7 @@ unsigned Svy_GetNumCoursesWithSurveys (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=surveys.CrsCod",
|
" AND courses.CrsCod=surveys.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (surveys.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (surveys.CrsCod))"
|
||||||
" FROM degrees,courses,surveys"
|
" FROM degrees,courses,surveys"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -3530,14 +3530,14 @@ unsigned Svy_GetNumCoursesWithSurveys (Sco_Scope_t Scope)
|
||||||
" AND courses.CrsCod=surveys.CrsCod",
|
" AND courses.CrsCod=surveys.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (surveys.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (surveys.CrsCod))"
|
||||||
" FROM courses,surveys"
|
" FROM courses,surveys"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
" AND courses.CrsCod=surveys.CrsCod",
|
" AND courses.CrsCod=surveys.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM surveys"
|
" FROM surveys"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -3576,12 +3576,12 @@ unsigned Svy_GetNumSurveys (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
/***** Get number of surveys from database *****/
|
/***** Get number of surveys from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM surveys"
|
" FROM surveys"
|
||||||
" WHERE CrsCod>'0'");
|
" WHERE CrsCod>'0'");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(surveys.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(surveys.NumNotif)"
|
||||||
" FROM centres,degrees,courses,surveys"
|
" FROM centres,degrees,courses,surveys"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -3590,7 +3590,7 @@ unsigned Svy_GetNumSurveys (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=surveys.CrsCod",
|
" AND courses.CrsCod=surveys.CrsCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(surveys.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(surveys.NumNotif)"
|
||||||
" FROM degrees,courses,surveys"
|
" FROM degrees,courses,surveys"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -3598,14 +3598,14 @@ unsigned Svy_GetNumSurveys (Sco_Scope_t Scope,unsigned *NumNotif)
|
||||||
" AND courses.CrsCod=surveys.CrsCod",
|
" AND courses.CrsCod=surveys.CrsCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(surveys.NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(surveys.NumNotif)"
|
||||||
" FROM courses,surveys"
|
" FROM courses,surveys"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
" AND courses.CrsCod=surveys.CrsCod",
|
" AND courses.CrsCod=surveys.CrsCod",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumNotif)"
|
||||||
" FROM surveys"
|
" FROM surveys"
|
||||||
" WHERE CrsCod='%ld'",
|
" WHERE CrsCod='%ld'",
|
||||||
|
@ -3651,7 +3651,7 @@ float Svy_GetNumQstsPerSurvey (Sco_Scope_t Scope)
|
||||||
/***** Get number of courses per user from database *****/
|
/***** Get number of courses per user from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
||||||
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
||||||
" FROM surveys,svy_questions"
|
" FROM surveys,svy_questions"
|
||||||
|
@ -3659,7 +3659,7 @@ float Svy_GetNumQstsPerSurvey (Sco_Scope_t Scope)
|
||||||
" AND surveys.SvyCod=svy_questions.SvyCod"
|
" AND surveys.SvyCod=svy_questions.SvyCod"
|
||||||
" GROUP BY svy_questions.SvyCod) AS NumQstsTable");
|
" GROUP BY svy_questions.SvyCod) AS NumQstsTable");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
||||||
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
||||||
" FROM centres,degrees,courses,surveys,svy_questions"
|
" FROM centres,degrees,courses,surveys,svy_questions"
|
||||||
|
@ -3671,7 +3671,7 @@ float Svy_GetNumQstsPerSurvey (Sco_Scope_t Scope)
|
||||||
" GROUP BY svy_questions.SvyCod) AS NumQstsTable",
|
" GROUP BY svy_questions.SvyCod) AS NumQstsTable",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
||||||
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
||||||
" FROM degrees,courses,surveys,svy_questions"
|
" FROM degrees,courses,surveys,svy_questions"
|
||||||
|
@ -3682,7 +3682,7 @@ float Svy_GetNumQstsPerSurvey (Sco_Scope_t Scope)
|
||||||
" GROUP BY svy_questions.SvyCod) AS NumQstsTable",
|
" GROUP BY svy_questions.SvyCod) AS NumQstsTable",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
||||||
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
||||||
" FROM courses,surveys,svy_questions"
|
" FROM courses,surveys,svy_questions"
|
||||||
|
@ -3692,7 +3692,7 @@ float Svy_GetNumQstsPerSurvey (Sco_Scope_t Scope)
|
||||||
" GROUP BY svy_questions.SvyCod) AS NumQstsTable",
|
" GROUP BY svy_questions.SvyCod) AS NumQstsTable",
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
sprintf (Query,"SELECT AVG(NumQsts) FROM"
|
||||||
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
" (SELECT COUNT(svy_questions.QstCod) AS NumQsts"
|
||||||
" FROM surveys,svy_questions"
|
" FROM surveys,svy_questions"
|
||||||
|
|
40
swad_test.c
40
swad_test.c
|
@ -254,7 +254,7 @@ void Tst_ShowFormAskTst (void)
|
||||||
/***** Put form to go to test edition and configuration *****/
|
/***** Put form to go to test edition and configuration *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT ||
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
fprintf (Gbl.F.Out,"<div style=\"text-align:center;\">");
|
||||||
Tst_PutFormToSeeResultsOfUsersTests ();
|
Tst_PutFormToSeeResultsOfUsersTests ();
|
||||||
|
@ -581,7 +581,7 @@ static bool Tst_CheckIfNextTstAllowed (void)
|
||||||
unsigned Year,Month,Day,Hour,Minute,Second;
|
unsigned Year,Month,Day,Hour,Minute,Second;
|
||||||
|
|
||||||
/***** Superusers are allowed to do all test they want *****/
|
/***** Superusers are allowed to do all test they want *****/
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/***** Get date of next allowed access to test from database *****/
|
/***** Get date of next allowed access to test from database *****/
|
||||||
|
@ -2335,7 +2335,7 @@ static unsigned long Tst_GetQuestionsForExam (MYSQL_RES **mysql_res)
|
||||||
sprintf (StrNumQsts,"%u",Gbl.Test.NumQsts);
|
sprintf (StrNumQsts,"%u",Gbl.Test.NumQsts);
|
||||||
strcat (Query,StrNumQsts);
|
strcat (Query,StrNumQsts);
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query);
|
Lay_ShowAlert (Lay_INFO,Query);
|
||||||
*/
|
*/
|
||||||
/* Make the query */
|
/* Make the query */
|
||||||
|
@ -5510,7 +5510,7 @@ static unsigned Tst_GetNumTstQuestions (Sco_Scope_t Scope,Tst_AnswerType_t AnsTy
|
||||||
/***** Get number of test questions from database *****/
|
/***** Get number of test questions from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
||||||
" FROM tst_questions");
|
" FROM tst_questions");
|
||||||
|
@ -5520,7 +5520,7 @@ static unsigned Tst_GetNumTstQuestions (Sco_Scope_t Scope,Tst_AnswerType_t AnsTy
|
||||||
" WHERE AnsType='%s'",
|
" WHERE AnsType='%s'",
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
||||||
" FROM centres,degrees,courses,tst_questions"
|
" FROM centres,degrees,courses,tst_questions"
|
||||||
|
@ -5540,7 +5540,7 @@ static unsigned Tst_GetNumTstQuestions (Sco_Scope_t Scope,Tst_AnswerType_t AnsTy
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
||||||
" FROM degrees,courses,tst_questions"
|
" FROM degrees,courses,tst_questions"
|
||||||
|
@ -5558,7 +5558,7 @@ static unsigned Tst_GetNumTstQuestions (Sco_Scope_t Scope,Tst_AnswerType_t AnsTy
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
||||||
" FROM courses,tst_questions"
|
" FROM courses,tst_questions"
|
||||||
|
@ -5574,7 +5574,7 @@ static unsigned Tst_GetNumTstQuestions (Sco_Scope_t Scope,Tst_AnswerType_t AnsTy
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
sprintf (Query,"SELECT COUNT(*),SUM(NumHits),SUM(Score)"
|
||||||
" FROM tst_questions"
|
" FROM tst_questions"
|
||||||
|
@ -5636,7 +5636,7 @@ static unsigned Tst_GetNumCoursesWithTstQuestions (Sco_Scope_t Scope,Tst_AnswerT
|
||||||
/***** Get number of courses with test questions from database *****/
|
/***** Get number of courses with test questions from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM tst_questions");
|
" FROM tst_questions");
|
||||||
|
@ -5646,7 +5646,7 @@ static unsigned Tst_GetNumCoursesWithTstQuestions (Sco_Scope_t Scope,Tst_AnswerT
|
||||||
" WHERE AnsType='%s'",
|
" WHERE AnsType='%s'",
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
||||||
" FROM centres,degrees,courses,tst_questions"
|
" FROM centres,degrees,courses,tst_questions"
|
||||||
|
@ -5666,7 +5666,7 @@ static unsigned Tst_GetNumCoursesWithTstQuestions (Sco_Scope_t Scope,Tst_AnswerT
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
||||||
" FROM degrees,courses,tst_questions"
|
" FROM degrees,courses,tst_questions"
|
||||||
|
@ -5684,7 +5684,7 @@ static unsigned Tst_GetNumCoursesWithTstQuestions (Sco_Scope_t Scope,Tst_AnswerT
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
||||||
" FROM courses,tst_questions"
|
" FROM courses,tst_questions"
|
||||||
|
@ -5700,7 +5700,7 @@ static unsigned Tst_GetNumCoursesWithTstQuestions (Sco_Scope_t Scope,Tst_AnswerT
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
Tst_StrAnswerTypesDB[AnsType]);
|
Tst_StrAnswerTypesDB[AnsType]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (CrsCod))"
|
||||||
" FROM tst_questions"
|
" FROM tst_questions"
|
||||||
|
@ -5747,7 +5747,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts
|
||||||
/***** Get number of courses with test questions from database *****/
|
/***** Get number of courses with test questions from database *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT tst_questions.CrsCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT tst_questions.CrsCod)"
|
||||||
" FROM tst_questions,tst_config"
|
" FROM tst_questions,tst_config"
|
||||||
|
@ -5763,7 +5763,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts
|
||||||
Tst_StrAnswerTypesDB[AnsType],
|
Tst_StrAnswerTypesDB[AnsType],
|
||||||
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
||||||
" FROM centres,degrees,courses,tst_questions,tst_config"
|
" FROM centres,degrees,courses,tst_questions,tst_config"
|
||||||
|
@ -5789,7 +5789,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts
|
||||||
Tst_StrAnswerTypesDB[AnsType],
|
Tst_StrAnswerTypesDB[AnsType],
|
||||||
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
||||||
" FROM degrees,courses,tst_questions,tst_config"
|
" FROM degrees,courses,tst_questions,tst_config"
|
||||||
|
@ -5813,7 +5813,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts
|
||||||
Tst_StrAnswerTypesDB[AnsType],
|
Tst_StrAnswerTypesDB[AnsType],
|
||||||
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
sprintf (Query,"SELECT COUNT(DISTINCT (tst_questions.CrsCod))"
|
||||||
" FROM courses,tst_questions,tst_config"
|
" FROM courses,tst_questions,tst_config"
|
||||||
|
@ -5835,7 +5835,7 @@ static unsigned Tst_GetNumCoursesWithPluggableTstQuestions (Sco_Scope_t Scope,Ts
|
||||||
Tst_StrAnswerTypesDB[AnsType],
|
Tst_StrAnswerTypesDB[AnsType],
|
||||||
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
Tst_PluggableDB[Tst_PLUGGABLE_YES]);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
if (AnsType == Tst_ANS_ALL)
|
if (AnsType == Tst_ANS_ALL)
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT tst_questions.CrsCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT tst_questions.CrsCod)"
|
||||||
" FROM tst_questions,tst_config"
|
" FROM tst_questions,tst_config"
|
||||||
|
@ -5891,8 +5891,8 @@ void Tst_SelUsrsToSeeUsrsTstExams (void)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActReqSeeUsrTstExa);
|
Usr_ShowFormsToSelectUsrListType (ActReqSeeUsrTstExa);
|
||||||
|
|
||||||
/***** Get and order lists of users from this course *****/
|
/***** Get and order lists of users from this course *****/
|
||||||
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_TEACHER,Sco_SCOPE_CRS,NULL,false);
|
||||||
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_COURSE,NULL,false);
|
Usr_GetUsrsLst (Rol_ROLE_STUDENT,Sco_SCOPE_CRS,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
if (Gbl.Usrs.LstTchs.NumUsrs ||
|
||||||
Gbl.Usrs.LstStds.NumUsrs)
|
Gbl.Usrs.LstStds.NumUsrs)
|
||||||
|
|
605
swad_text.c
605
swad_text.c
File diff suppressed because it is too large
Load Diff
315
swad_user.c
315
swad_user.c
|
@ -417,7 +417,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat)
|
||||||
UsrDat->Roles = Rol_GetRolesInAllCrss (UsrDat->UsrCod);
|
UsrDat->Roles = Rol_GetRolesInAllCrss (UsrDat->UsrCod);
|
||||||
if (UsrDat->RoleInCurrentCrsDB == Rol_ROLE_UNKNOWN)
|
if (UsrDat->RoleInCurrentCrsDB == Rol_ROLE_UNKNOWN)
|
||||||
UsrDat->RoleInCurrentCrsDB = (UsrDat->Roles < (1 << Rol_ROLE_STUDENT)) ?
|
UsrDat->RoleInCurrentCrsDB = (UsrDat->Roles < (1 << Rol_ROLE_STUDENT)) ?
|
||||||
Rol_ROLE_GUEST : // User does not belong to any course
|
Rol_ROLE_GUEST__ : // User does not belong to any course
|
||||||
Rol_ROLE_VISITOR; // User belongs to some courses
|
Rol_ROLE_VISITOR; // User belongs to some courses
|
||||||
|
|
||||||
/* Get name */
|
/* Get name */
|
||||||
|
@ -707,6 +707,7 @@ bool Usr_CheckIfUsrIsAdm (long UsrCod,Sco_Scope_t Scope,long Cod)
|
||||||
UsrCod,Sco_ScopeAdminDB[Scope],Cod);
|
UsrCod,Sco_ScopeAdminDB[Scope],Cod);
|
||||||
return (DB_QueryCOUNT (Query,"can not check if a user is administrator") != 0);
|
return (DB_QueryCOUNT (Query,"can not check if a user is administrator") != 0);
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2169,9 +2170,11 @@ static void Usr_SetUsrRoleAndPrefs (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ThemeId[The_NUM_THEMES];
|
extern const char *The_ThemeId[The_NUM_THEMES];
|
||||||
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
|
extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
|
||||||
bool ICanBeAdmin = false;
|
bool ICanBeInsAdm = false;
|
||||||
|
bool ICanBeCtrAdm = false;
|
||||||
|
bool ICanBeDegAdm = false;
|
||||||
|
|
||||||
// User is logged
|
// In this point I am logged
|
||||||
|
|
||||||
/***** Set preferences from my preferences *****/
|
/***** Set preferences from my preferences *****/
|
||||||
Gbl.Prefs.Theme = Gbl.Usrs.Me.UsrDat.Prefs.Theme;
|
Gbl.Prefs.Theme = Gbl.Usrs.Me.UsrDat.Prefs.Theme;
|
||||||
|
@ -2222,12 +2225,26 @@ static void Usr_SetUsrRoleAndPrefs (void)
|
||||||
/***** Check if my photo exists and create a link to it ****/
|
/***** Check if my photo exists and create a link to it ****/
|
||||||
Gbl.Usrs.Me.MyPhotoExists = Pho_BuildLinkToPhoto (&Gbl.Usrs.Me.UsrDat,Gbl.Usrs.Me.PhotoURL,true);
|
Gbl.Usrs.Me.MyPhotoExists = Pho_BuildLinkToPhoto (&Gbl.Usrs.Me.UsrDat,Gbl.Usrs.Me.PhotoURL,true);
|
||||||
|
|
||||||
/***** Check if I belong to current degree and if I am administrator of current degree *****/
|
/***** Check if I am administrator of current institution/centre/degree *****/
|
||||||
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
if (Gbl.CurrentIns.Ins.InsCod > 0)
|
||||||
/* Check if I am and administrator of current degree */
|
{
|
||||||
ICanBeAdmin = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Me.UsrDat.UsrCod,
|
/* Check if I am and administrator of current institution */
|
||||||
Sco_SCOPE_DEGREE,
|
ICanBeInsAdm = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Gbl.CurrentDeg.Deg.DegCod);
|
Sco_SCOPE_INS,
|
||||||
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
|
if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
||||||
|
{
|
||||||
|
/* Check if I am and administrator of current centre */
|
||||||
|
ICanBeCtrAdm = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
Sco_SCOPE_CTR,
|
||||||
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
|
if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
||||||
|
/* Check if I am and administrator of current degree */
|
||||||
|
ICanBeDegAdm = Usr_CheckIfUsrIsAdm (Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
Sco_SCOPE_DEG,
|
||||||
|
Gbl.CurrentDeg.Deg.DegCod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***** Check if I belong to current course *****/
|
/***** Check if I belong to current course *****/
|
||||||
|
@ -2287,14 +2304,18 @@ static void Usr_SetUsrRoleAndPrefs (void)
|
||||||
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_STUDENT)
|
else if (Gbl.Usrs.Me.MaxRole >= Rol_ROLE_STUDENT)
|
||||||
Gbl.Usrs.Me.AvailableRoles = (1 << Rol_ROLE_VISITOR);
|
Gbl.Usrs.Me.AvailableRoles = (1 << Rol_ROLE_VISITOR);
|
||||||
else
|
else
|
||||||
Gbl.Usrs.Me.AvailableRoles = (1 << Rol_ROLE_GUEST);
|
Gbl.Usrs.Me.AvailableRoles = (1 << Rol_ROLE_GUEST__);
|
||||||
}
|
}
|
||||||
else // No course selected
|
else // No course selected
|
||||||
Gbl.Usrs.Me.AvailableRoles = (1 << Gbl.Usrs.Me.MaxRole);
|
Gbl.Usrs.Me.AvailableRoles = (1 << Gbl.Usrs.Me.MaxRole);
|
||||||
if (ICanBeAdmin)
|
if (ICanBeInsAdm)
|
||||||
Gbl.Usrs.Me.AvailableRoles |= (1 << Rol_ROLE_DEG_ADMIN);
|
Gbl.Usrs.Me.AvailableRoles |= (1 << Rol_ROLE_INS_ADM);
|
||||||
|
if (ICanBeCtrAdm)
|
||||||
|
Gbl.Usrs.Me.AvailableRoles |= (1 << Rol_ROLE_CTR_ADM);
|
||||||
|
if (ICanBeDegAdm)
|
||||||
|
Gbl.Usrs.Me.AvailableRoles |= (1 << Rol_ROLE_DEG_ADM);
|
||||||
if (Usr_CheckIfUsrIsSuperuser (Gbl.Usrs.Me.UsrDat.UsrCod))
|
if (Usr_CheckIfUsrIsSuperuser (Gbl.Usrs.Me.UsrDat.UsrCod))
|
||||||
Gbl.Usrs.Me.AvailableRoles |= (1 << Rol_ROLE_SUPERUSER);
|
Gbl.Usrs.Me.AvailableRoles |= (1 << Rol_ROLE_SYS_ADM);
|
||||||
|
|
||||||
/***** Check if the role I am logged is now available for me *****/
|
/***** Check if the role I am logged is now available for me *****/
|
||||||
if (!(Gbl.Usrs.Me.AvailableRoles & (1 << Gbl.Usrs.Me.LoggedRole))) // Current type I am logged is not available for me
|
if (!(Gbl.Usrs.Me.AvailableRoles & (1 << Gbl.Usrs.Me.LoggedRole))) // Current type I am logged is not available for me
|
||||||
|
@ -2495,7 +2516,7 @@ static void Usr_WriteRowGstMainData (unsigned NumUsr,struct UsrData *UsrDat)
|
||||||
fprintf (Gbl.F.Out,"<td style=\"text-align:center; vertical-align:middle;"
|
fprintf (Gbl.F.Out,"<td style=\"text-align:center; vertical-align:middle;"
|
||||||
" background-color:%s;\">",
|
" background-color:%s;\">",
|
||||||
BgColor);
|
BgColor);
|
||||||
Usr_PutCheckboxToSelectUser (Rol_ROLE_GUEST,UsrDat->EncryptedUsrCod,false);
|
Usr_PutCheckboxToSelectUser (Rol_ROLE_GUEST__,UsrDat->EncryptedUsrCod,false);
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
/***** Student has accepted enrollment in current course? *****/
|
/***** Student has accepted enrollment in current course? *****/
|
||||||
|
@ -2569,8 +2590,8 @@ void Usr_WriteRowStdMainData (unsigned NumUsr,struct UsrData *UsrDat,bool PutChe
|
||||||
char MailLink[7+Cns_MAX_BYTES_STRING+1]; // mailto:mail_address
|
char MailLink[7+Cns_MAX_BYTES_STRING+1]; // mailto:mail_address
|
||||||
struct Institution Ins;
|
struct Institution Ins;
|
||||||
bool ShowEmail = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER && UsrDat->Accepted) ||
|
bool ShowEmail = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER && UsrDat->Accepted) ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER;
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM;
|
||||||
|
|
||||||
/***** Start row *****/
|
/***** Start row *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>");
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
|
@ -2772,8 +2793,8 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
|
||||||
char Text[Cns_MAX_BYTES_TEXT+1];
|
char Text[Cns_MAX_BYTES_TEXT+1];
|
||||||
struct Institution Ins;
|
struct Institution Ins;
|
||||||
bool ShowData = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER && UsrDat->Accepted) ||
|
bool ShowData = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER && UsrDat->Accepted) ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER;
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM;
|
||||||
|
|
||||||
/***** Start row *****/
|
/***** Start row *****/
|
||||||
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows
|
BgColor = Gbl.ColorRows[Gbl.RowEvenOdd]; // Two colors are used alternatively to better distinguish the rows
|
||||||
|
@ -2838,7 +2859,7 @@ void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
|
||||||
" ",
|
" ",
|
||||||
NULL,true,UsrDat->Accepted);
|
NULL,true,UsrDat->Accepted);
|
||||||
|
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
{
|
{
|
||||||
/***** Write the groups a the que pertenece the student *****/
|
/***** Write the groups a the que pertenece the student *****/
|
||||||
for (NumGrpTyp = 0;
|
for (NumGrpTyp = 0;
|
||||||
|
@ -2893,8 +2914,8 @@ static void Usr_WriteRowTchMainData (unsigned NumUsr,struct UsrData *UsrDat,bool
|
||||||
char MailLink[7+Cns_MAX_BYTES_STRING+1]; // mailto:mail_address
|
char MailLink[7+Cns_MAX_BYTES_STRING+1]; // mailto:mail_address
|
||||||
struct Institution Ins;
|
struct Institution Ins;
|
||||||
bool ShowEmail = UsrDat->Accepted ||
|
bool ShowEmail = UsrDat->Accepted ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER;
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM;
|
||||||
|
|
||||||
/***** Start row *****/
|
/***** Start row *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>");
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
|
@ -2988,8 +3009,8 @@ void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
|
||||||
struct Institution Ins;
|
struct Institution Ins;
|
||||||
bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod);
|
bool ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat->UsrCod);
|
||||||
bool ShowData = (ItsMe || UsrDat->Accepted ||
|
bool ShowData = (ItsMe || UsrDat->Accepted ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
struct Centre Ctr;
|
struct Centre Ctr;
|
||||||
struct Department Dpt;
|
struct Department Dpt;
|
||||||
|
|
||||||
|
@ -3101,7 +3122,7 @@ void Usr_WriteRowAdmData (unsigned NumUsr,struct UsrData *UsrDat)
|
||||||
UsrDat->Accepted ? "DAT_SMALL_N" :
|
UsrDat->Accepted ? "DAT_SMALL_N" :
|
||||||
"DAT_SMALL",
|
"DAT_SMALL",
|
||||||
BgColor);
|
BgColor);
|
||||||
ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER));
|
ID_WriteUsrIDs (UsrDat,(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM));
|
||||||
fprintf (Gbl.F.Out," </td>");
|
fprintf (Gbl.F.Out," </td>");
|
||||||
|
|
||||||
/***** Write rest of main administrator's data *****/
|
/***** Write rest of main administrator's data *****/
|
||||||
|
@ -3576,7 +3597,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
char Query[Usr_MAX_LENGTH_QUERY_LIST_USERS+1];
|
char Query[Usr_MAX_LENGTH_QUERY_LIST_USERS+1];
|
||||||
|
|
||||||
/***** Build query *****/
|
/***** Build query *****/
|
||||||
if (Search && Role == Rol_ROLE_GUEST) // Special case
|
if (Search && Role == Rol_ROLE_GUEST__) // Special case
|
||||||
{
|
{
|
||||||
/* Select users with no courses */
|
/* Select users with no courses */
|
||||||
sprintf (Query,"SELECT UsrCod,'N',Sex"
|
sprintf (Query,"SELECT UsrCod,'N',Sex"
|
||||||
|
@ -3589,7 +3610,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
else // Rest of cases
|
else // Rest of cases
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
if (Search)
|
if (Search)
|
||||||
/* Select users with any of their courses not accepted +
|
/* Select users with any of their courses not accepted +
|
||||||
users with all their courses accepted */
|
users with all their courses accepted */
|
||||||
|
@ -3635,7 +3656,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
(unsigned) Role,
|
(unsigned) Role,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COUNTRY:
|
case Sco_SCOPE_CTY:
|
||||||
if (Search)
|
if (Search)
|
||||||
/* Select users of degrees in current country with any courses in those degrees not accepted +
|
/* Select users of degrees in current country with any courses in those degrees not accepted +
|
||||||
users of degrees in current country with all their courses in those degrees accepted */
|
users of degrees in current country with all their courses in those degrees accepted */
|
||||||
|
@ -3716,7 +3737,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
Gbl.CurrentCty.Cty.CtyCod,(unsigned) Role,
|
Gbl.CurrentCty.Cty.CtyCod,(unsigned) Role,
|
||||||
Gbl.CurrentCty.Cty.CtyCod,(unsigned) Role);
|
Gbl.CurrentCty.Cty.CtyCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
if (Search)
|
if (Search)
|
||||||
/* Select users of degrees in current institution with any courses in those degrees not accepted +
|
/* Select users of degrees in current institution with any courses in those degrees not accepted +
|
||||||
users of degrees in current institution with all their courses in those degrees accepted */
|
users of degrees in current institution with all their courses in those degrees accepted */
|
||||||
|
@ -3791,7 +3812,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
Gbl.CurrentIns.Ins.InsCod,(unsigned) Role,
|
Gbl.CurrentIns.Ins.InsCod,(unsigned) Role,
|
||||||
Gbl.CurrentIns.Ins.InsCod,(unsigned) Role);
|
Gbl.CurrentIns.Ins.InsCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
if (Search)
|
if (Search)
|
||||||
/* Select users of degrees in current centre with any courses in those degrees not accepted +
|
/* Select users of degrees in current centre with any courses in those degrees not accepted +
|
||||||
users of degrees in current centre with all their courses in those degrees accepted */
|
users of degrees in current centre with all their courses in those degrees accepted */
|
||||||
|
@ -3860,7 +3881,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Role,
|
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Role,
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Role);
|
Gbl.CurrentCtr.Ctr.CtrCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
if (Search)
|
if (Search)
|
||||||
/* Select users of current degree with any courses in current degree not accepted +
|
/* Select users of current degree with any courses in current degree not accepted +
|
||||||
users of current degree with all their courses in current degree accepted */
|
users of current degree with all their courses in current degree accepted */
|
||||||
|
@ -3920,7 +3941,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Role,
|
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Role,
|
||||||
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Role);
|
Gbl.CurrentDeg.Deg.DegCod,(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
Usr_BuildQueryToGetUsrsLstCrs (Role,UsrQuery,Search,Query);
|
Usr_BuildQueryToGetUsrsLstCrs (Role,UsrQuery,Search,Query);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -3928,7 +3949,7 @@ void Usr_GetUsrsLst (Rol_Role_t Role,Sco_Scope_t Scope,const char *UsrQuery,bool
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
Lay_ShowAlert (Lay_INFO,Query);
|
Lay_ShowAlert (Lay_INFO,Query);
|
||||||
*/
|
*/
|
||||||
/***** Get list of users from database *****/
|
/***** Get list of users from database *****/
|
||||||
|
@ -3949,7 +3970,7 @@ static void Usr_GetAdmsLst (Sco_Scope_t Scope)
|
||||||
/***** Build query *****/
|
/***** Build query *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
strcpy (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
strcpy (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
||||||
" FROM admin,usr_data"
|
" FROM admin,usr_data"
|
||||||
" WHERE (admin.Scope='Deg'"
|
" WHERE (admin.Scope='Deg'"
|
||||||
|
@ -3958,7 +3979,7 @@ static void Usr_GetAdmsLst (Sco_Scope_t Scope)
|
||||||
" ORDER BY usr_data.Surname1,usr_data.Surname2,"
|
" ORDER BY usr_data.Surname1,usr_data.Surname2,"
|
||||||
"usr_data.FirstName,usr_data.UsrCod");
|
"usr_data.FirstName,usr_data.UsrCod");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
sprintf (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
||||||
" FROM centres,degrees,admin,usr_data"
|
" FROM centres,degrees,admin,usr_data"
|
||||||
" WHERE ((centres.InsCod='%ld'"
|
" WHERE ((centres.InsCod='%ld'"
|
||||||
|
@ -3971,7 +3992,7 @@ static void Usr_GetAdmsLst (Sco_Scope_t Scope)
|
||||||
"usr_data.FirstName,usr_data.UsrCod",
|
"usr_data.FirstName,usr_data.UsrCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
sprintf (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
||||||
" FROM degrees,admin,usr_data"
|
" FROM degrees,admin,usr_data"
|
||||||
" WHERE ((degrees.CtrCod='%ld'"
|
" WHERE ((degrees.CtrCod='%ld'"
|
||||||
|
@ -3983,7 +4004,7 @@ static void Usr_GetAdmsLst (Sco_Scope_t Scope)
|
||||||
"usr_data.FirstName,usr_data.UsrCod",
|
"usr_data.FirstName,usr_data.UsrCod",
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod);
|
Gbl.CurrentCtr.Ctr.CtrCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
sprintf (Query,"SELECT DISTINCT admin.UsrCod,'Y',usr_data.Sex"
|
||||||
" FROM admin,usr_data"
|
" FROM admin,usr_data"
|
||||||
" WHERE ((admin.Scope='Deg' AND admin.Cod='%ld')"
|
" WHERE ((admin.Scope='Deg' AND admin.Cod='%ld')"
|
||||||
|
@ -4012,13 +4033,13 @@ static void Usr_GetGstsLst (Sco_Scope_t Scope)
|
||||||
/***** Build query *****/
|
/***** Build query *****/
|
||||||
switch (Scope)
|
switch (Scope)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
strcpy (Query,"SELECT DISTINCT UsrCod,'N',Sex"
|
strcpy (Query,"SELECT DISTINCT UsrCod,'N',Sex"
|
||||||
" FROM usr_data"
|
" FROM usr_data"
|
||||||
" WHERE UsrCod NOT IN (SELECT UsrCod FROM crs_usr)"
|
" WHERE UsrCod NOT IN (SELECT UsrCod FROM crs_usr)"
|
||||||
" ORDER BY Surname1,Surname2,FirstName,UsrCod");
|
" ORDER BY Surname1,Surname2,FirstName,UsrCod");
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COUNTRY:
|
case Sco_SCOPE_CTY:
|
||||||
sprintf (Query,"SELECT DISTINCT UsrCod,'Y',Sex"
|
sprintf (Query,"SELECT DISTINCT UsrCod,'Y',Sex"
|
||||||
" FROM usr_data"
|
" FROM usr_data"
|
||||||
" WHERE (CtyCod='%ld' OR InsCtyCod='%ld')"
|
" WHERE (CtyCod='%ld' OR InsCtyCod='%ld')"
|
||||||
|
@ -4027,7 +4048,7 @@ static void Usr_GetGstsLst (Sco_Scope_t Scope)
|
||||||
Gbl.CurrentCty.Cty.CtyCod,
|
Gbl.CurrentCty.Cty.CtyCod,
|
||||||
Gbl.CurrentCty.Cty.CtyCod);
|
Gbl.CurrentCty.Cty.CtyCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT DISTINCT UsrCod,'Y',Sex"
|
sprintf (Query,"SELECT DISTINCT UsrCod,'Y',Sex"
|
||||||
" FROM usr_data"
|
" FROM usr_data"
|
||||||
" WHERE InsCod='%ld'"
|
" WHERE InsCod='%ld'"
|
||||||
|
@ -4035,7 +4056,7 @@ static void Usr_GetGstsLst (Sco_Scope_t Scope)
|
||||||
" ORDER BY Surname1,Surname2,FirstName,UsrCod",
|
" ORDER BY Surname1,Surname2,FirstName,UsrCod",
|
||||||
Gbl.CurrentIns.Ins.InsCod);
|
Gbl.CurrentIns.Ins.InsCod);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT DISTINCT UsrCod,'Y',Sex"
|
sprintf (Query,"SELECT DISTINCT UsrCod,'Y',Sex"
|
||||||
" FROM usr_data"
|
" FROM usr_data"
|
||||||
" WHERE CtrCod='%ld'"
|
" WHERE CtrCod='%ld'"
|
||||||
|
@ -4141,7 +4162,7 @@ static void Usr_GetListUsrs (const char *Query,struct ListUsers *LstUsrs)
|
||||||
static void Usr_AllocateUsrsList (struct ListUsers *LstUsrs)
|
static void Usr_AllocateUsrsList (struct ListUsers *LstUsrs)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)
|
if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)
|
||||||
{
|
{
|
||||||
sprintf (Gbl.Message,"Memory used by list = %lu",(long) sizeof (struct UsrInList) * NumUsrs);
|
sprintf (Gbl.Message,"Memory used by list = %lu",(long) sizeof (struct UsrInList) * NumUsrs);
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||||
|
@ -4959,7 +4980,7 @@ static void Usr_ListMainDataGsts (bool PutCheckBoxToSelectUsr)
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
}
|
}
|
||||||
else // Gbl.Usrs.LstGsts.NumUsrs == 0
|
else // Gbl.Usrs.LstGsts.NumUsrs == 0
|
||||||
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST);
|
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST__);
|
||||||
|
|
||||||
/***** Free memory for students list *****/
|
/***** Free memory for students list *****/
|
||||||
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
||||||
|
@ -5233,7 +5254,7 @@ void Usr_ListAllDataGsts (void)
|
||||||
fprintf (Gbl.F.Out,"</table>");
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
}
|
}
|
||||||
else // Gbl.Usrs.LstGsts.NumUsrs == 0
|
else // Gbl.Usrs.LstGsts.NumUsrs == 0
|
||||||
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST);
|
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST__);
|
||||||
|
|
||||||
/***** Free memory for guests' list *****/
|
/***** Free memory for guests' list *****/
|
||||||
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
||||||
|
@ -5306,13 +5327,13 @@ void Usr_ListAllDataStds (void)
|
||||||
|
|
||||||
if (Gbl.Usrs.LstStds.NumUsrs)
|
if (Gbl.Usrs.LstStds.NumUsrs)
|
||||||
{
|
{
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
/***** Get list of record fields in current course *****/
|
/***** Get list of record fields in current course *****/
|
||||||
Rec_GetListRecordFieldsInCurrentCrs ();
|
Rec_GetListRecordFieldsInCurrentCrs ();
|
||||||
|
|
||||||
/***** Set number of columns *****/
|
/***** Set number of columns *****/
|
||||||
NumColumnsCommonCard = Usr_NUM_ALL_FIELDS_DATA_STD;
|
NumColumnsCommonCard = Usr_NUM_ALL_FIELDS_DATA_STD;
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
{
|
{
|
||||||
NumColumnsCardAndGroups = NumColumnsCommonCard + Gbl.CurrentCrs.Grps.GrpTypes.Num;
|
NumColumnsCardAndGroups = NumColumnsCommonCard + Gbl.CurrentCrs.Grps.GrpTypes.Num;
|
||||||
NumColumnsTotal = NumColumnsCardAndGroups + Gbl.CurrentCrs.Records.LstFields.Num;
|
NumColumnsTotal = NumColumnsCardAndGroups + Gbl.CurrentCrs.Records.LstFields.Num;
|
||||||
|
@ -5321,7 +5342,7 @@ void Usr_ListAllDataStds (void)
|
||||||
NumColumnsTotal = NumColumnsCardAndGroups = NumColumnsCommonCard;
|
NumColumnsTotal = NumColumnsCardAndGroups = NumColumnsCommonCard;
|
||||||
|
|
||||||
/***** Allocate memory for the string with the list of group names where student belongs to *****/
|
/***** Allocate memory for the string with the list of group names where student belongs to *****/
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
if ((GroupNames = (char *) malloc ((MAX_LENGTH_GROUP_NAME+3)*Gbl.CurrentCrs.Grps.GrpTypes.NumGrpsTotal)) == NULL)
|
if ((GroupNames = (char *) malloc ((MAX_LENGTH_GROUP_NAME+3)*Gbl.CurrentCrs.Grps.GrpTypes.NumGrpsTotal)) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Not enough memory to store names of groups.");
|
Lay_ShowErrorAndExit ("Not enough memory to store names of groups.");
|
||||||
|
|
||||||
|
@ -5354,7 +5375,7 @@ void Usr_ListAllDataStds (void)
|
||||||
VERY_LIGHT_BLUE,FieldNames[NumCol]);
|
VERY_LIGHT_BLUE,FieldNames[NumCol]);
|
||||||
|
|
||||||
/* 2. Columns for the groups */
|
/* 2. Columns for the groups */
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
{
|
{
|
||||||
if (Gbl.CurrentCrs.Grps.GrpTypes.Num)
|
if (Gbl.CurrentCrs.Grps.GrpTypes.Num)
|
||||||
for (NumGrpTyp = 0;
|
for (NumGrpTyp = 0;
|
||||||
|
@ -5428,7 +5449,7 @@ void Usr_ListAllDataStds (void)
|
||||||
fprintf (Gbl.F.Out,"</table>");
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
|
|
||||||
/***** Free memory used by the string with the list of group names where student belongs to *****/
|
/***** Free memory used by the string with the list of group names where student belongs to *****/
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
free ((void *) GroupNames);
|
free ((void *) GroupNames);
|
||||||
}
|
}
|
||||||
else // Gbl.Usrs.LstStds.NumUsrs == 0
|
else // Gbl.Usrs.LstStds.NumUsrs == 0
|
||||||
|
@ -5559,13 +5580,13 @@ void Usr_ListAllDataTchs (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
|
||||||
/***** Get and order list of teachers *****/
|
/***** Get and order list of teachers *****/
|
||||||
|
@ -5705,7 +5726,7 @@ unsigned Usr_ListUsrsFound (Rol_Role_t Role,const char *UsrQuery)
|
||||||
Usr_WriteRowTchMainData (NumUsr + 1,&UsrDat,false);
|
Usr_WriteRowTchMainData (NumUsr + 1,&UsrDat,false);
|
||||||
|
|
||||||
/* Write all the courses this user belongs to */
|
/* Write all the courses this user belongs to */
|
||||||
if (Role != Rol_ROLE_GUEST)
|
if (Role != Rol_ROLE_GUEST__)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td colspan=\"3\"></td>"
|
"<td colspan=\"3\"></td>"
|
||||||
|
@ -5772,12 +5793,12 @@ void Usr_ListDataAdms (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE;
|
1 << Sco_SCOPE_DEG;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_DEGREE;
|
Gbl.Scope.Default = Sco_SCOPE_DEG;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
|
||||||
/***** Form to select range of administrators *****/
|
/***** Form to select range of administrators *****/
|
||||||
|
@ -5847,7 +5868,7 @@ void Usr_ListDataAdms (void)
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
}
|
}
|
||||||
else // Gbl.Usrs.LstAdms.NumUsrs == 0
|
else // Gbl.Usrs.LstAdms.NumUsrs == 0
|
||||||
Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Rol_ROLE_DEG_ADMIN]);
|
Lay_ShowAlert (Lay_INFO,Txt_No_users_found[Rol_ROLE_DEG_ADM]);
|
||||||
|
|
||||||
/***** Free memory for teachers list *****/
|
/***** Free memory for teachers list *****/
|
||||||
Usr_FreeUsrsList (&Gbl.Usrs.LstAdms);
|
Usr_FreeUsrsList (&Gbl.Usrs.LstAdms);
|
||||||
|
@ -6205,9 +6226,9 @@ void Usr_SeeGuests (void)
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_CTR_ADMIN:
|
case Rol_ROLE_CTR_ADM:
|
||||||
case Rol_ROLE_INS_ADMIN:
|
case Rol_ROLE_INS_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
/***** Form to select range of guests *****/
|
/***** Form to select range of guests *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">",
|
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
@ -6271,21 +6292,21 @@ void Usr_SeeGuests (void)
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
||||||
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true,
|
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CENTRE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INSTITUTION) ? Gbl.CurrentIns.Ins.InsCod :
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
-1L,
|
-1L,
|
||||||
-1L,
|
-1L,
|
||||||
-1L);
|
-1L);
|
||||||
|
|
||||||
/* Put a row to select all users */
|
/* Put a row to select all users */
|
||||||
Usr_PutCheckboxToSelectAllTheUsers (Rol_ROLE_GUEST);
|
Usr_PutCheckboxToSelectAllTheUsers (Rol_ROLE_GUEST__);
|
||||||
|
|
||||||
/* Draw the classphoto/list */
|
/* Draw the classphoto/list */
|
||||||
switch (Gbl.Usrs.Me.ListType)
|
switch (Gbl.Usrs.Me.ListType)
|
||||||
{
|
{
|
||||||
case Usr_CLASS_PHOTO:
|
case Usr_CLASS_PHOTO:
|
||||||
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_SEL_SEE,
|
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_SEL_SEE,
|
||||||
Rol_ROLE_GUEST);
|
Rol_ROLE_GUEST__);
|
||||||
break;
|
break;
|
||||||
case Usr_LIST:
|
case Usr_LIST:
|
||||||
Usr_ListMainDataGsts (true);
|
Usr_ListMainDataGsts (true);
|
||||||
|
@ -6301,7 +6322,7 @@ void Usr_SeeGuests (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST);
|
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST__);
|
||||||
|
|
||||||
/***** Free memory for students list *****/
|
/***** Free memory for students list *****/
|
||||||
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
||||||
|
@ -6321,7 +6342,7 @@ void Usr_SeeStudents (void)
|
||||||
|
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER || // My role in current course is teacher...
|
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER || // My role in current course is teacher...
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER)) // ...or superuser
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM)) // ...or superuser
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div style=\"text-align:center;"
|
fprintf (Gbl.F.Out,"<div style=\"text-align:center;"
|
||||||
" margin-bottom:10px;\">");
|
" margin-bottom:10px;\">");
|
||||||
|
@ -6343,16 +6364,16 @@ void Usr_SeeStudents (void)
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
Sco_SetScopesForListingStudents ();
|
Sco_SetScopesForListingStudents ();
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
ICanViewRecords = (Gbl.Scope.Current == Sco_SCOPE_COURSE &&
|
ICanViewRecords = (Gbl.Scope.Current == Sco_SCOPE_CRS &&
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT ||
|
(Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER));
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM));
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_DEG_ADMIN:
|
case Rol_ROLE_DEG_ADM:
|
||||||
case Rol_ROLE_SUPERUSER:
|
case Rol_ROLE_SYS_ADM:
|
||||||
/***** Form to select range of students *****/
|
/***** Form to select range of students *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">",
|
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">",
|
||||||
The_ClassFormul[Gbl.Prefs.Theme]);
|
The_ClassFormul[Gbl.Prefs.Theme]);
|
||||||
|
@ -6370,7 +6391,7 @@ void Usr_SeeStudents (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Form to select groups *****/
|
/***** Form to select groups *****/
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_COURSE)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
Grp_ShowFormToSelectSeveralGroups (ActLstStd);
|
Grp_ShowFormToSelectSeveralGroups (ActLstStd);
|
||||||
|
|
||||||
/***** Form to select type of list of users *****/
|
/***** Form to select type of list of users *****/
|
||||||
|
@ -6428,15 +6449,15 @@ void Usr_SeeStudents (void)
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
||||||
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true,
|
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE ||
|
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CENTRE ||
|
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INSTITUTION) ? Gbl.CurrentIns.Ins.InsCod :
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
-1L,
|
-1L,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE) ? Gbl.CurrentDeg.Deg.DegCod :
|
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
||||||
-1L,
|
-1L,
|
||||||
Gbl.Scope.Current == Sco_SCOPE_COURSE ? Gbl.CurrentCrs.Crs.CrsCod :
|
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
||||||
-1L);
|
-1L);
|
||||||
|
|
||||||
/* Put a row to select all users */
|
/* Put a row to select all users */
|
||||||
|
@ -6497,15 +6518,15 @@ void Usr_SeeTeachers (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
ICanViewRecords = (Gbl.Scope.Current == Sco_SCOPE_COURSE);
|
ICanViewRecords = (Gbl.Scope.Current == Sco_SCOPE_CRS);
|
||||||
|
|
||||||
/***** Form to select scope *****/
|
/***** Form to select scope *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">",
|
fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"text-align:center;\">",
|
||||||
|
@ -6567,15 +6588,15 @@ void Usr_SeeTeachers (void)
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
||||||
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true,
|
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,false,true,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE ||
|
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CENTRE ||
|
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INSTITUTION) ? Gbl.CurrentIns.Ins.InsCod :
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
-1L,
|
-1L,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE) ? Gbl.CurrentDeg.Deg.DegCod :
|
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
||||||
-1L,
|
-1L,
|
||||||
Gbl.Scope.Current == Sco_SCOPE_COURSE ? Gbl.CurrentCrs.Crs.CrsCod :
|
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
||||||
-1L);
|
-1L);
|
||||||
|
|
||||||
/* Put a row to select all users */
|
/* Put a row to select all users */
|
||||||
|
@ -6659,15 +6680,15 @@ void Usr_SeeGstClassPhotoPrn (void)
|
||||||
/***** Draw the guests' class photo *****/
|
/***** Draw the guests' class photo *****/
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
||||||
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,true,true,
|
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,true,true,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CENTRE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INSTITUTION) ? Gbl.CurrentIns.Ins.InsCod :
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
-1L,
|
-1L,
|
||||||
-1L,-1L);
|
-1L,-1L);
|
||||||
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,Rol_ROLE_GUEST);
|
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,Rol_ROLE_GUEST__);
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST);
|
Usr_ShowWarningNoUsersFound (Rol_ROLE_GUEST__);
|
||||||
|
|
||||||
/***** Free memory for students list *****/
|
/***** Free memory for students list *****/
|
||||||
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
Usr_FreeUsrsList (&Gbl.Usrs.LstGsts);
|
||||||
|
@ -6699,15 +6720,15 @@ void Usr_SeeStdClassPhotoPrn (void)
|
||||||
/***** Draw the students' class photo *****/
|
/***** Draw the students' class photo *****/
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
||||||
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,true,true,
|
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,true,true,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE ||
|
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CENTRE ||
|
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INSTITUTION) ? Gbl.CurrentIns.Ins.InsCod :
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
-1L,
|
-1L,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE) ? Gbl.CurrentDeg.Deg.DegCod :
|
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
||||||
-1L,
|
-1L,
|
||||||
Gbl.Scope.Current == Sco_SCOPE_COURSE ? Gbl.CurrentCrs.Crs.CrsCod :
|
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
||||||
-1L);
|
-1L);
|
||||||
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,Rol_ROLE_STUDENT);
|
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,Rol_ROLE_STUDENT);
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
|
@ -6736,13 +6757,13 @@ void Usr_SeeTchClassPhotoPrn (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_PLATFORM |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_COUNTRY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INSTITUTION |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CENTRE |
|
1 << Sco_SCOPE_CTR |
|
||||||
1 << Sco_SCOPE_DEGREE |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_COURSE;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_COURSE;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
|
||||||
/***** Get and order list of teachers *****/
|
/***** Get and order list of teachers *****/
|
||||||
|
@ -6753,15 +6774,15 @@ void Usr_SeeTchClassPhotoPrn (void)
|
||||||
/***** Draw the teachers' class photo *****/
|
/***** Draw the teachers' class photo *****/
|
||||||
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
Lay_StartRoundFrameTable10 (NULL,0,NULL);
|
||||||
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,true,true,
|
Lay_WriteHeaderClassPhoto (Gbl.Usrs.ClassPhoto.Cols,true,true,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE ||
|
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CENTRE ||
|
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INSTITUTION) ? Gbl.CurrentIns.Ins.InsCod :
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
-1L,
|
-1L,
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_COURSE ||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEGREE) ? Gbl.CurrentDeg.Deg.DegCod :
|
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
||||||
-1L,
|
-1L,
|
||||||
Gbl.Scope.Current == Sco_SCOPE_COURSE ? Gbl.CurrentCrs.Crs.CrsCod :
|
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
||||||
-1L);
|
-1L);
|
||||||
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,Rol_ROLE_TEACHER);
|
Usr_DrawClassPhoto (Usr_CLASS_PHOTO_PRN,Rol_ROLE_TEACHER);
|
||||||
Lay_EndRoundFrameTable10 ();
|
Lay_EndRoundFrameTable10 ();
|
||||||
|
@ -6786,8 +6807,8 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType,
|
||||||
unsigned NumUsr;
|
unsigned NumUsr;
|
||||||
bool TRIsOpen = false;
|
bool TRIsOpen = false;
|
||||||
bool IAmLoggedAsTeacherOrAbove = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
bool IAmLoggedAsTeacherOrAbove = (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
bool ICanSeePhotos = (IAmLoggedAsTeacherOrAbove ||
|
bool ICanSeePhotos = (IAmLoggedAsTeacherOrAbove ||
|
||||||
(Gbl.Usrs.Me.MyPhotoExists &&
|
(Gbl.Usrs.Me.MyPhotoExists &&
|
||||||
Gbl.Usrs.Me.UsrDat.PublicPhoto));
|
Gbl.Usrs.Me.UsrDat.PublicPhoto));
|
||||||
|
@ -6859,8 +6880,8 @@ static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType,
|
||||||
|
|
||||||
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat.UsrCod);
|
ItsMe = (Gbl.Usrs.Me.UsrDat.UsrCod == UsrDat.UsrCod);
|
||||||
ShowData = (ItsMe || UsrDat.Accepted ||
|
ShowData = (ItsMe || UsrDat.Accepted ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADMIN ||
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SUPERUSER);
|
Gbl.Usrs.Me.LoggedRole == Rol_ROLE_SYS_ADM);
|
||||||
|
|
||||||
/***** Begin user's cell *****/
|
/***** Begin user's cell *****/
|
||||||
fprintf (Gbl.F.Out,"<td class=\"CLASSPHOTO\""
|
fprintf (Gbl.F.Out,"<td class=\"CLASSPHOTO\""
|
||||||
|
@ -7071,17 +7092,17 @@ void Usr_GetAndShowNumUsrsInPlatform (Rol_Role_t Role)
|
||||||
float NumUsrsPerCrs;
|
float NumUsrsPerCrs;
|
||||||
|
|
||||||
/***** Get the number of users belonging to any course *****/
|
/***** Get the number of users belonging to any course *****/
|
||||||
if (Role == Rol_ROLE_GUEST) // Users not beloging to any course
|
if (Role == Rol_ROLE_GUEST__) // Users not beloging to any course
|
||||||
NumUsrs = Usr_GetNumUsrsNotBelongingToAnyCrs ();
|
NumUsrs = Usr_GetNumUsrsNotBelongingToAnyCrs ();
|
||||||
else
|
else
|
||||||
NumUsrs = Usr_GetNumUsrsBelongingToAnyCrs (Role);
|
NumUsrs = Usr_GetNumUsrsBelongingToAnyCrs (Role);
|
||||||
|
|
||||||
/***** Get average number of courses per user *****/
|
/***** Get average number of courses per user *****/
|
||||||
NumCrssPerUsr = (Role == Rol_ROLE_GUEST) ? 0 :
|
NumCrssPerUsr = (Role == Rol_ROLE_GUEST__) ? 0 :
|
||||||
Usr_GetNumCrssPerUsr (Role);
|
Usr_GetNumCrssPerUsr (Role);
|
||||||
|
|
||||||
/***** Query the number of users per course *****/
|
/***** Query the number of users per course *****/
|
||||||
NumUsrsPerCrs = (Role == Rol_ROLE_GUEST) ? 0 :
|
NumUsrsPerCrs = (Role == Rol_ROLE_GUEST__) ? 0 :
|
||||||
Usr_GetNumUsrsPerCrs (Role);
|
Usr_GetNumUsrsPerCrs (Role);
|
||||||
|
|
||||||
/***** Write the total number of users *****/
|
/***** Write the total number of users *****/
|
||||||
|
@ -7135,13 +7156,13 @@ static unsigned Usr_GetNumUsrsBelongingToAnyCrs (Rol_Role_t Role)
|
||||||
/***** Get number of users who belong to any course *****/
|
/***** Get number of users who belong to any course *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT UsrCod)"
|
||||||
" FROM crs_usr"
|
" FROM crs_usr"
|
||||||
" WHERE Role='%u'",
|
" WHERE Role='%u'",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM centres,degrees,courses,crs_usr"
|
" FROM centres,degrees,courses,crs_usr"
|
||||||
" WHERE centres.InsCod='%ld'"
|
" WHERE centres.InsCod='%ld'"
|
||||||
|
@ -7152,7 +7173,7 @@ static unsigned Usr_GetNumUsrsBelongingToAnyCrs (Rol_Role_t Role)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM degrees,courses,crs_usr"
|
" FROM degrees,courses,crs_usr"
|
||||||
" WHERE degrees.CtrCod='%ld'"
|
" WHERE degrees.CtrCod='%ld'"
|
||||||
|
@ -7162,7 +7183,7 @@ static unsigned Usr_GetNumUsrsBelongingToAnyCrs (Rol_Role_t Role)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM courses,crs_usr"
|
" FROM courses,crs_usr"
|
||||||
" WHERE courses.DegCod='%ld'"
|
" WHERE courses.DegCod='%ld'"
|
||||||
|
@ -7171,7 +7192,7 @@ static unsigned Usr_GetNumUsrsBelongingToAnyCrs (Rol_Role_t Role)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
sprintf (Query,"SELECT COUNT(DISTINCT crs_usr.UsrCod)"
|
||||||
" FROM crs_usr"
|
" FROM crs_usr"
|
||||||
" WHERE crs_usr.CrsCod='%ld'"
|
" WHERE crs_usr.CrsCod='%ld'"
|
||||||
|
@ -7200,14 +7221,14 @@ static float Usr_GetNumCrssPerUsr (Rol_Role_t Role)
|
||||||
/***** Get number of courses per user from database *****/
|
/***** Get number of courses per user from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
||||||
"(SELECT COUNT(CrsCod) AS NumCrss"
|
"(SELECT COUNT(CrsCod) AS NumCrss"
|
||||||
" FROM crs_usr"
|
" FROM crs_usr"
|
||||||
" WHERE Role='%u' GROUP BY UsrCod) AS NumCrssTable",
|
" WHERE Role='%u' GROUP BY UsrCod) AS NumCrssTable",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
||||||
"(SELECT COUNT(crs_usr.CrsCod) AS NumCrss"
|
"(SELECT COUNT(crs_usr.CrsCod) AS NumCrss"
|
||||||
" FROM centres,degrees,courses,crs_usr"
|
" FROM centres,degrees,courses,crs_usr"
|
||||||
|
@ -7220,7 +7241,7 @@ static float Usr_GetNumCrssPerUsr (Rol_Role_t Role)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
||||||
"(SELECT COUNT(crs_usr.CrsCod) AS NumCrss"
|
"(SELECT COUNT(crs_usr.CrsCod) AS NumCrss"
|
||||||
" FROM degrees,courses,crs_usr"
|
" FROM degrees,courses,crs_usr"
|
||||||
|
@ -7232,7 +7253,7 @@ static float Usr_GetNumCrssPerUsr (Rol_Role_t Role)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
sprintf (Query,"SELECT AVG(NumCrss) FROM "
|
||||||
"(SELECT COUNT(crs_usr.CrsCod) AS NumCrss"
|
"(SELECT COUNT(crs_usr.CrsCod) AS NumCrss"
|
||||||
" FROM courses,crs_usr"
|
" FROM courses,crs_usr"
|
||||||
|
@ -7243,7 +7264,7 @@ static float Usr_GetNumCrssPerUsr (Rol_Role_t Role)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
return 1.0;
|
return 1.0;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong scope.");
|
Lay_ShowErrorAndExit ("Wrong scope.");
|
||||||
|
@ -7275,14 +7296,14 @@ static float Usr_GetNumUsrsPerCrs (Rol_Role_t Role)
|
||||||
/***** Get number of users per course from database *****/
|
/***** Get number of users per course from database *****/
|
||||||
switch (Gbl.Scope.Current)
|
switch (Gbl.Scope.Current)
|
||||||
{
|
{
|
||||||
case Sco_SCOPE_PLATFORM:
|
case Sco_SCOPE_SYS:
|
||||||
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
||||||
"(SELECT COUNT(UsrCod) AS NumUsrs"
|
"(SELECT COUNT(UsrCod) AS NumUsrs"
|
||||||
" FROM crs_usr"
|
" FROM crs_usr"
|
||||||
" WHERE Role='%u' GROUP BY CrsCod) AS NumUsrsTable",
|
" WHERE Role='%u' GROUP BY CrsCod) AS NumUsrsTable",
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_INSTITUTION:
|
case Sco_SCOPE_INS:
|
||||||
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
||||||
"(SELECT COUNT(crs_usr.UsrCod) AS NumUsrs"
|
"(SELECT COUNT(crs_usr.UsrCod) AS NumUsrs"
|
||||||
" FROM centres,degrees,courses,crs_usr"
|
" FROM centres,degrees,courses,crs_usr"
|
||||||
|
@ -7295,7 +7316,7 @@ static float Usr_GetNumUsrsPerCrs (Rol_Role_t Role)
|
||||||
Gbl.CurrentIns.Ins.InsCod,
|
Gbl.CurrentIns.Ins.InsCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_CENTRE:
|
case Sco_SCOPE_CTR:
|
||||||
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
||||||
"(SELECT COUNT(crs_usr.UsrCod) AS NumUsrs"
|
"(SELECT COUNT(crs_usr.UsrCod) AS NumUsrs"
|
||||||
" FROM degrees,courses,crs_usr"
|
" FROM degrees,courses,crs_usr"
|
||||||
|
@ -7307,7 +7328,7 @@ static float Usr_GetNumUsrsPerCrs (Rol_Role_t Role)
|
||||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_DEGREE:
|
case Sco_SCOPE_DEG:
|
||||||
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
sprintf (Query,"SELECT AVG(NumUsrs) FROM "
|
||||||
"(SELECT COUNT(crs_usr.UsrCod) AS NumUsrs"
|
"(SELECT COUNT(crs_usr.UsrCod) AS NumUsrs"
|
||||||
" FROM courses,crs_usr"
|
" FROM courses,crs_usr"
|
||||||
|
@ -7318,7 +7339,7 @@ static float Usr_GetNumUsrsPerCrs (Rol_Role_t Role)
|
||||||
Gbl.CurrentDeg.Deg.DegCod,
|
Gbl.CurrentDeg.Deg.DegCod,
|
||||||
(unsigned) Role);
|
(unsigned) Role);
|
||||||
break;
|
break;
|
||||||
case Sco_SCOPE_COURSE:
|
case Sco_SCOPE_CRS:
|
||||||
return (float) ((Role == Rol_ROLE_TEACHER) ? Gbl.CurrentCrs.Crs.NumTchs :
|
return (float) ((Role == Rol_ROLE_TEACHER) ? Gbl.CurrentCrs.Crs.NumTchs :
|
||||||
Gbl.CurrentCrs.Crs.NumStds);
|
Gbl.CurrentCrs.Crs.NumStds);
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -574,7 +574,7 @@ static int Svc_GetSomeUsrDataFromUsrCod (struct UsrData *UsrDat,long CrsCod)
|
||||||
UsrDat->RoleInCurrentCrsDB = Rol_ROLE_UNKNOWN;
|
UsrDat->RoleInCurrentCrsDB = Rol_ROLE_UNKNOWN;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
UsrDat->RoleInCurrentCrsDB = Rol_ROLE_GUEST;
|
UsrDat->RoleInCurrentCrsDB = Rol_ROLE_GUEST__;
|
||||||
|
|
||||||
/* Free structure that stores the query result */
|
/* Free structure that stores the query result */
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
@ -590,7 +590,7 @@ static int Svc_GetRoleFromInternalRole (Rol_Role_t Role)
|
||||||
{
|
{
|
||||||
switch (Role)
|
switch (Role)
|
||||||
{
|
{
|
||||||
case Rol_ROLE_GUEST:
|
case Rol_ROLE_GUEST__:
|
||||||
case Rol_ROLE_VISITOR:
|
case Rol_ROLE_VISITOR:
|
||||||
return 1; // guest or visitor
|
return 1; // guest or visitor
|
||||||
case Rol_ROLE_STUDENT:
|
case Rol_ROLE_STUDENT:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user