mirror of https://github.com/acanas/swad-core.git
Version19.112.8
This commit is contained in:
parent
2f5030384d
commit
e747318bbf
|
@ -1043,7 +1043,7 @@ int swad__loginBySessionKey (struct soap *soap,
|
||||||
|
|
||||||
/***** Get degree (row[1]) *****/
|
/***** Get degree (row[1]) *****/
|
||||||
Gbl.Hierarchy.Deg.DegCod = Str_ConvertStrCodToLongCod (row[1]);
|
Gbl.Hierarchy.Deg.DegCod = Str_ConvertStrCodToLongCod (row[1]);
|
||||||
Deg_GetDataOfDegreeByCod (&Gbl.Hierarchy.Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Gbl.Hierarchy.Deg);
|
||||||
loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Deg.DegCod;
|
loginBySessionKeyOut->degreeCode = (int) Gbl.Hierarchy.Deg.DegCod;
|
||||||
Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Deg.FullName,
|
Str_Copy (loginBySessionKeyOut->degreeName,Gbl.Hierarchy.Deg.FullName,
|
||||||
Hie_MAX_BYTES_FULL_NAME);
|
Hie_MAX_BYTES_FULL_NAME);
|
||||||
|
@ -3070,7 +3070,7 @@ int swad__getNotifications (struct soap *soap,
|
||||||
|
|
||||||
/* Get degree (row[6]) */
|
/* Get degree (row[6]) */
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/* Get message/post/... code (row[8]) */
|
/* Get message/post/... code (row[8]) */
|
||||||
Cod = Str_ConvertStrCodToLongCod (row[8]);
|
Cod = Str_ConvertStrCodToLongCod (row[8]);
|
||||||
|
|
|
@ -606,15 +606,15 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
|
||||||
bool CtrFound = false;
|
bool CtrFound = false;
|
||||||
|
|
||||||
/***** Clear data *****/
|
/***** Clear data *****/
|
||||||
Ctr->InsCod = -1L;
|
Ctr->InsCod = -1L;
|
||||||
Ctr->PlcCod = -1L;
|
Ctr->PlcCod = -1L;
|
||||||
Ctr->Status = (Ctr_Status_t) 0;
|
Ctr->Status = (Ctr_Status_t) 0;
|
||||||
Ctr->RequesterUsrCod = -1L;
|
Ctr->RequesterUsrCod = -1L;
|
||||||
Ctr->ShrtName[0] = '\0';
|
Ctr->ShrtName[0] = '\0';
|
||||||
Ctr->FullName[0] = '\0';
|
Ctr->FullName[0] = '\0';
|
||||||
Ctr->WWW[0] = '\0';
|
Ctr->WWW[0] = '\0';
|
||||||
Ctr->Degs.Num = 0;
|
Ctr->Degs.Num = 0;
|
||||||
Ctr->Degs.Lst = NULL;
|
Ctr->Degs.Lst = NULL;
|
||||||
|
|
||||||
/***** Check if centre code is correct *****/
|
/***** Check if centre code is correct *****/
|
||||||
if (Ctr->CtrCod > 0)
|
if (Ctr->CtrCod > 0)
|
||||||
|
@ -1990,6 +1990,7 @@ static void Ctr_EditingCentreConstructor (void)
|
||||||
Ctr_EditingCtr->CtrCod = -1L;
|
Ctr_EditingCtr->CtrCod = -1L;
|
||||||
Ctr_EditingCtr->InsCod = -1L;
|
Ctr_EditingCtr->InsCod = -1L;
|
||||||
Ctr_EditingCtr->PlcCod = -1L;
|
Ctr_EditingCtr->PlcCod = -1L;
|
||||||
|
Ctr_EditingCtr->Status = (Ctr_Status_t) 0;
|
||||||
Ctr_EditingCtr->RequesterUsrCod = -1L;
|
Ctr_EditingCtr->RequesterUsrCod = -1L;
|
||||||
Ctr_EditingCtr->ShrtName[0] = '\0';
|
Ctr_EditingCtr->ShrtName[0] = '\0';
|
||||||
Ctr_EditingCtr->FullName[0] = '\0';
|
Ctr_EditingCtr->FullName[0] = '\0';
|
||||||
|
|
|
@ -492,7 +492,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.112.7 (2020-01-05)"
|
#define Log_PLATFORM_VERSION "SWAD 19.112.8 (2020-01-05)"
|
||||||
#define CSS_FILE "swad19.112.css"
|
#define CSS_FILE "swad19.112.css"
|
||||||
#define JS_FILE "swad19.91.1.js"
|
#define JS_FILE "swad19.91.1.js"
|
||||||
/*
|
/*
|
||||||
|
@ -500,8 +500,9 @@ ps2pdf source.ps destination.pdf
|
||||||
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
// TODO: Impedir la creación y edición de proyectos si no son editables.
|
||||||
// TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué?
|
// TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué?
|
||||||
// TODO: Mapas más estrechos en móvil
|
// TODO: Mapas más estrechos en móvil
|
||||||
// TODO: Quitar todos los EXTRA_DATA
|
// TODO: Quitar todos los EXTRA_DATA.
|
||||||
|
|
||||||
|
Version 19.112.8: Jan 05, 2020 Optimization in number of courses in a degree. (278396 lines)
|
||||||
Version 19.112.7: Jan 05, 2020 Optimization in number of degrees in a centre. (278384 lines)
|
Version 19.112.7: Jan 05, 2020 Optimization in number of degrees in a centre. (278384 lines)
|
||||||
Version 19.112.6: Jan 05, 2020 Optimization in number of courses in a centre. (278374 lines)
|
Version 19.112.6: Jan 05, 2020 Optimization in number of courses in a centre. (278374 lines)
|
||||||
Version 19.112.5: Jan 05, 2020 Optimization in number of users who claim to belong to a centre. (278361 lines)
|
Version 19.112.5: Jan 05, 2020 Optimization in number of users who claim to belong to a centre. (278361 lines)
|
||||||
|
|
|
@ -175,7 +175,7 @@ void Cht_ShowListOfAvailableChatRooms (void)
|
||||||
{
|
{
|
||||||
/* Get data of this degree */
|
/* Get data of this degree */
|
||||||
Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod;
|
Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod;
|
||||||
if (!Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA))
|
if (!Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
Lay_ShowErrorAndExit ("Degree not found.");
|
Lay_ShowErrorAndExit ("Degree not found.");
|
||||||
|
|
||||||
/* Link to the room of this degree */
|
/* Link to the room of this degree */
|
||||||
|
@ -521,7 +521,7 @@ void Cht_OpenChatWindow (void)
|
||||||
|
|
||||||
/* Get data of this degree */
|
/* Get data of this degree */
|
||||||
Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod;
|
Deg.DegCod = Gbl.Usrs.Me.MyDegs.Degs[NumMyDeg].DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
snprintf (ThisRoomShortName,sizeof (ThisRoomShortName),
|
snprintf (ThisRoomShortName,sizeof (ThisRoomShortName),
|
||||||
"%s",
|
"%s",
|
||||||
|
|
|
@ -67,7 +67,7 @@ static struct Course *Crs_EditingCrs = NULL; // Static variable to keep the cour
|
||||||
|
|
||||||
static void Crs_WriteListMyCoursesToSelectOne (void);
|
static void Crs_WriteListMyCoursesToSelectOne (void);
|
||||||
|
|
||||||
static void Crs_GetListCoursesInCurrentDegree (Crs_WhatCourses_t WhatCourses);
|
static void Crs_GetListCrssInCurrentDeg (Crs_WhatCourses_t WhatCourses);
|
||||||
static void Crs_ListCourses (void);
|
static void Crs_ListCourses (void);
|
||||||
static bool Crs_CheckIfICanCreateCourses (void);
|
static bool Crs_CheckIfICanCreateCourses (void);
|
||||||
static void Crs_PutIconsListCourses (void);
|
static void Crs_PutIconsListCourses (void);
|
||||||
|
@ -309,7 +309,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
|
|
||||||
/***** Get data of this degree *****/
|
/***** Get data of this degree *****/
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
if (!Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA))
|
if (!Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
Lay_ShowErrorAndExit ("Degree not found.");
|
Lay_ShowErrorAndExit ("Degree not found.");
|
||||||
|
|
||||||
/***** Write link to degree *****/
|
/***** Write link to degree *****/
|
||||||
|
@ -475,14 +475,30 @@ unsigned Crs_GetNumCrssInCtr (long CtrCod)
|
||||||
/******************** Get number of courses in a degree **********************/
|
/******************** Get number of courses in a degree **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Crs_FlushCacheNumCrssInDeg (void)
|
||||||
|
{
|
||||||
|
Gbl.Cache.NumCrssInDeg.DegCod = -1L;
|
||||||
|
Gbl.Cache.NumCrssInDeg.NumCrss = 0;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned Crs_GetNumCrssInDeg (long DegCod)
|
unsigned Crs_GetNumCrssInDeg (long DegCod)
|
||||||
{
|
{
|
||||||
/***** Get number of courses in a degree from database *****/
|
/***** 1. Fast check: Trivial case *****/
|
||||||
return
|
if (DegCod <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/***** 2. Fast check: If cached... *****/
|
||||||
|
if (DegCod == Gbl.Cache.NumCrssInDeg.DegCod)
|
||||||
|
return Gbl.Cache.NumCrssInDeg.NumCrss;
|
||||||
|
|
||||||
|
/***** 3. Slow: number of courses in a degree from database *****/
|
||||||
|
Gbl.Cache.NumCrssInDeg.DegCod = DegCod;
|
||||||
|
Gbl.Cache.NumCrssInDeg.NumCrss =
|
||||||
(unsigned) DB_QueryCOUNT ("can not get the number of courses in a degree",
|
(unsigned) DB_QueryCOUNT ("can not get the number of courses in a degree",
|
||||||
"SELECT COUNT(*) FROM courses"
|
"SELECT COUNT(*) FROM courses"
|
||||||
" WHERE DegCod=%ld",
|
" WHERE DegCod=%ld",
|
||||||
DegCod);
|
DegCod);
|
||||||
|
return Gbl.Cache.NumCrssInDeg.NumCrss;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -578,7 +594,7 @@ void Crs_ShowCrssOfCurrentDeg (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/***** Get list of courses in this degree *****/
|
/***** Get list of courses in this degree *****/
|
||||||
Crs_GetListCoursesInCurrentDegree (Crs_ALL_COURSES_EXCEPT_REMOVED);
|
Crs_GetListCrssInCurrentDeg (Crs_ALL_COURSES_EXCEPT_REMOVED);
|
||||||
|
|
||||||
/***** Write menu to select country, institution, centre and degree *****/
|
/***** Write menu to select country, institution, centre and degree *****/
|
||||||
Hie_WriteMenuHierarchy ();
|
Hie_WriteMenuHierarchy ();
|
||||||
|
@ -594,7 +610,7 @@ void Crs_ShowCrssOfCurrentDeg (void)
|
||||||
/*************** Create a list with courses in current degree ****************/
|
/*************** Create a list with courses in current degree ****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Crs_GetListCoursesInCurrentDegree (Crs_WhatCourses_t WhatCourses)
|
static void Crs_GetListCrssInCurrentDeg (Crs_WhatCourses_t WhatCourses)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -790,7 +806,7 @@ static void Crs_ListCourses (void)
|
||||||
{
|
{
|
||||||
Frm_StartForm (ActEdiCrs);
|
Frm_StartForm (ActEdiCrs);
|
||||||
Btn_PutConfirmButton (Gbl.Hierarchy.Deg.Crss.Num ? Txt_Create_another_course :
|
Btn_PutConfirmButton (Gbl.Hierarchy.Deg.Crss.Num ? Txt_Create_another_course :
|
||||||
Txt_Create_course);
|
Txt_Create_course);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -954,10 +970,10 @@ static void Crs_EditCoursesInternal (void)
|
||||||
extern const char *Txt_Courses_of_DEGREE_X;
|
extern const char *Txt_Courses_of_DEGREE_X;
|
||||||
|
|
||||||
/***** Get list of degrees in this centre *****/
|
/***** Get list of degrees in this centre *****/
|
||||||
Deg_GetListDegsOfCurrentCtr ();
|
Deg_GetListDegsInCurrentCtr ();
|
||||||
|
|
||||||
/***** Get list of courses in this degree *****/
|
/***** Get list of courses in this degree *****/
|
||||||
Crs_GetListCoursesInCurrentDegree (Crs_ALL_COURSES_EXCEPT_REMOVED);
|
Crs_GetListCrssInCurrentDeg (Crs_ALL_COURSES_EXCEPT_REMOVED);
|
||||||
|
|
||||||
/***** Write menu to select country, institution, centre and degree *****/
|
/***** Write menu to select country, institution, centre and degree *****/
|
||||||
Hie_WriteMenuHierarchy ();
|
Hie_WriteMenuHierarchy ();
|
||||||
|
@ -2592,7 +2608,7 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
|
||||||
/***** Get degree code (row[0]) *****/
|
/***** Get degree code (row[0]) *****/
|
||||||
if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
if ((Deg.DegCod = Str_ConvertStrCodToLongCod (row[0])) < 0)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of degree.");
|
Lay_ShowErrorAndExit ("Wrong code of degree.");
|
||||||
if (!Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA))
|
if (!Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
Lay_ShowErrorAndExit ("Degree not found.");
|
Lay_ShowErrorAndExit ("Degree not found.");
|
||||||
|
|
||||||
/***** Get course code (row[1]) *****/
|
/***** Get course code (row[1]) *****/
|
||||||
|
|
|
@ -105,6 +105,7 @@ unsigned Crs_GetNumCrssInCty (long CtyCod);
|
||||||
unsigned Crs_GetNumCrssInIns (long InsCod);
|
unsigned Crs_GetNumCrssInIns (long InsCod);
|
||||||
void Crs_FlushCacheNumCrssInCtr (void);
|
void Crs_FlushCacheNumCrssInCtr (void);
|
||||||
unsigned Crs_GetNumCrssInCtr (long CtrCod);
|
unsigned Crs_GetNumCrssInCtr (long CtrCod);
|
||||||
|
void Crs_FlushCacheNumCrssInDeg (void);
|
||||||
unsigned Crs_GetNumCrssInDeg (long DegCod);
|
unsigned Crs_GetNumCrssInDeg (long DegCod);
|
||||||
unsigned Crs_GetNumCrssWithUsrs (Rol_Role_t Role,const char *SubQuery);
|
unsigned Crs_GetNumCrssWithUsrs (Rol_Role_t Role,const char *SubQuery);
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
|
||||||
if (PutForm)
|
if (PutForm)
|
||||||
{
|
{
|
||||||
/* Get list of degrees of the current centre */
|
/* Get list of degrees of the current centre */
|
||||||
Deg_GetListDegsOfCurrentCtr ();
|
Deg_GetListDegsInCurrentCtr ();
|
||||||
|
|
||||||
/* Put form to select degree */
|
/* Put form to select degree */
|
||||||
Frm_StartForm (ActChgCrsDegCfg);
|
Frm_StartForm (ActChgCrsDegCfg);
|
||||||
|
@ -493,7 +493,7 @@ void CrsCfg_ChangeCrsDeg (void)
|
||||||
if (NewDeg.DegCod != Gbl.Hierarchy.Crs.DegCod)
|
if (NewDeg.DegCod != Gbl.Hierarchy.Crs.DegCod)
|
||||||
{
|
{
|
||||||
/***** Get data of new degree *****/
|
/***** Get data of new degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (&NewDeg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&NewDeg);
|
||||||
|
|
||||||
/***** If name of course was in database in the new degree... *****/
|
/***** If name of course was in database in the new degree... *****/
|
||||||
if (Crs_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.Hierarchy.Crs.ShrtName,-1L,
|
if (Crs_CheckIfCrsNameExistsInYearOfDeg ("ShortName",Gbl.Hierarchy.Crs.ShrtName,-1L,
|
||||||
|
|
|
@ -177,7 +177,7 @@ void Deg_SeeDegWithPendingCrss (void)
|
||||||
Gbl.ColorRows[Gbl.RowEvenOdd];
|
Gbl.ColorRows[Gbl.RowEvenOdd];
|
||||||
|
|
||||||
/* Get data of degree */
|
/* Get data of degree */
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ void Deg_ShowDegsOfCurrentCtr (void)
|
||||||
|
|
||||||
/***** Get list of centres and degrees *****/
|
/***** Get list of centres and degrees *****/
|
||||||
Ctr_GetListCentres (Gbl.Hierarchy.Ins.InsCod);
|
Ctr_GetListCentres (Gbl.Hierarchy.Ins.InsCod);
|
||||||
Deg_GetListDegsOfCurrentCtr ();
|
Deg_GetListDegsInCurrentCtr ();
|
||||||
|
|
||||||
/***** Write menu to select country, institution and centre *****/
|
/***** Write menu to select country, institution and centre *****/
|
||||||
Hie_WriteMenuHierarchy ();
|
Hie_WriteMenuHierarchy ();
|
||||||
|
@ -850,6 +850,7 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
|
||||||
const char *TxtClassNormal;
|
const char *TxtClassNormal;
|
||||||
const char *TxtClassStrong;
|
const char *TxtClassStrong;
|
||||||
const char *BgColor;
|
const char *BgColor;
|
||||||
|
unsigned NumCrss = Crs_GetNumCrssInDeg (Deg->DegCod);
|
||||||
Deg_StatusTxt_t StatusTxt;
|
Deg_StatusTxt_t StatusTxt;
|
||||||
|
|
||||||
/***** Get data of type of degree of this degree *****/
|
/***** Get data of type of degree of this degree *****/
|
||||||
|
@ -868,17 +869,17 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
|
||||||
TxtClassStrong = "BT_LINK LT DAT_N";
|
TxtClassStrong = "BT_LINK LT DAT_N";
|
||||||
}
|
}
|
||||||
BgColor = (Deg->DegCod == Gbl.Hierarchy.Deg.DegCod) ? "LIGHT_BLUE" :
|
BgColor = (Deg->DegCod == Gbl.Hierarchy.Deg.DegCod) ? "LIGHT_BLUE" :
|
||||||
Gbl.ColorRows[Gbl.RowEvenOdd];
|
Gbl.ColorRows[Gbl.RowEvenOdd];
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/***** Put tip if degree has courses *****/
|
/***** Put tip if degree has courses *****/
|
||||||
HTM_TD_Begin ("class=\"%s CM %s\" title=\"%s\"",
|
HTM_TD_Begin ("class=\"%s CM %s\" title=\"%s\"",
|
||||||
TxtClassNormal,BgColor,
|
TxtClassNormal,BgColor,
|
||||||
Deg->Crss.Num ? Txt_DEGREE_With_courses :
|
NumCrss ? Txt_DEGREE_With_courses :
|
||||||
Txt_DEGREE_Without_courses);
|
Txt_DEGREE_Without_courses);
|
||||||
HTM_Txt (Deg->Crss.Num ? "✓" :
|
HTM_Txt (NumCrss ? "✓" :
|
||||||
" ");
|
" ");
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Number of degree in this list *****/
|
/***** Number of degree in this list *****/
|
||||||
|
@ -899,7 +900,7 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
|
||||||
|
|
||||||
/***** Current number of courses in this degree *****/
|
/***** Current number of courses in this degree *****/
|
||||||
HTM_TD_Begin ("class=\"%s RM %s\"",TxtClassNormal,BgColor);
|
HTM_TD_Begin ("class=\"%s RM %s\"",TxtClassNormal,BgColor);
|
||||||
HTM_Unsigned (Deg->Crss.Num);
|
HTM_Unsigned (NumCrss);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Degree status *****/
|
/***** Degree status *****/
|
||||||
|
@ -937,7 +938,7 @@ static void Deg_EditDegreesInternal (void)
|
||||||
extern const char *Txt_No_types_of_degree;
|
extern const char *Txt_No_types_of_degree;
|
||||||
|
|
||||||
/***** Get list of degrees in the current centre *****/
|
/***** Get list of degrees in the current centre *****/
|
||||||
Deg_GetListDegsOfCurrentCtr ();
|
Deg_GetListDegsInCurrentCtr ();
|
||||||
|
|
||||||
/***** Get list of degree types *****/
|
/***** Get list of degree types *****/
|
||||||
DT_GetListDegreeTypes (Hie_SYS,DT_ORDER_BY_DEGREE_TYPE);
|
DT_GetListDegreeTypes (Hie_SYS,DT_ORDER_BY_DEGREE_TYPE);
|
||||||
|
@ -1061,7 +1062,7 @@ void Deg_GetListAllDegsWithStds (struct ListDegrees *Degs)
|
||||||
/************ Get a list with the degrees of the current centre **************/
|
/************ Get a list with the degrees of the current centre **************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Deg_GetListDegsOfCurrentCtr (void)
|
void Deg_GetListDegsInCurrentCtr (void)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -1096,9 +1097,6 @@ void Deg_GetListDegsOfCurrentCtr (void)
|
||||||
/* Get next degree */
|
/* Get next degree */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
Deg_GetDataOfDegreeFromRow (Deg,row);
|
Deg_GetDataOfDegreeFromRow (Deg,row);
|
||||||
|
|
||||||
/* Get number of courses in this degree */
|
|
||||||
Deg->Crss.Num = Crs_GetNumCrssInDeg (Deg->DegCod);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1224,10 +1222,10 @@ void Deg_RemoveDegree (void)
|
||||||
Deg_EditingDeg->DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
Deg_EditingDeg->DegCod = Deg_GetAndCheckParamOtherDegCod (1);
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (Deg_EditingDeg,Deg_GET_EXTRA_DATA);
|
Deg_GetDataOfDegreeByCod (Deg_EditingDeg);
|
||||||
|
|
||||||
/***** Check if this degree has courses *****/
|
/***** Check if this degree has courses *****/
|
||||||
if (Deg_EditingDeg->Crss.Num) // Degree has courses ==> don't remove
|
if (Crs_GetNumCrssInDeg (Deg_EditingDeg->DegCod)) // Degree has courses ==> don't remove
|
||||||
Ale_CreateAlert (Ale_WARNING,NULL,
|
Ale_CreateAlert (Ale_WARNING,NULL,
|
||||||
Txt_To_remove_a_degree_you_must_first_remove_all_courses_in_the_degree);
|
Txt_To_remove_a_degree_you_must_first_remove_all_courses_in_the_degree);
|
||||||
else // Degree has no courses ==> remove it
|
else // Degree has no courses ==> remove it
|
||||||
|
@ -1282,22 +1280,22 @@ long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Returns true if degree found
|
// Returns true if degree found
|
||||||
|
|
||||||
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg,
|
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg)
|
||||||
Deg_GetExtraData_t GetExtraData)
|
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
bool DegFound = false;
|
bool DegFound = false;
|
||||||
|
|
||||||
/***** Clear data *****/
|
/***** Clear data *****/
|
||||||
Deg->CtrCod = -1L;
|
Deg->CtrCod = -1L;
|
||||||
Deg->DegTypCod = -1L;
|
Deg->DegTypCod = -1L;
|
||||||
Deg->Status = (Deg_Status_t) 0;
|
Deg->Status = (Deg_Status_t) 0;
|
||||||
Deg->RequesterUsrCod = -1L;
|
Deg->RequesterUsrCod = -1L;
|
||||||
Deg->ShrtName[0] = '\0';
|
Deg->ShrtName[0] = '\0';
|
||||||
Deg->FullName[0] = '\0';
|
Deg->FullName[0] = '\0';
|
||||||
Deg->WWW[0] = '\0';
|
Deg->WWW[0] = '\0';
|
||||||
Deg->Crss.Lst = NULL;
|
Deg->Crss.Num = 0;
|
||||||
|
Deg->Crss.Lst = NULL;
|
||||||
|
|
||||||
/***** Check if degree code is correct *****/
|
/***** Check if degree code is correct *****/
|
||||||
if (Deg->DegCod > 0)
|
if (Deg->DegCod > 0)
|
||||||
|
@ -1313,11 +1311,6 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg,
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
Deg_GetDataOfDegreeFromRow (Deg,row);
|
Deg_GetDataOfDegreeFromRow (Deg,row);
|
||||||
|
|
||||||
/* Get extra data */
|
|
||||||
if (GetExtraData == Deg_GET_EXTRA_DATA)
|
|
||||||
/* Get number of courses in this degree */
|
|
||||||
Deg->Crss.Num = Crs_GetNumCrssInDeg (Deg->DegCod);
|
|
||||||
|
|
||||||
/* Set return value */
|
/* Set return value */
|
||||||
DegFound = true;
|
DegFound = true;
|
||||||
}
|
}
|
||||||
|
@ -1519,6 +1512,9 @@ void Deg_RemoveDegreeCompletely (long DegCod)
|
||||||
"DELETE FROM degrees WHERE DegCod=%ld",
|
"DELETE FROM degrees WHERE DegCod=%ld",
|
||||||
DegCod);
|
DegCod);
|
||||||
|
|
||||||
|
/***** Flush caches *****/
|
||||||
|
Crs_FlushCacheNumCrssInDeg ();
|
||||||
|
|
||||||
/***** Delete all the degrees in sta_degrees table not present in degrees table *****/
|
/***** Delete all the degrees in sta_degrees table not present in degrees table *****/
|
||||||
Pho_RemoveObsoleteStatDegrees ();
|
Pho_RemoveObsoleteStatDegrees ();
|
||||||
}
|
}
|
||||||
|
@ -1583,7 +1579,7 @@ void Deg_RenameDegree (struct Degree *Deg,Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
Par_GetParToText (ParamName,NewDegName,MaxBytes);
|
Par_GetParToText (ParamName,NewDegName,MaxBytes);
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (Deg);
|
||||||
|
|
||||||
/***** Check if new name is empty *****/
|
/***** Check if new name is empty *****/
|
||||||
if (NewDegName[0])
|
if (NewDegName[0])
|
||||||
|
@ -1668,7 +1664,7 @@ void Deg_ChangeDegreeType (void)
|
||||||
NewDegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
NewDegTypCod = DT_GetAndCheckParamOtherDegTypCod (1);
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (Deg_EditingDeg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (Deg_EditingDeg);
|
||||||
|
|
||||||
/***** Update the table of degrees changing old type by new type *****/
|
/***** Update the table of degrees changing old type by new type *****/
|
||||||
DB_QueryUPDATE ("can not update the type of a degree",
|
DB_QueryUPDATE ("can not update the type of a degree",
|
||||||
|
@ -1703,7 +1699,7 @@ void Deg_ChangeDegWWW (void)
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (Deg_EditingDeg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (Deg_EditingDeg);
|
||||||
|
|
||||||
/***** Check if new WWW is empty *****/
|
/***** Check if new WWW is empty *****/
|
||||||
if (NewWWW[0])
|
if (NewWWW[0])
|
||||||
|
@ -1764,7 +1760,7 @@ void Deg_ChangeDegStatus (void)
|
||||||
Status = Deg_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
Status = Deg_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg_GetDataOfDegreeByCod (Deg_EditingDeg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (Deg_EditingDeg);
|
||||||
|
|
||||||
/***** Update status in table of degrees *****/
|
/***** Update status in table of degrees *****/
|
||||||
DB_QueryUPDATE ("can not update the status of a degree",
|
DB_QueryUPDATE ("can not update the status of a degree",
|
||||||
|
@ -1984,7 +1980,7 @@ void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumDegs)
|
||||||
Deg_PutHeadDegreesForSeeing ();
|
Deg_PutHeadDegreesForSeeing ();
|
||||||
|
|
||||||
/***** List the degrees (one row per degree) *****/
|
/***** List the degrees (one row per degree) *****/
|
||||||
for (NumDeg = 1;
|
for (NumDeg = 1;
|
||||||
NumDeg <= NumDegs;
|
NumDeg <= NumDegs;
|
||||||
NumDeg++)
|
NumDeg++)
|
||||||
{
|
{
|
||||||
|
@ -1995,7 +1991,7 @@ void Deg_ListDegsFound (MYSQL_RES **mysql_res,unsigned NumDegs)
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
/* Get data of degree */
|
/* Get data of degree */
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_EXTRA_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/* Write data of this degree */
|
/* Write data of this degree */
|
||||||
Deg_ListOneDegreeForSeeing (&Deg,NumDeg);
|
Deg_ListOneDegreeForSeeing (&Deg,NumDeg);
|
||||||
|
@ -2027,7 +2023,7 @@ static void Deg_EditingDegreeConstructor (void)
|
||||||
Deg_EditingDeg->DegCod = -1L;
|
Deg_EditingDeg->DegCod = -1L;
|
||||||
Deg_EditingDeg->DegTypCod = -1L;
|
Deg_EditingDeg->DegTypCod = -1L;
|
||||||
Deg_EditingDeg->CtrCod = -1L;
|
Deg_EditingDeg->CtrCod = -1L;
|
||||||
Deg_EditingDeg->Status = 0;
|
Deg_EditingDeg->Status = (Deg_Status_t) 0;
|
||||||
Deg_EditingDeg->RequesterUsrCod = -1L;
|
Deg_EditingDeg->RequesterUsrCod = -1L;
|
||||||
Deg_EditingDeg->ShrtName[0] = '\0';
|
Deg_EditingDeg->ShrtName[0] = '\0';
|
||||||
Deg_EditingDeg->FullName[0] = '\0';
|
Deg_EditingDeg->FullName[0] = '\0';
|
||||||
|
|
|
@ -89,12 +89,6 @@ struct ListDegrees
|
||||||
struct Degree *Lst; // List of degrees
|
struct Degree *Lst; // List of degrees
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
Deg_GET_BASIC_DATA,
|
|
||||||
Deg_GET_EXTRA_DATA,
|
|
||||||
} Deg_GetExtraData_t;
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Public prototypes *****************************/
|
/***************************** Public prototypes *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -115,7 +109,7 @@ void Deg_EditDegrees (void);
|
||||||
void Deg_PutIconToViewDegrees (void);
|
void Deg_PutIconToViewDegrees (void);
|
||||||
|
|
||||||
void Deg_GetListAllDegsWithStds (struct ListDegrees *Degs);
|
void Deg_GetListAllDegsWithStds (struct ListDegrees *Degs);
|
||||||
void Deg_GetListDegsOfCurrentCtr (void);
|
void Deg_GetListDegsInCurrentCtr (void);
|
||||||
void Deg_FreeListDegs (struct ListDegrees *Degs);
|
void Deg_FreeListDegs (struct ListDegrees *Degs);
|
||||||
|
|
||||||
void Deg_RecFormReqDeg (void);
|
void Deg_RecFormReqDeg (void);
|
||||||
|
@ -125,8 +119,7 @@ void Deg_RemoveDegree (void);
|
||||||
void Deg_PutParamDegCod (long DegCod);
|
void Deg_PutParamDegCod (long DegCod);
|
||||||
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed);
|
long Deg_GetAndCheckParamOtherDegCod (long MinCodAllowed);
|
||||||
|
|
||||||
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg,
|
bool Deg_GetDataOfDegreeByCod (struct Degree *Deg);
|
||||||
Deg_GetExtraData_t GetExtraData);
|
|
||||||
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg);
|
void Deg_GetShortNameOfDegreeByCod (struct Degree *Deg);
|
||||||
long Deg_GetCtrCodOfDegreeByCod (long DegCod);
|
long Deg_GetCtrCodOfDegreeByCod (long DegCod);
|
||||||
long Deg_GetInsCodOfDegreeByCod (long DegCod);
|
long Deg_GetInsCodOfDegreeByCod (long DegCod);
|
||||||
|
|
|
@ -2822,7 +2822,7 @@ static void Enr_ShowEnrolmentRequestsGivenRoles (unsigned RolesSelected)
|
||||||
/***** Link to course *****/
|
/***** Link to course *****/
|
||||||
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
||||||
Deg.DegCod = Crs.DegCod;
|
Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
HTM_TD_Begin ("class=\"DAT LT\"");
|
HTM_TD_Begin ("class=\"DAT LT\"");
|
||||||
Frm_StartFormGoTo (ActSeeCrsInf);
|
Frm_StartFormGoTo (ActSeeCrsInf);
|
||||||
Crs_PutParamCrsCod (Crs.CrsCod);
|
Crs_PutParamCrsCod (Crs.CrsCod);
|
||||||
|
|
|
@ -1611,7 +1611,7 @@ static void Exa_GetNotifContentExamAnnouncement (char **ContentStr)
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg.DegCod = Crs.DegCod;
|
Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/***** Get data of institution *****/
|
/***** Get data of institution *****/
|
||||||
Ins.InsCod = Deg_GetInsCodOfDegreeByCod (Deg.DegCod);
|
Ins.InsCod = Deg_GetInsCodOfDegreeByCod (Deg.DegCod);
|
||||||
|
|
|
@ -6882,7 +6882,7 @@ static void Brw_WriteCurrentClipboard (void)
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_DEG:
|
case Brw_ADMI_DOC_DEG:
|
||||||
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
|
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
|
||||||
"%s, %s <strong>%s</strong>",
|
"%s, %s <strong>%s</strong>",
|
||||||
Txt_documents_management_area,
|
Txt_documents_management_area,
|
||||||
|
@ -6890,7 +6890,7 @@ static void Brw_WriteCurrentClipboard (void)
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_SHR_DEG:
|
case Brw_ADMI_SHR_DEG:
|
||||||
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
|
snprintf (TxtClipboardZone,sizeof (TxtClipboardZone),
|
||||||
"%s, %s <strong>%s</strong>",
|
"%s, %s <strong>%s</strong>",
|
||||||
Txt_shared_files_area,
|
Txt_shared_files_area,
|
||||||
|
@ -7891,7 +7891,7 @@ static void Brw_PasteClipboard (void)
|
||||||
case Brw_ADMI_DOC_DEG:
|
case Brw_ADMI_DOC_DEG:
|
||||||
case Brw_ADMI_SHR_DEG:
|
case Brw_ADMI_SHR_DEG:
|
||||||
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
Deg.DegCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA))
|
if (Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%02u/%u/%s",
|
"%s/%02u/%u/%s",
|
||||||
Cfg_PATH_DEG_PRIVATE,
|
Cfg_PATH_DEG_PRIVATE,
|
||||||
|
@ -11062,7 +11062,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*GrpCod = -1L;
|
*GrpCod = -1L;
|
||||||
*CrsCod = -1L;
|
*CrsCod = -1L;
|
||||||
*DegCod = Deg.DegCod = Cod;
|
*DegCod = Deg.DegCod = Cod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
|
@ -11078,7 +11078,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*CrsCod = Crs.CrsCod = Cod;
|
*CrsCod = Crs.CrsCod = Cod;
|
||||||
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
||||||
*DegCod = Deg.DegCod = Crs.DegCod;
|
*DegCod = Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
|
@ -11093,7 +11093,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*CrsCod = Crs.CrsCod = GrpDat.CrsCod;
|
*CrsCod = Crs.CrsCod = GrpDat.CrsCod;
|
||||||
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
||||||
*DegCod = Deg.DegCod = Crs.DegCod;
|
*DegCod = Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
|
@ -11105,7 +11105,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*CrsCod = Crs.CrsCod = Prj_GetCourseOfProject (Cod);
|
*CrsCod = Crs.CrsCod = Prj_GetCourseOfProject (Cod);
|
||||||
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
Crs_GetDataOfCourseByCod (&Crs,Crs_GET_BASIC_DATA);
|
||||||
*DegCod = Deg.DegCod = Crs.DegCod;
|
*DegCod = Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
|
|
|
@ -2191,14 +2191,14 @@ void For_SetForumName (struct Forum *Forum,
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_USRS:
|
case For_FORUM_DEGREE_USRS:
|
||||||
Deg.DegCod = Forum->Location;
|
Deg.DegCod = Forum->Location;
|
||||||
if (!Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA))
|
if (!Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
Lay_ShowErrorAndExit ("Degree not found.");
|
Lay_ShowErrorAndExit ("Degree not found.");
|
||||||
Str_Copy (ForumName,Deg.ShrtName,
|
Str_Copy (ForumName,Deg.ShrtName,
|
||||||
For_MAX_BYTES_FORUM_NAME);
|
For_MAX_BYTES_FORUM_NAME);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_DEGREE_TCHS:
|
case For_FORUM_DEGREE_TCHS:
|
||||||
Deg.DegCod = Forum->Location;
|
Deg.DegCod = Forum->Location;
|
||||||
if (!Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA))
|
if (!Deg_GetDataOfDegreeByCod (&Deg))
|
||||||
Lay_ShowErrorAndExit ("Degree not found.");
|
Lay_ShowErrorAndExit ("Degree not found.");
|
||||||
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,
|
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,
|
||||||
"%s%s",Deg.ShrtName,
|
"%s%s",Deg.ShrtName,
|
||||||
|
|
|
@ -414,6 +414,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
Deg_FlushCacheNumDegsInCtr ();
|
Deg_FlushCacheNumDegsInCtr ();
|
||||||
Crs_FlushCacheNumCrssInCtr ();
|
Crs_FlushCacheNumCrssInCtr ();
|
||||||
|
Crs_FlushCacheNumCrssInDeg ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr ();
|
||||||
Usr_FlushCacheNumUsrsInCrssOfCtr ();
|
Usr_FlushCacheNumUsrsInCrssOfCtr ();
|
||||||
Usr_FlushCacheUsrIsSuperuser ();
|
Usr_FlushCacheUsrIsSuperuser ();
|
||||||
|
|
|
@ -782,6 +782,11 @@ struct Globals
|
||||||
long CtrCod;
|
long CtrCod;
|
||||||
unsigned NumCrss;
|
unsigned NumCrss;
|
||||||
} NumCrssInCtr;
|
} NumCrssInCtr;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long DegCod;
|
||||||
|
unsigned NumCrss;
|
||||||
|
} NumCrssInDeg;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
long CtrCod;
|
long CtrCod;
|
||||||
|
|
|
@ -535,8 +535,7 @@ void Hie_InitHierarchy (void)
|
||||||
/***** If degree code is available, get degree data *****/
|
/***** If degree code is available, get degree data *****/
|
||||||
if (Gbl.Hierarchy.Deg.DegCod > 0)
|
if (Gbl.Hierarchy.Deg.DegCod > 0)
|
||||||
{
|
{
|
||||||
if (Deg_GetDataOfDegreeByCod (&Gbl.Hierarchy.Deg, // Degree found
|
if (Deg_GetDataOfDegreeByCod (&Gbl.Hierarchy.Deg)) // Degree found
|
||||||
Deg_GET_EXTRA_DATA)) // Get extra data because they may be needed later
|
|
||||||
{
|
{
|
||||||
Gbl.Hierarchy.Ctr.CtrCod = Gbl.Hierarchy.Deg.CtrCod;
|
Gbl.Hierarchy.Ctr.CtrCod = Gbl.Hierarchy.Deg.CtrCod;
|
||||||
Gbl.Hierarchy.Ins.InsCod = Deg_GetInsCodOfDegreeByCod (Gbl.Hierarchy.Deg.DegCod);
|
Gbl.Hierarchy.Ins.InsCod = Deg_GetInsCodOfDegreeByCod (Gbl.Hierarchy.Deg.DegCod);
|
||||||
|
@ -548,7 +547,7 @@ void Hie_InitHierarchy (void)
|
||||||
/***** If centre code is available, get centre data *****/
|
/***** If centre code is available, get centre data *****/
|
||||||
if (Gbl.Hierarchy.Ctr.CtrCod > 0)
|
if (Gbl.Hierarchy.Ctr.CtrCod > 0)
|
||||||
{
|
{
|
||||||
if (Ctr_GetDataOfCentreByCod (&Gbl.Hierarchy.Ctr)) // Degree found
|
if (Ctr_GetDataOfCentreByCod (&Gbl.Hierarchy.Ctr)) // Centre found
|
||||||
Gbl.Hierarchy.Ins.InsCod = Gbl.Hierarchy.Ctr.InsCod;
|
Gbl.Hierarchy.Ins.InsCod = Gbl.Hierarchy.Ctr.InsCod;
|
||||||
else
|
else
|
||||||
Hie_ResetHierarchy ();
|
Hie_ResetHierarchy ();
|
||||||
|
@ -762,7 +761,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan)
|
||||||
if (Deg.DegCod > 0)
|
if (Deg.DegCod > 0)
|
||||||
{
|
{
|
||||||
/* Get data of degree */
|
/* Get data of degree */
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/* Write degree logo and name */
|
/* Write degree logo and name */
|
||||||
Deg_DrawDegreeLogoAndNameWithLink (&Deg,ActSeeDegInf,
|
Deg_DrawDegreeLogoAndNameWithLink (&Deg,ActSeeDegInf,
|
||||||
|
|
|
@ -1557,7 +1557,7 @@ void Lay_WriteHeaderClassPhoto (bool PrintView,bool DrawingClassPhoto,
|
||||||
|
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg.DegCod = DegCod;
|
Deg.DegCod = DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/***** Get data of course *****/
|
/***** Get data of course *****/
|
||||||
Crs.CrsCod = CrsCod;
|
Crs.CrsCod = CrsCod;
|
||||||
|
|
|
@ -411,7 +411,7 @@ void Ntf_ShowMyNotifications (void)
|
||||||
|
|
||||||
/* Get degree code (row[4]) */
|
/* Get degree code (row[4]) */
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/* Get course code (row[5]) */
|
/* Get course code (row[5]) */
|
||||||
Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]);
|
Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
|
@ -1658,7 +1658,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
|
||||||
|
|
||||||
/* Get degree code (row[4]) */
|
/* Get degree code (row[4]) */
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/* Get course code (row[5]) */
|
/* Get course code (row[5]) */
|
||||||
Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]);
|
Crs.CrsCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
|
|
|
@ -2010,7 +2010,7 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
|
||||||
Deg_GetListAllDegsWithStds (&Degs);
|
Deg_GetListAllDegsWithStds (&Degs);
|
||||||
|
|
||||||
/***** Get data of the degree from database *****/
|
/***** Get data of the degree from database *****/
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/***** Contextual menu *****/
|
/***** Contextual menu *****/
|
||||||
Mnu_ContextMenuBegin ();
|
Mnu_ContextMenuBegin ();
|
||||||
|
@ -2153,7 +2153,7 @@ static void Pho_ShowOrPrintClassPhotoDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrin
|
||||||
Lay_ShowErrorAndExit ("Wrong code of degree.");
|
Lay_ShowErrorAndExit ("Wrong code of degree.");
|
||||||
|
|
||||||
/* Get data of degree */
|
/* Get data of degree */
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/* Get number of students and number of students with photo in this degree */
|
/* Get number of students and number of students with photo in this degree */
|
||||||
Pho_GetNumStdsInDegree (Deg.DegCod,Usr_SEX_ALL,&NumStds,&NumStdsWithPhoto);
|
Pho_GetNumStdsInDegree (Deg.DegCod,Usr_SEX_ALL,&NumStds,&NumStdsWithPhoto);
|
||||||
|
@ -2246,7 +2246,7 @@ static void Pho_ShowOrPrintListDegrees (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
|
||||||
Lay_ShowErrorAndExit ("Wrong code of degree.");
|
Lay_ShowErrorAndExit ("Wrong code of degree.");
|
||||||
|
|
||||||
/* Get data of degree */
|
/* Get data of degree */
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
|
|
|
@ -1165,7 +1165,7 @@ static void Rep_WriteRowCrsData (long CrsCod,Rol_Role_t Role,
|
||||||
|
|
||||||
/***** Get degree data *****/
|
/***** Get degree data *****/
|
||||||
Deg.DegCod = Crs.DegCod;
|
Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/***** Start row *****/
|
/***** Start row *****/
|
||||||
fprintf (Gbl.F.Rep,"<li>");
|
fprintf (Gbl.F.Rep,"<li>");
|
||||||
|
|
|
@ -3552,7 +3552,7 @@ static void Sta_WriteDegree (long DegCod)
|
||||||
{
|
{
|
||||||
/***** Get data of degree *****/
|
/***** Get data of degree *****/
|
||||||
Deg.DegCod = DegCod;
|
Deg.DegCod = DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
|
|
||||||
/***** Title in cell *****/
|
/***** Title in cell *****/
|
||||||
HTM_TD_Begin ("class=\"LOG LM\" title=\"%s\"",Deg.FullName);
|
HTM_TD_Begin ("class=\"LOG LM\" title=\"%s\"",Deg.FullName);
|
||||||
|
|
|
@ -1623,7 +1623,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
|
||||||
case TL_NOTE_DEG_SHA_PUB_FILE:
|
case TL_NOTE_DEG_SHA_PUB_FILE:
|
||||||
/* Get degree data */
|
/* Get degree data */
|
||||||
Deg.DegCod = SocNot->HieCod;
|
Deg.DegCod = SocNot->HieCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg);
|
||||||
break;
|
break;
|
||||||
case TL_NOTE_CRS_DOC_PUB_FILE:
|
case TL_NOTE_CRS_DOC_PUB_FILE:
|
||||||
case TL_NOTE_CRS_SHA_PUB_FILE:
|
case TL_NOTE_CRS_SHA_PUB_FILE:
|
||||||
|
|
Loading…
Reference in New Issue