mirror of https://github.com/acanas/swad-core.git
Version 23.4: Sep 15, 2023 Code refactoring in hierarchy.
This commit is contained in:
parent
304be2889e
commit
89d098a4a0
|
@ -8796,32 +8796,32 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
|||
case Brw_ADMI_DOC_INS:
|
||||
case Brw_ADMI_SHR_INS:
|
||||
/* Cod stores the institution code */
|
||||
*GrpCod = -1L;
|
||||
*CrsCod = -1L;
|
||||
*DegCod = -1L;
|
||||
*GrpCod =
|
||||
*CrsCod =
|
||||
*DegCod =
|
||||
*CtrCod = -1L;
|
||||
*InsCod = Cod;
|
||||
break;
|
||||
case Brw_ADMI_DOC_CTR:
|
||||
case Brw_ADMI_SHR_CTR:
|
||||
/* Cod stores the center code */
|
||||
*GrpCod = -1L;
|
||||
*CrsCod = -1L;
|
||||
*GrpCod =
|
||||
*CrsCod =
|
||||
*DegCod = -1L;
|
||||
*CtrCod = Ctr.Cod = Cod;
|
||||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
*InsCod = Ctr.InsCod;
|
||||
*InsCod = Ctr.PrtCod;
|
||||
break;
|
||||
case Brw_ADMI_DOC_DEG:
|
||||
case Brw_ADMI_SHR_DEG:
|
||||
/* Cod stores the degree code */
|
||||
*GrpCod = -1L;
|
||||
*GrpCod =
|
||||
*CrsCod = -1L;
|
||||
*DegCod = Deg.Cod = Cod;
|
||||
Deg_GetDegreeDataByCod (&Deg);
|
||||
*CtrCod = Ctr.Cod = Deg.CtrCod;
|
||||
*CtrCod = Ctr.Cod = Deg.PrtCod;
|
||||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
*InsCod = Ctr.InsCod;
|
||||
*InsCod = Ctr.PrtCod;
|
||||
break;
|
||||
case Brw_ADMI_DOC_CRS:
|
||||
case Brw_ADMI_TCH_CRS:
|
||||
|
@ -8833,11 +8833,11 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
|||
*GrpCod = -1L;
|
||||
*CrsCod = Crs.Cod = Cod;
|
||||
Crs_GetCourseDataByCod (&Crs);
|
||||
*DegCod = Deg.Cod = Crs.DegCod;
|
||||
*DegCod = Deg.Cod = Crs.PrtCod;
|
||||
Deg_GetDegreeDataByCod (&Deg);
|
||||
*CtrCod = Ctr.Cod = Deg.CtrCod;
|
||||
*CtrCod = Ctr.Cod = Deg.PrtCod;
|
||||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
*InsCod = Ctr.InsCod;
|
||||
*InsCod = Ctr.PrtCod;
|
||||
break;
|
||||
case Brw_ADMI_DOC_GRP:
|
||||
case Brw_ADMI_TCH_GRP:
|
||||
|
@ -8848,11 +8848,11 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
|||
Grp_GetGroupDataByCod (&GrpDat);
|
||||
*CrsCod = Crs.Cod = GrpDat.CrsCod;
|
||||
Crs_GetCourseDataByCod (&Crs);
|
||||
*DegCod = Deg.Cod = Crs.DegCod;
|
||||
*DegCod = Deg.Cod = Crs.PrtCod;
|
||||
Deg_GetDegreeDataByCod (&Deg);
|
||||
*CtrCod = Ctr.Cod = Deg.CtrCod;
|
||||
*CtrCod = Ctr.Cod = Deg.PrtCod;
|
||||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
*InsCod = Ctr.InsCod;
|
||||
*InsCod = Ctr.PrtCod;
|
||||
break;
|
||||
case Brw_ADMI_DOC_PRJ:
|
||||
case Brw_ADMI_ASS_PRJ:
|
||||
|
@ -8860,17 +8860,17 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
|||
*GrpCod = -1L;
|
||||
*CrsCod = Crs.Cod = Prj_DB_GetCrsOfPrj (Cod);
|
||||
Crs_GetCourseDataByCod (&Crs);
|
||||
*DegCod = Deg.Cod = Crs.DegCod;
|
||||
*DegCod = Deg.Cod = Crs.PrtCod;
|
||||
Deg_GetDegreeDataByCod (&Deg);
|
||||
*CtrCod = Ctr.Cod = Deg.CtrCod;
|
||||
*CtrCod = Ctr.Cod = Deg.PrtCod;
|
||||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
*InsCod = Ctr.InsCod;
|
||||
*InsCod = Ctr.PrtCod;
|
||||
break;
|
||||
default:
|
||||
*GrpCod = -1L;
|
||||
*CrsCod = -1L;
|
||||
*DegCod = -1L;
|
||||
*CtrCod = -1L;
|
||||
*GrpCod =
|
||||
*CrsCod =
|
||||
*DegCod =
|
||||
*CtrCod =
|
||||
*InsCod = -1L;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1616,7 +1616,7 @@ static void Cfe_GetNotifContentCallForExam (const struct Cfe_CallsForExams *Call
|
|||
Crs_GetCourseDataByCod (&Hie.Crs);
|
||||
|
||||
/***** Get data of degree *****/
|
||||
Hie.Deg.Cod = Hie.Crs.DegCod;
|
||||
Hie.Deg.Cod = Hie.Crs.PrtCod;
|
||||
Deg_GetDegreeDataByCod (&Hie.Deg);
|
||||
|
||||
/***** Get data of institution *****/
|
||||
|
|
|
@ -551,7 +551,7 @@ bool Ctr_GetCenterDataByCod (struct Ctr_Center *Ctr)
|
|||
bool CtrFound = false;
|
||||
|
||||
/***** Clear data *****/
|
||||
Ctr->InsCod = -1L;
|
||||
Ctr->PrtCod = -1L;
|
||||
Ctr->PlcCod = -1L;
|
||||
Ctr->Status = (Hie_Status_t) 0;
|
||||
Ctr->RequesterUsrCod = -1L;
|
||||
|
@ -599,7 +599,7 @@ static void Ctr_GetCenterDataFromRow (MYSQL_RES *mysql_res,
|
|||
Err_WrongCenterExit ();
|
||||
|
||||
/***** Get institution code (row[1]) *****/
|
||||
Ctr->InsCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Ctr->PrtCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
|
||||
/***** Get place code (row[2]) *****/
|
||||
Ctr->PlcCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
|
@ -1492,7 +1492,7 @@ static void Ctr_ReceiveFormRequestOrCreateCtr (Hie_Status_t Status)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Set center institution */
|
||||
Ctr_EditingCtr->InsCod = Gbl.Hierarchy.Ins.Cod;
|
||||
Ctr_EditingCtr->PrtCod = Gbl.Hierarchy.Ins.Cod;
|
||||
|
||||
/* Get place */
|
||||
Ctr_EditingCtr->PlcCod = ParCod_GetAndCheckParMin (ParCod_Plc,0); // 0 (another place) is allowed here
|
||||
|
@ -1840,7 +1840,7 @@ static void Ctr_EditingCenterConstructor (void)
|
|||
|
||||
/***** Reset center *****/
|
||||
Ctr_EditingCtr->Cod = -1L;
|
||||
Ctr_EditingCtr->InsCod = -1L;
|
||||
Ctr_EditingCtr->PrtCod = -1L;
|
||||
Ctr_EditingCtr->PlcCod = -1L;
|
||||
Ctr_EditingCtr->Status = (Hie_Status_t) 0;
|
||||
Ctr_EditingCtr->RequesterUsrCod = -1L;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
struct Ctr_Center
|
||||
{
|
||||
long Cod; // Center code
|
||||
long InsCod; // Institution code
|
||||
long PrtCod; // Parent (institution) code
|
||||
long PlcCod; // Place code
|
||||
Hie_Status_t Status; // Center status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this center
|
||||
|
|
|
@ -1031,7 +1031,7 @@ void CtrCfg_ChangeCtrIns (void)
|
|||
NewIns.Cod = ParCod_GetAndCheckPar (ParCod_OthIns);
|
||||
|
||||
/***** Check if institution has changed *****/
|
||||
if (NewIns.Cod != Gbl.Hierarchy.Ctr.InsCod)
|
||||
if (NewIns.Cod != Gbl.Hierarchy.Ctr.PrtCod)
|
||||
{
|
||||
/***** Get data of new institution *****/
|
||||
Ins_GetInstitDataByCod (&NewIns);
|
||||
|
@ -1057,7 +1057,7 @@ void CtrCfg_ChangeCtrIns (void)
|
|||
{
|
||||
/***** Update institution in table of centers *****/
|
||||
Ctr_DB_UpdateCtrIns (Gbl.Hierarchy.Ctr.Cod,NewIns.Cod);
|
||||
Gbl.Hierarchy.Ctr.InsCod =
|
||||
Gbl.Hierarchy.Ctr.PrtCod =
|
||||
Gbl.Hierarchy.Ins.Cod = NewIns.Cod;
|
||||
|
||||
/***** Initialize again current course, degree, center... *****/
|
||||
|
|
|
@ -59,7 +59,7 @@ long Ctr_DB_CreateCenter (const struct Ctr_Center *Ctr,Hie_Status_t Status)
|
|||
" VALUES"
|
||||
" (%ld,%ld,%u,%ld,"
|
||||
"'%s','%s','%s','')",
|
||||
Ctr->InsCod,
|
||||
Ctr->PrtCod,
|
||||
Ctr->PlcCod,
|
||||
(unsigned) Status,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
|
|
|
@ -632,10 +632,11 @@ TODO: Francisco Javier Fern
|
|||
Me sale este error, no sé si por no recordar yo la sintaxis apropiada para mandar a varios destinatarios. ¿No era así?
|
||||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.3 (2023-09-14)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.4 (2023-09-15)"
|
||||
#define CSS_FILE "swad22.120.4.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 23.4: Sep 15, 2023 Code refactoring in hierarchy. (337618 lines)
|
||||
Version 23.3: Sep 14, 2023 Buttons to close browser tab in matches are replaced because they no longer work in Firefox. (337618 lines)
|
||||
Version 23.2: Sep 14, 2023 Code refactoring in hierarchy. (337604 lines)
|
||||
Version 23.1: Sep 14, 2023 Fixed bugs in listing of users. (337600 lines)
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
struct Cty_Countr
|
||||
{
|
||||
long Cod;
|
||||
long Cod; // Country code
|
||||
char Alpha2[2 + 1];
|
||||
char Name[1 + Lan_NUM_LANGUAGES][Cty_MAX_BYTES_NAME + 1];
|
||||
char WWW [1 + Lan_NUM_LANGUAGES][Cns_MAX_BYTES_WWW + 1];
|
||||
|
|
|
@ -292,7 +292,7 @@ static void CtyCfg_Map (void)
|
|||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
|
||||
/* Get data of institution */
|
||||
Ins.Cod = Ctr.InsCod;
|
||||
Ins.Cod = Ctr.PrtCod;
|
||||
Ins_GetInstitDataByCod (&Ins);
|
||||
|
||||
/* Add marker */
|
||||
|
|
|
@ -643,7 +643,7 @@ void Crs_WriteSelectorOfCourse (void)
|
|||
/***** Initial disabled option *****/
|
||||
HTM_OPTION (HTM_Type_STRING,"",
|
||||
Gbl.Hierarchy.Crs.Cod < 0 ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_DISABLED,
|
||||
"[%s]",Txt_Course);
|
||||
|
||||
|
@ -666,7 +666,7 @@ void Crs_WriteSelectorOfCourse (void)
|
|||
HTM_OPTION (HTM_Type_LONG,&CrsCod,
|
||||
Gbl.Hierarchy.Level == HieLvl_CRS && // Course selected
|
||||
CrsCod == Gbl.Hierarchy.Crs.Cod ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_ENABLED,
|
||||
"%s",row[1]); // Short name (row[1])
|
||||
}
|
||||
|
@ -807,7 +807,7 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void)
|
|||
|
||||
HTM_OPTION (HTM_Type_LONG,&CrsCod,
|
||||
CrsCod == Gbl.Hierarchy.Crs.Cod ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_ENABLED,
|
||||
"%s",CrsShortName);
|
||||
}
|
||||
|
@ -942,7 +942,7 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year)
|
|||
|
||||
/* Check if this course is one of my courses */
|
||||
BgColor = (Enr_CheckIfIBelongToCrs (Crs->Cod)) ? "BG_HIGHLIGHT" :
|
||||
The_GetColorRows ();
|
||||
The_GetColorRows ();
|
||||
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
|
@ -1369,8 +1369,7 @@ static void Crs_PutFormToCreateCourse (void)
|
|||
HTM_TD_End ();
|
||||
|
||||
/***** Course requester *****/
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",
|
||||
The_GetSuffix ());
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"",The_GetSuffix ());
|
||||
Usr_WriteAuthor (&Gbl.Usrs.Me.UsrDat,Cns_ENABLED);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -1481,7 +1480,7 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
|
|||
/***** Get parameters from form *****/
|
||||
/* Set course degree */
|
||||
// Deg.DegCod =
|
||||
Crs_EditingCrs->DegCod = Gbl.Hierarchy.Deg.Cod;
|
||||
Crs_EditingCrs->PrtCod = Gbl.Hierarchy.Deg.Cod;
|
||||
|
||||
/* Get parameters of the new course */
|
||||
Crs_GetParsNewCourse (Crs_EditingCrs);
|
||||
|
@ -1494,12 +1493,12 @@ static void Crs_ReceiveFormRequestOrCreateCrs (Hie_Status_t Status)
|
|||
{
|
||||
/***** If name of course was in database... *****/
|
||||
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Crs_EditingCrs->ShrtName,
|
||||
-1L,Crs_EditingCrs->DegCod,Crs_EditingCrs->Year))
|
||||
-1L,Crs_EditingCrs->PrtCod,Crs_EditingCrs->Year))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists,
|
||||
Crs_EditingCrs->ShrtName);
|
||||
else if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("FullName",Crs_EditingCrs->FullName,
|
||||
-1L,Crs_EditingCrs->DegCod,Crs_EditingCrs->Year))
|
||||
-1L,Crs_EditingCrs->PrtCod,Crs_EditingCrs->Year))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists,
|
||||
Crs_EditingCrs->FullName);
|
||||
|
@ -1593,8 +1592,8 @@ bool Crs_GetCourseDataByCod (struct Crs_Course *Crs)
|
|||
bool CrsFound = false;
|
||||
|
||||
/***** Clear data *****/
|
||||
Crs->DegCod = -1L;
|
||||
Crs->Year = 0;
|
||||
Crs->PrtCod = -1L;
|
||||
Crs->Year = 0;
|
||||
Crs->Status = (Hie_Status_t) 0;
|
||||
Crs->RequesterUsrCod = -1L;
|
||||
Crs->ShrtName[0] = '\0';
|
||||
|
@ -1637,7 +1636,7 @@ static void Crs_GetCourseDataFromRow (MYSQL_RES *mysql_res,
|
|||
Err_WrongCourseExit ();
|
||||
|
||||
/***** Get code of degree (row[1]) *****/
|
||||
Crs->DegCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Crs->PrtCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
|
||||
/***** Get year (row[2]) *****/
|
||||
Crs->Year = Deg_ConvStrToYear (row[2]);
|
||||
|
@ -1852,13 +1851,13 @@ void Crs_ChangeCrsYear (void)
|
|||
{
|
||||
/***** If name of course was in database in the new year... *****/
|
||||
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Crs_EditingCrs->ShrtName,
|
||||
-1L,Crs_EditingCrs->DegCod,NewYear))
|
||||
-1L,Crs_EditingCrs->PrtCod,NewYear))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists_in_year_Y,
|
||||
Crs_EditingCrs->ShrtName,
|
||||
Txt_YEAR_OF_DEGREE[NewYear]);
|
||||
else if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("FullName",Crs_EditingCrs->FullName,
|
||||
-1L,Crs_EditingCrs->DegCod,NewYear))
|
||||
-1L,Crs_EditingCrs->PrtCod,NewYear))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists_in_year_Y,
|
||||
Crs_EditingCrs->FullName,
|
||||
|
@ -1981,7 +1980,7 @@ void Crs_RenameCourse (struct Crs_Course *Crs,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
{
|
||||
/***** If course was in database... *****/
|
||||
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg (ParName,NewCrsName,Crs->Cod,
|
||||
Crs->DegCod,Crs->Year))
|
||||
Crs->PrtCod,Crs->Year))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists,
|
||||
NewCrsName);
|
||||
|
@ -2612,9 +2611,9 @@ static void Crs_EditingCourseConstructor (void)
|
|||
Err_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Reset course *****/
|
||||
Crs_EditingCrs->Cod = -1L;
|
||||
Crs_EditingCrs->Cod = -1L;
|
||||
Crs_EditingCrs->PrtCod = -1L;
|
||||
Crs_EditingCrs->InstitutionalCod[0] = '\0';
|
||||
Crs_EditingCrs->DegCod = -1L;
|
||||
Crs_EditingCrs->Year = 0;
|
||||
Crs_EditingCrs->Status = 0;
|
||||
Crs_EditingCrs->ShrtName[0] = '\0';
|
||||
|
|
|
@ -54,9 +54,9 @@
|
|||
|
||||
struct Crs_Course
|
||||
{
|
||||
long Cod;
|
||||
long Cod; // Course code
|
||||
long PrtCod; // Parent (degree) code
|
||||
char InstitutionalCod[Crs_MAX_BYTES_INSTITUTIONAL_COD + 1]; // Institutional code of the course
|
||||
long DegCod;
|
||||
unsigned Year; // Year: 0 (optatives), 1, 2, 3...
|
||||
Hie_Status_t Status; // Course status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this course
|
||||
|
|
|
@ -484,7 +484,7 @@ void CrsCfg_ChangeCrsDeg (void)
|
|||
NewDeg.Cod = ParCod_GetAndCheckPar (ParCod_OthDeg);
|
||||
|
||||
/***** Check if degree has changed *****/
|
||||
if (NewDeg.Cod != Gbl.Hierarchy.Crs.DegCod)
|
||||
if (NewDeg.Cod != Gbl.Hierarchy.Crs.PrtCod)
|
||||
{
|
||||
/***** Get data of new degree *****/
|
||||
Deg_GetDegreeDataByCod (&NewDeg);
|
||||
|
@ -508,7 +508,7 @@ void CrsCfg_ChangeCrsDeg (void)
|
|||
{
|
||||
/***** Update degree in table of courses *****/
|
||||
Crs_DB_UpdateCrsDeg (Gbl.Hierarchy.Crs.Cod,NewDeg.Cod);
|
||||
Gbl.Hierarchy.Crs.DegCod =
|
||||
Gbl.Hierarchy.Crs.PrtCod =
|
||||
Gbl.Hierarchy.Deg.Cod = NewDeg.Cod;
|
||||
|
||||
/***** Initialize again current course, degree, center... *****/
|
||||
|
@ -558,13 +558,13 @@ void CrsCfg_ChangeCrsYear (void)
|
|||
{
|
||||
/***** If name of course was in database in the new year... *****/
|
||||
if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.Hierarchy.Crs.ShrtName,-1L,
|
||||
Gbl.Hierarchy.Crs.DegCod,NewYear))
|
||||
Gbl.Hierarchy.Crs.PrtCod,NewYear))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists_in_year_Y,
|
||||
Gbl.Hierarchy.Crs.ShrtName,
|
||||
Txt_YEAR_OF_DEGREE[NewYear]);
|
||||
else if (Crs_DB_CheckIfCrsNameExistsInYearOfDeg ("FullName",Gbl.Hierarchy.Crs.FullName,-1L,
|
||||
Gbl.Hierarchy.Crs.DegCod,NewYear))
|
||||
Gbl.Hierarchy.Crs.PrtCod,NewYear))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_course_X_already_exists_in_year_Y,
|
||||
Gbl.Hierarchy.Crs.FullName,
|
||||
|
|
|
@ -58,7 +58,7 @@ void Crs_DB_CreateCourse (struct Crs_Course *Crs,Hie_Status_t Status)
|
|||
" VALUES"
|
||||
" (%ld,%u,'%s',%u,%ld,"
|
||||
"'%s','%s')",
|
||||
Crs->DegCod,
|
||||
Crs->PrtCod,
|
||||
Crs->Year,
|
||||
Crs->InstitutionalCod,
|
||||
(unsigned) Status,
|
||||
|
|
|
@ -418,7 +418,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
{
|
||||
DegTypInLst = &DegTypes->Lst[NumDegTyp];
|
||||
HTM_OPTION (HTM_Type_LONG,&DegTypInLst->DegTypCod,
|
||||
DegTypInLst->DegTypCod == DegInLst->DegTypCod ? HTM_OPTION_SELECTED :
|
||||
DegTypInLst->DegTypCod == DegInLst->TypCod ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_ENABLED,
|
||||
"%s",DegTypInLst->DegTypName);
|
||||
|
@ -432,7 +432,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
|
|||
NumDegTyp++)
|
||||
{
|
||||
DegTypInLst = &DegTypes->Lst[NumDegTyp];
|
||||
if (DegTypInLst->DegTypCod == DegInLst->DegTypCod)
|
||||
if (DegTypInLst->DegTypCod == DegInLst->TypCod)
|
||||
HTM_Txt (DegTypInLst->DegTypName);
|
||||
}
|
||||
HTM_TD_End ();
|
||||
|
@ -579,7 +579,7 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
|
|||
{
|
||||
DegTypInLst = &DegTypes->Lst[NumDegTyp];
|
||||
HTM_OPTION (HTM_Type_LONG,&DegTypInLst->DegTypCod,
|
||||
DegTypInLst->DegTypCod == Deg_EditingDeg->DegTypCod ? HTM_OPTION_SELECTED :
|
||||
DegTypInLst->DegTypCod == Deg_EditingDeg->TypCod ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_ENABLED,
|
||||
"%s",DegTypInLst->DegTypName);
|
||||
|
@ -788,7 +788,7 @@ static void Deg_ListOneDegreeForSeeing (struct Deg_Degree *Deg,unsigned NumDeg)
|
|||
unsigned NumCrss = Crs_GetCachedNumCrssInDeg (Deg->Cod);
|
||||
|
||||
/***** Get data of type of degree of this degree *****/
|
||||
DegTyp.DegTypCod = Deg->DegTypCod;
|
||||
DegTyp.DegTypCod = Deg->TypCod;
|
||||
if (!DegTyp_GetDegreeTypeDataByCod (&DegTyp))
|
||||
Err_WrongDegTypExit ();
|
||||
|
||||
|
@ -1062,14 +1062,14 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Set degree center */
|
||||
Deg_EditingDeg->CtrCod = Gbl.Hierarchy.Ctr.Cod;
|
||||
Deg_EditingDeg->PrtCod = Gbl.Hierarchy.Ctr.Cod;
|
||||
|
||||
/* Get degree short name and full name */
|
||||
Par_GetParText ("ShortName",Deg_EditingDeg->ShrtName,Cns_HIERARCHY_MAX_BYTES_SHRT_NAME);
|
||||
Par_GetParText ("FullName" ,Deg_EditingDeg->FullName,Cns_HIERARCHY_MAX_BYTES_FULL_NAME);
|
||||
|
||||
/* Get degree type */
|
||||
Deg_EditingDeg->DegTypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp);
|
||||
Deg_EditingDeg->TypCod = ParCod_GetAndCheckPar (ParCod_OthDegTyp);
|
||||
|
||||
/* Get degree WWW */
|
||||
Par_GetParText ("WWW",Deg_EditingDeg->WWW,Cns_MAX_BYTES_WWW);
|
||||
|
@ -1081,12 +1081,12 @@ static void Deg_ReceiveFormRequestOrCreateDeg (Hie_Status_t Status)
|
|||
{
|
||||
/***** If name of degree was in database... *****/
|
||||
if (Deg_DB_CheckIfDegNameExistsInCtr ("ShortName",Deg_EditingDeg->ShrtName,
|
||||
-1L,Deg_EditingDeg->CtrCod))
|
||||
-1L,Deg_EditingDeg->PrtCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_degree_X_already_exists,
|
||||
Deg_EditingDeg->ShrtName);
|
||||
else if (Deg_DB_CheckIfDegNameExistsInCtr ("FullName",Deg_EditingDeg->FullName,
|
||||
-1L,Deg_EditingDeg->CtrCod))
|
||||
-1L,Deg_EditingDeg->PrtCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_degree_X_already_exists,
|
||||
Deg_EditingDeg->FullName);
|
||||
|
@ -1152,8 +1152,8 @@ bool Deg_GetDegreeDataByCod (struct Deg_Degree *Deg)
|
|||
bool DegFound = false;
|
||||
|
||||
/***** Clear data *****/
|
||||
Deg->CtrCod = -1L;
|
||||
Deg->DegTypCod = -1L;
|
||||
Deg->PrtCod = -1L;
|
||||
Deg->TypCod = -1L;
|
||||
Deg->Status = (Hie_Status_t) 0;
|
||||
Deg->RequesterUsrCod = -1L;
|
||||
Deg->ShrtName[0] = '\0';
|
||||
|
@ -1197,8 +1197,8 @@ static void Deg_GetDegreeDataFromRow (MYSQL_RES *mysql_res,
|
|||
Err_WrongDegreeExit ();
|
||||
|
||||
/***** Get center code (row[1]) and code of the degree type (row[2]) *****/
|
||||
Deg->CtrCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Deg->DegTypCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
Deg->PrtCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Deg->TypCod = Str_ConvertStrCodToLongCod (row[2]);
|
||||
|
||||
/* Get course status (row[3]) */
|
||||
if (sscanf (row[3],"%u",&(Deg->Status)) != 1)
|
||||
|
@ -1341,7 +1341,7 @@ void Deg_RenameDegree (struct Deg_Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullNam
|
|||
if (strcmp (CurrentDegName,NewDegName)) // Different names
|
||||
{
|
||||
/***** If degree was in database... *****/
|
||||
if (Deg_DB_CheckIfDegNameExistsInCtr (ParName,NewDegName,Deg->Cod,Deg->CtrCod))
|
||||
if (Deg_DB_CheckIfDegNameExistsInCtr (ParName,NewDegName,Deg->Cod,Deg->PrtCod))
|
||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||
Txt_The_degree_X_already_exists,
|
||||
NewDegName);
|
||||
|
@ -1391,7 +1391,7 @@ void Deg_ChangeDegreeType (void)
|
|||
|
||||
/***** Update the table of degrees changing old type by new type *****/
|
||||
Deg_DB_UpdateDegTyp (Deg_EditingDeg->Cod,NewDegTypCod);
|
||||
Deg_EditingDeg->DegTypCod = NewDegTypCod;
|
||||
Deg_EditingDeg->TypCod = NewDegTypCod;
|
||||
|
||||
/***** Create alert to show the change made
|
||||
and put button to go to degree changed *****/
|
||||
|
@ -1770,9 +1770,9 @@ static void Deg_EditingDegreeConstructor (void)
|
|||
Err_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Reset degree *****/
|
||||
Deg_EditingDeg->Cod = -1L;
|
||||
Deg_EditingDeg->DegTypCod = -1L;
|
||||
Deg_EditingDeg->CtrCod = -1L;
|
||||
Deg_EditingDeg->Cod = -1L;
|
||||
Deg_EditingDeg->PrtCod = -1L;
|
||||
Deg_EditingDeg->TypCod = -1L;
|
||||
Deg_EditingDeg->Status = (Hie_Status_t) 0;
|
||||
Deg_EditingDeg->RequesterUsrCod = -1L;
|
||||
Deg_EditingDeg->ShrtName[0] = '\0';
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
|
||||
struct Deg_Degree
|
||||
{
|
||||
long Cod; // Degree code
|
||||
long DegTypCod; // Degree type code
|
||||
long CtrCod; // Center code
|
||||
Hie_Status_t Status; // Degree status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this degree
|
||||
long Cod; // Degree code
|
||||
long PrtCod; // Parent (center) code
|
||||
long TypCod; // Degree type code
|
||||
Hie_Status_t Status; // Degree status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this degree
|
||||
char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1]; // Short name of degree
|
||||
char FullName[Cns_HIERARCHY_MAX_BYTES_FULL_NAME + 1]; // Full name of degree
|
||||
char WWW[Cns_MAX_BYTES_WWW + 1];
|
||||
|
|
|
@ -370,7 +370,7 @@ void DegCfg_ChangeDegCtr (void)
|
|||
NewCtr.Cod = ParCod_GetAndCheckPar (ParCod_OthCtr);
|
||||
|
||||
/***** Check if center has changed *****/
|
||||
if (NewCtr.Cod != Gbl.Hierarchy.Deg.CtrCod)
|
||||
if (NewCtr.Cod != Gbl.Hierarchy.Deg.PrtCod)
|
||||
{
|
||||
/***** Get data of new center *****/
|
||||
Ctr_GetCenterDataByCod (&NewCtr);
|
||||
|
@ -388,7 +388,7 @@ void DegCfg_ChangeDegCtr (void)
|
|||
{
|
||||
/***** Update center in table of degrees *****/
|
||||
Deg_DB_UpdateDegCtr (Gbl.Hierarchy.Deg.Cod,NewCtr.Cod);
|
||||
Gbl.Hierarchy.Deg.CtrCod =
|
||||
Gbl.Hierarchy.Deg.PrtCod =
|
||||
Gbl.Hierarchy.Ctr.Cod = NewCtr.Cod;
|
||||
|
||||
/***** Initialize again current course, degree, center... *****/
|
||||
|
|
|
@ -64,8 +64,8 @@ void Deg_DB_CreateDegree (struct Deg_Degree *Deg,Hie_Status_t Status)
|
|||
" VALUES"
|
||||
" (%ld,%ld,%u,"
|
||||
"%ld,'%s','%s','%s')",
|
||||
Deg->CtrCod,
|
||||
Deg->DegTypCod,
|
||||
Deg->PrtCod,
|
||||
Deg->TypCod,
|
||||
(unsigned) Status,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Deg->ShrtName,
|
||||
|
|
|
@ -324,7 +324,7 @@ static void DegTyp_ListDegreeTypesForSeeing (const struct DegTyp_DegTypes *DegTy
|
|||
NumDegTyp++, The_ChangeRowColor ())
|
||||
{
|
||||
BgColor = (DegTypes->Lst[NumDegTyp].DegTypCod ==
|
||||
Gbl.Hierarchy.Deg.DegTypCod) ? "BG_HIGHLIGHT" :
|
||||
Gbl.Hierarchy.Deg.TypCod) ? "BG_HIGHLIGHT" :
|
||||
The_GetColorRows ();
|
||||
|
||||
/* Begin table row */
|
||||
|
|
|
@ -2246,7 +2246,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
|
|||
HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ());
|
||||
|
||||
Crs_GetCourseDataByCod (&Crs);
|
||||
Deg.Cod = Crs.DegCod;
|
||||
Deg.Cod = Crs.PrtCod;
|
||||
Deg_GetDegreeDataByCod (&Deg);
|
||||
|
||||
Frm_BeginFormGoTo (ActSeeCrsInf);
|
||||
|
|
|
@ -558,7 +558,7 @@ void Hie_InitHierarchy (void)
|
|||
if (Gbl.Hierarchy.Crs.Cod > 0)
|
||||
{
|
||||
if (Crs_GetCourseDataByCod (&Gbl.Hierarchy.Crs)) // Course found
|
||||
Gbl.Hierarchy.Deg.Cod = Gbl.Hierarchy.Crs.DegCod;
|
||||
Gbl.Hierarchy.Deg.Cod = Gbl.Hierarchy.Crs.PrtCod;
|
||||
else
|
||||
Hie_ResetHierarchy ();
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ void Hie_InitHierarchy (void)
|
|||
{
|
||||
if (Deg_GetDegreeDataByCod (&Gbl.Hierarchy.Deg)) // Degree found
|
||||
{
|
||||
Gbl.Hierarchy.Ctr.Cod = Gbl.Hierarchy.Deg.CtrCod;
|
||||
Gbl.Hierarchy.Ctr.Cod = Gbl.Hierarchy.Deg.PrtCod;
|
||||
Gbl.Hierarchy.Ins.Cod = Deg_DB_GetInsCodOfDegreeByCod (Gbl.Hierarchy.Deg.Cod);
|
||||
}
|
||||
else
|
||||
|
@ -579,7 +579,7 @@ void Hie_InitHierarchy (void)
|
|||
if (Gbl.Hierarchy.Ctr.Cod > 0)
|
||||
{
|
||||
if (Ctr_GetCenterDataByCod (&Gbl.Hierarchy.Ctr)) // Center found
|
||||
Gbl.Hierarchy.Ins.Cod = Gbl.Hierarchy.Ctr.InsCod;
|
||||
Gbl.Hierarchy.Ins.Cod = Gbl.Hierarchy.Ctr.PrtCod;
|
||||
else
|
||||
Hie_ResetHierarchy ();
|
||||
}
|
||||
|
@ -588,7 +588,7 @@ void Hie_InitHierarchy (void)
|
|||
if (Gbl.Hierarchy.Ins.Cod > 0)
|
||||
{
|
||||
if (Ins_GetInstitDataByCod (&Gbl.Hierarchy.Ins)) // Institution found
|
||||
Gbl.Hierarchy.Cty.Cod = Gbl.Hierarchy.Ins.CtyCod;
|
||||
Gbl.Hierarchy.Cty.Cod = Gbl.Hierarchy.Ins.PrtCod;
|
||||
else
|
||||
Hie_ResetHierarchy ();
|
||||
}
|
||||
|
@ -661,21 +661,21 @@ void Hie_InitHierarchy (void)
|
|||
void Hie_ResetHierarchy (void)
|
||||
{
|
||||
/***** Country *****/
|
||||
Gbl.Hierarchy.Cty.Cod = -1L;
|
||||
Gbl.Hierarchy.Cty.Cod = -1L;
|
||||
|
||||
/***** Institution *****/
|
||||
Gbl.Hierarchy.Ins.Cod = -1L;
|
||||
Gbl.Hierarchy.Ins.Cod = -1L;
|
||||
|
||||
/***** Center *****/
|
||||
Gbl.Hierarchy.Ctr.Cod = -1L;
|
||||
Gbl.Hierarchy.Ctr.InsCod = -1L;
|
||||
Gbl.Hierarchy.Ctr.Cod = -1L;
|
||||
Gbl.Hierarchy.Ctr.PrtCod = -1L;
|
||||
Gbl.Hierarchy.Ctr.PlcCod = -1L;
|
||||
|
||||
/***** Degree *****/
|
||||
Gbl.Hierarchy.Deg.Cod = -1L;
|
||||
Gbl.Hierarchy.Deg.Cod = -1L;
|
||||
|
||||
/***** Course *****/
|
||||
Gbl.Hierarchy.Crs.Cod = -1L;
|
||||
Gbl.Hierarchy.Crs.Cod = -1L;
|
||||
|
||||
/***** Hierarchy level and code *****/
|
||||
Gbl.Hierarchy.Level = HieLvl_UNK;
|
||||
|
|
|
@ -660,7 +660,7 @@ bool Ins_GetInstitDataByCod (struct Ins_Instit *Ins)
|
|||
bool InsFound = false;
|
||||
|
||||
/***** Clear data *****/
|
||||
Ins->CtyCod = -1L;
|
||||
Ins->PrtCod = -1L;
|
||||
Ins->Status = (Hie_Status_t) 0;
|
||||
Ins->RequesterUsrCod = -1L;
|
||||
Ins->ShrtName[0] =
|
||||
|
@ -716,7 +716,7 @@ static void Ins_GetInstitDataFromRow (MYSQL_RES *mysql_res,
|
|||
Err_WrongInstitExit ();
|
||||
|
||||
/***** Get country code (row[1]) *****/
|
||||
Ins->CtyCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
Ins->PrtCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||
|
||||
/***** Get institution status (row[2]) *****/
|
||||
if (sscanf (row[2],"%u",&(Ins->Status)) != 1)
|
||||
|
@ -1527,7 +1527,7 @@ static void Ins_ReceiveFormRequestOrCreateIns (Hie_Status_t Status)
|
|||
|
||||
/***** Get parameters from form *****/
|
||||
/* Set institution country */
|
||||
Ins_EditingIns->CtyCod = Gbl.Hierarchy.Cty.Cod;
|
||||
Ins_EditingIns->PrtCod = Gbl.Hierarchy.Cty.Cod;
|
||||
|
||||
/* Get institution short name */
|
||||
Par_GetParText ("ShortName",Ins_EditingIns->ShrtName,Cns_HIERARCHY_MAX_BYTES_SHRT_NAME);
|
||||
|
@ -1787,11 +1787,11 @@ static void Ins_EditingInstitutionConstructor (void)
|
|||
Err_NotEnoughMemoryExit ();
|
||||
|
||||
/***** Reset institution *****/
|
||||
Ins_EditingIns->Cod = -1L;
|
||||
Ins_EditingIns->CtyCod = -1L;
|
||||
Ins_EditingIns->ShrtName[0] = '\0';
|
||||
Ins_EditingIns->FullName[0] = '\0';
|
||||
Ins_EditingIns->WWW[0] = '\0';
|
||||
Ins_EditingIns->Cod = -1L;
|
||||
Ins_EditingIns->PrtCod = -1L;
|
||||
Ins_EditingIns->ShrtName[0] = '\0';
|
||||
Ins_EditingIns->FullName[0] = '\0';
|
||||
Ins_EditingIns->WWW[0] = '\0';
|
||||
}
|
||||
|
||||
static void Ins_EditingInstitutionDestructor (void)
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
|
||||
struct Ins_Instit
|
||||
{
|
||||
long Cod;
|
||||
long CtyCod;
|
||||
long Cod; // Institution code
|
||||
long PrtCod; // Parent (country) code
|
||||
Hie_Status_t Status; // Institution status
|
||||
long RequesterUsrCod; // User code of the person who requested the creation of this institution
|
||||
char ShrtName[Cns_HIERARCHY_MAX_BYTES_SHRT_NAME + 1];
|
||||
|
|
|
@ -549,7 +549,7 @@ void InsCfg_ChangeInsCty (void)
|
|||
NewCty.Cod = ParCod_GetAndCheckPar (ParCod_OthCty);
|
||||
|
||||
/***** Check if country has changed *****/
|
||||
if (NewCty.Cod != Gbl.Hierarchy.Ins.CtyCod)
|
||||
if (NewCty.Cod != Gbl.Hierarchy.Ins.PrtCod)
|
||||
{
|
||||
/***** Get data of the country from database *****/
|
||||
Cty_GetCountryDataByCod (&NewCty);
|
||||
|
@ -567,7 +567,7 @@ void InsCfg_ChangeInsCty (void)
|
|||
{
|
||||
/***** Update the table changing the country of the institution *****/
|
||||
Ins_DB_UpdateInsCty (Gbl.Hierarchy.Ins.Cod,NewCty.Cod);
|
||||
Gbl.Hierarchy.Ins.CtyCod =
|
||||
Gbl.Hierarchy.Ins.PrtCod =
|
||||
Gbl.Hierarchy.Cty.Cod = NewCty.Cod;
|
||||
|
||||
/***** Initialize again current course, degree, center... *****/
|
||||
|
|
|
@ -57,7 +57,7 @@ long Ins_DB_CreateInstitution (const struct Ins_Instit *Ins,Hie_Status_t Status)
|
|||
" VALUES"
|
||||
" (%ld,%u,%ld,"
|
||||
"'%s','%s','%s')",
|
||||
Ins->CtyCod,
|
||||
Ins->PrtCod,
|
||||
(unsigned) Status,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
Ins->ShrtName,
|
||||
|
|
|
@ -4071,8 +4071,8 @@ void Rec_UpdateMyInstitution (void)
|
|||
if (Ins.Cod > 0)
|
||||
{
|
||||
Ins_GetInstitDataByCod (&Ins);
|
||||
if (Gbl.Usrs.Me.UsrDat.InsCtyCod != Ins.CtyCod)
|
||||
Gbl.Usrs.Me.UsrDat.InsCtyCod = Ins.CtyCod;
|
||||
if (Gbl.Usrs.Me.UsrDat.InsCtyCod != Ins.PrtCod)
|
||||
Gbl.Usrs.Me.UsrDat.InsCtyCod = Ins.PrtCod;
|
||||
}
|
||||
|
||||
/* Set institution code */
|
||||
|
@ -4107,9 +4107,9 @@ void Rec_UpdateMyCenter (void)
|
|||
if (Ctr.Cod > 0)
|
||||
{
|
||||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
if (Gbl.Usrs.Me.UsrDat.InsCod != Ctr.InsCod)
|
||||
if (Gbl.Usrs.Me.UsrDat.InsCod != Ctr.PrtCod)
|
||||
{
|
||||
Gbl.Usrs.Me.UsrDat.InsCod = Ctr.InsCod;
|
||||
Gbl.Usrs.Me.UsrDat.InsCod = Ctr.PrtCod;
|
||||
Gbl.Usrs.Me.UsrDat.Tch.DptCod = -1L;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1044,7 +1044,7 @@ static void Rep_WriteRowCrsData (long CrsCod,Rol_Role_t Role,
|
|||
Crs_GetCourseDataByCod (&Crs);
|
||||
|
||||
/***** Get degree data *****/
|
||||
Deg.Cod = Crs.DegCod;
|
||||
Deg.Cod = Crs.PrtCod;
|
||||
Deg_GetDegreeDataByCod (&Deg);
|
||||
|
||||
/***** Begin row *****/
|
||||
|
|
|
@ -3314,7 +3314,7 @@ static void Sta_ShowNumHitsPerCourse (Sta_CountType_t CountType,
|
|||
HTM_TD_End ();
|
||||
|
||||
/* Write degree */
|
||||
Sta_WriteDegree (Crs.DegCod);
|
||||
Sta_WriteDegree (Crs.PrtCod);
|
||||
|
||||
/* Write degree year */
|
||||
HTM_TD_Begin ("class=\"CT LOG_%s\"",The_GetSuffix ());
|
||||
|
|
|
@ -230,7 +230,7 @@ static void SysCfg_Map (void)
|
|||
Ctr_GetCenterDataByCod (&Ctr);
|
||||
|
||||
/* Get data of institution */
|
||||
Ins.Cod = Ctr.InsCod;
|
||||
Ins.Cod = Ctr.PrtCod;
|
||||
Ins_GetInstitDataByCod (&Ins);
|
||||
|
||||
/* Add marker */
|
||||
|
|
Loading…
Reference in New Issue