mirror of https://github.com/acanas/swad-core.git
Version19.112.22
This commit is contained in:
parent
f30375e7ce
commit
a8e670490f
|
@ -1828,15 +1828,31 @@ unsigned Ctr_GetNumCtrsTotal (void)
|
||||||
/******************* Get number of centres in a country **********************/
|
/******************* Get number of centres in a country **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Ctr_FlushCacheNumCtrsInCty (void)
|
||||||
|
{
|
||||||
|
Gbl.Cache.NumCtrsInCty.CtyCod = -1L;
|
||||||
|
Gbl.Cache.NumCtrsInCty.NumCtrs = 0;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned Ctr_GetNumCtrsInCty (long CtyCod)
|
unsigned Ctr_GetNumCtrsInCty (long CtyCod)
|
||||||
{
|
{
|
||||||
/***** Get number of centres of a country from database *****/
|
/***** 1. Fast check: Trivial case *****/
|
||||||
return
|
if (CtyCod <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/***** 2. Fast check: If cached... *****/
|
||||||
|
if (CtyCod == Gbl.Cache.NumCtrsInCty.CtyCod)
|
||||||
|
return Gbl.Cache.NumCtrsInCty.NumCtrs;
|
||||||
|
|
||||||
|
/***** 3. Slow: number of centres in a country from database *****/
|
||||||
|
Gbl.Cache.NumCtrsInCty.CtyCod = CtyCod;
|
||||||
|
Gbl.Cache.NumCtrsInCty.NumCtrs =
|
||||||
(unsigned) DB_QueryCOUNT ("can not get number of centres in a country",
|
(unsigned) DB_QueryCOUNT ("can not get number of centres in a country",
|
||||||
"SELECT COUNT(*) FROM institutions,centres"
|
"SELECT COUNT(*) FROM institutions,centres"
|
||||||
" WHERE institutions.CtyCod=%ld"
|
" WHERE institutions.CtyCod=%ld"
|
||||||
" AND institutions.InsCod=centres.InsCod",
|
" AND institutions.InsCod=centres.InsCod",
|
||||||
CtyCod);
|
CtyCod);
|
||||||
|
return Gbl.Cache.NumCtrsInCty.NumCtrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -121,6 +121,7 @@ void Ctr_RecFormReqCtr (void);
|
||||||
void Ctr_RecFormNewCtr (void);
|
void Ctr_RecFormNewCtr (void);
|
||||||
|
|
||||||
unsigned Ctr_GetNumCtrsTotal (void);
|
unsigned Ctr_GetNumCtrsTotal (void);
|
||||||
|
void Ctr_FlushCacheNumCtrsInCty (void);
|
||||||
unsigned Ctr_GetNumCtrsInCty (long CtyCod);
|
unsigned Ctr_GetNumCtrsInCty (long CtyCod);
|
||||||
void Ctr_FlushCacheNumCtrsInIns (void);
|
void Ctr_FlushCacheNumCtrsInIns (void);
|
||||||
unsigned Ctr_GetNumCtrsInIns (long InsCod);
|
unsigned Ctr_GetNumCtrsInIns (long InsCod);
|
||||||
|
|
|
@ -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.21 (2020-01-07)"
|
#define Log_PLATFORM_VERSION "SWAD 19.112.22 (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.22:Jan 07, 2020 Optimization in number of centres in a country. (278761 lines)
|
||||||
Version 19.112.21:Jan 07, 2020 Optimization in number of degrees in a country. (278741 lines)
|
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)
|
||||||
|
|
|
@ -424,7 +424,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->NumCtrs);
|
HTM_Unsigned (Ctr_GetNumCtrsInCty (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 = 0;
|
Cty->Inss.Num = 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],
|
||||||
|
@ -868,9 +868,6 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData)
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty.Valid = true;
|
Cty->NumUsrsWhoClaimToBelongToCty.Valid = true;
|
||||||
else
|
else
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
|
|
||||||
/* Get number of centres in this country */
|
|
||||||
Cty->NumCtrs = Ctr_GetNumCtrsInCty (Cty->CtyCod);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -997,8 +994,10 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD
|
||||||
Cty->Name[Lan][0] = '\0';
|
Cty->Name[Lan][0] = '\0';
|
||||||
Cty->WWW[Lan][0] = '\0';
|
Cty->WWW[Lan][0] = '\0';
|
||||||
}
|
}
|
||||||
|
Cty->Inss.Num = 0;
|
||||||
|
Cty->Inss.Lst = NULL;
|
||||||
|
Cty->Inss.SelectedOrder = Ins_ORDER_DEFAULT;
|
||||||
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
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)
|
||||||
|
@ -1373,6 +1372,7 @@ void Cty_RemoveCountry (void)
|
||||||
/***** Flush cache *****/
|
/***** Flush cache *****/
|
||||||
Cty_FlushCacheCountryName ();
|
Cty_FlushCacheCountryName ();
|
||||||
Ins_FlushCacheNumInssInCty ();
|
Ins_FlushCacheNumInssInCty ();
|
||||||
|
Ctr_FlushCacheNumCtrsInCty ();
|
||||||
Deg_FlushCacheNumDegsInCty ();
|
Deg_FlushCacheNumDegsInCty ();
|
||||||
Crs_FlushCacheNumCrssInCty ();
|
Crs_FlushCacheNumCrssInCty ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToCty ();
|
||||||
|
@ -2077,7 +2077,6 @@ static void Cty_EditingCountryConstructor (void)
|
||||||
Cty_EditingCty->Inss.Num = 0;
|
Cty_EditingCty->Inss.Num = 0;
|
||||||
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->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
Cty_EditingCty->NumUsrsWhoClaimToBelongToCty.Valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ struct Country
|
||||||
struct Instit *Lst; // List of institutions in this country
|
struct Instit *Lst; // List of institutions in this country
|
||||||
Ins_Order_t SelectedOrder;
|
Ins_Order_t SelectedOrder;
|
||||||
} Inss;
|
} Inss;
|
||||||
unsigned NumCtrs;
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool Valid;
|
bool Valid;
|
||||||
|
|
|
@ -408,6 +408,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
|
|
||||||
Ins_FlushCacheNumInssInCty ();
|
Ins_FlushCacheNumInssInCty ();
|
||||||
|
Ctr_FlushCacheNumCtrsInCty ();
|
||||||
Deg_FlushCacheNumDegsInCty ();
|
Deg_FlushCacheNumDegsInCty ();
|
||||||
Crs_FlushCacheNumCrssInCty ();
|
Crs_FlushCacheNumCrssInCty ();
|
||||||
|
|
||||||
|
|
|
@ -783,6 +783,11 @@ struct Globals
|
||||||
long CtyCod;
|
long CtyCod;
|
||||||
unsigned NumInss;
|
unsigned NumInss;
|
||||||
} NumInssInCty;
|
} NumInssInCty;
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
long CtyCod;
|
||||||
|
unsigned NumCtrs;
|
||||||
|
} NumCtrsInCty;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
long InsCod;
|
long InsCod;
|
||||||
|
|
Loading…
Reference in New Issue