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 *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#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)
|
||||
|
|
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)
|
||||
{
|
||||
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,"<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)
|
||||
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,"<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 *****/
|
||||
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 ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
87
swad_user.c
87
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,"<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 *****/
|
||||
if (Gbl.Scope.Current == Sco_SCOPE_CRS)
|
||||
Grp_ShowFormToSelectSeveralGroups (ActLstStd);
|
||||
|
@ -6783,20 +6763,40 @@ void Usr_SeeStudents (void)
|
|||
/***** Get and order list of students *****/
|
||||
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 *****/
|
||||
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));
|
||||
case Rol_DEG_ADM:
|
||||
case Rol_SYS_ADM:
|
||||
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;
|
||||
}
|
||||
|
||||
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 *****/
|
||||
|
|
Loading…
Reference in New Issue