mirror of https://github.com/acanas/swad-core.git
Version19.112.21
This commit is contained in:
parent
d197a9428d
commit
f30375e7ce
|
@ -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.20 (2020-01-07)"
|
#define Log_PLATFORM_VERSION "SWAD 19.112.21 (2020-01-07)"
|
||||||
#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"
|
||||||
/*
|
/*
|
||||||
|
@ -502,6 +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.21:Jan 07, 2020 Optimization in number of degrees in a country. (278741 lines)
|
||||||
Version 19.112.20:Jan 07, 2020 Optimization in number of courses in a country. (278724 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)
|
||||||
|
|
|
@ -428,7 +428,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->NumDegs);
|
HTM_Unsigned (Deg_GetNumDegsInCty (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 = 0;
|
Cty->Inss.Num = Cty->NumCtrs = 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],
|
||||||
|
@ -871,9 +871,6 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
|
||||||
|
|
||||||
/* Get number of centres in this country */
|
/* Get number of centres in this country */
|
||||||
Cty->NumCtrs = Ctr_GetNumCtrsInCty (Cty->CtyCod);
|
Cty->NumCtrs = Ctr_GetNumCtrsInCty (Cty->CtyCod);
|
||||||
|
|
||||||
/* Get number of degrees in this country */
|
|
||||||
Cty->NumDegs = Deg_GetNumDegsInCty (Cty->CtyCod);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1001,7 +998,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 = 0;
|
Cty->Inss.Num = Cty->NumCtrs = 0;
|
||||||
|
|
||||||
/***** Check if country code is correct *****/
|
/***** Check if country code is correct *****/
|
||||||
if (Cty->CtyCod == 0)
|
if (Cty->CtyCod == 0)
|
||||||
|
@ -1376,6 +1373,7 @@ void Cty_RemoveCountry (void)
|
||||||
/***** Flush cache *****/
|
/***** Flush cache *****/
|
||||||
Cty_FlushCacheCountryName ();
|
Cty_FlushCacheCountryName ();
|
||||||
Ins_FlushCacheNumInssInCty ();
|
Ins_FlushCacheNumInssInCty ();
|
||||||
|
Deg_FlushCacheNumDegsInCty ();
|
||||||
Crs_FlushCacheNumCrssInCty ();
|
Crs_FlushCacheNumCrssInCty ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
||||||
|
|
||||||
|
@ -2080,7 +2078,6 @@ static void Cty_EditingCountryConstructor (void)
|
||||||
Cty_EditingCty->Inss.Lst = NULL;
|
Cty_EditingCty->Inss.Lst = NULL;
|
||||||
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->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty_EditingCty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,6 @@ struct Country
|
||||||
Ins_Order_t SelectedOrder;
|
Ins_Order_t SelectedOrder;
|
||||||
} Inss;
|
} Inss;
|
||||||
unsigned NumCtrs;
|
unsigned NumCtrs;
|
||||||
unsigned NumDegs;
|
|
||||||
// unsigned NumCrss;
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool Valid;
|
bool Valid;
|
||||||
|
|
|
@ -1860,16 +1860,32 @@ unsigned Deg_GetNumDegsTotal (void)
|
||||||
/********************* Get number of degrees in a country ********************/
|
/********************* Get number of degrees in a country ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
unsigned Deg_GetNumDegsInCty (long InsCod)
|
void Deg_FlushCacheNumDegsInCty (void)
|
||||||
{
|
{
|
||||||
/***** Get number of degrees in a country from database *****/
|
Gbl.Cache.NumDegsInCty.CtyCod = -1L;
|
||||||
return
|
Gbl.Cache.NumDegsInCty.NumDegs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned Deg_GetNumDegsInCty (long CtyCod)
|
||||||
|
{
|
||||||
|
/***** 1. Fast check: Trivial case *****/
|
||||||
|
if (CtyCod <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/***** 2. Fast check: If cached... *****/
|
||||||
|
if (CtyCod == Gbl.Cache.NumDegsInCty.CtyCod)
|
||||||
|
return Gbl.Cache.NumDegsInCty.NumDegs;
|
||||||
|
|
||||||
|
/***** 3. Slow: number of degrees in a country from database *****/
|
||||||
|
Gbl.Cache.NumDegsInCty.CtyCod = CtyCod;
|
||||||
|
Gbl.Cache.NumDegsInCty.NumDegs =
|
||||||
(unsigned) DB_QueryCOUNT ("can not get the number of degrees in a country",
|
(unsigned) DB_QueryCOUNT ("can not get the number of degrees in a country",
|
||||||
"SELECT COUNT(*) FROM institutions,centres,degrees"
|
"SELECT COUNT(*) FROM institutions,centres,degrees"
|
||||||
" WHERE institutions.CtyCod=%ld"
|
" WHERE institutions.CtyCod=%ld"
|
||||||
" AND institutions.InsCod=centres.InsCod"
|
" AND institutions.InsCod=centres.InsCod"
|
||||||
" AND centres.CtrCod=degrees.CtrCod",
|
" AND centres.CtrCod=degrees.CtrCod",
|
||||||
InsCod);
|
CtyCod);
|
||||||
|
return Gbl.Cache.NumDegsInCty.NumDegs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -140,7 +140,8 @@ void Deg_ReceiveLogo (void);
|
||||||
void Deg_RemoveLogo (void);
|
void Deg_RemoveLogo (void);
|
||||||
|
|
||||||
unsigned Deg_GetNumDegsTotal (void);
|
unsigned Deg_GetNumDegsTotal (void);
|
||||||
unsigned Deg_GetNumDegsInCty (long InsCod);
|
void Deg_FlushCacheNumDegsInCty (void);
|
||||||
|
unsigned Deg_GetNumDegsInCty (long CtyCod);
|
||||||
void Deg_FlushCacheNumDegsInIns (void);
|
void Deg_FlushCacheNumDegsInIns (void);
|
||||||
unsigned Deg_GetNumDegsInIns (long InsCod);
|
unsigned Deg_GetNumDegsInIns (long InsCod);
|
||||||
void Deg_FlushCacheNumDegsInCtr (void);
|
void Deg_FlushCacheNumDegsInCtr (void);
|
||||||
|
|
|
@ -408,6 +408,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
|
|
||||||
Ins_FlushCacheNumInssInCty ();
|
Ins_FlushCacheNumInssInCty ();
|
||||||
|
Deg_FlushCacheNumDegsInCty ();
|
||||||
Crs_FlushCacheNumCrssInCty ();
|
Crs_FlushCacheNumCrssInCty ();
|
||||||
|
|
||||||
Dpt_FlushCacheNumDptsInIns ();
|
Dpt_FlushCacheNumDptsInIns ();
|
||||||
|
|
|
@ -788,6 +788,11 @@ struct Globals
|
||||||
long InsCod;
|
long InsCod;
|
||||||
unsigned NumCtrs;
|
unsigned NumCtrs;
|
||||||
} NumCtrsInIns;
|
} NumCtrsInIns;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long CtyCod;
|
||||||
|
unsigned NumDegs;
|
||||||
|
} NumDegsInCty;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
long InsCod;
|
long InsCod;
|
||||||
|
|
Loading…
Reference in New Issue