mirror of https://github.com/acanas/swad-core.git
Version 20.94.8: Jun 29, 2021 Queries moved to module swad_group_database.
This commit is contained in:
parent
a7dfc5702a
commit
a07743090f
|
@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
|
||||||
|
|
||||||
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.94.7 (2021-06-28)"
|
#define Log_PLATFORM_VERSION "SWAD 20.94.8 (2021-06-28)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.69.1.js"
|
#define JS_FILE "swad20.69.1.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
|
Version 20.94.8: Jun 29, 2021 Queries moved to module swad_group_database. (? lines)
|
||||||
Version 20.94.7: Jun 28, 2021 Queries moved to module swad_group_database. (313782 lines)
|
Version 20.94.7: Jun 28, 2021 Queries moved to module swad_group_database. (313782 lines)
|
||||||
Version 20.94.6: Jun 28, 2021 Fixed bug in removal of project. (313688 lines)
|
Version 20.94.6: Jun 28, 2021 Fixed bug in removal of project. (313688 lines)
|
||||||
Version 20.94.5: Jun 25, 2021 Queries moved to module swad_group_database. (313686 lines)
|
Version 20.94.5: Jun 25, 2021 Queries moved to module swad_group_database. (313686 lines)
|
||||||
|
|
50
swad_group.c
50
swad_group.c
|
@ -3782,12 +3782,7 @@ void Grp_ChangeGroupRoom (void)
|
||||||
Grp_GetDataOfGroupByCod (&GrpDat);
|
Grp_GetDataOfGroupByCod (&GrpDat);
|
||||||
|
|
||||||
/***** Update the table of groups changing old room by new room *****/
|
/***** Update the table of groups changing old room by new room *****/
|
||||||
DB_QueryUPDATE ("can not update the room of a group",
|
Grp_DB_ChangeRoomOfGrp (Gbl.Crs.Grps.GrpCod,NewRooCod);
|
||||||
"UPDATE grp_groups"
|
|
||||||
" SET RooCod=%ld"
|
|
||||||
" WHERE GrpCod=%ld",
|
|
||||||
NewRooCod,
|
|
||||||
Gbl.Crs.Grps.GrpCod);
|
|
||||||
|
|
||||||
/* Create message to show the change made */
|
/* Create message to show the change made */
|
||||||
AlertType = Ale_SUCCESS;
|
AlertType = Ale_SUCCESS;
|
||||||
|
@ -3836,14 +3831,10 @@ void Grp_ChangeMandatGrpTyp (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Update of the table of types of group changing the old type of enrolment by the new *****/
|
/***** Update of the table of types of group
|
||||||
DB_QueryUPDATE ("can not update enrolment type of a type of group",
|
changing the old type of enrolment by the new *****/
|
||||||
"UPDATE grp_types"
|
Grp_DB_ChangeMandatoryEnrolmentOfAGrpTyp (Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||||
" SET Mandatory='%c'"
|
NewMandatoryEnrolment);
|
||||||
" WHERE GrpTypCod=%ld",
|
|
||||||
NewMandatoryEnrolment ? 'Y' :
|
|
||||||
'N',
|
|
||||||
Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
AlertType = Ale_SUCCESS;
|
AlertType = Ale_SUCCESS;
|
||||||
|
@ -3895,13 +3886,8 @@ void Grp_ChangeMultiGrpTyp (void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Update of the table of types of group changing the old type of enrolment by the new *****/
|
/***** Update of the table of types of group changing the old type of enrolment by the new *****/
|
||||||
DB_QueryUPDATE ("can not update enrolment type of a type of group",
|
Grp_DB_ChangeMultipleEnrolmentOfAGrpTyp (Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||||
"UPDATE grp_types"
|
NewMultipleEnrolment);
|
||||||
" SET Multiple='%c'"
|
|
||||||
" WHERE GrpTypCod=%ld",
|
|
||||||
NewMultipleEnrolment ? 'Y' :
|
|
||||||
'N',
|
|
||||||
Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
AlertType = Ale_SUCCESS;
|
AlertType = Ale_SUCCESS;
|
||||||
|
@ -3937,16 +3923,10 @@ void Grp_ChangeOpenTimeGrpTyp (void)
|
||||||
Gbl.Crs.Grps.GrpTyp.MustBeOpened = Grp_CheckIfOpenTimeInTheFuture (Gbl.Crs.Grps.GrpTyp.OpenTimeUTC);
|
Gbl.Crs.Grps.GrpTyp.MustBeOpened = Grp_CheckIfOpenTimeInTheFuture (Gbl.Crs.Grps.GrpTyp.OpenTimeUTC);
|
||||||
|
|
||||||
/***** Update the table of types of group
|
/***** Update the table of types of group
|
||||||
changing the old open time of enrolment by the new *****/
|
changing the old opening time of enrolment by the new *****/
|
||||||
DB_QueryUPDATE ("can not update enrolment type of a type of group",
|
Grp_DB_ChangeOpeningTimeOfAGrpTyp (Gbl.Crs.Grps.GrpTyp.GrpTypCod,
|
||||||
"UPDATE grp_types"
|
Gbl.Crs.Grps.GrpTyp.MustBeOpened,
|
||||||
" SET MustBeOpened='%c',"
|
Gbl.Crs.Grps.GrpTyp.OpenTimeUTC);
|
||||||
"OpenTime=FROM_UNIXTIME(%ld)"
|
|
||||||
" WHERE GrpTypCod=%ld",
|
|
||||||
Gbl.Crs.Grps.GrpTyp.MustBeOpened ? 'Y' :
|
|
||||||
'N',
|
|
||||||
(long) Gbl.Crs.Grps.GrpTyp.OpenTimeUTC,
|
|
||||||
Gbl.Crs.Grps.GrpTyp.GrpTypCod);
|
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_The_date_time_of_opening_of_groups_has_changed);
|
Ale_ShowAlert (Ale_SUCCESS,Txt_The_date_time_of_opening_of_groups_has_changed);
|
||||||
|
@ -3998,13 +3978,7 @@ void Grp_ChangeMaxStdsGrp (void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Update the table of groups changing the old maximum of students to the new *****/
|
/***** Update the table of groups changing the old maximum of students to the new *****/
|
||||||
DB_QueryUPDATE ("can not update the maximum number of students"
|
Grp_DB_ChangeMaxStdsOfGrp (Gbl.Crs.Grps.GrpCod,NewMaxStds);
|
||||||
" in a group",
|
|
||||||
"UPDATE grp_groups"
|
|
||||||
" SET MaxStudents=%u"
|
|
||||||
" WHERE GrpCod=%ld",
|
|
||||||
NewMaxStds,
|
|
||||||
Gbl.Crs.Grps.GrpCod);
|
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
AlertType = Ale_SUCCESS;
|
AlertType = Ale_SUCCESS;
|
||||||
|
|
|
@ -666,6 +666,56 @@ bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,const char *Field,long Co
|
||||||
Field,Cod) != 0);
|
Field,Cod) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************ Change the mandatory enrolment of a type of group **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Grp_DB_ChangeMandatoryEnrolmentOfAGrpTyp (long GrpTypCod,
|
||||||
|
bool NewMandatoryEnrolment)
|
||||||
|
{
|
||||||
|
DB_QueryUPDATE ("can not update enrolment type of a type of group",
|
||||||
|
"UPDATE grp_types"
|
||||||
|
" SET Mandatory='%c'"
|
||||||
|
" WHERE GrpTypCod=%ld",
|
||||||
|
NewMandatoryEnrolment ? 'Y' :
|
||||||
|
'N',
|
||||||
|
GrpTypCod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************* Change the multiple enrolment of a type of group **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Grp_DB_ChangeMultipleEnrolmentOfAGrpTyp (long GrpTypCod,
|
||||||
|
bool NewMultipleEnrolment)
|
||||||
|
{
|
||||||
|
DB_QueryUPDATE ("can not update enrolment type of a type of group",
|
||||||
|
"UPDATE grp_types"
|
||||||
|
" SET Multiple='%c'"
|
||||||
|
" WHERE GrpTypCod=%ld",
|
||||||
|
NewMultipleEnrolment ? 'Y' :
|
||||||
|
'N',
|
||||||
|
GrpTypCod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*************** Change the opening time of a type of group ******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Grp_DB_ChangeOpeningTimeOfAGrpTyp (long GrpTypCod,
|
||||||
|
bool MustBeOpened,time_t OpenTimeUTC)
|
||||||
|
{
|
||||||
|
DB_QueryUPDATE ("can not update enrolment type of a type of group",
|
||||||
|
"UPDATE grp_types"
|
||||||
|
" SET MustBeOpened='%c',"
|
||||||
|
"OpenTime=FROM_UNIXTIME(%ld)"
|
||||||
|
" WHERE GrpTypCod=%ld",
|
||||||
|
MustBeOpened ? 'Y' :
|
||||||
|
'N',
|
||||||
|
(long) OpenTimeUTC,
|
||||||
|
GrpTypCod);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Set type of group to not be opened *********************/
|
/******************** Set type of group to not be opened *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -763,6 +813,35 @@ void Grp_DB_ChangeGrpTypOfGrp (long GrpCod,long NewGrpTypCod)
|
||||||
GrpCod);
|
GrpCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*************************** Change room of a group **************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Grp_DB_ChangeRoomOfGrp (long GrpCod,long NewRooCod)
|
||||||
|
{
|
||||||
|
DB_QueryUPDATE ("can not update the room of a group",
|
||||||
|
"UPDATE grp_groups"
|
||||||
|
" SET RooCod=%ld"
|
||||||
|
" WHERE GrpCod=%ld",
|
||||||
|
NewRooCod,
|
||||||
|
GrpCod);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************* Change maximum of students in a group *******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Grp_DB_ChangeMaxStdsOfGrp (long GrpCod,unsigned NewMaxStds)
|
||||||
|
{
|
||||||
|
DB_QueryUPDATE ("can not update the maximum number of students"
|
||||||
|
" in a group",
|
||||||
|
"UPDATE grp_groups"
|
||||||
|
" SET MaxStudents=%u"
|
||||||
|
" WHERE GrpCod=%ld",
|
||||||
|
NewMaxStds,
|
||||||
|
GrpCod);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**** Get if any group in group-type/this-course is open and has vacants *****/
|
/**** Get if any group in group-type/this-course is open and has vacants *****/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -89,13 +89,22 @@ bool Grp_DB_CheckIfAssociatedToGrp (const char *Table,const char *Field,
|
||||||
long Cod,long GrpCod);
|
long Cod,long GrpCod);
|
||||||
bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,const char *Field,long Cod);
|
bool Grp_DB_CheckIfAssociatedToGrps (const char *Table,const char *Field,long Cod);
|
||||||
|
|
||||||
|
void Grp_DB_ChangeMandatoryEnrolmentOfAGrpTyp (long GrpTypCod,
|
||||||
|
bool NewMandatoryEnrolment);
|
||||||
|
void Grp_DB_ChangeMultipleEnrolmentOfAGrpTyp (long GrpTypCod,
|
||||||
|
bool NewMultipleEnrolment);
|
||||||
|
void Grp_DB_ChangeOpeningTimeOfAGrpTyp (long GrpTypCod,
|
||||||
|
bool MustBeOpened,time_t OpenTimeUTC);
|
||||||
void Grp_DB_ClearMustBeOpened (long GrpTypCod);
|
void Grp_DB_ClearMustBeOpened (long GrpTypCod);
|
||||||
void Grp_DB_OpenGrpsOfType (long GrpTypCod);
|
void Grp_DB_OpenGrpsOfType (long GrpTypCod);
|
||||||
|
|
||||||
void Grp_DB_OpenGrp (long GrpCod);
|
void Grp_DB_OpenGrp (long GrpCod);
|
||||||
void Grp_DB_CloseGrp (long GrpCod);
|
void Grp_DB_CloseGrp (long GrpCod);
|
||||||
void Grp_DB_EnableFileZonesGrp (long GrpCod);
|
void Grp_DB_EnableFileZonesGrp (long GrpCod);
|
||||||
void Grp_DB_DisableFileZonesGrp (long GrpCod);
|
void Grp_DB_DisableFileZonesGrp (long GrpCod);
|
||||||
void Grp_DB_ChangeGrpTypOfGrp (long GrpCod,long NewGrpTypCod);
|
void Grp_DB_ChangeGrpTypOfGrp (long GrpCod,long NewGrpTypCod);
|
||||||
|
void Grp_DB_ChangeRoomOfGrp (long GrpCod,long NewRooCod);
|
||||||
|
void Grp_DB_ChangeMaxStdsOfGrp (long GrpCod,unsigned NewMaxStds);
|
||||||
|
|
||||||
bool Grp_DB_CheckIfAvailableGrpTyp (long GrpTypCod);
|
bool Grp_DB_CheckIfAvailableGrpTyp (long GrpTypCod);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue