mirror of https://github.com/acanas/swad-core.git
Version 15.147.3
This commit is contained in:
parent
d2297c361d
commit
bab7ef9ff8
|
@ -129,13 +129,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.147.2 (2016-03-16)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.147.3 (2016-03-16)"
|
||||
#define CSS_FILE "swad15.146.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.147.3: Mar 16, 2016 Icon to edit groups integrated in frame. (195867 lines)
|
||||
Version 15.147.2: Mar 16, 2016 Icon to edit degree types integrated in frame. (195866 lines)
|
||||
Version 15.147.1: Mar 16, 2016 Removed links to view when editing. (195854 lines)
|
||||
Version 15.147: Mar 16, 2016 New buttons to create another institution / centre / degree / course. (195903 lines)
|
||||
|
|
65
swad_group.c
65
swad_group.c
|
@ -70,6 +70,7 @@ static void Grp_ListGroupTypesForEdition (void);
|
|||
static void Grp_WriteHeadingGroupTypes (void);
|
||||
static void Grp_ListGroupsForEdition (void);
|
||||
static void Grp_WriteHeadingGroups (void);
|
||||
static void Grp_PutIconToEdit (void);
|
||||
|
||||
static void Grp_ShowWarningToStdsToChangeGrps (void);
|
||||
static unsigned Grp_ListGrpsForChange (struct GroupType *GrpTyp);
|
||||
|
@ -1528,30 +1529,12 @@ void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrS
|
|||
|
||||
void Grp_ReqRegisterInGrps (void)
|
||||
{
|
||||
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 NumGrpsIBelong;
|
||||
|
||||
/***** Put link (form) to edit groups *****/
|
||||
if (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
|
||||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
|
||||
Lay_PutFormToEdit (ActReqEdiGrp);
|
||||
|
||||
/***** Check if this course has groups *****/
|
||||
if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups
|
||||
{
|
||||
/***** Start form *****/
|
||||
Act_FormStart (ActChgGrp);
|
||||
|
||||
/***** Show list of groups to register/remove me *****/
|
||||
NumGrpsIBelong = Grp_ShowLstGrpsToChgMyGrps ((Gbl.Usrs.Me.LoggedRole == Rol_STUDENT));
|
||||
|
||||
/***** End form *****/
|
||||
Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups :
|
||||
Txt_Enroll_in_groups);
|
||||
Act_FormEnd ();
|
||||
}
|
||||
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,
|
||||
|
@ -1563,13 +1546,18 @@ void Grp_ReqRegisterInGrps (void)
|
|||
/*****************************************************************************/
|
||||
/***************** Show list of groups to register/remove me *****************/
|
||||
/*****************************************************************************/
|
||||
// Returns the number of groups I belongs to
|
||||
|
||||
unsigned Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
|
||||
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;
|
||||
unsigned NumGrpTyp;
|
||||
unsigned NumGrpsIBelong = 0;
|
||||
bool PutFormToChangeGrps = !Gbl.Form.Inside; // Not inside another form (record card)
|
||||
bool ICanEdit = !Gbl.Form.Inside &&
|
||||
(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);
|
||||
|
@ -1579,23 +1567,48 @@ unsigned Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents)
|
|||
if (ShowWarningsToStudents)
|
||||
Grp_ShowWarningToStdsToChangeGrps ();
|
||||
|
||||
/***** Start table *****/
|
||||
Lay_StartRoundFrameTable (NULL,2,Txt_My_groups);
|
||||
/***** Start frame *****/
|
||||
Lay_StartRoundFrame (NULL,Txt_My_groups,
|
||||
ICanEdit ? Grp_PutIconToEdit :
|
||||
NULL);
|
||||
|
||||
/***** Start form *****/
|
||||
if (PutFormToChangeGrps)
|
||||
Act_FormStart (ActChgGrp);
|
||||
|
||||
/***** List the groups the user belongs to for change *****/
|
||||
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_2\" style=\"margin:0 auto;\">");
|
||||
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 table *****/
|
||||
Lay_EndRoundFrameTable ();
|
||||
/***** End form *****/
|
||||
if (PutFormToChangeGrps)
|
||||
{
|
||||
Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups :
|
||||
Txt_Enroll_in_groups);
|
||||
Act_FormEnd ();
|
||||
}
|
||||
|
||||
/***** End frame *****/
|
||||
Lay_EndRoundFrame ();
|
||||
|
||||
/***** Free list of groups types and groups in this course *****/
|
||||
Grp_FreeListGrpTypesAndGrps ();
|
||||
}
|
||||
|
||||
return NumGrpsIBelong;
|
||||
/*****************************************************************************/
|
||||
/*************************** Put icon to edit groups *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Grp_PutIconToEdit (void)
|
||||
{
|
||||
extern const char *Txt_Edit;
|
||||
|
||||
Lay_PutContextualLink (ActReqEdiGrp,NULL,"edit64x64.png",Txt_Edit,NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -138,7 +138,7 @@ void Grp_RemUsrFromAllGrps (struct UsrData *UsrDat,Cns_QuietOrVerbose_t QuietOrV
|
|||
void Grp_ListGrpsToEditAsgAttOrSvy (struct GroupType *GrpTyp,long Cod,Grp_AsgOrSvy_t Grp_AsgOrSvy);
|
||||
|
||||
void Grp_ReqRegisterInGrps (void);
|
||||
unsigned Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents);
|
||||
void Grp_ShowLstGrpsToChgMyGrps (bool ShowWarningsToStudents);
|
||||
void Grp_ShowLstGrpsToChgOtherUsrsGrps (long UsrCod);
|
||||
|
||||
void Grp_GetListGrpTypesInThisCrs (Grp_WhichGroupTypes_t WhichGroupTypes);
|
||||
|
|
|
@ -978,20 +978,6 @@ static void Lay_ShowRightColumn (void)
|
|||
// Lnk_WriteMenuWithInstitutionalLinks ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************* Put a link (form) to edit *************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Lay_PutFormToEdit (Act_Action_t Action)
|
||||
{
|
||||
extern const char *Txt_Edit;
|
||||
|
||||
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">");
|
||||
Lay_PutContextualLink (Action,NULL,"edit64x64.png",
|
||||
Txt_Edit,Txt_Edit);
|
||||
fprintf (Gbl.F.Out,"</div>");
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************** Show an icon with a link in contextual menu ***************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -71,7 +71,6 @@ typedef enum
|
|||
void Lay_WriteStartOfPage (void);
|
||||
void Lay_WriteTitle (const char *Title);
|
||||
|
||||
void Lay_PutFormToEdit (Act_Action_t Action);
|
||||
void Lay_PutContextualLink (Act_Action_t NextAction,
|
||||
void (*FuncParams) (),
|
||||
const char *Icon,
|
||||
|
|
Loading…
Reference in New Issue