diff --git a/swad_changelog.h b/swad_changelog.h
index 95b360730..4c83e9fe8 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -136,13 +136,15 @@
/****************************** 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 JS_FILE "swad15.131.3.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
+ Version 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.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)
diff --git a/swad_group.c b/swad_group.c
index 7222e44d7..f6bb111ca 100644
--- a/swad_group.c
+++ b/swad_group.c
@@ -1532,18 +1532,8 @@ void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrS
void Grp_ReqRegisterInGrps (void)
{
- extern const char *Txt_No_groups_have_been_created_in_the_course_X;
-
- /***** 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);
- }
+ /***** Show list of groups to register/remove me *****/
+ Grp_ShowLstGrpsToChgMyGrps ((Gbl.Usrs.Me.LoggedRole == Rol_STUDENT));
}
/*****************************************************************************/
@@ -1555,6 +1545,7 @@ void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
extern const char *Txt_My_groups;
extern const char *Txt_Change_my_groups;
extern const char *Txt_Enroll_in_groups;
+ extern const char *Txt_No_groups_have_been_created_in_the_course_X;
unsigned NumGrpTyp;
unsigned NumGrpsIBelong = 0;
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_SYS_ADM);
- /***** Get list of groups types and groups in this course *****/
- Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
+ if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
+ {
+ /***** Get list of groups types and groups in this course *****/
+ Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
- /***** Show warnings to students *****/
- // Students are required to join groups with mandatory enrollment; teachers don't
- if (ShowWarningsToStudents)
- Grp_ShowWarningToStdsToChangeGrps ();
+ /***** Show warnings to students *****/
+ // Students are required to join groups with mandatory enrollment; teachers don't
+ if (ShowWarningsToStudents)
+ Grp_ShowWarningToStdsToChangeGrps ();
+ }
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_My_groups,
ICanEdit ? Grp_PutIconToEditGroups :
NULL);
- /***** Start form *****/
- if (PutFormToChangeGrps)
- Act_FormStart (ActChgGrp);
-
- /***** List the groups the user belongs to for change *****/
- fprintf (Gbl.F.Out,"
");
- 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,"
");
-
- /***** End form *****/
- if (PutFormToChangeGrps)
+ if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
{
- Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups :
- Txt_Enroll_in_groups);
- Act_FormEnd ();
+ /***** Start form *****/
+ if (PutFormToChangeGrps)
+ Act_FormStart (ActChgGrp);
+
+ /***** List the groups the user belongs to for change *****/
+ fprintf (Gbl.F.Out,"
");
+ 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,"
");
+
+ /***** 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 *****/
Lay_EndRoundFrame ();
- /***** Free list of groups types and groups in this course *****/
- Grp_FreeListGrpTypesAndGrps ();
+ if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
+ /***** Free list of groups types and groups in this course *****/
+ Grp_FreeListGrpTypesAndGrps ();
}
/*****************************************************************************/
diff --git a/swad_user.c b/swad_user.c
index 407b884eb..90a40c4ea 100644
--- a/swad_user.c
+++ b/swad_user.c
@@ -6707,8 +6707,8 @@ void Usr_SeeGuests (void)
void Usr_SeeStudents (void)
{
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_Scope;
extern const char *Txt_Show_records;
bool ICanViewRecords;
@@ -6756,26 +6756,6 @@ void Usr_SeeStudents (void)
Gbl.Usrs.Me.LoggedRole == Rol_DEG_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,"
");
+ break;
+ default:
+ break;
+ }
+ if (Gbl.Usrs.LstStds.NumUsrs)
+ {
/***** Form to select type of list of users *****/
Usr_ShowFormsToSelectUsrListType (ActLstStd);
@@ -6852,19 +6852,20 @@ void Usr_SeeStudents (void)
/* End form */
Act_FormEnd ();
}
-
- /* End frame */
- Lay_EndRoundFrame ();
}
- }
- else
- {
- Usr_ShowWarningNoUsersFound (Rol_STUDENT);
+ else
+ {
+ /***** Show warning indicating no students found *****/
+ Usr_ShowWarningNoUsersFound (Rol_STUDENT);
- /***** Form to enroll several students *****/
- if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
- Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER) // I am a teacher in current course
- Enr_PutButtonToEnrollStudents ();
+ /***** Form to enroll several students *****/
+ if (Gbl.CurrentCrs.Crs.CrsCod > 0 && // Course selected
+ Gbl.Usrs.Me.UsrDat.RoleInCurrentCrsDB == Rol_TEACHER) // I am a teacher in current course
+ Enr_PutButtonToEnrollStudents ();
+ }
+
+ /***** End frame *****/
+ Lay_EndRoundFrame ();
}
/***** Free memory for students list *****/