mirror of https://github.com/acanas/swad-core.git
Version19.112.20
This commit is contained in:
parent
d91f19a3fb
commit
d197a9428d
|
@ -502,7 +502,7 @@ ps2pdf source.ps destination.pdf
|
||||||
// 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.20:Jan 07, 2020 Optimization in number of users in a country. (? lines)
|
Version 19.112.20:Jan 07, 2020 Optimization in number of courses in a country. (278724 lines)
|
||||||
Version 19.112.19:Jan 07, 2020 Optimization in number of users in a country. (278675 lines)
|
Version 19.112.19:Jan 07, 2020 Optimization in number of users in a country. (278675 lines)
|
||||||
Version 19.112.18:Jan 07, 2020 Optimization in number of users in a country. (278668 lines)
|
Version 19.112.18:Jan 07, 2020 Optimization in number of users in a country. (278668 lines)
|
||||||
Version 19.112.17:Jan 07, 2020 Optimization in number of institutions in a country. (278600 lines)
|
Version 19.112.17:Jan 07, 2020 Optimization in number of institutions in a country. (278600 lines)
|
||||||
|
|
|
@ -432,7 +432,7 @@ static void Cty_ListOneCountryForSeeing (struct Country *Cty,unsigned NumCty)
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM %s\"",BgColor);
|
HTM_TD_Begin ("class=\"DAT RM %s\"",BgColor);
|
||||||
HTM_Unsigned (Cty->NumCrss);
|
HTM_Unsigned (Crs_GetNumCrssInCty (Cty->CtyCod));
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TD_Begin ("class=\"DAT RM %s\"",BgColor);
|
HTM_TD_Begin ("class=\"DAT RM %s\"",BgColor);
|
||||||
|
@ -844,7 +844,7 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
|
||||||
Cty->WWW[Lan][0] = '\0';
|
Cty->WWW[Lan][0] = '\0';
|
||||||
}
|
}
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
Cty->Inss.Num = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0;
|
Cty->Inss.Num = Cty->NumCtrs = Cty->NumDegs = 0;
|
||||||
|
|
||||||
/* Get the name of the country in current language */
|
/* Get the name of the country in current language */
|
||||||
Str_Copy (Cty->Name[Gbl.Prefs.Language],row[2],
|
Str_Copy (Cty->Name[Gbl.Prefs.Language],row[2],
|
||||||
|
@ -874,9 +874,6 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
|
||||||
|
|
||||||
/* Get number of degrees in this country */
|
/* Get number of degrees in this country */
|
||||||
Cty->NumDegs = Deg_GetNumDegsInCty (Cty->CtyCod);
|
Cty->NumDegs = Deg_GetNumDegsInCty (Cty->CtyCod);
|
||||||
|
|
||||||
/* Get number of courses in this country */
|
|
||||||
Cty->NumCrss = Crs_GetNumCrssInCty (Cty->CtyCod);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1004,7 +1001,7 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
|
||||||
Cty->WWW[Lan][0] = '\0';
|
Cty->WWW[Lan][0] = '\0';
|
||||||
}
|
}
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
Cty->Inss.Num = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0;
|
Cty->Inss.Num = Cty->NumCtrs = Cty->NumDegs = 0;
|
||||||
|
|
||||||
/***** Check if country code is correct *****/
|
/***** Check if country code is correct *****/
|
||||||
if (Cty->CtyCod == 0)
|
if (Cty->CtyCod == 0)
|
||||||
|
@ -1379,6 +1376,7 @@ void Cty_RemoveCountry (void)
|
||||||
/***** Flush cache *****/
|
/***** Flush cache *****/
|
||||||
Cty_FlushCacheCountryName ();
|
Cty_FlushCacheCountryName ();
|
||||||
Ins_FlushCacheNumInssInCty ();
|
Ins_FlushCacheNumInssInCty ();
|
||||||
|
Crs_FlushCacheNumCrssInCty ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
||||||
|
|
||||||
/***** Write message to show the change made *****/
|
/***** Write message to show the change made *****/
|
||||||
|
@ -2083,7 +2081,6 @@ static void Cty_EditingCountryConstructor (void)
|
||||||
Cty_EditingCty->Inss.SelectedOrder = Ins_ORDER_DEFAULT;
|
Cty_EditingCty->Inss.SelectedOrder = Ins_ORDER_DEFAULT;
|
||||||
Cty_EditingCty->NumCtrs = 0;
|
Cty_EditingCty->NumCtrs = 0;
|
||||||
Cty_EditingCty->NumDegs = 0;
|
Cty_EditingCty->NumDegs = 0;
|
||||||
Cty_EditingCty->NumCrss = 0;
|
|
||||||
Cty_EditingCty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty_EditingCty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ struct Country
|
||||||
} Inss;
|
} Inss;
|
||||||
unsigned NumCtrs;
|
unsigned NumCtrs;
|
||||||
unsigned NumDegs;
|
unsigned NumDegs;
|
||||||
unsigned NumCrss;
|
// unsigned NumCrss;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool Valid;
|
bool Valid;
|
||||||
|
|
|
@ -409,10 +409,25 @@ unsigned Crs_GetNumCrssTotal (void)
|
||||||
/****************** Get number of courses in a country ***********************/
|
/****************** Get number of courses in a country ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Crs_FlushCacheNumCrssInCty (void)
|
||||||
|
{
|
||||||
|
Gbl.Cache.NumCrssInCty.CtyCod = -1L;
|
||||||
|
Gbl.Cache.NumCrssInCty.NumCrss = 0;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned Crs_GetNumCrssInCty (long CtyCod)
|
unsigned Crs_GetNumCrssInCty (long CtyCod)
|
||||||
{
|
{
|
||||||
/***** Get number of courses in a country from database *****/
|
/***** 1. Fast check: Trivial case *****/
|
||||||
return
|
if (CtyCod <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/***** 2. Fast check: If cached... *****/
|
||||||
|
if (CtyCod == Gbl.Cache.NumCrssInCty.CtyCod)
|
||||||
|
return Gbl.Cache.NumCrssInCty.NumCrss;
|
||||||
|
|
||||||
|
/***** 3. Slow: number of courses in a country from database *****/
|
||||||
|
Gbl.Cache.NumCrssInCty.CtyCod = CtyCod;
|
||||||
|
Gbl.Cache.NumCrssInCty.NumCrss =
|
||||||
(unsigned) DB_QueryCOUNT ("can not get the number of courses in a country",
|
(unsigned) DB_QueryCOUNT ("can not get the number of courses in a country",
|
||||||
"SELECT COUNT(*)"
|
"SELECT COUNT(*)"
|
||||||
" FROM institutions,centres,degrees,courses"
|
" FROM institutions,centres,degrees,courses"
|
||||||
|
@ -421,6 +436,7 @@ unsigned Crs_GetNumCrssInCty (long CtyCod)
|
||||||
" AND centres.CtrCod=degrees.CtrCod"
|
" AND centres.CtrCod=degrees.CtrCod"
|
||||||
" AND degrees.DegCod=courses.DegCod",
|
" AND degrees.DegCod=courses.DegCod",
|
||||||
CtyCod);
|
CtyCod);
|
||||||
|
return Gbl.Cache.NumCrssInCty.NumCrss;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -94,6 +94,7 @@ struct Course
|
||||||
void Crs_ShowIntroduction (void);
|
void Crs_ShowIntroduction (void);
|
||||||
|
|
||||||
unsigned Crs_GetNumCrssTotal (void);
|
unsigned Crs_GetNumCrssTotal (void);
|
||||||
|
void Crs_FlushCacheNumCrssInCty (void);
|
||||||
unsigned Crs_GetNumCrssInCty (long CtyCod);
|
unsigned Crs_GetNumCrssInCty (long CtyCod);
|
||||||
void Crs_FlushCacheNumCrssInIns (void);
|
void Crs_FlushCacheNumCrssInIns (void);
|
||||||
unsigned Crs_GetNumCrssInIns (long InsCod);
|
unsigned Crs_GetNumCrssInIns (long InsCod);
|
||||||
|
|
|
@ -406,14 +406,20 @@ void Gbl_InitializeGlobals (void)
|
||||||
Cty_FlushCacheCountryName ();
|
Cty_FlushCacheCountryName ();
|
||||||
Ins_FlushCacheShortNameOfInstitution ();
|
Ins_FlushCacheShortNameOfInstitution ();
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
|
|
||||||
Ins_FlushCacheNumInssInCty ();
|
Ins_FlushCacheNumInssInCty ();
|
||||||
|
Crs_FlushCacheNumCrssInCty ();
|
||||||
|
|
||||||
Dpt_FlushCacheNumDptsInIns ();
|
Dpt_FlushCacheNumDptsInIns ();
|
||||||
Ctr_FlushCacheNumCtrsInIns ();
|
Ctr_FlushCacheNumCtrsInIns ();
|
||||||
Deg_FlushCacheNumDegsInIns ();
|
Deg_FlushCacheNumDegsInIns ();
|
||||||
Deg_FlushCacheNumDegsInCtr ();
|
|
||||||
Crs_FlushCacheNumCrssInIns ();
|
Crs_FlushCacheNumCrssInIns ();
|
||||||
|
|
||||||
|
Deg_FlushCacheNumDegsInCtr ();
|
||||||
Crs_FlushCacheNumCrssInCtr ();
|
Crs_FlushCacheNumCrssInCtr ();
|
||||||
|
|
||||||
Crs_FlushCacheNumCrssInDeg ();
|
Crs_FlushCacheNumCrssInDeg ();
|
||||||
|
|
||||||
Usr_FlushCacheNumUsrsWhoDontClaimToBelongToAnyCty ();
|
Usr_FlushCacheNumUsrsWhoDontClaimToBelongToAnyCty ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToAnotherCty ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToAnotherCty ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
||||||
|
|
|
@ -798,6 +798,11 @@ struct Globals
|
||||||
long CtrCod;
|
long CtrCod;
|
||||||
unsigned NumDegs;
|
unsigned NumDegs;
|
||||||
} NumDegsInCtr;
|
} NumDegsInCtr;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long CtyCod;
|
||||||
|
unsigned NumCrss;
|
||||||
|
} NumCrssInCty;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
long InsCod;
|
long InsCod;
|
||||||
|
|
Loading…
Reference in New Issue