mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-15 21:24:07 +02:00
Version 16.194.20
This commit is contained in:
parent
9b7ca70c3e
commit
cd82eeca98
|
@ -223,13 +223,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.194.19 (2017-04-28)"
|
#define Log_PLATFORM_VERSION "SWAD 16.194.20 (2017-04-28)"
|
||||||
#define CSS_FILE "swad16.193.4.css"
|
#define CSS_FILE "swad16.193.4.css"
|
||||||
#define JS_FILE "swad16.181.js"
|
#define JS_FILE "swad16.181.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 16.194.20:Apr 28, 2017 Changes in edition of groups. (218420 lines)
|
||||||
Version 16.194.19:Apr 28, 2017 Changed dialog to remove a non empty type of group. (218397 lines)
|
Version 16.194.19:Apr 28, 2017 Changed dialog to remove a non empty type of group. (218397 lines)
|
||||||
Version 16.194.18:Apr 28, 2017 Changed dialog to remove a survey. (218388 lines)
|
Version 16.194.18:Apr 28, 2017 Changed dialog to remove a survey. (218388 lines)
|
||||||
Version 16.194.17:Apr 28, 2017 Changed dialog to remove a test question. (218388 lines)
|
Version 16.194.17:Apr 28, 2017 Changed dialog to remove a test question. (218388 lines)
|
||||||
|
|
71
swad_group.c
71
swad_group.c
|
@ -58,6 +58,8 @@ extern struct Globals Gbl;
|
||||||
/***************************** Internal prototypes ***************************/
|
/***************************** Internal prototypes ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Grp_ReqEditGroupsInternal (Lay_AlertType_t AlertType,const char *Message);
|
||||||
|
|
||||||
static void Grp_EditGroupTypes (void);
|
static void Grp_EditGroupTypes (void);
|
||||||
static void Grp_EditGroups (void);
|
static void Grp_EditGroups (void);
|
||||||
|
|
||||||
|
@ -162,22 +164,43 @@ void Grp_WriteNamesOfSelectedGrps (void)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Grp_ReqEditGroups (void)
|
void Grp_ReqEditGroups (void)
|
||||||
|
{
|
||||||
|
Grp_ReqEditGroupsInternal (Lay_INFO,NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Grp_ReqEditGroupsInternal (Lay_AlertType_t AlertType,const char *Message)
|
||||||
{
|
{
|
||||||
/***** Get list of groups types and groups in this course *****/
|
/***** Get list of groups types and groups in this course *****/
|
||||||
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ALL_GROUP_TYPES);
|
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ALL_GROUP_TYPES);
|
||||||
|
|
||||||
/***** Put form to edit group types *****/
|
/***** Group types *****/
|
||||||
|
/* Start section */
|
||||||
|
fprintf (Gbl.F.Out,"<section id=\"group_types\">");
|
||||||
|
|
||||||
|
/* Put form to edit group types */
|
||||||
Grp_EditGroupTypes ();
|
Grp_EditGroupTypes ();
|
||||||
|
|
||||||
/***** Put form to edit groups *****/
|
/* End section */
|
||||||
if (Gbl.CurrentCrs.Grps.GrpTypes.Num) // If there are group types...
|
fprintf (Gbl.F.Out,"</section>");
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"<br />");
|
|
||||||
Grp_EditGroups ();
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Free list of groups types and groups in this course *****/
|
/***** Groups *****/
|
||||||
|
/* Start section */
|
||||||
|
fprintf (Gbl.F.Out,"<section id=\"groups\">");
|
||||||
|
|
||||||
|
/* Show optional alert */
|
||||||
|
if (Message)
|
||||||
|
if (Message[0])
|
||||||
|
Lay_ShowAlert (AlertType,Message);
|
||||||
|
|
||||||
|
/* Put form to edit groups */
|
||||||
|
if (Gbl.CurrentCrs.Grps.GrpTypes.Num) // If there are group types...
|
||||||
|
Grp_EditGroups ();
|
||||||
|
|
||||||
|
/* Free list of groups types and groups in this course */
|
||||||
Grp_FreeListGrpTypesAndGrps ();
|
Grp_FreeListGrpTypesAndGrps ();
|
||||||
|
|
||||||
|
/* End section */
|
||||||
|
fprintf (Gbl.F.Out,"</section>");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2070,7 +2093,7 @@ static void Grp_PutFormToCreateGroupType (void)
|
||||||
extern const char *Txt_Create_type_of_group;
|
extern const char *Txt_Create_type_of_group;
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
Act_FormStart (ActNewGrpTyp);
|
Act_FormStartAnchor (ActNewGrpTyp,"group_types");
|
||||||
|
|
||||||
/***** Start of frame *****/
|
/***** Start of frame *****/
|
||||||
Lay_StartRoundFrameTable (NULL,Txt_New_type_of_group,
|
Lay_StartRoundFrameTable (NULL,Txt_New_type_of_group,
|
||||||
|
@ -2182,7 +2205,7 @@ static void Grp_PutFormToCreateGroup (void)
|
||||||
unsigned NumGrpTyp;
|
unsigned NumGrpTyp;
|
||||||
|
|
||||||
/***** Start form *****/
|
/***** Start form *****/
|
||||||
Act_FormStart (ActNewGrp);
|
Act_FormStartAnchor (ActNewGrp,"groups");
|
||||||
|
|
||||||
/***** Start of frame *****/
|
/***** Start of frame *****/
|
||||||
Lay_StartRoundFrameTable (NULL,Txt_New_group,NULL,Hlp_USERS_Groups,2);
|
Lay_StartRoundFrameTable (NULL,Txt_New_group,NULL,Hlp_USERS_Groups,2);
|
||||||
|
@ -3188,7 +3211,9 @@ static bool Grp_CheckIfOpenTimeInTheFuture (time_t OpenTimeUTC)
|
||||||
void Grp_RecFormNewGrp (void)
|
void Grp_RecFormNewGrp (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_group_X_already_exists;
|
extern const char *Txt_The_group_X_already_exists;
|
||||||
|
extern const char *Txt_Created_new_group_X;
|
||||||
extern const char *Txt_You_must_specify_the_name_of_the_new_group;
|
extern const char *Txt_You_must_specify_the_name_of_the_new_group;
|
||||||
|
Lay_AlertType_t AlertType;
|
||||||
|
|
||||||
/***** Get parameters from form *****/
|
/***** Get parameters from form *****/
|
||||||
if ((Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod = Grp_GetParamGrpTypCod ()) > 0) // Group type valid
|
if ((Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod = Grp_GetParamGrpTypCod ()) > 0) // Group type valid
|
||||||
|
@ -3209,24 +3234,34 @@ void Grp_RecFormNewGrp (void)
|
||||||
/***** If name of group was in database... *****/
|
/***** If name of group was in database... *****/
|
||||||
if (Grp_CheckIfGroupNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod,Gbl.CurrentCrs.Grps.GrpName,-1L))
|
if (Grp_CheckIfGroupNameExists (Gbl.CurrentCrs.Grps.GrpTyp.GrpTypCod,Gbl.CurrentCrs.Grps.GrpName,-1L))
|
||||||
{
|
{
|
||||||
|
AlertType = Lay_WARNING;
|
||||||
sprintf (Gbl.Message,Txt_The_group_X_already_exists,
|
sprintf (Gbl.Message,Txt_The_group_X_already_exists,
|
||||||
Gbl.CurrentCrs.Grps.GrpName);
|
Gbl.CurrentCrs.Grps.GrpName);
|
||||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
|
||||||
}
|
}
|
||||||
else // Add new group to database
|
else // Add new group to database
|
||||||
|
{
|
||||||
Grp_CreateGroup ();
|
Grp_CreateGroup ();
|
||||||
|
|
||||||
|
/* Write success message */
|
||||||
|
AlertType = Lay_SUCCESS;
|
||||||
|
sprintf (Gbl.Message,Txt_Created_new_group_X,
|
||||||
|
Gbl.CurrentCrs.Grps.GrpName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // If there is not a group name
|
else // If there is not a group name
|
||||||
{
|
{
|
||||||
|
AlertType = Lay_ERROR;
|
||||||
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_group);
|
sprintf (Gbl.Message,"%s",Txt_You_must_specify_the_name_of_the_new_group);
|
||||||
Lay_ShowAlert (Lay_ERROR,Gbl.Message);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Invalid group type
|
else // Invalid group type
|
||||||
Lay_ShowAlert (Lay_ERROR,"Wrong type of group.");
|
{
|
||||||
|
AlertType = Lay_ERROR;
|
||||||
|
sprintf (Gbl.Message,"%s","Wrong type of group.");
|
||||||
|
}
|
||||||
|
|
||||||
/***** Show the form again *****/
|
/***** Show the form again *****/
|
||||||
Grp_ReqEditGroups ();
|
Grp_ReqEditGroupsInternal (AlertType,Gbl.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3296,8 +3331,7 @@ static void Grp_CreateGroupType (void)
|
||||||
|
|
||||||
static void Grp_CreateGroup (void)
|
static void Grp_CreateGroup (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Created_new_group_X;
|
char Query[256 + Grp_MAX_BYTES_GROUP_NAME];
|
||||||
char Query[1024];
|
|
||||||
|
|
||||||
/***** Create a new group *****/
|
/***** Create a new group *****/
|
||||||
sprintf (Query,"INSERT INTO crs_grp"
|
sprintf (Query,"INSERT INTO crs_grp"
|
||||||
|
@ -3308,11 +3342,6 @@ static void Grp_CreateGroup (void)
|
||||||
Gbl.CurrentCrs.Grps.GrpName,
|
Gbl.CurrentCrs.Grps.GrpName,
|
||||||
Gbl.CurrentCrs.Grps.MaxStudents);
|
Gbl.CurrentCrs.Grps.MaxStudents);
|
||||||
DB_QueryINSERT (Query,"can not create group");
|
DB_QueryINSERT (Query,"can not create group");
|
||||||
|
|
||||||
/***** Write success message *****/
|
|
||||||
sprintf (Gbl.Message,Txt_Created_new_group_X,
|
|
||||||
Gbl.CurrentCrs.Grps.GrpName);
|
|
||||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user