mirror of https://github.com/acanas/swad-core.git
Version 15.164
This commit is contained in:
parent
752222b32b
commit
10d5ae1a49
|
@ -136,13 +136,15 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.163.4 (2016-03-28)"
|
#define Log_PLATFORM_VERSION "SWAD 15.164 (2016-03-28)"
|
||||||
#define CSS_FILE "swad15.162.1.css"
|
#define CSS_FILE "swad15.162.1.css"
|
||||||
#define JS_FILE "swad15.131.3.js"
|
#define JS_FILE "swad15.131.3.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 15.164: Mar 28, 2016 Scope selector inside frame in listing of students.
|
||||||
|
Fix bug in edition of groups. (196664 lines)
|
||||||
Version 15.163.4: Mar 28, 2016 Scope selector inside frame in listing of teachers. (196656 lines)
|
Version 15.163.4: Mar 28, 2016 Scope selector inside frame in listing of teachers. (196656 lines)
|
||||||
Version 15.163.3: Mar 28, 2016 Scope selector inside frame in listing of admins. (196652 lines)
|
Version 15.163.3: Mar 28, 2016 Scope selector inside frame in listing of admins. (196652 lines)
|
||||||
Version 15.163.2: Mar 27, 2016 Scope selector inside frame in listing of guests. (196655 lines)
|
Version 15.163.2: Mar 27, 2016 Scope selector inside frame in listing of guests. (196655 lines)
|
||||||
|
|
80
swad_group.c
80
swad_group.c
|
@ -1532,18 +1532,8 @@ void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrS
|
||||||
|
|
||||||
void Grp_ReqRegisterInGrps (void)
|
void Grp_ReqRegisterInGrps (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_No_groups_have_been_created_in_the_course_X;
|
/***** Show list of groups to register/remove me *****/
|
||||||
|
Grp_ShowLstGrpsToChgMyGrps ((Gbl.Usrs.Me.LoggedRole == Rol_STUDENT));
|
||||||
/***** Check if this course has groups *****/
|
|
||||||
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
|
|
||||||
/***** Show list of groups to register/remove me *****/
|
|
||||||
Grp_ShowLstGrpsToChgMyGrps ((Gbl.Usrs.Me.LoggedRole == Rol_STUDENT));
|
|
||||||
else // This course has not groups
|
|
||||||
{
|
|
||||||
sprintf (Gbl.Message,Txt_No_groups_have_been_created_in_the_course_X,
|
|
||||||
Gbl.CurrentCrs.Crs.FullName);
|
|
||||||
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1555,6 +1545,7 @@ void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
|
||||||
extern const char *Txt_My_groups;
|
extern const char *Txt_My_groups;
|
||||||
extern const char *Txt_Change_my_groups;
|
extern const char *Txt_Change_my_groups;
|
||||||
extern const char *Txt_Enroll_in_groups;
|
extern const char *Txt_Enroll_in_groups;
|
||||||
|
extern const char *Txt_No_groups_have_been_created_in_the_course_X;
|
||||||
unsigned NumGrpTyp;
|
unsigned NumGrpTyp;
|
||||||
unsigned NumGrpsIBelong = 0;
|
unsigned NumGrpsIBelong = 0;
|
||||||
bool PutFormToChangeGrps = !Gbl.Form.Inside; // Not inside another form (record card)
|
bool PutFormToChangeGrps = !Gbl.Form.Inside; // Not inside another form (record card)
|
||||||
|
@ -1562,45 +1553,58 @@ void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
|
||||||
(Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
|
(Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
|
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
|
||||||
|
|
||||||
/***** Get list of groups types and groups in this course *****/
|
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
|
||||||
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
|
{
|
||||||
|
/***** Get list of groups types and groups in this course *****/
|
||||||
|
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
|
||||||
|
|
||||||
/***** Show warnings to students *****/
|
/***** Show warnings to students *****/
|
||||||
// Students are required to join groups with mandatory enrollment; teachers don't
|
// Students are required to join groups with mandatory enrollment; teachers don't
|
||||||
if (ShowWarningsToStudents)
|
if (ShowWarningsToStudents)
|
||||||
Grp_ShowWarningToStdsToChangeGrps ();
|
Grp_ShowWarningToStdsToChangeGrps ();
|
||||||
|
}
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start frame *****/
|
||||||
Lay_StartRoundFrame (NULL,Txt_My_groups,
|
Lay_StartRoundFrame (NULL,Txt_My_groups,
|
||||||
ICanEdit ? Grp_PutIconToEditGroups :
|
ICanEdit ? Grp_PutIconToEditGroups :
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/***** Start form *****/
|
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
|
||||||
if (PutFormToChangeGrps)
|
|
||||||
Act_FormStart (ActChgGrp);
|
|
||||||
|
|
||||||
/***** List the groups the user belongs to for change *****/
|
|
||||||
fprintf (Gbl.F.Out,"<table class=\"FRAME_TABLE CELLS_PAD_2\">");
|
|
||||||
for (NumGrpTyp = 0;
|
|
||||||
NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num;
|
|
||||||
NumGrpTyp++)
|
|
||||||
if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) // If there are groups of this type
|
|
||||||
NumGrpsIBelong += Grp_ListGrpsForChange (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp]);
|
|
||||||
fprintf (Gbl.F.Out,"</table>");
|
|
||||||
|
|
||||||
/***** End form *****/
|
|
||||||
if (PutFormToChangeGrps)
|
|
||||||
{
|
{
|
||||||
Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups :
|
/***** Start form *****/
|
||||||
Txt_Enroll_in_groups);
|
if (PutFormToChangeGrps)
|
||||||
Act_FormEnd ();
|
Act_FormStart (ActChgGrp);
|
||||||
|
|
||||||
|
/***** List the groups the user belongs to for change *****/
|
||||||
|
fprintf (Gbl.F.Out,"<table class=\"FRAME_TABLE CELLS_PAD_2\">");
|
||||||
|
for (NumGrpTyp = 0;
|
||||||
|
NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num;
|
||||||
|
NumGrpTyp++)
|
||||||
|
if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) // If there are groups of this type
|
||||||
|
NumGrpsIBelong += Grp_ListGrpsForChange (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp]);
|
||||||
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
|
|
||||||
|
/***** End form *****/
|
||||||
|
if (PutFormToChangeGrps)
|
||||||
|
{
|
||||||
|
Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups :
|
||||||
|
Txt_Enroll_in_groups);
|
||||||
|
Act_FormEnd ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // This course has no groups
|
||||||
|
{
|
||||||
|
sprintf (Gbl.Message,Txt_No_groups_have_been_created_in_the_course_X,
|
||||||
|
Gbl.CurrentCrs.Crs.FullName);
|
||||||
|
Lay_ShowAlert (Lay_INFO,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End frame *****/
|
/***** End frame *****/
|
||||||
Lay_EndRoundFrame ();
|
Lay_EndRoundFrame ();
|
||||||
|
|
||||||
/***** Free list of groups types and groups in this course *****/
|
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
|
||||||
Grp_FreeListGrpTypesAndGrps ();
|
/***** Free list of groups types and groups in this course *****/
|
||||||
|
Grp_FreeListGrpTypesAndGrps ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
87
swad_user.c
87
swad_user.c
|
@ -6707,8 +6707,8 @@ void Usr_SeeGuests (void)
|
||||||
void Usr_SeeStudents (void)
|
void Usr_SeeStudents (void)
|
||||||
{
|
{
|
||||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||||
extern const char *Txt_Scope;
|
|
||||||
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
|
||||||
|
extern const char *Txt_Scope;
|
||||||
extern const char *Txt_Show_records;
|
extern const char *Txt_Show_records;
|
||||||
bool ICanViewRecords;
|
bool ICanViewRecords;
|
||||||
|
|
||||||
|
@ -6756,26 +6756,6 @@ void Usr_SeeStudents (void)
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_DEG_ADM ||
|
Gbl.Usrs.Me.LoggedRole == Rol_DEG_ADM ||
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM));
|
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM));
|
||||||
|
|
||||||
switch (Gbl.Usrs.Me.LoggedRole)
|
|
||||||
{
|
|
||||||
case Rol_DEG_ADM:
|
|
||||||
case Rol_SYS_ADM:
|
|
||||||
/***** Form to select range of students *****/
|
|
||||||
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
|
|
||||||
Act_FormStart (ActLstStd);
|
|
||||||
Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType);
|
|
||||||
Usr_PutParamColsClassPhoto ();
|
|
||||||
Usr_PutParamListWithPhotos ();
|
|
||||||
fprintf (Gbl.F.Out,"<label class=\"%s\">%s: </label>",
|
|
||||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Scope);
|
|
||||||
Sco_PutSelectorScope (true);
|
|
||||||
Act_FormEnd ();
|
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Form to select groups *****/
|
/***** Form to select groups *****/
|
||||||
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||||
Grp_ShowFormToSelectSeveralGroups (ActLstStd);
|
Grp_ShowFormToSelectSeveralGroups (ActLstStd);
|
||||||
|
@ -6783,20 +6763,40 @@ void Usr_SeeStudents (void)
|
||||||
/***** Get and order list of students *****/
|
/***** Get and order list of students *****/
|
||||||
Usr_GetUsrsLst (Rol_STUDENT,Gbl.Scope.Current,NULL,false);
|
Usr_GetUsrsLst (Rol_STUDENT,Gbl.Scope.Current,NULL,false);
|
||||||
|
|
||||||
if (Gbl.Usrs.LstStds.NumUsrs)
|
if (Usr_GetIfShowBigList (Gbl.Usrs.LstStds.NumUsrs))
|
||||||
{
|
{
|
||||||
if (Usr_GetIfShowBigList (Gbl.Usrs.LstStds.NumUsrs))
|
/***** Get list of selected users *****/
|
||||||
|
Usr_GetListsSelectedUsrs ();
|
||||||
|
|
||||||
|
/***** Start frame *****/
|
||||||
|
Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN],
|
||||||
|
(Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO) ? (Gbl.Usrs.LstStds.NumUsrs ? Usr_PutIconToPrintStds :
|
||||||
|
NULL) :
|
||||||
|
((Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER) ? Usr_PutIconToShowStdsAllData :
|
||||||
|
NULL));
|
||||||
|
|
||||||
|
/***** Form to select range of students *****/
|
||||||
|
switch (Gbl.Usrs.Me.LoggedRole)
|
||||||
{
|
{
|
||||||
/***** Get list of selected users *****/
|
case Rol_DEG_ADM:
|
||||||
Usr_GetListsSelectedUsrs ();
|
case Rol_SYS_ADM:
|
||||||
|
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
|
||||||
/***** Start frame *****/
|
Act_FormStart (ActLstStd);
|
||||||
Lay_StartRoundFrame (NULL,Txt_ROLES_PLURAL_Abc[Rol_STUDENT][Usr_SEX_UNKNOWN],
|
Usr_PutParamUsrListType (Gbl.Usrs.Me.ListType);
|
||||||
(Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO) ? (Gbl.Usrs.LstStds.NumUsrs ? Usr_PutIconToPrintStds :
|
Usr_PutParamColsClassPhoto ();
|
||||||
NULL) :
|
Usr_PutParamListWithPhotos ();
|
||||||
((Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER) ? Usr_PutIconToShowStdsAllData :
|
fprintf (Gbl.F.Out,"<label class=\"%s\">%s: </label>",
|
||||||
NULL));
|
The_ClassForm[Gbl.Prefs.Theme],Txt_Scope);
|
||||||
|
Sco_PutSelectorScope (true);
|
||||||
|
Act_FormEnd ();
|
||||||
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Gbl.Usrs.LstStds.NumUsrs)
|
||||||
|
{
|
||||||
/***** Form to select type of list of users *****/
|
/***** Form to select type of list of users *****/
|
||||||
Usr_ShowFormsToSelectUsrListType (ActLstStd);
|
Usr_ShowFormsToSelectUsrListType (ActLstStd);
|
||||||
|
|
||||||
|
@ -6852,19 +6852,20 @@ void Usr_SeeStudents (void)
|
||||||
/* End form */
|
/* End form */
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End frame */
|
|
||||||
Lay_EndRoundFrame ();
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
/***** Show warning indicating no students found *****/
|
||||||
Usr_ShowWarningNoUsersFound (Rol_STUDENT);
|
Usr_ShowWarningNoUsersFound (Rol_STUDENT);
|
||||||
|
|
||||||
/***** Form to enroll several students *****/
|
/***** Form to enroll several students *****/
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
|
if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
|
||||||
Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER) // I am a teacher in current course
|
Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER) // I am a teacher in current course
|
||||||
Enr_PutButtonToEnrollStudents ();
|
Enr_PutButtonToEnrollStudents ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** End frame *****/
|
||||||
|
Lay_EndRoundFrame ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free memory for students list *****/
|
/***** Free memory for students list *****/
|
||||||
|
|
Loading…
Reference in New Issue