Version 20.94.4: Jun 24, 2021 Queries moved to module swad_group_database.

This commit is contained in:
acanas 2021-06-24 20:32:25 +02:00
parent ac7223fb08
commit 0be1d7ba16
4 changed files with 168 additions and 124 deletions

View File

@ -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.3 (2021-06-18)" #define Log_PLATFORM_VERSION "SWAD 20.94.4 (2021-06-24)"
#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.4: Jun 24, 2021 Queries moved to module swad_group_database. (313637 lines)
Version 20.94.3: Jun 18, 2021 Queries moved to module swad_group_database. (313602 lines) Version 20.94.3: Jun 18, 2021 Queries moved to module swad_group_database. (313602 lines)
Version 20.94.2: Jun 18, 2021 Queries moved to module swad_group_database. (313557 lines) Version 20.94.2: Jun 18, 2021 Queries moved to module swad_group_database. (313557 lines)
Version 20.94.1: Jun 17, 2021 Queries moved to module swad_group_database. (313511 lines) Version 20.94.1: Jun 17, 2021 Queries moved to module swad_group_database. (313511 lines)

View File

@ -1232,7 +1232,6 @@ static void Grp_RemoveUsrFromGroup (long UsrCod,long GrpCod)
static void Grp_ListGroupTypesForEdition (void) static void Grp_ListGroupTypesForEdition (void)
{ {
extern const char *Txt_It_is_optional_to_choose_a_group; extern const char *Txt_It_is_optional_to_choose_a_group;
extern const char *Txt_It_is_mandatory_to_choose_a_group; extern const char *Txt_It_is_mandatory_to_choose_a_group;
extern const char *Txt_A_student_can_belong_to_several_groups; extern const char *Txt_A_student_can_belong_to_several_groups;
@ -1668,19 +1667,18 @@ void Grp_ListGrpsToEditAsgAttSvyEvtMch (struct GroupType *GrpTyp,
/* Put checkbox to select the group */ /* Put checkbox to select the group */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
if (IBelongToThisGroup) HTM_TD_Begin ("class=\"%s\"",
HTM_TD_Begin ("class=\"LM LIGHT_BLUE\""); IBelongToThisGroup ? "LM LIGHT_BLUE" :
else "LM");
HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE,
HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE, "id=\"Grp%ld\" value=\"%ld\"%s%s"
"id=\"Grp%ld\" value=\"%ld\"%s%s" " onclick=\"uncheckParent(this,'WholeCrs')\"",
" onclick=\"uncheckParent(this,'WholeCrs')\"", Grp->GrpCod,Grp->GrpCod,
Grp->GrpCod,Grp->GrpCod, AssociatedToGrp ? " checked=\"checked\"" :
AssociatedToGrp ? " checked=\"checked\"" : "",
"", (IBelongToThisGroup ||
(IBelongToThisGroup || Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? "" :
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? "" : " disabled=\"disabled\"");
" disabled=\"disabled\"");
HTM_TD_End (); HTM_TD_End ();
Grp_WriteRowGrp (Grp,IBelongToThisGroup); Grp_WriteRowGrp (Grp,IBelongToThisGroup);
@ -1962,45 +1960,44 @@ static bool Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp,
/* Put radio item or checkbox to select the group */ /* Put radio item or checkbox to select the group */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
if (IBelongToThisGroup) HTM_TD_Begin ("class=\"%s\"",
HTM_TD_Begin ("class=\"LM LIGHT_BLUE\""); IBelongToThisGroup ? "LM LIGHT_BLUE" :
else "LM");
HTM_TD_Begin ("class=\"LM\"");
snprintf (StrGrpCod,sizeof (StrGrpCod),"GrpCod%ld",GrpTyp->GrpTypCod); snprintf (StrGrpCod,sizeof (StrGrpCod),"GrpCod%ld",GrpTyp->GrpTypCod);
if (Gbl.Usrs.Me.Role.Logged == Rol_STD && // If I am a student if (Gbl.Usrs.Me.Role.Logged == Rol_STD && // If I am a student
!GrpTyp->MultipleEnrolment && // ...and the enrolment is single !GrpTyp->MultipleEnrolment && // ...and the enrolment is single
GrpTyp->NumGrps > 1) // ...and there are more than one group GrpTyp->NumGrps > 1) // ...and there are more than one group
{ {
/* Put a radio item */ /* Put a radio item */
if (GrpTyp->MandatoryEnrolment) if (GrpTyp->MandatoryEnrolment)
HTM_INPUT_RADIO (StrGrpCod,false, HTM_INPUT_RADIO (StrGrpCod,false,
"id=\"Grp%ld\" value=\"%ld\"%s%s", "id=\"Grp%ld\" value=\"%ld\"%s%s",
Grp->GrpCod,Grp->GrpCod, Grp->GrpCod,Grp->GrpCod,
IBelongToThisGroup ? " checked=\"checked\"" : "", // Group selected? IBelongToThisGroup ? " checked=\"checked\"" : "", // Group selected?
ICanChangeMySelectionForThisGrp ? "" : ICanChangeMySelectionForThisGrp ? "" :
IBelongToThisGroup ? " readonly" : // I can not unregister (disabled does not work because the value is not submitted) IBelongToThisGroup ? " readonly" : // I can not unregister (disabled does not work because the value is not submitted)
" disabled=\"disabled\""); // I can not register " disabled=\"disabled\""); // I can not register
else // If the enrolment is not mandatory, I can select no groups else // If the enrolment is not mandatory, I can select no groups
HTM_INPUT_RADIO (StrGrpCod,false, HTM_INPUT_RADIO (StrGrpCod,false,
"id=\"Grp%ld\" value=\"%ld\"%s%s" "id=\"Grp%ld\" value=\"%ld\"%s%s"
" onclick=\"selectUnselectRadio(this,this.form.GrpCod%ld,%u)\"", " onclick=\"selectUnselectRadio(this,this.form.GrpCod%ld,%u)\"",
Grp->GrpCod,Grp->GrpCod, Grp->GrpCod,Grp->GrpCod,
IBelongToThisGroup ? " checked=\"checked\"" : "", // Group selected? IBelongToThisGroup ? " checked=\"checked\"" : "", // Group selected?
ICanChangeMySelectionForThisGrp ? "" : ICanChangeMySelectionForThisGrp ? "" :
IBelongToThisGroup ? " readonly" : // I can not unregister (disabled does not work because the value is not submitted) IBelongToThisGroup ? " readonly" : // I can not unregister (disabled does not work because the value is not submitted)
" disabled=\"disabled\"", // I can not register " disabled=\"disabled\"", // I can not register
GrpTyp->GrpTypCod,GrpTyp->NumGrps); GrpTyp->GrpTypCod,GrpTyp->NumGrps);
} }
else else
/* Put a checkbox item */ /* Put a checkbox item */
HTM_INPUT_CHECKBOX (StrGrpCod,HTM_DONT_SUBMIT_ON_CHANGE, HTM_INPUT_CHECKBOX (StrGrpCod,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s%s", "id=\"Grp%ld\" value=\"%ld\"%s%s",
Grp->GrpCod,Grp->GrpCod, Grp->GrpCod,Grp->GrpCod,
IBelongToThisGroup ? " checked=\"checked\"" : "", IBelongToThisGroup ? " checked=\"checked\"" : "",
ICanChangeMySelectionForThisGrp ? "" : ICanChangeMySelectionForThisGrp ? "" :
IBelongToThisGroup ? " readonly" : // I can not unregister (disabled does not work because the value is not submitted) IBelongToThisGroup ? " readonly" : // I can not unregister (disabled does not work because the value is not submitted)
" disabled=\"disabled\""); // I can not register " disabled=\"disabled\""); // I can not register
HTM_TD_End (); HTM_TD_End ();
@ -2084,19 +2081,19 @@ static void Grp_ListGrpsToAddOrRemUsrs (struct GroupType *GrpTyp,long UsrCod)
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Start cell for checkbox */ /* Start cell for checkbox */
if (UsrBelongsToThisGroup) HTM_TD_Begin ("class=\"%s\"",
HTM_TD_Begin ("class=\"LM LIGHT_BLUE\""); UsrBelongsToThisGroup ? "LM LIGHT_BLUE" :
else "LM");
HTM_TD_Begin ("class=\"LM\"");
/* Put checkbox to select the group */ /* Put checkbox to select the group */
// Always checkbox, not radio, because the role in the form may be teacher, // Always checkbox, not radio, because the role in the form may be teacher,
// so if he/she is registered as teacher, he/she can belong to several groups // so if he/she is registered as teacher, he/she can belong to several groups
snprintf (StrGrpCod,sizeof (StrGrpCod),"GrpCod%ld",GrpTyp->GrpTypCod); snprintf (StrGrpCod,sizeof (StrGrpCod),"GrpCod%ld",GrpTyp->GrpTypCod);
HTM_INPUT_CHECKBOX (StrGrpCod,HTM_DONT_SUBMIT_ON_CHANGE, HTM_INPUT_CHECKBOX (StrGrpCod,HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Grp%ld\" value=\"%ld\"%s", "id=\"Grp%ld\" value=\"%ld\"%s",
Grp->GrpCod,Grp->GrpCod, Grp->GrpCod,Grp->GrpCod,
UsrBelongsToThisGroup ? " checked=\"checked\"" : ""); // I can not register UsrBelongsToThisGroup ? " checked=\"checked\"" :
""); // I can not register
/* End cell for checkbox */ /* End cell for checkbox */
HTM_TD_End (); HTM_TD_End ();
@ -2187,16 +2184,16 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp,
/* Put checkbox to select the group */ /* Put checkbox to select the group */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
if (IBelongToThisGroup) HTM_TD_Begin ("class=\"%s\"",
HTM_TD_Begin ("class=\"LM LIGHT_BLUE\""); IBelongToThisGroup ? "LIGHT_BLUE" :
else "LM");
HTM_TD_Begin ("class=\"LM\""); HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE,
HTM_INPUT_CHECKBOX ("GrpCods",HTM_DONT_SUBMIT_ON_CHANGE, "id=\"Grp%ld\" value=\"%ld\"%s%s",
"id=\"Grp%ld\" value=\"%ld\"%s%s", Grp->GrpCod,Grp->GrpCod,
Grp->GrpCod,Grp->GrpCod, Checked ? " checked=\"checked\"" :
Checked ? " checked=\"checked\"" : "", "",
ICanSelUnselGroup ? " onclick=\"checkParent(this,'AllGroups')\"" : ICanSelUnselGroup ? " onclick=\"checkParent(this,'AllGroups')\"" :
" disabled=\"disabled\""); " disabled=\"disabled\"");
HTM_TD_End (); HTM_TD_End ();
Grp_WriteRowGrp (Grp,IBelongToThisGroup); Grp_WriteRowGrp (Grp,IBelongToThisGroup);
@ -2235,8 +2232,9 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp,
"id=\"Grp%ld\" value=\"%ld\"%s" "id=\"Grp%ld\" value=\"%ld\"%s"
" onclick=\"checkParent(this,'AllGroups')\"", " onclick=\"checkParent(this,'AllGroups')\"",
-GrpTyp->GrpTypCod,-GrpTyp->GrpTypCod, -GrpTyp->GrpTypCod,-GrpTyp->GrpTypCod,
ICanSelUnselGroup ? (Checked ? " checked=\"checked\"" : "") : ICanSelUnselGroup ? (Checked ? " checked=\"checked\"" :
" disabled=\"disabled\""); "") :
" disabled=\"disabled\"");
HTM_TD_End (); HTM_TD_End ();
/* Column closed/open */ /* Column closed/open */
@ -2337,6 +2335,7 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight)
char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
/***** Write icon to show if group is open or closed *****/ /***** Write icon to show if group is open or closed *****/
if (Highlight) if (Highlight)
HTM_TD_Begin ("class=\"BM LIGHT_BLUE\""); HTM_TD_Begin ("class=\"BM LIGHT_BLUE\"");
else else
@ -2350,16 +2349,18 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight)
HTM_TD_End (); HTM_TD_End ();
/***** Group name *****/ /***** Group name *****/
HTM_TD_Begin (Highlight ? "class=\"LM LIGHT_BLUE\"" : HTM_TD_Begin ("class=\"%s\"",
"class=\"LM\""); Highlight ? "LM LIGHT_BLUE" :
"LM");
HTM_LABEL_Begin ("for=\"Grp%ld\" class=\"DAT\"",Grp->GrpCod); HTM_LABEL_Begin ("for=\"Grp%ld\" class=\"DAT\"",Grp->GrpCod);
HTM_Txt (Grp->GrpName); HTM_Txt (Grp->GrpName);
HTM_LABEL_End (); HTM_LABEL_End ();
HTM_TD_End (); HTM_TD_End ();
/***** Room *****/ /***** Room *****/
HTM_TD_Begin (Highlight ? "class=\"DAT LM LIGHT_BLUE\"" : HTM_TD_Begin ("class=\"%s\"",
"class=\"DAT LM\""); Highlight ? "DAT LM LIGHT_BLUE" :
"DAT LM");
HTM_Txt (Grp->Room.ShrtName); HTM_Txt (Grp->Room.ShrtName);
HTM_TD_End (); HTM_TD_End ();
@ -2877,16 +2878,7 @@ static void Grp_GetDataOfGroupTypeByCod (struct GroupType *GrpTyp)
MYSQL_ROW row; MYSQL_ROW row;
/***** Get data of a type of group from database *****/ /***** Get data of a type of group from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get type of group", if (Grp_DB_GetDataOfGroupTypeByCod (&mysql_res,GrpTyp->GrpTypCod) != 1)
"SELECT GrpTypName," // row[0]
"Mandatory," // row[1]
"Multiple," // row[2]
"MustBeOpened," // row[3]
"UNIX_TIMESTAMP(OpenTime)" // row[4]
" FROM grp_types"
" WHERE CrsCod=%ld"
" AND GrpTypCod=%ld",
Gbl.Hierarchy.Crs.CrsCod,GrpTyp->GrpTypCod) != 1)
Err_WrongGrpTypExit (); Err_WrongGrpTypExit ();
/***** Get some data of group type *****/ /***** Get some data of group type *****/
@ -2912,12 +2904,7 @@ static bool Grp_GetMultipleEnrolmentOfAGroupType (long GrpTypCod)
bool MultipleEnrolment; bool MultipleEnrolment;
/***** Get data of a type of group from database *****/ /***** Get data of a type of group from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get if type of group" if (Grp_DB_GetMultipleEnrolmentOfAGroupType (&mysql_res,GrpTypCod) != 1)
" has multiple enrolment",
"SELECT Multiple" // row[0]
" FROM grp_types"
" WHERE GrpTypCod=%ld",
GrpTypCod) != 1)
Err_ShowErrorAndExit ("Error when getting type of enrolment."); Err_ShowErrorAndExit ("Error when getting type of enrolment.");
/***** Get multiple enrolment *****/ /***** Get multiple enrolment *****/
@ -2955,24 +2942,7 @@ void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat)
if (GrpDat->GrpCod > 0) if (GrpDat->GrpCod > 0)
{ {
/***** Get data of a group from database *****/ /***** Get data of a group from database *****/
if (DB_QuerySELECT (&mysql_res,"can not get data of a group", if (Grp_DB_GetDataOfGroupByCod (&mysql_res,GrpDat->GrpCod) == 1)
"SELECT grp_groups.GrpTypCod," // row[0]
"grp_types.CrsCod," // row[1]
"grp_types.GrpTypName," // row[2]
"grp_types.Multiple," // row[3]
"grp_groups.GrpName," // row[4]
"grp_groups.RooCod," // row[5]
"roo_rooms.ShortName," // row[6]
"grp_groups.MaxStudents," // row[7]
"grp_groups.Open," // row[8]
"grp_groups.FileZones" // row[9]
" FROM (grp_groups,"
"grp_types)"
" LEFT JOIN roo_rooms"
" ON grp_groups.RooCod=roo_rooms.RooCod"
" WHERE grp_groups.GrpCod=%ld"
" AND grp_groups.GrpTypCod=grp_types.GrpTypCod",
GrpDat->GrpCod) == 1)
{ {
/***** Get data of group *****/ /***** Get data of group *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
@ -3041,14 +3011,7 @@ bool Grp_GetIfIBelongToGrp (long GrpCod)
/***** 3. Slow check: Get if I belong to a group from database *****/ /***** 3. Slow check: Get if I belong to a group from database *****/
Gbl.Cache.IBelongToGrp.GrpCod = GrpCod; Gbl.Cache.IBelongToGrp.GrpCod = GrpCod;
Gbl.Cache.IBelongToGrp.IBelong = Gbl.Cache.IBelongToGrp.IBelong = Grp_DB_CheckIfIBelongToGrp (GrpCod);
(DB_QueryCOUNT ("can not check if you belong to a group",
"SELECT COUNT(*)"
" FROM grp_users"
" WHERE GrpCod=%ld"
" AND UsrCod=%ld",
GrpCod,
Gbl.Usrs.Me.UsrDat.UsrCod) != 0);
return Gbl.Cache.IBelongToGrp.IBelong; return Gbl.Cache.IBelongToGrp.IBelong;
} }

View File

@ -146,6 +146,67 @@ void Grp_DB_CreateGroup (const struct Grp_Groups *Grps)
Grps->MaxStudents); Grps->MaxStudents);
} }
/*****************************************************************************/
/******************* Get data of a group type from its code ******************/
/*****************************************************************************/
unsigned Grp_DB_GetDataOfGroupTypeByCod (MYSQL_RES **mysql_res,long GrpTypCod)
{
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get type of group",
"SELECT GrpTypName," // row[0]
"Mandatory," // row[1]
"Multiple," // row[2]
"MustBeOpened," // row[3]
"UNIX_TIMESTAMP(OpenTime)" // row[4]
" FROM grp_types"
" WHERE GrpTypCod=%ld"
" AND CrsCod=%ld", // Extra check
GrpTypCod,
Gbl.Hierarchy.Crs.CrsCod);
}
/*****************************************************************************/
/************* Check if a group type has multiple enrolment *****************/
/*****************************************************************************/
unsigned Grp_DB_GetMultipleEnrolmentOfAGroupType (MYSQL_RES **mysql_res,long GrpTypCod)
{
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get if type of group has multiple enrolment",
"SELECT Multiple" // row[0]
" FROM grp_types"
" WHERE GrpTypCod=%ld",
GrpTypCod);
}
/*****************************************************************************/
/********************** Get data of a group from its code ********************/
/*****************************************************************************/
unsigned Grp_DB_GetDataOfGroupByCod (MYSQL_RES **mysql_res,long GrpCod)
{
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a group",
"SELECT grp_groups.GrpTypCod," // row[0]
"grp_types.CrsCod," // row[1]
"grp_types.GrpTypName," // row[2]
"grp_types.Multiple," // row[3]
"grp_groups.GrpName," // row[4]
"grp_groups.RooCod," // row[5]
"roo_rooms.ShortName," // row[6]
"grp_groups.MaxStudents," // row[7]
"grp_groups.Open," // row[8]
"grp_groups.FileZones" // row[9]
" FROM (grp_groups,"
"grp_types)"
" LEFT JOIN roo_rooms"
" ON grp_groups.RooCod=roo_rooms.RooCod"
" WHERE grp_groups.GrpCod=%ld"
" AND grp_groups.GrpTypCod=grp_types.GrpTypCod",
GrpCod);
}
/*****************************************************************************/ /*****************************************************************************/
/******************** Check if a group exists in database ********************/ /******************** Check if a group exists in database ********************/
/*****************************************************************************/ /*****************************************************************************/
@ -268,7 +329,6 @@ unsigned Grp_DB_CountNumUsrsInNoGrpsOfType (Rol_Role_t Role,long GrpTypCod)
bool Grp_DB_CheckIfIBelongToGrpsOfType (long GrpTypCod) bool Grp_DB_CheckIfIBelongToGrpsOfType (long GrpTypCod)
{ {
/***** Get a group which I belong to from database *****/
return (DB_QueryCOUNT ("can not check if you belong to a group type", return (DB_QueryCOUNT ("can not check if you belong to a group type",
"SELECT COUNT(grp_groups.GrpCod)" "SELECT COUNT(grp_groups.GrpCod)"
" FROM grp_groups," " FROM grp_groups,"
@ -280,6 +340,21 @@ bool Grp_DB_CheckIfIBelongToGrpsOfType (long GrpTypCod)
Gbl.Usrs.Me.UsrDat.UsrCod) != 0); Gbl.Usrs.Me.UsrDat.UsrCod) != 0);
} }
/*****************************************************************************/
/*********************** Check if I belong to a group ************************/
/*****************************************************************************/
bool Grp_DB_CheckIfIBelongToGrp (long GrpCod)
{
return (DB_QueryCOUNT ("can not check if you belong to a group",
"SELECT COUNT(*)"
" FROM grp_users"
" WHERE GrpCod=%ld"
" AND UsrCod=%ld", // I belong
GrpCod,
Gbl.Usrs.Me.UsrDat.UsrCod) != 0);
}
/*****************************************************************************/ /*****************************************************************************/
/************** Get group types with groups in current course ****************/ /************** Get group types with groups in current course ****************/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -50,6 +50,10 @@ void Grp_DB_UnlockTables (void);
long Grp_DB_CreateGroupType (const struct GroupType *GrpTyp); long Grp_DB_CreateGroupType (const struct GroupType *GrpTyp);
void Grp_DB_CreateGroup (const struct Grp_Groups *Grps); void Grp_DB_CreateGroup (const struct Grp_Groups *Grps);
unsigned Grp_DB_GetDataOfGroupTypeByCod (MYSQL_RES **mysql_res,long GrpTypCod);
unsigned Grp_DB_GetMultipleEnrolmentOfAGroupType (MYSQL_RES **mysql_res,long GrpTypCod);
unsigned Grp_DB_GetDataOfGroupByCod (MYSQL_RES **mysql_res,long GrpCod);
bool Grp_DB_CheckIfGrpExists (long GrpCod); bool Grp_DB_CheckIfGrpExists (long GrpCod);
bool Grp_DB_CheckIfGrpBelongsToCrs (long GrpCod,long CrsCod); bool Grp_DB_CheckIfGrpBelongsToCrs (long GrpCod,long CrsCod);
@ -60,6 +64,7 @@ unsigned Grp_DB_CountNumUsrsInGrp (Rol_Role_t Role,long GrpCod);
unsigned Grp_DB_CountNumUsrsInNoGrpsOfType (Rol_Role_t Role,long GrpTypCod); unsigned Grp_DB_CountNumUsrsInNoGrpsOfType (Rol_Role_t Role,long GrpTypCod);
bool Grp_DB_CheckIfIBelongToGrpsOfType (long GrpTypCod); bool Grp_DB_CheckIfIBelongToGrpsOfType (long GrpTypCod);
bool Grp_DB_CheckIfIBelongToGrp (long GrpCod);
unsigned Grp_DB_GetGrpTypesWithGrpsInCurrentCrs (MYSQL_RES **mysql_res); unsigned Grp_DB_GetGrpTypesWithGrpsInCurrentCrs (MYSQL_RES **mysql_res);
unsigned Grp_DB_GetAllGrpTypesInCurrentCrs (MYSQL_RES **mysql_res); unsigned Grp_DB_GetAllGrpTypesInCurrentCrs (MYSQL_RES **mysql_res);