mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-01 14:25:27 +02:00
Version19.112.7
This commit is contained in:
parent
d664dd1982
commit
2f5030384d
|
@ -3066,7 +3066,7 @@ int swad__getNotifications (struct soap *soap,
|
||||||
|
|
||||||
/* Get centre (row[5]) */
|
/* Get centre (row[5]) */
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Get degree (row[6]) */
|
/* Get degree (row[6]) */
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[6]);
|
||||||
|
|
|
@ -170,7 +170,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
|
||||||
Gbl.ColorRows[Gbl.RowEvenOdd];
|
Gbl.ColorRows[Gbl.RowEvenOdd];
|
||||||
|
|
||||||
/* Get data of centre */
|
/* Get data of centre */
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Centre logo and full name */
|
/* Centre logo and full name */
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
@ -406,7 +406,7 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr)
|
||||||
|
|
||||||
/***** Number of degrees *****/
|
/***** Number of degrees *****/
|
||||||
HTM_TD_Begin ("class=\"%s RM %s\"",TxtClassNormal,BgColor);
|
HTM_TD_Begin ("class=\"%s RM %s\"",TxtClassNormal,BgColor);
|
||||||
HTM_Unsigned (Ctr->Degs.Num);
|
HTM_Unsigned (Deg_GetNumDegsInCtr (Ctr->CtrCod));
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** Number of courses *****/
|
/***** Number of courses *****/
|
||||||
|
@ -585,9 +585,6 @@ void Ctr_GetListCentres (long InsCod)
|
||||||
/* Get next centre */
|
/* Get next centre */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
Ctr_GetDataOfCentreFromRow (Ctr,row);
|
Ctr_GetDataOfCentreFromRow (Ctr,row);
|
||||||
|
|
||||||
/* Get number of degrees in this centre */
|
|
||||||
Ctr->Degs.Num = Deg_GetNumDegsInCtr (Ctr->CtrCod);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -601,8 +598,7 @@ void Ctr_GetListCentres (long InsCod)
|
||||||
/************************ Get data of centre by code *************************/
|
/************************ Get data of centre by code *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr,
|
bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr)
|
||||||
Ctr_GetExtraData_t GetExtraData)
|
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -618,6 +614,7 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr,
|
||||||
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;
|
||||||
|
|
||||||
/***** Check if centre code is correct *****/
|
/***** Check if centre code is correct *****/
|
||||||
if (Ctr->CtrCod > 0)
|
if (Ctr->CtrCod > 0)
|
||||||
|
@ -644,11 +641,6 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr,
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
Ctr_GetDataOfCentreFromRow (Ctr,row);
|
Ctr_GetDataOfCentreFromRow (Ctr,row);
|
||||||
|
|
||||||
/* Get extra data */
|
|
||||||
if (GetExtraData == Ctr_GET_EXTRA_DATA)
|
|
||||||
/* Get number of degrees in this centre */
|
|
||||||
Ctr->Degs.Num = Deg_GetNumDegsInCtr (Ctr->CtrCod);
|
|
||||||
|
|
||||||
/* Set return value */
|
/* Set return value */
|
||||||
CtrFound = true;
|
CtrFound = true;
|
||||||
}
|
}
|
||||||
|
@ -882,7 +874,7 @@ static void Ctr_ListCentresForEdition (void)
|
||||||
HTM_TD_Begin ("class=\"BM\"");
|
HTM_TD_Begin ("class=\"BM\"");
|
||||||
if (!ICanEdit)
|
if (!ICanEdit)
|
||||||
Ico_PutIconRemovalNotAllowed ();
|
Ico_PutIconRemovalNotAllowed ();
|
||||||
else if (Ctr->Degs.Num) // Centre has degrees
|
else if (Deg_GetNumDegsInCtr (Ctr->CtrCod)) // Centre has degrees
|
||||||
Ico_PutIconRemovalNotAllowed ();
|
Ico_PutIconRemovalNotAllowed ();
|
||||||
else if (Usr_GetNumUsrsWhoClaimToBelongToCtr (Ctr->CtrCod)) // Centre has users who claim to belong to it
|
else if (Usr_GetNumUsrsWhoClaimToBelongToCtr (Ctr->CtrCod)) // Centre has users who claim to belong to it
|
||||||
Ico_PutIconRemovalNotAllowed ();
|
Ico_PutIconRemovalNotAllowed ();
|
||||||
|
@ -994,7 +986,7 @@ static void Ctr_ListCentresForEdition (void)
|
||||||
|
|
||||||
/* Number of degrees */
|
/* Number of degrees */
|
||||||
HTM_TD_Begin ("class=\"DAT RM\"");
|
HTM_TD_Begin ("class=\"DAT RM\"");
|
||||||
HTM_Unsigned (Ctr->Degs.Num);
|
HTM_Unsigned (Deg_GetNumDegsInCtr (Ctr->CtrCod));
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/* Number of users in courses of this centre */
|
/* Number of users in courses of this centre */
|
||||||
|
@ -1148,10 +1140,10 @@ void Ctr_RemoveCentre (void)
|
||||||
Ctr_EditingCtr->CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
Ctr_EditingCtr->CtrCod = Ctr_GetAndCheckParamOtherCtrCod (1);
|
||||||
|
|
||||||
/***** Get data of the centre from database *****/
|
/***** Get data of the centre from database *****/
|
||||||
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr,Ctr_GET_EXTRA_DATA);
|
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr);
|
||||||
|
|
||||||
/***** Check if this centre has teachers *****/
|
/***** Check if this centre has teachers *****/
|
||||||
if (Ctr_EditingCtr->Degs.Num) // Centre has degrees
|
if (Deg_GetNumDegsInCtr (Ctr_EditingCtr->CtrCod)) // Centre has degrees
|
||||||
Ale_ShowAlert (Ale_WARNING,
|
Ale_ShowAlert (Ale_WARNING,
|
||||||
Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
|
Txt_To_remove_a_centre_you_must_first_remove_all_degrees_and_teachers_in_the_centre);
|
||||||
else if (Usr_GetNumUsrsWhoClaimToBelongToCtr (Ctr_EditingCtr->CtrCod)) // Centre has users who claim to belong to it
|
else if (Usr_GetNumUsrsWhoClaimToBelongToCtr (Ctr_EditingCtr->CtrCod)) // Centre has users who claim to belong to it
|
||||||
|
@ -1189,6 +1181,7 @@ void Ctr_RemoveCentre (void)
|
||||||
Ctr_EditingCtr->CtrCod);
|
Ctr_EditingCtr->CtrCod);
|
||||||
|
|
||||||
/***** Flush caches *****/
|
/***** Flush caches *****/
|
||||||
|
Deg_FlushCacheNumDegsInCtr ();
|
||||||
Crs_FlushCacheNumCrssInCtr ();
|
Crs_FlushCacheNumCrssInCtr ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr ();
|
||||||
Usr_FlushCacheNumUsrsInCrssOfCtr ();
|
Usr_FlushCacheNumUsrsInCrssOfCtr ();
|
||||||
|
@ -1221,7 +1214,7 @@ void Ctr_ChangeCtrPlc (void)
|
||||||
NewPlcCod = Plc_GetParamPlcCod ();
|
NewPlcCod = Plc_GetParamPlcCod ();
|
||||||
|
|
||||||
/***** Get data of centre from database *****/
|
/***** Get data of centre from database *****/
|
||||||
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr);
|
||||||
|
|
||||||
/***** Update place in table of centres *****/
|
/***** Update place in table of centres *****/
|
||||||
Ctr_UpdateCtrPlcDB (Ctr_EditingCtr->CtrCod,NewPlcCod);
|
Ctr_UpdateCtrPlcDB (Ctr_EditingCtr->CtrCod,NewPlcCod);
|
||||||
|
@ -1304,7 +1297,7 @@ void Ctr_RenameCentre (struct Centre *Ctr,Cns_ShrtOrFullName_t ShrtOrFullName)
|
||||||
Par_GetParToText (ParamName,NewCtrName,MaxBytes);
|
Par_GetParToText (ParamName,NewCtrName,MaxBytes);
|
||||||
|
|
||||||
/***** Get from the database the old names of the centre *****/
|
/***** Get from the database the old names of the centre *****/
|
||||||
Ctr_GetDataOfCentreByCod (Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (Ctr);
|
||||||
|
|
||||||
/***** Check if new name is empty *****/
|
/***** Check if new name is empty *****/
|
||||||
if (!NewCtrName[0])
|
if (!NewCtrName[0])
|
||||||
|
@ -1388,7 +1381,7 @@ void Ctr_ChangeCtrWWW (void)
|
||||||
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
Par_GetParToText ("WWW",NewWWW,Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/***** Get data of centre *****/
|
/***** Get data of centre *****/
|
||||||
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr);
|
||||||
|
|
||||||
/***** Check if new WWW is empty *****/
|
/***** Check if new WWW is empty *****/
|
||||||
if (NewWWW[0])
|
if (NewWWW[0])
|
||||||
|
@ -1448,7 +1441,7 @@ void Ctr_ChangeCtrStatus (void)
|
||||||
Status = Ctr_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
Status = Ctr_GetStatusBitsFromStatusTxt (StatusTxt); // New status
|
||||||
|
|
||||||
/***** Get data of centre *****/
|
/***** Get data of centre *****/
|
||||||
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (Ctr_EditingCtr);
|
||||||
|
|
||||||
/***** Update status in table of centres *****/
|
/***** Update status in table of centres *****/
|
||||||
DB_QueryUPDATE ("can not update the status of a centre",
|
DB_QueryUPDATE ("can not update the status of a centre",
|
||||||
|
@ -1965,7 +1958,7 @@ void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs)
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
/* Get data of centre */
|
/* Get data of centre */
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_EXTRA_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Write data of this centre */
|
/* Write data of this centre */
|
||||||
Ctr_ListOneCentreForSeeing (&Ctr,NumCtr);
|
Ctr_ListOneCentreForSeeing (&Ctr,NumCtr);
|
||||||
|
|
|
@ -82,12 +82,6 @@ typedef enum
|
||||||
} Ctr_Order_t;
|
} Ctr_Order_t;
|
||||||
#define Ctr_ORDER_DEFAULT Ctr_ORDER_BY_CENTRE
|
#define Ctr_ORDER_DEFAULT Ctr_ORDER_BY_CENTRE
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
Ctr_GET_BASIC_DATA,
|
|
||||||
Ctr_GET_EXTRA_DATA,
|
|
||||||
} Ctr_GetExtraData_t;
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public prototypes ****************************/
|
/****************************** Public prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -103,8 +97,7 @@ void Ctr_EditCentres (void);
|
||||||
void Ctr_PutIconToViewCentres (void);
|
void Ctr_PutIconToViewCentres (void);
|
||||||
|
|
||||||
void Ctr_GetListCentres (long InsCod);
|
void Ctr_GetListCentres (long InsCod);
|
||||||
bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr,
|
bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr);
|
||||||
Ctr_GetExtraData_t GetExtraData);
|
|
||||||
long Ctr_GetInsCodOfCentreByCod (long CtrCod);
|
long Ctr_GetInsCodOfCentreByCod (long CtrCod);
|
||||||
void Ctr_GetShortNameOfCentreByCod (struct Centre *Ctr);
|
void Ctr_GetShortNameOfCentreByCod (struct Centre *Ctr);
|
||||||
void Ctr_FreeListCentres (void);
|
void Ctr_FreeListCentres (void);
|
||||||
|
|
|
@ -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.6 (2020-01-05)"
|
#define Log_PLATFORM_VERSION "SWAD 19.112.7 (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,7 +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
|
||||||
|
|
||||||
|
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)
|
||||||
Version 19.112.4: Jan 05, 2020 Optimization in number of users in courses of a centre. (278385 lines)
|
Version 19.112.4: Jan 05, 2020 Optimization in number of users in courses of a centre. (278385 lines)
|
||||||
|
|
|
@ -331,7 +331,7 @@ static void CtyCfg_Map (void)
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
/* Get data of centre */
|
/* Get data of centre */
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Get data of institution */
|
/* Get data of institution */
|
||||||
Ins.InsCod = Ctr.InsCod;
|
Ins.InsCod = Ctr.InsCod;
|
||||||
|
|
|
@ -275,7 +275,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
||||||
|
|
||||||
/***** Get data of this centre *****/
|
/***** Get data of this centre *****/
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
if (!Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA))
|
if (!Ctr_GetDataOfCentreByCod (&Ctr))
|
||||||
Lay_ShowErrorAndExit ("Centre not found.");
|
Lay_ShowErrorAndExit ("Centre not found.");
|
||||||
|
|
||||||
/***** Write link to centre *****/
|
/***** Write link to centre *****/
|
||||||
|
|
|
@ -793,7 +793,7 @@ static void Deg_ListDegrees (void)
|
||||||
{
|
{
|
||||||
Frm_StartForm (ActEdiDeg);
|
Frm_StartForm (ActEdiDeg);
|
||||||
Btn_PutConfirmButton (Gbl.Hierarchy.Ctr.Degs.Num ? Txt_Create_another_degree :
|
Btn_PutConfirmButton (Gbl.Hierarchy.Ctr.Degs.Num ? Txt_Create_another_degree :
|
||||||
Txt_Create_degree);
|
Txt_Create_degree);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1895,14 +1895,30 @@ unsigned Deg_GetNumDegsInIns (long InsCod)
|
||||||
/******************** Get number of degrees in a centre **********************/
|
/******************** Get number of degrees in a centre **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Deg_FlushCacheNumDegsInCtr (void)
|
||||||
|
{
|
||||||
|
Gbl.Cache.NumDegsInCtr.CtrCod = -1L;
|
||||||
|
Gbl.Cache.NumDegsInCtr.NumDegs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned Deg_GetNumDegsInCtr (long CtrCod)
|
unsigned Deg_GetNumDegsInCtr (long CtrCod)
|
||||||
{
|
{
|
||||||
/***** Get number of degrees in a centre from database *****/
|
/***** 1. Fast check: Trivial case *****/
|
||||||
return
|
if (CtrCod <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/***** 2. Fast check: If cached... *****/
|
||||||
|
if (CtrCod == Gbl.Cache.NumDegsInCtr.CtrCod)
|
||||||
|
return Gbl.Cache.NumDegsInCtr.NumDegs;
|
||||||
|
|
||||||
|
/***** 3. Slow: number of degrees in a centre from database *****/
|
||||||
|
Gbl.Cache.NumDegsInCtr.CtrCod = CtrCod;
|
||||||
|
Gbl.Cache.NumDegsInCtr.NumDegs =
|
||||||
(unsigned) DB_QueryCOUNT ("can not get the number of degrees in a centre",
|
(unsigned) DB_QueryCOUNT ("can not get the number of degrees in a centre",
|
||||||
"SELECT COUNT(*) FROM degrees"
|
"SELECT COUNT(*) FROM degrees"
|
||||||
" WHERE CtrCod=%ld",
|
" WHERE CtrCod=%ld",
|
||||||
CtrCod);
|
CtrCod);
|
||||||
|
return Gbl.Cache.NumDegsInCtr.NumDegs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -149,6 +149,7 @@ void Deg_RemoveLogo (void);
|
||||||
unsigned Deg_GetNumDegsTotal (void);
|
unsigned Deg_GetNumDegsTotal (void);
|
||||||
unsigned Deg_GetNumDegsInCty (long InsCod);
|
unsigned Deg_GetNumDegsInCty (long InsCod);
|
||||||
unsigned Deg_GetNumDegsInIns (long InsCod);
|
unsigned Deg_GetNumDegsInIns (long InsCod);
|
||||||
|
void Deg_FlushCacheNumDegsInCtr (void);
|
||||||
unsigned Deg_GetNumDegsInCtr (long CtrCod);
|
unsigned Deg_GetNumDegsInCtr (long CtrCod);
|
||||||
unsigned Deg_GetNumDegsWithCrss (const char *SubQuery);
|
unsigned Deg_GetNumDegsWithCrss (const char *SubQuery);
|
||||||
unsigned Deg_GetNumDegsWithUsrs (Rol_Role_t Role,const char *SubQuery);
|
unsigned Deg_GetNumDegsWithUsrs (Rol_Role_t Role,const char *SubQuery);
|
||||||
|
|
|
@ -388,7 +388,7 @@ void DegCfg_ChangeDegCtr (void)
|
||||||
if (NewCtr.CtrCod != Gbl.Hierarchy.Deg.CtrCod)
|
if (NewCtr.CtrCod != Gbl.Hierarchy.Deg.CtrCod)
|
||||||
{
|
{
|
||||||
/***** Get data of new centre *****/
|
/***** Get data of new centre *****/
|
||||||
Ctr_GetDataOfCentreByCod (&NewCtr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&NewCtr);
|
||||||
|
|
||||||
/***** Check if it already exists a degree with the same name in the new centre *****/
|
/***** Check if it already exists a degree with the same name in the new centre *****/
|
||||||
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Hierarchy.Deg.ShrtName,Gbl.Hierarchy.Deg.DegCod,NewCtr.CtrCod))
|
if (Deg_CheckIfDegNameExistsInCtr ("ShortName",Gbl.Hierarchy.Deg.ShrtName,Gbl.Hierarchy.Deg.DegCod,NewCtr.CtrCod))
|
||||||
|
|
|
@ -6866,7 +6866,7 @@ static void Brw_WriteCurrentClipboard (void)
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_CTR:
|
case Brw_ADMI_DOC_CTR:
|
||||||
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
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,
|
||||||
|
@ -6874,7 +6874,7 @@ static void Brw_WriteCurrentClipboard (void)
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_SHR_CTR:
|
case Brw_ADMI_SHR_CTR:
|
||||||
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
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,
|
||||||
|
@ -7878,7 +7878,7 @@ static void Brw_PasteClipboard (void)
|
||||||
case Brw_ADMI_DOC_CTR:
|
case Brw_ADMI_DOC_CTR:
|
||||||
case Brw_ADMI_SHR_CTR:
|
case Brw_ADMI_SHR_CTR:
|
||||||
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
Ctr.CtrCod = Gbl.FileBrowser.Clipboard.Cod;
|
||||||
if (Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA))
|
if (Ctr_GetDataOfCentreByCod (&Ctr))
|
||||||
snprintf (PathOrg,sizeof (PathOrg),
|
snprintf (PathOrg,sizeof (PathOrg),
|
||||||
"%s/%02u/%u/%s",
|
"%s/%02u/%u/%s",
|
||||||
Cfg_PATH_CTR_PRIVATE,
|
Cfg_PATH_CTR_PRIVATE,
|
||||||
|
@ -11053,7 +11053,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*CrsCod = -1L;
|
*CrsCod = -1L;
|
||||||
*DegCod = -1L;
|
*DegCod = -1L;
|
||||||
*CtrCod = Ctr.CtrCod = Cod;
|
*CtrCod = Ctr.CtrCod = Cod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_DEG:
|
case Brw_ADMI_DOC_DEG:
|
||||||
|
@ -11064,7 +11064,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*DegCod = Deg.DegCod = Cod;
|
*DegCod = Deg.DegCod = Cod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_CRS:
|
case Brw_ADMI_DOC_CRS:
|
||||||
|
@ -11080,7 +11080,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*DegCod = Deg.DegCod = Crs.DegCod;
|
*DegCod = Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_GRP:
|
case Brw_ADMI_DOC_GRP:
|
||||||
|
@ -11095,7 +11095,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*DegCod = Deg.DegCod = Crs.DegCod;
|
*DegCod = Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
break;
|
break;
|
||||||
case Brw_ADMI_DOC_PRJ:
|
case Brw_ADMI_DOC_PRJ:
|
||||||
|
@ -11107,7 +11107,7 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
*DegCod = Deg.DegCod = Crs.DegCod;
|
*DegCod = Deg.DegCod = Crs.DegCod;
|
||||||
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
Deg_GetDataOfDegreeByCod (&Deg,Deg_GET_BASIC_DATA);
|
||||||
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
*CtrCod = Ctr.CtrCod = Deg.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
*InsCod = Ctr.InsCod;
|
*InsCod = Ctr.InsCod;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -2175,14 +2175,14 @@ void For_SetForumName (struct Forum *Forum,
|
||||||
break;
|
break;
|
||||||
case For_FORUM_CENTRE_USRS:
|
case For_FORUM_CENTRE_USRS:
|
||||||
Ctr.CtrCod = Forum->Location;
|
Ctr.CtrCod = Forum->Location;
|
||||||
if (!Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA))
|
if (!Ctr_GetDataOfCentreByCod (&Ctr))
|
||||||
Lay_ShowErrorAndExit ("Centre not found.");
|
Lay_ShowErrorAndExit ("Centre not found.");
|
||||||
Str_Copy (ForumName,Ctr.ShrtName,
|
Str_Copy (ForumName,Ctr.ShrtName,
|
||||||
For_MAX_BYTES_FORUM_NAME);
|
For_MAX_BYTES_FORUM_NAME);
|
||||||
break;
|
break;
|
||||||
case For_FORUM_CENTRE_TCHS:
|
case For_FORUM_CENTRE_TCHS:
|
||||||
Ctr.CtrCod = Forum->Location;
|
Ctr.CtrCod = Forum->Location;
|
||||||
if (!Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA))
|
if (!Ctr_GetDataOfCentreByCod (&Ctr))
|
||||||
Lay_ShowErrorAndExit ("Centre not found.");
|
Lay_ShowErrorAndExit ("Centre not found.");
|
||||||
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,
|
snprintf (ForumName,For_MAX_BYTES_FORUM_NAME + 1,
|
||||||
"%s%s",Ctr.ShrtName,
|
"%s%s",Ctr.ShrtName,
|
||||||
|
|
|
@ -412,6 +412,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Cty_FlushCacheCountryName ();
|
Cty_FlushCacheCountryName ();
|
||||||
Ins_FlushCacheShortNameOfInstitution ();
|
Ins_FlushCacheShortNameOfInstitution ();
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
|
Deg_FlushCacheNumDegsInCtr ();
|
||||||
Crs_FlushCacheNumCrssInCtr ();
|
Crs_FlushCacheNumCrssInCtr ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCtr ();
|
||||||
Usr_FlushCacheNumUsrsInCrssOfCtr ();
|
Usr_FlushCacheNumUsrsInCrssOfCtr ();
|
||||||
|
|
|
@ -772,6 +772,11 @@ struct Globals
|
||||||
char ShrtName[Hie_MAX_BYTES_SHRT_NAME + 1];
|
char ShrtName[Hie_MAX_BYTES_SHRT_NAME + 1];
|
||||||
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1];
|
char CtyName[Hie_MAX_BYTES_FULL_NAME + 1];
|
||||||
} InstitutionShrtNameAndCty;
|
} InstitutionShrtNameAndCty;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long CtrCod;
|
||||||
|
unsigned NumDegs;
|
||||||
|
} NumDegsInCtr;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
long CtrCod;
|
long CtrCod;
|
||||||
|
|
|
@ -548,8 +548,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)) // Degree found
|
||||||
Ctr_GET_EXTRA_DATA)) // Get extra data because they may be needed later
|
|
||||||
Gbl.Hierarchy.Ins.InsCod = Gbl.Hierarchy.Ctr.InsCod;
|
Gbl.Hierarchy.Ins.InsCod = Gbl.Hierarchy.Ctr.InsCod;
|
||||||
else
|
else
|
||||||
Hie_ResetHierarchy ();
|
Hie_ResetHierarchy ();
|
||||||
|
@ -751,7 +750,7 @@ void Hie_GetAndWriteInsCtrDegAdminBy (long UsrCod,unsigned ColSpan)
|
||||||
if (Ctr.CtrCod > 0)
|
if (Ctr.CtrCod > 0)
|
||||||
{
|
{
|
||||||
/* Get data of centre */
|
/* Get data of centre */
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Write centre logo and name */
|
/* Write centre logo and name */
|
||||||
Ctr_DrawCentreLogoAndNameWithLink (&Ctr,ActSeeCtrInf,
|
Ctr_DrawCentreLogoAndNameWithLink (&Ctr,ActSeeCtrInf,
|
||||||
|
|
|
@ -338,7 +338,7 @@ static void InsCfg_Map (void)
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
/* Get data of centre */
|
/* Get data of centre */
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Add marker */
|
/* Add marker */
|
||||||
Map_AddMarker (&Ctr.Coord);
|
Map_AddMarker (&Ctr.Coord);
|
||||||
|
|
|
@ -407,7 +407,7 @@ void Ntf_ShowMyNotifications (void)
|
||||||
|
|
||||||
/* Get centre code (row[3]) */
|
/* Get centre code (row[3]) */
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Get degree code (row[4]) */
|
/* Get degree code (row[4]) */
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
|
@ -1654,7 +1654,7 @@ static void Ntf_SendPendingNotifByEMailToOneUsr (struct UsrData *ToUsrDat,unsign
|
||||||
|
|
||||||
/* Get centre code (row[3]) */
|
/* Get centre code (row[3]) */
|
||||||
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]);
|
Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[3]);
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/* Get degree code (row[4]) */
|
/* Get degree code (row[4]) */
|
||||||
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
Deg.DegCod = Str_ConvertStrCodToLongCod (row[4]);
|
||||||
|
|
|
@ -3571,7 +3571,7 @@ static void Rec_ShowCentre (struct UsrData *UsrDat,bool ShowData)
|
||||||
if (UsrDat->Tch.CtrCod > 0)
|
if (UsrDat->Tch.CtrCod > 0)
|
||||||
{
|
{
|
||||||
Ctr.CtrCod = UsrDat->Tch.CtrCod;
|
Ctr.CtrCod = UsrDat->Tch.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
if (Ctr.WWW[0])
|
if (Ctr.WWW[0])
|
||||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_N\"",
|
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_N\"",
|
||||||
Ctr.WWW);
|
Ctr.WWW);
|
||||||
|
@ -4208,7 +4208,7 @@ void Rec_UpdateMyCentre (void)
|
||||||
/* Get institution of centre */
|
/* Get institution of centre */
|
||||||
if (Ctr.CtrCod > 0)
|
if (Ctr.CtrCod > 0)
|
||||||
{
|
{
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
if (Gbl.Usrs.Me.UsrDat.InsCod != Ctr.InsCod)
|
if (Gbl.Usrs.Me.UsrDat.InsCod != Ctr.InsCod)
|
||||||
{
|
{
|
||||||
Gbl.Usrs.Me.UsrDat.InsCod = Ctr.InsCod;
|
Gbl.Usrs.Me.UsrDat.InsCod = Ctr.InsCod;
|
||||||
|
|
|
@ -3460,7 +3460,7 @@ static void Sta_WriteCentre (long CtrCod)
|
||||||
{
|
{
|
||||||
/***** Get data of centre *****/
|
/***** Get data of centre *****/
|
||||||
Ctr.CtrCod = CtrCod;
|
Ctr.CtrCod = CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
|
|
||||||
/***** Title in cell *****/
|
/***** Title in cell *****/
|
||||||
HTM_TD_Begin ("class=\"LOG LM\" title=\"%s\"",Ctr.FullName);
|
HTM_TD_Begin ("class=\"LOG LM\" title=\"%s\"",Ctr.FullName);
|
||||||
|
|
|
@ -1617,7 +1617,7 @@ static void TL_WriteNote (const struct TL_Note *SocNot,
|
||||||
case TL_NOTE_CTR_SHA_PUB_FILE:
|
case TL_NOTE_CTR_SHA_PUB_FILE:
|
||||||
/* Get centre data */
|
/* Get centre data */
|
||||||
Ctr.CtrCod = SocNot->HieCod;
|
Ctr.CtrCod = SocNot->HieCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
break;
|
break;
|
||||||
case TL_NOTE_DEG_DOC_PUB_FILE:
|
case TL_NOTE_DEG_DOC_PUB_FILE:
|
||||||
case TL_NOTE_DEG_SHA_PUB_FILE:
|
case TL_NOTE_DEG_SHA_PUB_FILE:
|
||||||
|
|
|
@ -3771,7 +3771,7 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
|
||||||
if (UsrDat->Tch.CtrCod > 0)
|
if (UsrDat->Tch.CtrCod > 0)
|
||||||
{
|
{
|
||||||
Ctr.CtrCod = UsrDat->Tch.CtrCod;
|
Ctr.CtrCod = UsrDat->Tch.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
}
|
}
|
||||||
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
|
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
|
||||||
UsrDat->Tch.CtrCod > 0 ? Ctr.FullName :
|
UsrDat->Tch.CtrCod > 0 ? Ctr.FullName :
|
||||||
|
@ -3994,7 +3994,7 @@ static void Usr_WriteRowTchAllData (struct UsrData *UsrDat)
|
||||||
if (ShowData && UsrDat->Tch.CtrCod > 0)
|
if (ShowData && UsrDat->Tch.CtrCod > 0)
|
||||||
{
|
{
|
||||||
Ctr.CtrCod = UsrDat->Tch.CtrCod;
|
Ctr.CtrCod = UsrDat->Tch.CtrCod;
|
||||||
Ctr_GetDataOfCentreByCod (&Ctr,Ctr_GET_BASIC_DATA);
|
Ctr_GetDataOfCentreByCod (&Ctr);
|
||||||
}
|
}
|
||||||
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
|
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
|
||||||
(ShowData && UsrDat->Tch.CtrCod > 0) ? Ctr.FullName :
|
(ShowData && UsrDat->Tch.CtrCod > 0) ? Ctr.FullName :
|
||||||
|
|
Loading…
Reference in New Issue
Block a user