Version 23.65: Feb 09, 2024 Responsive design in last clicks.

This commit is contained in:
acanas 2024-02-09 00:22:59 +01:00
parent 59c687355b
commit 931cccc596
32 changed files with 259 additions and 265 deletions

View File

@ -5387,11 +5387,8 @@ table.TBL_WIDE > tbody > tr > th {padding:2px;}
.LC_CLK {text-align:right; vertical-align:top; min-width:60px;} .LC_CLK {text-align:right; vertical-align:top; min-width:60px;}
.LC_TIM {text-align:right; vertical-align:top; min-width:60px; max-width:60px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .LC_TIM {text-align:right; vertical-align:top; min-width:60px; max-width:60px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_ROL {text-align:left; vertical-align:top; min-width:100px; max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .LC_ROL {text-align:left; vertical-align:top; min-width:100px; max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_CTY {text-align:left; vertical-align:top; min-width:100px; max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .LC_HIE {text-align:left; vertical-align:top; min-width:100px; max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_INS {text-align:left; vertical-align:top; min-width:100px; max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;} .LC_ACT {text-align:left; vertical-align:top; min-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_CTR {text-align:left; vertical-align:top; min-width:100px; max-width:100px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_DEG {text-align:left; vertical-align:top; min-width:150px; max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.LC_ACT {text-align:left; vertical-align:top; min-width:200px; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
/*********************** Listing my courses as a tree ************************/ /*********************** Listing my courses as a tree ************************/
@media only screen and (max-width:800px) @media only screen and (max-width:800px)

View File

@ -1341,16 +1341,16 @@ static void Att_GetAndWriteNamesOfGrpsAssociatedToEvent (struct Att_Event *Event
/***************** Remove all attendance events of a course ******************/ /***************** Remove all attendance events of a course ******************/
/*****************************************************************************/ /*****************************************************************************/
void Att_RemoveCrsEvents (long CrsCod) void Att_RemoveCrsEvents (long HieCod)
{ {
/***** Remove students *****/ /***** Remove students *****/
Att_DB_RemoveUsrsFromCrsEvents (CrsCod); Att_DB_RemoveUsrsFromCrsEvents (HieCod);
/***** Remove groups *****/ /***** Remove groups *****/
Att_DB_RemoveGrpsAssociatedToCrsEvents (CrsCod); Att_DB_RemoveGrpsAssociatedToCrsEvents (HieCod);
/***** Remove attendance events *****/ /***** Remove attendance events *****/
Att_DB_RemoveCrsEvents (CrsCod); Att_DB_RemoveCrsEvents (HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -101,7 +101,7 @@ void Att_ReceiveFormEvent (void);
void Att_CreateEvent (struct Att_Event *Event,const char *Description); void Att_CreateEvent (struct Att_Event *Event,const char *Description);
void Att_UpdateEvent (struct Att_Event *Event,const char *Description); void Att_UpdateEvent (struct Att_Event *Event,const char *Description);
void Att_RemoveCrsEvents (long CrsCod); void Att_RemoveCrsEvents (long HieCod);
unsigned Att_GetNumEvents (Hie_Level_t Level,unsigned *NumNotif); unsigned Att_GetNumEvents (Hie_Level_t Level,unsigned *NumNotif);

View File

@ -797,7 +797,7 @@ void Att_DB_RemoveEventFromCurrentCrs (long AttCod)
/************* Remove users in all attendance events of a course *************/ /************* Remove users in all attendance events of a course *************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_RemoveUsrsFromCrsEvents (long CrsCod) void Att_DB_RemoveUsrsFromCrsEvents (long HieCod)
{ {
DB_QueryDELETE ("can not remove users registered" DB_QueryDELETE ("can not remove users registered"
" in attendance events of a course", " in attendance events of a course",
@ -806,14 +806,14 @@ void Att_DB_RemoveUsrsFromCrsEvents (long CrsCod)
"att_users" "att_users"
" WHERE att_events.CrsCod=%ld" " WHERE att_events.CrsCod=%ld"
" AND att_events.AttCod=att_users.AttCod", " AND att_events.AttCod=att_users.AttCod",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************ Remove groups in all attendance events of a course *************/ /************ Remove groups in all attendance events of a course *************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_RemoveGrpsAssociatedToCrsEvents (long CrsCod) void Att_DB_RemoveGrpsAssociatedToCrsEvents (long HieCod)
{ {
DB_QueryDELETE ("can not remove all groups associated" DB_QueryDELETE ("can not remove all groups associated"
" to attendance events of a course", " to attendance events of a course",
@ -822,26 +822,26 @@ void Att_DB_RemoveGrpsAssociatedToCrsEvents (long CrsCod)
"att_groups" "att_groups"
" WHERE att_events.CrsCod=%ld" " WHERE att_events.CrsCod=%ld"
" AND att_events.AttCod=att_groups.AttCod", " AND att_events.AttCod=att_groups.AttCod",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/***************** Remove all attendance events of a course ******************/ /***************** Remove all attendance events of a course ******************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_RemoveCrsEvents (long CrsCod) void Att_DB_RemoveCrsEvents (long HieCod)
{ {
DB_QueryDELETE ("can not remove all attendance events of a course", DB_QueryDELETE ("can not remove all attendance events of a course",
"DELETE FROM att_events" "DELETE FROM att_events"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/*************** Get number of attendance events in a course *****************/ /*************** Get number of attendance events in a course *****************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Att_DB_GetNumEventsInCrs (long CrsCod) unsigned Att_DB_GetNumEventsInCrs (long HieCod)
{ {
/***** Get number of attendance events in a course from database *****/ /***** Get number of attendance events in a course from database *****/
return (unsigned) return (unsigned)
@ -849,7 +849,7 @@ unsigned Att_DB_GetNumEventsInCrs (long CrsCod)
"SELECT COUNT(*)" "SELECT COUNT(*)"
" FROM att_events" " FROM att_events"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -82,11 +82,11 @@ void Att_DB_RemoveUsrFromAllEvents (long UsrCod);
void Att_DB_RemoveUsrFromCrsEvents (long UsrCod,long CrsCod); void Att_DB_RemoveUsrFromCrsEvents (long UsrCod,long CrsCod);
void Att_DB_RemoveEventFromCurrentCrs (long AttCod); void Att_DB_RemoveEventFromCurrentCrs (long AttCod);
void Att_DB_RemoveUsrsFromCrsEvents (long CrsCod); void Att_DB_RemoveUsrsFromCrsEvents (long HieCod);
void Att_DB_RemoveGrpsAssociatedToCrsEvents (long CrsCod); void Att_DB_RemoveGrpsAssociatedToCrsEvents (long HieCod);
void Att_DB_RemoveCrsEvents (long CrsCod); void Att_DB_RemoveCrsEvents (long HieCod);
unsigned Att_DB_GetNumEventsInCrs (long CrsCod); unsigned Att_DB_GetNumEventsInCrs (long HieCod);
unsigned Att_DB_GetNumCoursesWithEvents (Hie_Level_t Level); unsigned Att_DB_GetNumCoursesWithEvents (Hie_Level_t Level);
unsigned Att_DB_GetNumEvents (MYSQL_RES **mysql_res,Hie_Level_t Level); unsigned Att_DB_GetNumEvents (MYSQL_RES **mysql_res,Hie_Level_t Level);

View File

@ -5377,7 +5377,7 @@ static void Brw_WriteCurrentClipboard (void)
Prj_AllocMemProject (&Prj); Prj_AllocMemProject (&Prj);
Prj.PrjCod = Gbl.FileBrowser.Clipboard.HieCod; Prj.PrjCod = Gbl.FileBrowser.Clipboard.HieCod;
Prj_GetProjectDataByCod (&Prj); Prj_GetProjectDataByCod (&Prj);
Hie[Hie_CRS].HieCod = Prj.CrsCod; Hie[Hie_CRS].HieCod = Prj.HieCod;
Hie_GetDataByCod[Hie_CRS] (&Hie[Hie_CRS]); Hie_GetDataByCod[Hie_CRS] (&Hie[Hie_CRS]);
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone), snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
"%s, %s <strong>%s</strong>, %s <strong>%s</strong>", "%s, %s <strong>%s</strong>, %s <strong>%s</strong>",

View File

@ -205,7 +205,7 @@ unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res)
/************************ Get data of center by code *************************/ /************************ Get data of center by code *************************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod) unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a center", DB_QuerySELECT (mysql_res,"can not get data of a center",
@ -219,14 +219,14 @@ unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod)
"WWW" // row[7] "WWW" // row[7]
" FROM ctr_centers" " FROM ctr_centers"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/******************** Get coordinates of center by code **********************/ /******************** Get coordinates of center by code **********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long CtrCod) unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get coordinares of a center", DB_QuerySELECT (mysql_res,"can not get coordinares of a center",
@ -235,17 +235,17 @@ unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long CtrCod)
"Altitude" // row[ 2] "Altitude" // row[ 2]
" FROM ctr_centers" " FROM ctr_centers"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/*********** Get the institution code of a center from its code **************/ /*********** Get the institution code of a center from its code **************/
/*****************************************************************************/ /*****************************************************************************/
long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod) long Ctr_DB_GetInsCodOfCenterByCod (long HieCod)
{ {
/***** Trivial check: center code should be > 0 *****/ /***** Trivial check: center code should be > 0 *****/
if (CtrCod <= 0) if (HieCod <= 0)
return -1L; return -1L;
/***** Get the institution code of a center from database *****/ /***** Get the institution code of a center from database *****/
@ -253,17 +253,17 @@ long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod)
"SELECT InsCod" "SELECT InsCod"
" FROM ctr_centers" " FROM ctr_centers"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/*************** Get the short name of a center from its code ****************/ /*************** Get the short name of a center from its code ****************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]) void Ctr_DB_GetCtrShrtName (long HieCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
/***** Trivial check: center code should be > 0 *****/ /***** Trivial check: center code should be > 0 *****/
if (CtrCod <= 0) if (HieCod <= 0)
{ {
ShrtName[0] = '\0'; ShrtName[0] = '\0';
return; return;
@ -275,7 +275,7 @@ void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Nam_MAX_BYTES_S
"SELECT ShortName" "SELECT ShortName"
" FROM ctr_centers" " FROM ctr_centers"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -342,7 +342,7 @@ unsigned Ctr_DB_SearchCtrs (MYSQL_RES **mysql_res,
/********************** Get number of centers in system **********************/ /********************** Get number of centers in system **********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetNumCtrsInSys (__attribute__((unused)) long SysCod) unsigned Ctr_DB_GetNumCtrsInSys (__attribute__((unused)) long HieCod)
{ {
return (unsigned) DB_GetNumRowsTable ("ctr_centers"); return (unsigned) DB_GetNumRowsTable ("ctr_centers");
} }
@ -351,7 +351,7 @@ unsigned Ctr_DB_GetNumCtrsInSys (__attribute__((unused)) long SysCod)
/******************** Get number of centers in a country *********************/ /******************** Get number of centers in a country *********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetNumCtrsInCty (long CtyCod) unsigned Ctr_DB_GetNumCtrsInCty (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of centers in a country", DB_QueryCOUNT ("can not get number of centers in a country",
@ -360,21 +360,21 @@ unsigned Ctr_DB_GetNumCtrsInCty (long CtyCod)
"ctr_centers" "ctr_centers"
" WHERE ins_instits.CtyCod=%ld" " WHERE ins_instits.CtyCod=%ld"
" AND ins_instits.InsCod=ctr_centers.InsCod", " AND ins_instits.InsCod=ctr_centers.InsCod",
CtyCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/****************** Get number of centers in an institution ******************/ /****************** Get number of centers in an institution ******************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetNumCtrsInIns (long InsCod) unsigned Ctr_DB_GetNumCtrsInIns (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of centers in an institution", DB_QueryCOUNT ("can not get number of centers in an institution",
"SELECT COUNT(*)" "SELECT COUNT(*)"
" FROM ctr_centers" " FROM ctr_centers"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -411,7 +411,7 @@ unsigned Ctr_DB_GetNumCtrsWithMap (void)
/**************** Get number of centers with map in a country ****************/ /**************** Get number of centers with map in a country ****************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetNumCtrsWithMapInCty (long CtyCod) unsigned Ctr_DB_GetNumCtrsWithMapInCty (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of centers with map", DB_QueryCOUNT ("can not get number of centers with map",
@ -422,14 +422,14 @@ unsigned Ctr_DB_GetNumCtrsWithMapInCty (long CtyCod)
" AND ins_instits.InsCod=ctr_centers.InsCod" " AND ins_instits.InsCod=ctr_centers.InsCod"
" AND (ctr_centers.Latitude<>0" " AND (ctr_centers.Latitude<>0"
" OR ctr_centers.Longitude<>0)", " OR ctr_centers.Longitude<>0)",
CtyCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************* Get number of centers with map in an institution **************/ /************* Get number of centers with map in an institution **************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetNumCtrsWithMapInIns (long InsCod) unsigned Ctr_DB_GetNumCtrsWithMapInIns (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of centers with map", DB_QueryCOUNT ("can not get number of centers with map",
@ -439,7 +439,7 @@ unsigned Ctr_DB_GetNumCtrsWithMapInIns (long InsCod)
" AND (Latitude<>0" " AND (Latitude<>0"
" OR" " OR"
" Longitude<>0)", " Longitude<>0)",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -520,35 +520,35 @@ unsigned Ctr_DB_GetNumCtrsWithUsrs (Rol_Role_t Role,
/******************* Update institution in table of centers ******************/ /******************* Update institution in table of centers ******************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_UpdateCtrIns (long CtrCod,long NewInsCod) void Ctr_DB_UpdateCtrIns (long HieCod,long NewInsCod)
{ {
DB_QueryUPDATE ("can not update the institution of a center", DB_QueryUPDATE ("can not update the institution of a center",
"UPDATE ctr_centers" "UPDATE ctr_centers"
" SET InsCod=%ld" " SET InsCod=%ld"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
NewInsCod, NewInsCod,
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************** Update database changing old place by new place **************/ /************** Update database changing old place by new place **************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_UpdateCtrPlc (long CtrCod,long NewPlcCod) void Ctr_DB_UpdateCtrPlc (long HieCod,long NewPlcCod)
{ {
DB_QueryUPDATE ("can not update the place of a center", DB_QueryUPDATE ("can not update the place of a center",
"UPDATE ctr_centers" "UPDATE ctr_centers"
" SET PlcCod=%ld" " SET PlcCod=%ld"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
NewPlcCod, NewPlcCod,
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/****************** Update center name in table of centers *******************/ /****************** Update center name in table of centers *******************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_UpdateCtrName (long CtrCod, void Ctr_DB_UpdateCtrName (long HieCod,
const char *FldName,const char *NewCtrName) const char *FldName,const char *NewCtrName)
{ {
/***** Update center changing old name by new name */ /***** Update center changing old name by new name */
@ -557,7 +557,7 @@ void Ctr_DB_UpdateCtrName (long CtrCod,
" SET %s='%s'" " SET %s='%s'"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
FldName,NewCtrName, FldName,NewCtrName,
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -578,21 +578,21 @@ void Ctr_DB_UpdateCtrWWW (long CtrCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1])
/******* Update the table changing old attribution by new attribution ********/ /******* Update the table changing old attribution by new attribution ********/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_UpdateCtrPhotoAttribution (long CtrCod,const char NewPhotoAttribution[Med_MAX_BYTES_ATTRIBUTION + 1]) void Ctr_DB_UpdateCtrPhotoAttribution (long HieCod,const char NewPhotoAttribution[Med_MAX_BYTES_ATTRIBUTION + 1])
{ {
DB_QueryUPDATE ("can not update the photo attribution of a center", DB_QueryUPDATE ("can not update the photo attribution of a center",
"UPDATE ctr_centers" "UPDATE ctr_centers"
" SET PhotoAttribution='%s'" " SET PhotoAttribution='%s'"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
NewPhotoAttribution, NewPhotoAttribution,
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/******** Update database changing old coordinate by new coordinate **********/ /******** Update database changing old coordinate by new coordinate **********/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_UpdateCtrCoordinate (long CtrCod, void Ctr_DB_UpdateCtrCoordinate (long HieCod,
const char *CoordField,double NewCoord) const char *CoordField,double NewCoord)
{ {
Str_SetDecimalPointToUS (); // To write the decimal point as a dot Str_SetDecimalPointToUS (); // To write the decimal point as a dot
@ -602,7 +602,7 @@ void Ctr_DB_UpdateCtrCoordinate (long CtrCod,
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CoordField, CoordField,
NewCoord, NewCoord,
CtrCod); HieCod);
Str_SetDecimalPointToLocal (); // Return to local system Str_SetDecimalPointToLocal (); // Return to local system
} }
@ -610,21 +610,21 @@ void Ctr_DB_UpdateCtrCoordinate (long CtrCod,
/******************** Update status in table of centers **********************/ /******************** Update status in table of centers **********************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_UpdateCtrStatus (long CtrCod,Hie_Status_t NewStatus) void Ctr_DB_UpdateCtrStatus (long HieCod,Hie_Status_t NewStatus)
{ {
DB_QueryUPDATE ("can not update the status of a center", DB_QueryUPDATE ("can not update the status of a center",
"UPDATE ctr_centers" "UPDATE ctr_centers"
" SET Status=%u" " SET Status=%u"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
(unsigned) NewStatus, (unsigned) NewStatus,
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/********** Check if any of the centers in an institution has map ************/ /********** Check if any of the centers in an institution has map ************/
/*****************************************************************************/ /*****************************************************************************/
bool Ctr_DB_CheckIfMapIsAvailableInIns (long InsCod) bool Ctr_DB_CheckIfMapIsAvailableInIns (long HieCod)
{ {
/***** Get if any center in current institution has a coordinate set /***** Get if any center in current institution has a coordinate set
(coordinates 0, 0 means not set ==> don't show map) *****/ (coordinates 0, 0 means not set ==> don't show map) *****/
@ -637,7 +637,7 @@ bool Ctr_DB_CheckIfMapIsAvailableInIns (long InsCod)
" AND (Latitude<>0" " AND (Latitude<>0"
" OR" " OR"
" Longitude<>0))", " Longitude<>0))",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -791,24 +791,24 @@ bool Ctr_DB_CheckIfUsrBelongsToCtr (long UsrCod,long HieCod,
/*********** Get number of users who claim to belong to a center *************/ /*********** Get number of users who claim to belong to a center *************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ctr_DB_GetNumUsrsWhoClaimToBelongToCtr (long CtrCod) unsigned Ctr_DB_GetNumUsrsWhoClaimToBelongToCtr (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of users", DB_QueryCOUNT ("can not get number of users",
"SELECT COUNT(UsrCod)" "SELECT COUNT(UsrCod)"
" FROM usr_data" " FROM usr_data"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/****************************** Remove a center ******************************/ /****************************** Remove a center ******************************/
/*****************************************************************************/ /*****************************************************************************/
void Ctr_DB_RemoveCenter (long CtrCod) void Ctr_DB_RemoveCenter (long HieCod)
{ {
DB_QueryDELETE ("can not remove a center", DB_QueryDELETE ("can not remove a center",
"DELETE FROM ctr_centers" "DELETE FROM ctr_centers"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }

View File

@ -45,10 +45,10 @@ unsigned Ctr_DB_GetListOfCtrsFull (MYSQL_RES **mysql_res,long InsCod);
unsigned Ctr_DB_GetListOfCtrsFullWithNumUsrs (MYSQL_RES **mysql_res, unsigned Ctr_DB_GetListOfCtrsFullWithNumUsrs (MYSQL_RES **mysql_res,
long InsCod,Hie_Order_t SelectedOrder); long InsCod,Hie_Order_t SelectedOrder);
unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res); unsigned Ctr_DB_GetCtrsWithPendingDegs (MYSQL_RES **mysql_res);
unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long CtrCod); unsigned Ctr_DB_GetCenterDataByCod (MYSQL_RES **mysql_res,long HieCod);
unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long CtrCod); unsigned Ctr_DB_GetCoordByCod (MYSQL_RES **mysql_res,long HieCod);
long Ctr_DB_GetInsCodOfCenterByCod (long CtrCod); long Ctr_DB_GetInsCodOfCenterByCod (long HieCod);
void Ctr_DB_GetShortNameOfCenterByCod (long CtrCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]); void Ctr_DB_GetCtrShrtName (long HieCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]);
unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod); unsigned Ctr_DB_GetPhotoAttribution (MYSQL_RES **mysql_res,long CtrCod);
bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FldName,const char *Name, bool Ctr_DB_CheckIfCtrNameExistsInIns (const char *FldName,const char *Name,
long Cod,long PrtCod, long Cod,long PrtCod,
@ -58,30 +58,30 @@ unsigned Ctr_DB_SearchCtrs (MYSQL_RES **mysql_res,
const char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1], const char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1],
const char *RangeQuery); const char *RangeQuery);
unsigned Ctr_DB_GetNumCtrsInSys (__attribute__((unused)) long SysCod); unsigned Ctr_DB_GetNumCtrsInSys (__attribute__((unused)) long HieCod);
unsigned Ctr_DB_GetNumCtrsInCty (long CtyCod); unsigned Ctr_DB_GetNumCtrsInCty (long HieCod);
unsigned Ctr_DB_GetNumCtrsInIns (long InsCod); unsigned Ctr_DB_GetNumCtrsInIns (long HieCod);
unsigned Ctr_DB_GetNumCtrsInPlc (long PlcCod); unsigned Ctr_DB_GetNumCtrsInPlc (long PlcCod);
unsigned Ctr_DB_GetNumCtrsWithMap (void); unsigned Ctr_DB_GetNumCtrsWithMap (void);
unsigned Ctr_DB_GetNumCtrsWithMapInCty (long CtyCod); unsigned Ctr_DB_GetNumCtrsWithMapInCty (long HieCod);
unsigned Ctr_DB_GetNumCtrsWithMapInIns (long InsCod); unsigned Ctr_DB_GetNumCtrsWithMapInIns (long HieCod);
unsigned Ctr_DB_GetNumCtrsWithDegs (Hie_Level_t Level,long Cod); unsigned Ctr_DB_GetNumCtrsWithDegs (Hie_Level_t Level,long Cod);
unsigned Ctr_DB_GetNumCtrsWithCrss (Hie_Level_t Level,long Cod); unsigned Ctr_DB_GetNumCtrsWithCrss (Hie_Level_t Level,long Cod);
unsigned Ctr_DB_GetNumCtrsWithUsrs (Rol_Role_t Role, unsigned Ctr_DB_GetNumCtrsWithUsrs (Rol_Role_t Role,
Hie_Level_t Level,long Cod); Hie_Level_t Level,long Cod);
void Ctr_DB_UpdateCtrIns (long CtrCod,long NewInsCod); void Ctr_DB_UpdateCtrIns (long HieCod,long NewInsCod);
void Ctr_DB_UpdateCtrPlc (long CtrCod,long NewPlcCod); void Ctr_DB_UpdateCtrPlc (long HieCod,long NewPlcCod);
void Ctr_DB_UpdateCtrName (long CtrCod, void Ctr_DB_UpdateCtrName (long HieCod,
const char *FldName,const char *NewCtrName); const char *FldName,const char *NewCtrName);
void Ctr_DB_UpdateCtrWWW (long CtrCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); void Ctr_DB_UpdateCtrWWW (long HieCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
void Ctr_DB_UpdateCtrPhotoAttribution (long CtrCod,const char NewPhotoAttribution[Med_MAX_BYTES_ATTRIBUTION + 1]); void Ctr_DB_UpdateCtrPhotoAttribution (long HieCod,const char NewPhotoAttribution[Med_MAX_BYTES_ATTRIBUTION + 1]);
void Ctr_DB_UpdateCtrCoordinate (long CtrCod, void Ctr_DB_UpdateCtrCoordinate (long HieCod,
const char *CoordField,double NewCoord); const char *CoordField,double NewCoord);
void Ctr_DB_UpdateCtrStatus (long CtrCod,Hie_Status_t NewStatus); void Ctr_DB_UpdateCtrStatus (long HieCod,Hie_Status_t NewStatus);
bool Ctr_DB_CheckIfMapIsAvailableInIns (long InsCod); bool Ctr_DB_CheckIfMapIsAvailableInIns (long HieCod);
void Ctr_DB_GetAvgCoordAndZoom (struct Map_Coordinates *Coord,unsigned *Zoom); void Ctr_DB_GetAvgCoordAndZoom (struct Map_Coordinates *Coord,unsigned *Zoom);
void Ctr_DB_GetAvgCoordAndZoomInCurrentIns (struct Map_Coordinates *Coord,unsigned *Zoom); void Ctr_DB_GetAvgCoordAndZoomInCurrentIns (struct Map_Coordinates *Coord,unsigned *Zoom);
unsigned Ctr_DB_GetCtrsWithCoords (MYSQL_RES **mysql_res); unsigned Ctr_DB_GetCtrsWithCoords (MYSQL_RES **mysql_res);
@ -90,8 +90,8 @@ unsigned Ctr_DB_GetCtrsWithCoordsInCurrentIns (MYSQL_RES **mysql_res);
unsigned Ctr_DB_GetMyCtrs (MYSQL_RES **mysql_res,long PrtCod); unsigned Ctr_DB_GetMyCtrs (MYSQL_RES **mysql_res,long PrtCod);
bool Ctr_DB_CheckIfUsrBelongsToCtr (long UsrCod,long HieCod, bool Ctr_DB_CheckIfUsrBelongsToCtr (long UsrCod,long HieCod,
bool CountOnlyAcceptedCourses); bool CountOnlyAcceptedCourses);
unsigned Ctr_DB_GetNumUsrsWhoClaimToBelongToCtr (long CtrCod); unsigned Ctr_DB_GetNumUsrsWhoClaimToBelongToCtr (long HieCod);
void Ctr_DB_RemoveCenter (long CtrCod); void Ctr_DB_RemoveCenter (long HieCod);
#endif #endif

View File

@ -633,10 +633,11 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod') "can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/ */
#define Log_PLATFORM_VERSION "SWAD 23.64.1 (2024-02-06)" #define Log_PLATFORM_VERSION "SWAD 23.65 (2024-02-09)"
#define CSS_FILE "swad23.64.1.css" #define CSS_FILE "swad23.65.css"
#define JS_FILE "swad23.53.6.js" #define JS_FILE "swad23.53.6.js"
/* /*
Version 23.65: Feb 09, 2024 Responsive design in last clicks. (335502 lines)
Version 23.64.1: Feb 06, 2024 Fixed CSS bug. Reported by Francisco Ocaña Lara. (335505 lines) Version 23.64.1: Feb 06, 2024 Fixed CSS bug. Reported by Francisco Ocaña Lara. (335505 lines)
Version 23.64: Jan 30, 2024 Responsive design. (335503 lines) Version 23.64: Jan 30, 2024 Responsive design. (335503 lines)
Version 23.63.4: Jan 30, 2024 Code refactoring in users. (335414 lines) Version 23.63.4: Jan 30, 2024 Code refactoring in users. (335414 lines)

View File

@ -110,7 +110,7 @@ static void Crs_GetParsNewCourse (struct Hie_Node *Crs);
static void Crs_GetCourseDataFromRow (MYSQL_RES *mysql_res, static void Crs_GetCourseDataFromRow (MYSQL_RES *mysql_res,
struct Hie_Node *Crs); struct Hie_Node *Crs);
static void Crs_EmptyCourseCompletely (long CrsCod); static void Crs_EmptyCourseCompletely (long HieCod);
static void Crs_PutButtonToGoToCrs (void); static void Crs_PutButtonToGoToCrs (void);
static void Crs_PutButtonToRegisterInCrs (void); static void Crs_PutButtonToRegisterInCrs (void);
@ -1153,18 +1153,18 @@ static void Crs_GetCourseDataFromRow (MYSQL_RES *mysql_res,
/****************************** Remove a course ******************************/ /****************************** Remove a course ******************************/
/*****************************************************************************/ /*****************************************************************************/
void Crs_RemoveCourseCompletely (long CrsCod) void Crs_RemoveCourseCompletely (long HieCod)
{ {
if (CrsCod > 0) if (HieCod > 0)
{ {
/***** Empty course *****/ /***** Empty course *****/
Crs_EmptyCourseCompletely (CrsCod); Crs_EmptyCourseCompletely (HieCod);
/***** Remove course from table of last accesses to courses in database *****/ /***** Remove course from table of last accesses to courses in database *****/
Crs_DB_RemoveCrsLast (CrsCod); Crs_DB_RemoveCrsLast (HieCod);
/***** Remove course from table of courses in database *****/ /***** Remove course from table of courses in database *****/
Crs_DB_RemoveCrs (CrsCod); Crs_DB_RemoveCrs (HieCod);
} }
} }
@ -1174,16 +1174,16 @@ void Crs_RemoveCourseCompletely (long CrsCod)
// Start removing less important things to more important things; // Start removing less important things to more important things;
// so, in case of failure, important things can been removed in the future // so, in case of failure, important things can been removed in the future
static void Crs_EmptyCourseCompletely (long CrsCod) static void Crs_EmptyCourseCompletely (long HieCod)
{ {
extern bool (*Hie_GetDataByCod[Hie_NUM_LEVELS]) (struct Hie_Node *Node); extern bool (*Hie_GetDataByCod[Hie_NUM_LEVELS]) (struct Hie_Node *Node);
struct Hie_Node Crs; struct Hie_Node Crs;
char PathRelCrs[PATH_MAX + 1]; char PathRelCrs[PATH_MAX + 1];
if (CrsCod > 0) if (HieCod > 0)
{ {
/***** Get course data *****/ /***** Get course data *****/
Crs.HieCod = CrsCod; Crs.HieCod = HieCod;
Hie_GetDataByCod[Hie_CRS] (&Crs); Hie_GetDataByCod[Hie_CRS] (&Crs);
/***** Remove all students in the course *****/ /***** Remove all students in the course *****/
@ -1191,83 +1191,83 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
/***** Set all notifications from the course as removed, /***** Set all notifications from the course as removed,
except notifications about new messages *****/ except notifications about new messages *****/
Ntf_DB_MarkNotifInCrsAsRemoved (-1L,CrsCod); Ntf_DB_MarkNotifInCrsAsRemoved (-1L,HieCod);
/***** Remove information of the course ****/ /***** Remove information of the course ****/
/* Remove information of the course */ /* Remove information of the course */
Crs_DB_RemoveCrsInfo (CrsCod); Crs_DB_RemoveCrsInfo (HieCod);
/* Remove timetable of the course */ /* Remove timetable of the course */
Crs_DB_RemoveCrsTimetable (CrsCod); Crs_DB_RemoveCrsTimetable (HieCod);
/***** Remove exam announcements in the course *****/ /***** Remove exam announcements in the course *****/
/* Mark all exam announcements in the course as deleted */ /* Mark all exam announcements in the course as deleted */
Cfe_DB_MarkCallForExamsInCrsAsDeleted (CrsCod); Cfe_DB_MarkCallForExamsInCrsAsDeleted (HieCod);
/***** Remove course cards of the course *****/ /***** Remove course cards of the course *****/
/* Remove content of course cards */ /* Remove content of course cards */
Rec_DB_RemoveAllFieldContentsInCrs (CrsCod); Rec_DB_RemoveAllFieldContentsInCrs (HieCod);
/* Remove definition of fields in course cards */ /* Remove definition of fields in course cards */
Rec_DB_RemoveAllFieldsInCrs (CrsCod); Rec_DB_RemoveAllFieldsInCrs (HieCod);
/***** Remove information related to files in course, /***** Remove information related to files in course,
including groups and projects, including groups and projects,
so this function must be called so this function must be called
before removing groups and projects *****/ before removing groups and projects *****/
Brw_DB_RemoveCrsFiles (CrsCod); Brw_DB_RemoveCrsFiles (HieCod);
/***** Assessment tab *****/ /***** Assessment tab *****/
/* Remove assignments of the course */ /* Remove assignments of the course */
Asg_RemoveCrsAssignments (CrsCod); Asg_RemoveCrsAssignments (HieCod);
/* Remove projects of the course */ /* Remove projects of the course */
Prj_RemoveCrsProjects (CrsCod); Prj_RemoveCrsProjects (HieCod);
/* Remove tests of the course */ /* Remove tests of the course */
TstPrn_RemoveCrsPrints (CrsCod); TstPrn_RemoveCrsPrints (HieCod);
Tst_DB_RemoveTstConfig (CrsCod); Tst_DB_RemoveTstConfig (HieCod);
/* Remove all exams in the course */ /* Remove all exams in the course */
Exa_RemoveCrsExams (CrsCod); Exa_RemoveCrsExams (HieCod);
/* Remove all games in the course */ /* Remove all games in the course */
Gam_RemoveCrsGames (CrsCod); Gam_RemoveCrsGames (HieCod);
/* Remove all questions in the course */ /* Remove all questions in the course */
Qst_RemoveCrsQsts (CrsCod); Qst_RemoveCrsQsts (HieCod);
/* Remove all rubrics in the course */ /* Remove all rubrics in the course */
Rub_RemoveCrsRubrics (CrsCod); Rub_RemoveCrsRubrics (HieCod);
/***** Remove attendance events of the course *****/ /***** Remove attendance events of the course *****/
Att_RemoveCrsEvents (CrsCod); Att_RemoveCrsEvents (HieCod);
/***** Remove notices in the course *****/ /***** Remove notices in the course *****/
Not_DB_RemoveCrsNotices (CrsCod); Not_DB_RemoveCrsNotices (HieCod);
/***** Remove all threads and posts in forums of the course *****/ /***** Remove all threads and posts in forums of the course *****/
For_DB_RemoveForums (Hie_CRS,CrsCod); For_DB_RemoveForums (Hie_CRS,HieCod);
/***** Remove all surveys in the course *****/ /***** Remove all surveys in the course *****/
Svy_RemoveSurveys (Hie_CRS,CrsCod); Svy_RemoveSurveys (Hie_CRS,HieCod);
/***** Remove groups in the course *****/ /***** Remove groups in the course *****/
Grp_DB_RemoveCrsGrps (CrsCod); Grp_DB_RemoveCrsGrps (HieCod);
/***** Remove users' requests for inscription in the course *****/ /***** Remove users' requests for inscription in the course *****/
Enr_DB_RemCrsRequests (CrsCod); Enr_DB_RemCrsRequests (HieCod);
/***** Remove possible users remaining in the course (teachers) *****/ /***** Remove possible users remaining in the course (teachers) *****/
Set_DB_RemAllUsrsFromCrsSettings (CrsCod); Set_DB_RemAllUsrsFromCrsSettings (HieCod);
Enr_DB_RemAllUsrsFromCrs (CrsCod); Enr_DB_RemAllUsrsFromCrs (HieCod);
/***** Remove directories of the course *****/ /***** Remove directories of the course *****/
snprintf (PathRelCrs,sizeof (PathRelCrs),"%s/%ld", snprintf (PathRelCrs,sizeof (PathRelCrs),"%s/%ld",
Cfg_PATH_CRS_PRIVATE,CrsCod); Cfg_PATH_CRS_PRIVATE,HieCod);
Fil_RemoveTree (PathRelCrs); Fil_RemoveTree (PathRelCrs);
snprintf (PathRelCrs,sizeof (PathRelCrs),"%s/%ld", snprintf (PathRelCrs,sizeof (PathRelCrs),"%s/%ld",
Cfg_PATH_CRS_PUBLIC,CrsCod); Cfg_PATH_CRS_PUBLIC,HieCod);
Fil_RemoveTree (PathRelCrs); Fil_RemoveTree (PathRelCrs);
} }
} }

View File

@ -64,7 +64,7 @@ void Crs_ReceiveFormNewCrs (void);
void Crs_RemoveCourse (void); void Crs_RemoveCourse (void);
bool Crs_GetCourseDataByCod (struct Hie_Node *Crs); bool Crs_GetCourseDataByCod (struct Hie_Node *Crs);
void Crs_RemoveCourseCompletely (long CrsCod); void Crs_RemoveCourseCompletely (long HieCod);
void Crs_ChangeInsCrsCod (void); void Crs_ChangeInsCrsCod (void);
void Crs_ChangeCrsYear (void); void Crs_ChangeCrsYear (void);

View File

@ -280,7 +280,7 @@ void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp)
/********************* Get data of a degree from its code ********************/ /********************* Get data of a degree from its code ********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod) unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of a degree", DB_QuerySELECT (mysql_res,"can not get data of a degree",
@ -294,17 +294,17 @@ unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod)
"WWW" // row[7] "WWW" // row[7]
" FROM deg_degrees" " FROM deg_degrees"
" WHERE DegCod=%ld", " WHERE DegCod=%ld",
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/********** Get the institution code of a degree from its code ***************/ /********** Get the institution code of a degree from its code ***************/
/*****************************************************************************/ /*****************************************************************************/
long Deg_DB_GetInsCodOfDegreeByCod (long DegCod) long Deg_DB_GetInsCodOfDegreeByCod (long HieCod)
{ {
/***** Trivial check: degree code should be > 0 *****/ /***** Trivial check: degree code should be > 0 *****/
if (DegCod <= 0) if (HieCod <= 0)
return -1L; return -1L;
/***** Get the institution code of a degree from database *****/ /***** Get the institution code of a degree from database *****/
@ -314,17 +314,17 @@ long Deg_DB_GetInsCodOfDegreeByCod (long DegCod)
"ctr_centers" "ctr_centers"
" WHERE deg_degrees.DegCod=%ld" " WHERE deg_degrees.DegCod=%ld"
" AND deg_degrees.CtrCod=ctr_centers.CtrCod", " AND deg_degrees.CtrCod=ctr_centers.CtrCod",
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************* Get the center code of a degree from its code *****************/ /************* Get the center code of a degree from its code *****************/
/*****************************************************************************/ /*****************************************************************************/
long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod) long Deg_DB_GetCtrCodOfDegreeByCod (long HieCod)
{ {
/***** Trivial check: degree code should be > 0 *****/ /***** Trivial check: degree code should be > 0 *****/
if (DegCod <= 0) if (HieCod <= 0)
return -1L; return -1L;
/***** Get the center code of a degree from database *****/ /***** Get the center code of a degree from database *****/
@ -332,17 +332,17 @@ long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod)
"SELECT CtrCod" "SELECT CtrCod"
" FROM deg_degrees" " FROM deg_degrees"
" WHERE DegCod=%ld", " WHERE DegCod=%ld",
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************* Get the short name of a degree from its code ******************/ /************* Get the short name of a degree from its code ******************/
/*****************************************************************************/ /*****************************************************************************/
void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]) void Deg_DB_GetDegShrtName (long HieCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
/***** Trivial check: degree code should be > 0 *****/ /***** Trivial check: degree code should be > 0 *****/
if (DegCod <= 0) if (HieCod <= 0)
{ {
ShrtName[0] = '\0'; ShrtName[0] = '\0';
return; return;
@ -354,7 +354,7 @@ void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Nam_MAX_BYTES_S
"SELECT ShortName" "SELECT ShortName"
" FROM deg_degrees" " FROM deg_degrees"
" WHERE DegCod=%ld", " WHERE DegCod=%ld",
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -626,7 +626,7 @@ unsigned Deg_DB_GetNumDegsInSys (__attribute__((unused)) long SysCod)
/******************** Get number of degrees in a country *********************/ /******************** Get number of degrees in a country *********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Deg_DB_GetNumDegsInCty (long CtyCod) unsigned Deg_DB_GetNumDegsInCty (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get the number of degrees in a country", DB_QueryCOUNT ("can not get the number of degrees in a country",
@ -637,14 +637,14 @@ unsigned Deg_DB_GetNumDegsInCty (long CtyCod)
" WHERE ins_instits.CtyCod=%ld" " WHERE ins_instits.CtyCod=%ld"
" AND ins_instits.InsCod=ctr_centers.InsCod" " AND ins_instits.InsCod=ctr_centers.InsCod"
" AND ctr_centers.CtrCod=deg_degrees.CtrCod", " AND ctr_centers.CtrCod=deg_degrees.CtrCod",
CtyCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/***************** Get number of degrees in an institution *******************/ /***************** Get number of degrees in an institution *******************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Deg_DB_GetNumDegsInIns (long InsCod) unsigned Deg_DB_GetNumDegsInIns (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get the number of degrees in an institution", DB_QueryCOUNT ("can not get the number of degrees in an institution",
@ -653,21 +653,21 @@ unsigned Deg_DB_GetNumDegsInIns (long InsCod)
"deg_degrees" "deg_degrees"
" WHERE ctr_centers.InsCod=%ld" " WHERE ctr_centers.InsCod=%ld"
" AND ctr_centers.CtrCod=deg_degrees.CtrCod", " AND ctr_centers.CtrCod=deg_degrees.CtrCod",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/******************** Get number of degrees in a center **********************/ /******************** Get number of degrees in a center **********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Deg_DB_GetNumDegsInCtr (long CtrCod) unsigned Deg_DB_GetNumDegsInCtr (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get the number of degrees in a center", DB_QueryCOUNT ("can not get the number of degrees in a center",
"SELECT COUNT(*)" "SELECT COUNT(*)"
" FROM deg_degrees" " FROM deg_degrees"
" WHERE CtrCod=%ld", " WHERE CtrCod=%ld",
CtrCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -689,7 +689,7 @@ void Deg_DB_UpdateDegTypName (long DegTypCod,
/***************** Update degree name in table of degrees ********************/ /***************** Update degree name in table of degrees ********************/
/*****************************************************************************/ /*****************************************************************************/
void Deg_DB_UpdateDegNameDB (long DegCod, void Deg_DB_UpdateDegNameDB (long HieCod,
const char *FldName,const char *NewDegName) const char *FldName,const char *NewDegName)
{ {
DB_QueryUPDATE ("can not update the name of a degree", DB_QueryUPDATE ("can not update the name of a degree",
@ -697,21 +697,21 @@ void Deg_DB_UpdateDegNameDB (long DegCod,
" SET %s='%s'" " SET %s='%s'"
" WHERE DegCod=%ld", " WHERE DegCod=%ld",
FldName,NewDegName, FldName,NewDegName,
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/*********************** Update the center of a degree ***********************/ /*********************** Update the center of a degree ***********************/
/*****************************************************************************/ /*****************************************************************************/
void Deg_DB_UpdateDegCtr (long DegCod,long NewCtrCod) void Deg_DB_UpdateDegCtr (long HieCod,long NewCtrCod)
{ {
DB_QueryUPDATE ("can not update the center of a degree", DB_QueryUPDATE ("can not update the center of a degree",
"UPDATE deg_degrees" "UPDATE deg_degrees"
" SET CtrCod=%ld" " SET CtrCod=%ld"
" WHERE DegCod=%ld", " WHERE DegCod=%ld",
NewCtrCod, NewCtrCod,
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -732,14 +732,14 @@ void Deg_DB_UpdateDegTyp (long DegCod,long NewDegTypCod)
/************************ Update the WWW of a degree *************************/ /************************ Update the WWW of a degree *************************/
/*****************************************************************************/ /*****************************************************************************/
void Deg_DB_UpdateDegWWW (long DegCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]) void Deg_DB_UpdateDegWWW (long HieCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1])
{ {
DB_QueryUPDATE ("can not update the web of a degree", DB_QueryUPDATE ("can not update the web of a degree",
"UPDATE deg_degrees" "UPDATE deg_degrees"
" SET WWW='%s'" " SET WWW='%s'"
" WHERE DegCod=%ld", " WHERE DegCod=%ld",
NewWWW, NewWWW,
DegCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -44,10 +44,10 @@ unsigned Deg_DB_GetNumDegreeTypes (Hie_Level_t Level);
unsigned Deg_DB_GetDegreeTypes (MYSQL_RES **mysql_res, unsigned Deg_DB_GetDegreeTypes (MYSQL_RES **mysql_res,
Hie_Level_t Level,DegTyp_Order_t Order); Hie_Level_t Level,DegTyp_Order_t Order);
void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp); void Deg_DB_GetDegTypeNameByCod (struct DegTyp_DegreeType *DegTyp);
unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long DegCod); unsigned Deg_DB_GetDegreeDataByCod (MYSQL_RES **mysql_res,long HieCod);
long Deg_DB_GetInsCodOfDegreeByCod (long DegCod); long Deg_DB_GetInsCodOfDegreeByCod (long HieCod);
long Deg_DB_GetCtrCodOfDegreeByCod (long DegCod); long Deg_DB_GetCtrCodOfDegreeByCod (long HieCod);
void Deg_DB_GetShortNameOfDegreeByCod (long DegCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]); void Deg_DB_GetDegShrtName (long HieCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]);
bool Deg_DB_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod); bool Deg_DB_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod);
unsigned Deg_DB_GetNumDegsOfType (long DegTypCod); unsigned Deg_DB_GetNumDegsOfType (long DegTypCod);
unsigned Deg_DB_GetDegsOfType (MYSQL_RES **mysql_res,long DegTypCod); unsigned Deg_DB_GetDegsOfType (MYSQL_RES **mysql_res,long DegTypCod);
@ -68,17 +68,17 @@ unsigned Deg_DB_GetNumDegsWithUsrs (Rol_Role_t Role,
Hie_Level_t Level,long Cod); Hie_Level_t Level,long Cod);
unsigned Deg_DB_GetNumDegsInSys (__attribute__((unused)) long SysCod); unsigned Deg_DB_GetNumDegsInSys (__attribute__((unused)) long SysCod);
unsigned Deg_DB_GetNumDegsInCty (long CtyCod); unsigned Deg_DB_GetNumDegsInCty (long HieCod);
unsigned Deg_DB_GetNumDegsInIns (long InsCod); unsigned Deg_DB_GetNumDegsInIns (long HieCod);
unsigned Deg_DB_GetNumDegsInCtr (long CtrCod); unsigned Deg_DB_GetNumDegsInCtr (long HieCod);
void Deg_DB_UpdateDegTypName (long DegTypCod, void Deg_DB_UpdateDegTypName (long DegTypCod,
const char NewNameDegTyp[DegTyp_MAX_BYTES_DEGREE_TYPE_NAME + 1]); const char NewNameDegTyp[DegTyp_MAX_BYTES_DEGREE_TYPE_NAME + 1]);
void Deg_DB_UpdateDegNameDB (long DegCod, void Deg_DB_UpdateDegNameDB (long HieCod,
const char *FldName,const char *NewDegName); const char *FldName,const char *NewDegName);
void Deg_DB_UpdateDegCtr (long DegCod,long NewCtrCod); void Deg_DB_UpdateDegCtr (long HieCod,long NewCtrCod);
void Deg_DB_UpdateDegTyp (long DegCod,long NewDegTypCod); void Deg_DB_UpdateDegTyp (long HieCod,long NewDegTypCod);
void Deg_DB_UpdateDegWWW (long DegCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); void Deg_DB_UpdateDegWWW (long HieCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
void Deg_DB_UpdateDegStatus (long DegCod,Hie_Status_t NewStatus); void Deg_DB_UpdateDegStatus (long DegCod,Hie_Status_t NewStatus);
unsigned Deg_DB_GetMyDegs (MYSQL_RES **mysql_res,long HieCod); unsigned Deg_DB_GetMyDegs (MYSQL_RES **mysql_res,long HieCod);

View File

@ -250,7 +250,7 @@ bool Enr_DB_CheckIfUsrSharesAnyOfMyCrsWithDifferentRole (long UsrCod)
/*****************************************************************************/ /*****************************************************************************/
// Returns user's code or -1 if no user found // Returns user's code or -1 if no user found
long Enr_DB_GetRamdomStdFromCrs (long CrsCod) long Enr_DB_GetRamdomStdFromCrs (long HieCod)
{ {
return DB_QuerySELECTCode ("can not get a random student from a course", return DB_QuerySELECTCode ("can not get a random student from a course",
"SELECT UsrCod" "SELECT UsrCod"
@ -259,7 +259,7 @@ long Enr_DB_GetRamdomStdFromCrs (long CrsCod)
" AND Role=%u" " AND Role=%u"
" ORDER BY RAND()" " ORDER BY RAND()"
" LIMIT 1", " LIMIT 1",
CrsCod, HieCod,
(unsigned) Rol_STD); (unsigned) Rol_STD);
} }
@ -977,13 +977,13 @@ double Enr_DB_GetAverageNumCrssPerUsr (Hie_Level_t Level,long Cod,Rol_Role_t Rol
/************************** Remove user from course **************************/ /************************** Remove user from course **************************/
/*****************************************************************************/ /*****************************************************************************/
void Enr_DB_RemUsrFromCrs (long UsrCod,long CrsCod) void Enr_DB_RemUsrFromCrs (long UsrCod,long HieCod)
{ {
DB_QueryDELETE ("can not remove a user from a course", DB_QueryDELETE ("can not remove a user from a course",
"DELETE FROM crs_users" "DELETE FROM crs_users"
" WHERE CrsCod=%ld" " WHERE CrsCod=%ld"
" AND UsrCod=%ld", " AND UsrCod=%ld",
CrsCod, HieCod,
UsrCod); UsrCod);
} }
@ -1003,12 +1003,12 @@ void Enr_DB_RemUsrFromAllCrss (long UsrCod)
/*************** Remove all users from settings in a course ******************/ /*************** Remove all users from settings in a course ******************/
/*****************************************************************************/ /*****************************************************************************/
void Enr_DB_RemAllUsrsFromCrs (long CrsCod) void Enr_DB_RemAllUsrsFromCrs (long HieCod)
{ {
DB_QueryDELETE ("can not remove users from a course", DB_QueryDELETE ("can not remove users from a course",
"DELETE FROM crs_users" "DELETE FROM crs_users"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1600,7 +1600,7 @@ unsigned Enr_DB_GetEnrolmentRequestByCod (MYSQL_RES **mysql_res,long ReqCod)
/********** Try to get an enrolment request from a user in a course **********/ /********** Try to get an enrolment request from a user in a course **********/
/*****************************************************************************/ /*****************************************************************************/
long Enr_DB_GetUsrEnrolmentRequestInCrs (long UsrCod,long CrsCod) long Enr_DB_GetUsrEnrolmentRequestInCrs (long UsrCod,long HieCod)
{ {
return return
DB_QuerySELECTCode ("can not get enrolment request", DB_QuerySELECTCode ("can not get enrolment request",
@ -1608,7 +1608,7 @@ long Enr_DB_GetUsrEnrolmentRequestInCrs (long UsrCod,long CrsCod)
" FROM crs_requests" " FROM crs_requests"
" WHERE CrsCod=%ld" " WHERE CrsCod=%ld"
" AND UsrCod=%ld", " AND UsrCod=%ld",
CrsCod, HieCod,
UsrCod); UsrCod);
} }
@ -1628,12 +1628,12 @@ void Enr_DB_RemRequest (long ReqCod)
/*********** Remove all users' requests for inscription in a course **********/ /*********** Remove all users' requests for inscription in a course **********/
/*****************************************************************************/ /*****************************************************************************/
void Enr_DB_RemCrsRequests (long CrsCod) void Enr_DB_RemCrsRequests (long HieCod)
{ {
DB_QueryDELETE ("can not remove requests for inscription to a course", DB_QueryDELETE ("can not remove requests for inscription to a course",
"DELETE FROM crs_requests" "DELETE FROM crs_requests"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -48,7 +48,7 @@ bool Enr_DB_CheckIfUsrBelongsToCrs (long UsrCod,long HieCod,
bool CountOnlyAcceptedCourses); bool CountOnlyAcceptedCourses);
bool Enr_DB_CheckIfUsrSharesAnyOfMyCrs (long UsrCod); bool Enr_DB_CheckIfUsrSharesAnyOfMyCrs (long UsrCod);
bool Enr_DB_CheckIfUsrSharesAnyOfMyCrsWithDifferentRole (long UsrCod); bool Enr_DB_CheckIfUsrSharesAnyOfMyCrsWithDifferentRole (long UsrCod);
long Enr_DB_GetRamdomStdFromCrs (long CrsCod); long Enr_DB_GetRamdomStdFromCrs (long HieCod);
unsigned Enr_DB_GetUsrsFromCurrentCrs (MYSQL_RES **mysql_res); unsigned Enr_DB_GetUsrsFromCurrentCrs (MYSQL_RES **mysql_res);
unsigned Enr_DB_GetUsrsFromCurrentCrsExceptMe (MYSQL_RES **mysql_res); unsigned Enr_DB_GetUsrsFromCurrentCrsExceptMe (MYSQL_RES **mysql_res);
unsigned Enr_DB_GetTchsFromCurrentCrsExceptMe (MYSQL_RES **mysql_res); unsigned Enr_DB_GetTchsFromCurrentCrsExceptMe (MYSQL_RES **mysql_res);
@ -64,9 +64,9 @@ unsigned Enr_DB_GetNumUsrsNotBelongingToAnyCrs (void);
double Enr_DB_GetAverageNumUsrsPerCrs (Hie_Level_t Level,long Cod,Rol_Role_t Role); double Enr_DB_GetAverageNumUsrsPerCrs (Hie_Level_t Level,long Cod,Rol_Role_t Role);
double Enr_DB_GetAverageNumCrssPerUsr (Hie_Level_t Level,long Cod,Rol_Role_t Role); double Enr_DB_GetAverageNumCrssPerUsr (Hie_Level_t Level,long Cod,Rol_Role_t Role);
void Enr_DB_RemUsrFromCrs (long UsrCod,long CrsCod); void Enr_DB_RemUsrFromCrs (long UsrCod,long HieCod);
void Enr_DB_RemUsrFromAllCrss (long UsrCod); void Enr_DB_RemUsrFromAllCrss (long UsrCod);
void Enr_DB_RemAllUsrsFromCrs (long CrsCod); void Enr_DB_RemAllUsrsFromCrs (long HieCod);
//-------------------------- Enrolment requests ------------------------------- //-------------------------- Enrolment requests -------------------------------
long Enr_DB_CreateMyEnrolmentRequestInCurrentCrs (Rol_Role_t NewRole); long Enr_DB_CreateMyEnrolmentRequestInCurrentCrs (Rol_Role_t NewRole);
@ -74,10 +74,10 @@ void Enr_DB_UpdateMyEnrolmentRequestInCurrentCrs (long ReqCod,Rol_Role_t NewRole
unsigned Enr_DB_GetEnrolmentRequests (MYSQL_RES **mysql_res,unsigned RolesSelected); unsigned Enr_DB_GetEnrolmentRequests (MYSQL_RES **mysql_res,unsigned RolesSelected);
unsigned Enr_DB_GetEnrolmentRequestByCod (MYSQL_RES **mysql_res,long ReqCod); unsigned Enr_DB_GetEnrolmentRequestByCod (MYSQL_RES **mysql_res,long ReqCod);
long Enr_DB_GetUsrEnrolmentRequestInCrs (long UsrCod,long CrsCod); long Enr_DB_GetUsrEnrolmentRequestInCrs (long UsrCod,long HieCod);
void Enr_DB_RemRequest (long ReqCod); void Enr_DB_RemRequest (long ReqCod);
void Enr_DB_RemCrsRequests (long CrsCod); void Enr_DB_RemCrsRequests (long HieCod);
void Enr_DB_RemUsrRequests (long UsrCod); void Enr_DB_RemUsrRequests (long UsrCod);
void Enr_DB_RemoveExpiredEnrolmentRequests (void); void Enr_DB_RemoveExpiredEnrolmentRequests (void);

View File

@ -4368,14 +4368,14 @@ Grp_WhichGroups_t Grp_GetParWhichGroups (void)
/************************** Remove groups in a course ************************/ /************************** Remove groups in a course ************************/
/*****************************************************************************/ /*****************************************************************************/
void Grp_DB_RemoveCrsGrps (long CrsCod) void Grp_DB_RemoveCrsGrps (long HieCod)
{ {
/***** Remove all users in groups in the course *****/ /***** Remove all users in groups in the course *****/
Grp_DB_RemoveUsrsFromGrpsOfCrs (CrsCod); Grp_DB_RemoveUsrsFromGrpsOfCrs (HieCod);
/***** Remove all groups in the course *****/ /***** Remove all groups in the course *****/
Grp_DB_RemoveGrpsInCrs (CrsCod); Grp_DB_RemoveGrpsInCrs (HieCod);
/***** Remove all group types in the course *****/ /***** Remove all group types in the course *****/
Grp_DB_RemoveGrpTypesInCrs (CrsCod); Grp_DB_RemoveGrpTypesInCrs (HieCod);
} }

View File

@ -237,6 +237,6 @@ void Grp_ShowFormToSelWhichGrps (Act_Action_t Action,
void (*FuncPars) (void *Args),void *Args); void (*FuncPars) (void *Args),void *Args);
Grp_WhichGroups_t Grp_GetParWhichGroups (void); Grp_WhichGroups_t Grp_GetParWhichGroups (void);
void Grp_DB_RemoveCrsGrps (long CrsCod); void Grp_DB_RemoveCrsGrps (long HieCod);
#endif #endif

View File

@ -1097,7 +1097,7 @@ void Grp_DB_RemUsrFromAllGrps (long UsrCod)
/******************* Remove all users from groups in a course ****************/ /******************* Remove all users from groups in a course ****************/
/*****************************************************************************/ /*****************************************************************************/
void Grp_DB_RemoveUsrsFromGrpsOfCrs (long CrsCod) void Grp_DB_RemoveUsrsFromGrpsOfCrs (long HieCod)
{ {
DB_QueryDELETE ("can not remove users from groups of a course", DB_QueryDELETE ("can not remove users from groups of a course",
"DELETE FROM grp_users" "DELETE FROM grp_users"
@ -1107,7 +1107,7 @@ void Grp_DB_RemoveUsrsFromGrpsOfCrs (long CrsCod)
" WHERE grp_types.CrsCod=%ld" " WHERE grp_types.CrsCod=%ld"
" AND grp_types.GrpTypCod=grp_groups.GrpTypCod" " AND grp_types.GrpTypCod=grp_groups.GrpTypCod"
" AND grp_groups.GrpCod=grp_users.GrpCod", " AND grp_groups.GrpCod=grp_users.GrpCod",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1141,12 +1141,12 @@ void Grp_DB_RemoveUsrsFromGrp (long GrpCod)
/******************** Remove all group types in a course *********************/ /******************** Remove all group types in a course *********************/
/*****************************************************************************/ /*****************************************************************************/
void Grp_DB_RemoveGrpTypesInCrs (long CrsCod) void Grp_DB_RemoveGrpTypesInCrs (long HieCod)
{ {
DB_QueryDELETE ("can not remove types of group of a course", DB_QueryDELETE ("can not remove types of group of a course",
"DELETE FROM grp_types" "DELETE FROM grp_types"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -113,11 +113,11 @@ void Grp_DB_RemoveUsrFromGrp (long UsrCod,long GrpCod);
void Grp_DB_RemUsrFromAllGrpsInCrs (long UsrCod,long CrsCod); void Grp_DB_RemUsrFromAllGrpsInCrs (long UsrCod,long CrsCod);
void Grp_DB_RemUsrFromAllGrps (long UsrCod); void Grp_DB_RemUsrFromAllGrps (long UsrCod);
void Grp_DB_RemoveUsrsFromGrpsOfCrs (long CrsCod); void Grp_DB_RemoveUsrsFromGrpsOfCrs (long HieCod);
void Grp_DB_RemoveUsrsFromGrpsOfType (long GrpTypCod); void Grp_DB_RemoveUsrsFromGrpsOfType (long GrpTypCod);
void Grp_DB_RemoveUsrsFromGrp (long GrpCod); void Grp_DB_RemoveUsrsFromGrp (long GrpCod);
void Grp_DB_RemoveGrpTypesInCrs (long CrsCod); void Grp_DB_RemoveGrpTypesInCrs (long HieCod);
void Grp_DB_RemoveGrpType (long GrpTypCod); void Grp_DB_RemoveGrpType (long GrpTypCod);
void Grp_DB_RemoveGrpsInCrs (long CrsCod); void Grp_DB_RemoveGrpsInCrs (long CrsCod);

View File

@ -69,35 +69,35 @@ long Ins_DB_CreateInstitution (const struct Hie_Node *Ins,Hie_Status_t Status)
/****************** Update country in table of institutions ******************/ /****************** Update country in table of institutions ******************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_UpdateInsCty (long InsCod,long CtyCod) void Ins_DB_UpdateInsCty (long HieCod,long CtyCod)
{ {
DB_QueryUPDATE ("can not update the country of an institution", DB_QueryUPDATE ("can not update the country of an institution",
"UPDATE ins_instits" "UPDATE ins_instits"
" SET CtyCod=%ld" " SET CtyCod=%ld"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
CtyCod, CtyCod,
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/****************** Update status in table of institutions *******************/ /****************** Update status in table of institutions *******************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_UpdateInsStatus (long InsCod,Hie_Status_t Status) void Ins_DB_UpdateInsStatus (long HieCod,Hie_Status_t Status)
{ {
DB_QueryUPDATE ("can not update the status of an institution", DB_QueryUPDATE ("can not update the status of an institution",
"UPDATE ins_instits" "UPDATE ins_instits"
" SET Status=%u" " SET Status=%u"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
(unsigned) Status, (unsigned) Status,
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/*************************** Update institution name *************************/ /*************************** Update institution name *************************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_UpdateInsName (long InsCod,const char *FldName,const char *NewName) void Ins_DB_UpdateInsName (long HieCod,const char *FldName,const char *NewName)
{ {
/***** Update institution changing old name by new name */ /***** Update institution changing old name by new name */
DB_QueryUPDATE ("can not update the name of an institution", DB_QueryUPDATE ("can not update the name of an institution",
@ -105,14 +105,14 @@ void Ins_DB_UpdateInsName (long InsCod,const char *FldName,const char *NewName)
" SET %s='%s'" " SET %s='%s'"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
FldName,NewName, FldName,NewName,
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/**************** Update database changing old WWW by new WWW ****************/ /**************** Update database changing old WWW by new WWW ****************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]) void Ins_DB_UpdateInsWWW (long HieCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1])
{ {
/***** Update database changing old WWW by new WWW *****/ /***** Update database changing old WWW by new WWW *****/
DB_QueryUPDATE ("can not update the web of an institution", DB_QueryUPDATE ("can not update the web of an institution",
@ -120,14 +120,14 @@ void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1])
" SET WWW='%s'" " SET WWW='%s'"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
NewWWW, NewWWW,
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/************************* Get data of an institution ************************/ /************************* Get data of an institution ************************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod) unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get data of an institution", DB_QuerySELECT (mysql_res,"can not get data of an institution",
@ -141,17 +141,17 @@ unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod)
"0 AS NumUsrs" // row[7] (not used) "0 AS NumUsrs" // row[7] (not used)
" FROM ins_instits" " FROM ins_instits"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/*********** Get the short name of an institution from its code **************/ /*********** Get the short name of an institution from its code **************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]) void Ins_DB_GetInsShrtName (long HieCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1])
{ {
/***** Trivial check: institution code should be > 0 *****/ /***** Trivial check: institution code should be > 0 *****/
if (InsCod <= 0) if (HieCod <= 0)
{ {
ShrtName[0] = '\0'; // Empty name ShrtName[0] = '\0'; // Empty name
return; return;
@ -163,7 +163,7 @@ void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME +
"SELECT ShortName" "SELECT ShortName"
" FROM ins_instits" " FROM ins_instits"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -256,7 +256,7 @@ unsigned Ins_DB_GetInsWithPendingCtrsAdminByMe (MYSQL_RES **mysql_res)
/************* Get institutions in country ordered by short name *************/ /************* Get institutions in country ordered by short name *************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ins_DB_GetInssInCtyOrderedByShrtName (MYSQL_RES **mysql_res,long CtyCod) unsigned Ins_DB_GetInssInCtyOrderedByShrtName (MYSQL_RES **mysql_res,long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get institutions", DB_QuerySELECT (mysql_res,"can not get institutions",
@ -266,14 +266,14 @@ unsigned Ins_DB_GetInssInCtyOrderedByShrtName (MYSQL_RES **mysql_res,long CtyCod
" FROM ins_instits" " FROM ins_instits"
" WHERE CtyCod=%ld" " WHERE CtyCod=%ld"
" ORDER BY ShortName", " ORDER BY ShortName",
CtyCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/******* Get basic list of institutions ordered by name of institution *******/ /******* Get basic list of institutions ordered by name of institution *******/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ins_DB_GetInssInCtyOrderedByFullName (MYSQL_RES **mysql_res,long CtyCod) unsigned Ins_DB_GetInssInCtyOrderedByFullName (MYSQL_RES **mysql_res,long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QuerySELECT (mysql_res,"can not get institutions", DB_QuerySELECT (mysql_res,"can not get institutions",
@ -288,7 +288,7 @@ unsigned Ins_DB_GetInssInCtyOrderedByFullName (MYSQL_RES **mysql_res,long CtyCod
" FROM ins_instits" " FROM ins_instits"
" WHERE CtyCod=%ld" " WHERE CtyCod=%ld"
" ORDER BY FullName", " ORDER BY FullName",
CtyCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -296,7 +296,7 @@ unsigned Ins_DB_GetInssInCtyOrderedByFullName (MYSQL_RES **mysql_res,long CtyCod
/************* with number of users who claim to belong to them **************/ /************* with number of users who claim to belong to them **************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ins_DB_GetFullListOfInssInCty (MYSQL_RES **mysql_res,long CtyCod) unsigned Ins_DB_GetFullListOfInssInCty (MYSQL_RES **mysql_res,long HieCod)
{ {
static const char *OrderBySubQuery[Hie_NUM_ORDERS] = static const char *OrderBySubQuery[Hie_NUM_ORDERS] =
{ {
@ -337,8 +337,8 @@ unsigned Ins_DB_GetFullListOfInssInCty (MYSQL_RES **mysql_res,long CtyCod)
"InsCod" "InsCod"
" FROM usr_data))" " FROM usr_data))"
" ORDER BY %s", " ORDER BY %s",
CtyCod, HieCod,
CtyCod, HieCod,
OrderBySubQuery[Gbl.Hierarchy.List[Hie_CTY].SelectedOrder]); OrderBySubQuery[Gbl.Hierarchy.List[Hie_CTY].SelectedOrder]);
} }
@ -643,7 +643,7 @@ unsigned Ins_DB_SearchInss (MYSQL_RES **mysql_res,
/******************* Get number of institutions in system ********************/ /******************* Get number of institutions in system ********************/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ins_DB_GetNumInssInSys (__attribute__((unused)) long SysCod) unsigned Ins_DB_GetNumInssInSys (__attribute__((unused)) long HieCod)
{ {
return (unsigned) DB_GetNumRowsTable ("ins_instits"); return (unsigned) DB_GetNumRowsTable ("ins_instits");
} }
@ -834,24 +834,24 @@ bool Ins_DB_CheckIfUsrBelongsToIns (long UsrCod,long HieCod,
/******** Get number of users who claim to belong to an institution **********/ /******** Get number of users who claim to belong to an institution **********/
/*****************************************************************************/ /*****************************************************************************/
unsigned Ins_DB_GetNumUsrsWhoClaimToBelongToIns (long InsCod) unsigned Ins_DB_GetNumUsrsWhoClaimToBelongToIns (long HieCod)
{ {
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of users", DB_QueryCOUNT ("can not get number of users",
"SELECT COUNT(UsrCod)" "SELECT COUNT(UsrCod)"
" FROM usr_data" " FROM usr_data"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
InsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
/***************************** Remove institution ****************************/ /***************************** Remove institution ****************************/
/*****************************************************************************/ /*****************************************************************************/
void Ins_DB_RemoveInstitution (long InsCod) void Ins_DB_RemoveInstitution (long HieCod)
{ {
DB_QueryDELETE ("can not remove an institution", DB_QueryDELETE ("can not remove an institution",
"DELETE FROM ins_instits" "DELETE FROM ins_instits"
" WHERE InsCod=%ld", " WHERE InsCod=%ld",
InsCod); HieCod);
} }

View File

@ -38,13 +38,13 @@
/*****************************************************************************/ /*****************************************************************************/
long Ins_DB_CreateInstitution (const struct Hie_Node *Ins,Hie_Status_t Status); long Ins_DB_CreateInstitution (const struct Hie_Node *Ins,Hie_Status_t Status);
void Ins_DB_UpdateInsCty (long InsCod,long CtyCod); void Ins_DB_UpdateInsCty (long HieCod,long CtyCod);
void Ins_DB_UpdateInsStatus (long InsCod,Hie_Status_t Status); void Ins_DB_UpdateInsStatus (long HieCod,Hie_Status_t Status);
void Ins_DB_UpdateInsName (long InsCod,const char *FldName,const char *NewName); void Ins_DB_UpdateInsName (long HieCod,const char *FldName,const char *NewName);
void Ins_DB_UpdateInsWWW (long InsCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]); void Ins_DB_UpdateInsWWW (long HieCod,const char NewWWW[Cns_MAX_BYTES_WWW + 1]);
unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long InsCod); unsigned Ins_DB_GetInsDataByCod (MYSQL_RES **mysql_res,long HieCod);
void Ins_DB_GetInsShrtName (long InsCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]); void Ins_DB_GetInsShrtName (long HieCod,char ShrtName[Nam_MAX_BYTES_SHRT_NAME + 1]);
unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod); unsigned Ins_DB_GetInsShrtNameAndCty (MYSQL_RES **mysql_res,long InsCod);
bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName, bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName,
const char *Name, const char *Name,
@ -55,9 +55,9 @@ bool Ins_DB_CheckIfInsNameExistsInCty (const char *FldName,
unsigned Ins_DB_GetAllInsWithPendingCtr (MYSQL_RES **mysql_res); unsigned Ins_DB_GetAllInsWithPendingCtr (MYSQL_RES **mysql_res);
unsigned Ins_DB_GetInsWithPendingCtrsAdminByMe (MYSQL_RES **mysql_res); unsigned Ins_DB_GetInsWithPendingCtrsAdminByMe (MYSQL_RES **mysql_res);
unsigned Ins_DB_GetInssInCtyOrderedByShrtName (MYSQL_RES **mysql_res,long CtyCod); unsigned Ins_DB_GetInssInCtyOrderedByShrtName (MYSQL_RES **mysql_res,long HieCod);
unsigned Ins_DB_GetInssInCtyOrderedByFullName (MYSQL_RES **mysql_res,long CtyCod); unsigned Ins_DB_GetInssInCtyOrderedByFullName (MYSQL_RES **mysql_res,long HieCod);
unsigned Ins_DB_GetFullListOfInssInCty (MYSQL_RES **mysql_res,long CtyCod); unsigned Ins_DB_GetFullListOfInssInCty (MYSQL_RES **mysql_res,long HieCod);
unsigned Ins_DB_GetInssOrderedByNumCtrs (MYSQL_RES **mysql_res); unsigned Ins_DB_GetInssOrderedByNumCtrs (MYSQL_RES **mysql_res);
unsigned Ins_DB_GetInssOrderedByNumDegs (MYSQL_RES **mysql_res); unsigned Ins_DB_GetInssOrderedByNumDegs (MYSQL_RES **mysql_res);
@ -69,7 +69,7 @@ unsigned Ins_DB_SearchInss (MYSQL_RES **mysql_res,
const char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1], const char SearchQuery[Sch_MAX_BYTES_SEARCH_QUERY + 1],
const char *RangeQuery); const char *RangeQuery);
unsigned Ins_DB_GetNumInssInSys (__attribute__((unused)) long SysCod); unsigned Ins_DB_GetNumInssInSys (__attribute__((unused)) long HieCod);
unsigned Ins_DB_GetNumInssInCty (long CtyCod); unsigned Ins_DB_GetNumInssInCty (long CtyCod);
unsigned Ins_DB_GetNumInssWithCtrs (Hie_Level_t Level,long HieCod); unsigned Ins_DB_GetNumInssWithCtrs (Hie_Level_t Level,long HieCod);
@ -81,8 +81,8 @@ unsigned Ins_DB_GetNumInnsWithUsrs (Rol_Role_t Role,
unsigned Ins_DB_GetMyInss (MYSQL_RES **mysql_res,long HieCod); unsigned Ins_DB_GetMyInss (MYSQL_RES **mysql_res,long HieCod);
bool Ins_DB_CheckIfUsrBelongsToIns (long UsrCod,long HieCod, bool Ins_DB_CheckIfUsrBelongsToIns (long UsrCod,long HieCod,
bool CountOnlyAcceptedCourses); bool CountOnlyAcceptedCourses);
unsigned Ins_DB_GetNumUsrsWhoClaimToBelongToIns (long InsCod); unsigned Ins_DB_GetNumUsrsWhoClaimToBelongToIns (long HieCod);
void Ins_DB_RemoveInstitution (long InsCod); void Ins_DB_RemoveInstitution (long HieCod);
#endif #endif

View File

@ -201,23 +201,24 @@ void Log_GetAndShowLastClicks (void)
const char *ClassRow; const char *ClassRow;
time_t TimeDiff; time_t TimeDiff;
struct Hie_Node Hie[Hie_NUM_LEVELS]; struct Hie_Node Hie[Hie_NUM_LEVELS];
Hie_Level_t Level;
/***** Get last clicks from database *****/ /***** Get last clicks from database *****/
NumClicks = Log_DB_GetLastClicks (&mysql_res); NumClicks = Log_DB_GetLastClicks (&mysql_res);
/***** Write list of connected users *****/ /***** Write list of connected users *****/
HTM_TABLE_BeginCenterPadding (1); HTM_TABLE_Begin ("TBL_SCROLL");
/* Heading row */ /* Heading row */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
HTM_TH_Span (Txt_Click ,HTM_HEAD_RIGHT,1,1,"LC_CLK"); // Click HTM_TH_Span (Txt_Click ,HTM_HEAD_RIGHT,1,1,"LC_CLK"); // Click
HTM_TH_Span (Txt_ELAPSED_TIME ,HTM_HEAD_RIGHT,1,1,"LC_TIM"); // Elapsed time HTM_TH_Span (Txt_ELAPSED_TIME ,HTM_HEAD_RIGHT,1,1,"LC_TIM"); // Elapsed time
HTM_TH_Span (Txt_Role ,HTM_HEAD_LEFT ,1,1,"LC_ROL"); // Role HTM_TH_Span (Txt_Role ,HTM_HEAD_LEFT ,1,1,"LC_ROL"); // Role
HTM_TH_Span (Txt_HIERARCHY_SINGUL_Abc[Hie_CTY],HTM_HEAD_LEFT ,1,1,"LC_CTY"); // Country for (Level = Hie_CTY;
HTM_TH_Span (Txt_HIERARCHY_SINGUL_Abc[Hie_INS],HTM_HEAD_LEFT ,1,1,"LC_INS"); // Institution Level <= Hie_DEG;
HTM_TH_Span (Txt_HIERARCHY_SINGUL_Abc[Hie_CTR],HTM_HEAD_LEFT ,1,1,"LC_CTR"); // Center Level++)
HTM_TH_Span (Txt_HIERARCHY_SINGUL_Abc[Hie_DEG],HTM_HEAD_LEFT ,1,1,"LC_DEG"); // Degree HTM_TH_Span (Txt_HIERARCHY_SINGUL_Abc[Level],HTM_HEAD_LEFT ,1,1,"LC_HIE"); // Country, Institution, Center, Degree
HTM_TH_Span (Txt_Action ,HTM_HEAD_LEFT ,1,1,"LC_ACT"); // Action HTM_TH_Span (Txt_Action ,HTM_HEAD_LEFT ,1,1,"LC_ACT"); // Action
HTM_TR_End (); HTM_TR_End ();
for (NumClick = 0; for (NumClick = 0;
@ -254,8 +255,8 @@ void Log_GetAndShowLastClicks (void)
Hie[Hie_CTR].HieCod = Str_ConvertStrCodToLongCod (row[6]); Hie[Hie_CTR].HieCod = Str_ConvertStrCodToLongCod (row[6]);
Hie[Hie_DEG].HieCod = Str_ConvertStrCodToLongCod (row[7]); Hie[Hie_DEG].HieCod = Str_ConvertStrCodToLongCod (row[7]);
Ins_DB_GetInsShrtName (Hie[Hie_INS].HieCod,Hie[Hie_INS].ShrtName); Ins_DB_GetInsShrtName (Hie[Hie_INS].HieCod,Hie[Hie_INS].ShrtName);
Ctr_DB_GetShortNameOfCenterByCod (Hie[Hie_CTR].HieCod,Hie[Hie_CTR].ShrtName); Ctr_DB_GetCtrShrtName (Hie[Hie_CTR].HieCod,Hie[Hie_CTR].ShrtName);
Deg_DB_GetShortNameOfDegreeByCod (Hie[Hie_DEG].HieCod,Hie[Hie_DEG].ShrtName); Deg_DB_GetDegShrtName (Hie[Hie_DEG].HieCod,Hie[Hie_DEG].ShrtName);
/* Print table row */ /* Print table row */
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -275,25 +276,20 @@ void Log_GetAndShowLastClicks (void)
HTM_Txt (Txt_ROLES_SINGUL_Abc[Rol_ConvertUnsignedStrToRole (row[3])][Usr_SEX_UNKNOWN]); // Role HTM_Txt (Txt_ROLES_SINGUL_Abc[Rol_ConvertUnsignedStrToRole (row[3])][Usr_SEX_UNKNOWN]); // Role
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"LC_CTY %s_%s\"", HTM_TD_Begin ("class=\"LC_HIE %s_%s\"",
ClassRow,The_GetSuffix ()); ClassRow,The_GetSuffix ());
HTM_Txt (Hie[Hie_CTY].FullName); // Country HTM_Txt (Hie[Hie_CTY].FullName); // Country
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"LC_INS %s_%s\"", for (Level = Hie_INS;
ClassRow,The_GetSuffix ()); Level <= Hie_DEG;
HTM_Txt (Hie[Hie_INS].ShrtName); // Institution Level++)
HTM_TD_End (); {
HTM_TD_Begin ("class=\"LC_HIE %s_%s\"",
HTM_TD_Begin ("class=\"LC_CTR %s_%s\"", ClassRow,The_GetSuffix ());
ClassRow,The_GetSuffix ()); HTM_Txt (Hie[Level].ShrtName); // Institution, Center, Degree
HTM_Txt (Hie[Hie_CTR].ShrtName); // Center HTM_TD_End ();
HTM_TD_End (); }
HTM_TD_Begin ("class=\"LC_DEG %s_%s\"",
ClassRow,The_GetSuffix ());
HTM_Txt (Hie[Hie_DEG].ShrtName); // Degree
HTM_TD_End ();
HTM_TD_Begin ("class=\"LC_ACT %s_%s\"", HTM_TD_Begin ("class=\"LC_ACT %s_%s\"",
ClassRow,The_GetSuffix ()); ClassRow,The_GetSuffix ());

View File

@ -374,7 +374,7 @@ void Not_DB_RemoveNotice (long NotCod)
/************************* Remove notices in a course ************************/ /************************* Remove notices in a course ************************/
/*****************************************************************************/ /*****************************************************************************/
void Not_DB_RemoveCrsNotices (long CrsCod) void Not_DB_RemoveCrsNotices (long HieCod)
{ {
/***** Copy all notices from the course to table of deleted notices *****/ /***** Copy all notices from the course to table of deleted notices *****/
DB_QueryINSERT ("can not remove notices in a course", DB_QueryINSERT ("can not remove notices in a course",
@ -388,11 +388,11 @@ void Not_DB_RemoveCrsNotices (long CrsCod)
"NumNotif" "NumNotif"
" FROM not_notices" " FROM not_notices"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
/***** Remove all notices from the course *****/ /***** Remove all notices from the course *****/
DB_QueryDELETE ("can not remove notices in a course", DB_QueryDELETE ("can not remove notices in a course",
"DELETE FROM not_notices" "DELETE FROM not_notices"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }

View File

@ -49,6 +49,6 @@ unsigned Not_DB_GetNumNoticesDeleted (MYSQL_RES **mysql_res,
Hie_Level_t Level); Hie_Level_t Level);
void Not_DB_RemoveNotice (long NotCod); void Not_DB_RemoveNotice (long NotCod);
void Not_DB_RemoveCrsNotices (long CrsCod); void Not_DB_RemoveCrsNotices (long HieCod);
#endif #endif

View File

@ -3372,7 +3372,7 @@ void Prj_GetProjectDataByCod (struct Prj_Project *Prj)
code of the course (row[1]) code of the course (row[1])
and code of the department (row[2]) */ and code of the department (row[2]) */
Prj->PrjCod = Str_ConvertStrCodToLongCod (row[0]); Prj->PrjCod = Str_ConvertStrCodToLongCod (row[0]);
Prj->CrsCod = Str_ConvertStrCodToLongCod (row[1]); Prj->HieCod = Str_ConvertStrCodToLongCod (row[1]);
Prj->DptCod = Str_ConvertStrCodToLongCod (row[2]); Prj->DptCod = Str_ConvertStrCodToLongCod (row[2]);
/* Get whether the project is locked or not (row[3]), /* Get whether the project is locked or not (row[3]),
@ -3445,7 +3445,7 @@ static void Prj_ResetProject (struct Prj_Project *Prj)
{ {
if (Prj->PrjCod <= 0) // If > 0 ==> keep value if (Prj->PrjCod <= 0) // If > 0 ==> keep value
Prj->PrjCod = -1L; Prj->PrjCod = -1L;
Prj->CrsCod = -1L; Prj->HieCod = -1L;
Prj->Locked = Prj_UNLOCKED; Prj->Locked = Prj_UNLOCKED;
Prj->Hidden = Prj_NEW_PRJ_HIDDEN_VISIBL_DEFAULT; Prj->Hidden = Prj_NEW_PRJ_HIDDEN_VISIBL_DEFAULT;
Prj->Assigned = Prj_NEW_PRJ_ASSIGNED_NONASSIG_DEFAULT; Prj->Assigned = Prj_NEW_PRJ_ASSIGNED_NONASSIG_DEFAULT;
@ -3561,7 +3561,7 @@ void Prj_RemoveProject (void)
/***** Remove directory of the project *****/ /***** Remove directory of the project *****/
snprintf (PathRelPrj,sizeof (PathRelPrj),"%s/%ld/%s/%02u/%ld", snprintf (PathRelPrj,sizeof (PathRelPrj),"%s/%ld/%s/%02u/%ld",
Cfg_PATH_CRS_PRIVATE,Projects.Prj.CrsCod,Cfg_FOLDER_PRJ, Cfg_PATH_CRS_PRIVATE,Projects.Prj.HieCod,Cfg_FOLDER_PRJ,
(unsigned) (Projects.Prj.PrjCod % 100),Projects.Prj.PrjCod); (unsigned) (Projects.Prj.PrjCod % 100),Projects.Prj.PrjCod);
Fil_RemoveTree (PathRelPrj); Fil_RemoveTree (PathRelPrj);

View File

@ -153,8 +153,8 @@ typedef enum
/***** Struct to store a project *****/ /***** Struct to store a project *****/
struct Prj_Project struct Prj_Project
{ {
long PrjCod; long PrjCod; // Project code
long CrsCod; long HieCod; // Course code
Prj_Locked_t Locked; Prj_Locked_t Locked;
HidVis_HiddenOrVisible_t Hidden; HidVis_HiddenOrVisible_t Hidden;
Prj_AssignedNonassig_t Assigned; Prj_AssignedNonassig_t Assigned;

View File

@ -102,7 +102,7 @@ void Rub_RubricConstructor (struct Rub_Rubric *Rubric)
{ {
/***** Initialize to empty rubric *****/ /***** Initialize to empty rubric *****/
Rubric->RubCod = -1L; Rubric->RubCod = -1L;
Rubric->CrsCod = -1L; Rubric->HieCod = -1L; // Course code
Rubric->UsrCod = -1L; Rubric->UsrCod = -1L;
Rubric->Title[0] = '\0'; Rubric->Title[0] = '\0';
@ -595,7 +595,7 @@ void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric)
/* Get code of the rubric (row[0]), course (row[1] and author (row[2]) */ /* Get code of the rubric (row[0]), course (row[1] and author (row[2]) */
Rubric->RubCod = Str_ConvertStrCodToLongCod (row[0]); Rubric->RubCod = Str_ConvertStrCodToLongCod (row[0]);
Rubric->CrsCod = Str_ConvertStrCodToLongCod (row[1]); Rubric->HieCod = Str_ConvertStrCodToLongCod (row[1]);
Rubric->UsrCod = Str_ConvertStrCodToLongCod (row[2]); Rubric->UsrCod = Str_ConvertStrCodToLongCod (row[2]);
/* Get the title of the rubric (row[3]) */ /* Get the title of the rubric (row[3]) */
@ -608,7 +608,7 @@ void Rub_GetRubricDataByCod (struct Rub_Rubric *Rubric)
{ {
/***** Initialize to empty rubric *****/ /***** Initialize to empty rubric *****/
Rubric->RubCod = -1L; Rubric->RubCod = -1L;
Rubric->CrsCod = -1L; Rubric->HieCod = -1L;
Rubric->UsrCod = -1L; Rubric->UsrCod = -1L;
Rubric->Title[0] = '\0'; Rubric->Title[0] = '\0';
Rubric->Txt[0] = '\0'; Rubric->Txt[0] = '\0';

View File

@ -1514,7 +1514,7 @@ static void RubCri_GetAndCheckRubricAndCriterion (struct Rub_Rubrics *Rubrics)
/***** Get rubric data from database *****/ /***** Get rubric data from database *****/
Rub_GetRubricDataByCod (&Rubrics->Rubric); Rub_GetRubricDataByCod (&Rubrics->Rubric);
if (Rubrics->Rubric.CrsCod != Gbl.Hierarchy.Node[Hie_CRS].HieCod) if (Rubrics->Rubric.HieCod != Gbl.Hierarchy.Node[Hie_CRS].HieCod)
Err_WrongRubricExit (); Err_WrongRubricExit ();
/***** Get criterion data from database *****/ /***** Get criterion data from database *****/

View File

@ -54,7 +54,7 @@ typedef enum
struct Rub_Rubric struct Rub_Rubric
{ {
long RubCod; // Rubric code long RubCod; // Rubric code
long CrsCod; // Course code long HieCod; // Course code
long UsrCod; // Author code long UsrCod; // Author code
char Title[Rub_MAX_BYTES_TITLE + 1]; // Title char Title[Rub_MAX_BYTES_TITLE + 1]; // Title
char *Txt; // Text (dynamically allocated) char *Txt; // Text (dynamically allocated)

View File

@ -240,7 +240,7 @@ unsigned Set_DB_GetMyLanguage (MYSQL_RES **mysql_res)
/************ Register last prefs in current course in database **************/ /************ Register last prefs in current course in database **************/
/*****************************************************************************/ /*****************************************************************************/
void Set_DB_InsertUsrInCrsSettings (long UsrCod,long CrsCod) void Set_DB_InsertUsrInCrsSettings (long UsrCod,long HieCod)
{ {
DB_QueryINSERT ("can not register user in course", DB_QueryINSERT ("can not register user in course",
"INSERT INTO crs_user_settings" "INSERT INTO crs_user_settings"
@ -254,7 +254,7 @@ void Set_DB_InsertUsrInCrsSettings (long UsrCod,long CrsCod)
"0,FROM_UNIXTIME(%ld),0," "0,FROM_UNIXTIME(%ld),0,"
"'%s',%u,'%c')", "'%s',%u,'%c')",
UsrCod, UsrCod,
CrsCod, HieCod,
(long) (time_t) 0, // The user never accessed to tests in this course (long) (time_t) 0, // The user never accessed to tests in this course
Set_DB_StringsUsrListTypes[Set_SHOW_USRS_TYPE_DEFAULT], Set_DB_StringsUsrListTypes[Set_SHOW_USRS_TYPE_DEFAULT],
Usr_CLASS_PHOTO_COLS_DEF, Usr_CLASS_PHOTO_COLS_DEF,
@ -386,14 +386,14 @@ unsigned Set_DB_GetMyPrefAboutListWithPhotosPhoto (MYSQL_RES **mysql_res)
/****************** Remove a user from a courses setting *********************/ /****************** Remove a user from a courses setting *********************/
/*****************************************************************************/ /*****************************************************************************/
void Set_DB_RemUsrFromCrsSettings (long UsrCod,long CrsCod) void Set_DB_RemUsrFromCrsSettings (long UsrCod,long HieCod)
{ {
DB_QueryDELETE ("can not remove a user from a course", DB_QueryDELETE ("can not remove a user from a course",
"DELETE FROM crs_user_settings" "DELETE FROM crs_user_settings"
" WHERE UsrCod=%ld" " WHERE UsrCod=%ld"
" AND CrsCod=%ld", " AND CrsCod=%ld",
UsrCod, UsrCod,
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -412,12 +412,12 @@ void Set_DB_RemUsrFromAllCrssSettings (long UsrCod)
/*************** Remove all users from settings in a course ******************/ /*************** Remove all users from settings in a course ******************/
/*****************************************************************************/ /*****************************************************************************/
void Set_DB_RemAllUsrsFromCrsSettings (long CrsCod) void Set_DB_RemAllUsrsFromCrsSettings (long HieCod)
{ {
DB_QueryDELETE ("can not remove users from a course settings", DB_QueryDELETE ("can not remove users from a course settings",
"DELETE FROM crs_user_settings" "DELETE FROM crs_user_settings"
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); HieCod);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -44,7 +44,7 @@ void Set_DB_UpdateMySettingsAboutNotifyEvents (void);
unsigned Set_DB_GetMyLanguage (MYSQL_RES **mysql_res); unsigned Set_DB_GetMyLanguage (MYSQL_RES **mysql_res);
//-------------------- User settings in the current course -------------------- //-------------------- User settings in the current course --------------------
void Set_DB_InsertUsrInCrsSettings (long UsrCod,long CrsCod); void Set_DB_InsertUsrInCrsSettings (long UsrCod,long HieCod);
void Set_DB_UpdateGrpMyLastAccZone (const char *FieldNameDB,long GrpCod); void Set_DB_UpdateGrpMyLastAccZone (const char *FieldNameDB,long GrpCod);
void Set_DB_UpdateMyUsrListType (void); void Set_DB_UpdateMyUsrListType (void);
@ -55,9 +55,9 @@ unsigned Set_DB_GetMyUsrListType (MYSQL_RES **mysql_res);
unsigned Set_DB_GetMyColsClassPhoto (MYSQL_RES **mysql_res); unsigned Set_DB_GetMyColsClassPhoto (MYSQL_RES **mysql_res);
unsigned Set_DB_GetMyPrefAboutListWithPhotosPhoto (MYSQL_RES **mysql_res); unsigned Set_DB_GetMyPrefAboutListWithPhotosPhoto (MYSQL_RES **mysql_res);
void Set_DB_RemUsrFromCrsSettings (long UsrCod,long CrsCod); void Set_DB_RemUsrFromCrsSettings (long UsrCod,long HieCod);
void Set_DB_RemUsrFromAllCrssSettings (long UsrCod); void Set_DB_RemUsrFromAllCrssSettings (long UsrCod);
void Set_DB_RemAllUsrsFromCrsSettings (long CrsCod); void Set_DB_RemAllUsrsFromCrsSettings (long HieCod);
//------------------- IP settings (when no user logged) ----------------------- //------------------- IP settings (when no user logged) -----------------------
void Set_DB_UpdateMyIPSettingsForCurrentIP (void); void Set_DB_UpdateMyIPSettingsForCurrentIP (void);

View File

@ -18689,7 +18689,7 @@ const char *Txt_Last_clicks_in_real_time =
#elif L==9 // pt #elif L==9 // pt
"&Uacute;ltimos cliques em tempo real"; "&Uacute;ltimos cliques em tempo real";
#elif L==10 // tr #elif L==10 // tr
"Last clicks in real time"; // Çeviri lazim! "Ger&ccedil;ek zamanl&inodot; son t&inodot;klamalar";
#endif #endif
const char *Txt_Latitude = const char *Txt_Latitude =