mirror of https://github.com/acanas/swad-core.git
Version19.112.13
This commit is contained in:
parent
e18455dd1f
commit
8f487eef7d
|
@ -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.12 (2020-01-06)"
|
#define Log_PLATFORM_VERSION "SWAD 19.112.13 (2020-01-06)"
|
||||||
#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.13:Jan 06, 2020 Optimization in number of departments of an institution. (278535 lines)
|
||||||
Version 19.112.12:Jan 06, 2020 Optimization in number of users who claim to belong to an institution. (278519 lines)
|
Version 19.112.12:Jan 06, 2020 Optimization in number of users who claim to belong to an institution. (278519 lines)
|
||||||
Version 19.112.11:Jan 06, 2020 Optimization in number of users in courses of an institution. (278486 lines)
|
Version 19.112.11:Jan 06, 2020 Optimization in number of users in courses of an institution. (278486 lines)
|
||||||
Version 19.112.10:Jan 06, 2020 Optimization in number of users in courses of a degree. (278468 lines)
|
Version 19.112.10:Jan 06, 2020 Optimization in number of users in courses of a degree. (278468 lines)
|
||||||
|
|
|
@ -1058,15 +1058,31 @@ unsigned Dpt_GetTotalNumberOfDepartments (void)
|
||||||
/**************** Get number of departments in a institution *****************/
|
/**************** Get number of departments in a institution *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Dpt_FlushCacheNumDptsInIns (void)
|
||||||
|
{
|
||||||
|
Gbl.Cache.NumDptsInIns.InsCod = -1L;
|
||||||
|
Gbl.Cache.NumDptsInIns.NumDpts = 0;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned Dpt_GetNumDptsInIns (long InsCod)
|
unsigned Dpt_GetNumDptsInIns (long InsCod)
|
||||||
{
|
{
|
||||||
/***** Get departments in an institution from database *****/
|
/***** 1. Fast check: Trivial case *****/
|
||||||
return
|
if (InsCod <= 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/***** 2. Fast check: If cached... *****/
|
||||||
|
if (InsCod == Gbl.Cache.NumDptsInIns.InsCod)
|
||||||
|
return Gbl.Cache.NumDptsInIns.NumDpts;
|
||||||
|
|
||||||
|
/***** 3. Slow: number of departments of an institution from database *****/
|
||||||
|
Gbl.Cache.NumDptsInIns.InsCod = InsCod;
|
||||||
|
Gbl.Cache.NumDptsInIns.NumDpts =
|
||||||
(unsigned) DB_QueryCOUNT ("can not get number of departments"
|
(unsigned) DB_QueryCOUNT ("can not get number of departments"
|
||||||
" in an institution",
|
" in an institution",
|
||||||
"SELECT COUNT(*) FROM departments"
|
"SELECT COUNT(*) FROM departments"
|
||||||
" WHERE InsCod=%ld",
|
" WHERE InsCod=%ld",
|
||||||
InsCod);
|
InsCod);
|
||||||
|
return Gbl.Cache.NumDptsInIns.NumDpts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -73,6 +73,7 @@ void Dpt_ContEditAfterChgDpt (void);
|
||||||
|
|
||||||
void Dpt_RecFormNewDpt (void);
|
void Dpt_RecFormNewDpt (void);
|
||||||
unsigned Dpt_GetTotalNumberOfDepartments (void);
|
unsigned Dpt_GetTotalNumberOfDepartments (void);
|
||||||
|
void Dpt_FlushCacheNumDptsInIns (void);
|
||||||
unsigned Dpt_GetNumDptsInIns (long InsCod);
|
unsigned Dpt_GetNumDptsInIns (long InsCod);
|
||||||
|
|
||||||
void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
|
void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
|
||||||
|
|
|
@ -220,7 +220,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Hierarchy.Ins.ShrtName[0] = '\0';
|
Gbl.Hierarchy.Ins.ShrtName[0] = '\0';
|
||||||
Gbl.Hierarchy.Ins.FullName[0] = '\0';
|
Gbl.Hierarchy.Ins.FullName[0] = '\0';
|
||||||
Gbl.Hierarchy.Ins.WWW[0] = '\0';
|
Gbl.Hierarchy.Ins.WWW[0] = '\0';
|
||||||
Gbl.Hierarchy.Ins.Ctrs.Num = Gbl.Hierarchy.Ins.NumDpts = Gbl.Hierarchy.Ins.NumDegs = 0;
|
Gbl.Hierarchy.Ins.Ctrs.Num = Gbl.Hierarchy.Ins.NumDegs = 0;
|
||||||
|
|
||||||
Gbl.Hierarchy.Ctr.ShrtName[0] = '\0';
|
Gbl.Hierarchy.Ctr.ShrtName[0] = '\0';
|
||||||
Gbl.Hierarchy.Ctr.FullName[0] = '\0';
|
Gbl.Hierarchy.Ctr.FullName[0] = '\0';
|
||||||
|
@ -411,6 +411,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Cty_FlushCacheCountryName ();
|
Cty_FlushCacheCountryName ();
|
||||||
Ins_FlushCacheShortNameOfInstitution ();
|
Ins_FlushCacheShortNameOfInstitution ();
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
|
Dpt_FlushCacheNumDptsInIns ();
|
||||||
Deg_FlushCacheNumDegsInCtr ();
|
Deg_FlushCacheNumDegsInCtr ();
|
||||||
Crs_FlushCacheNumCrssInCtr ();
|
Crs_FlushCacheNumCrssInCtr ();
|
||||||
Crs_FlushCacheNumCrssInDeg ();
|
Crs_FlushCacheNumCrssInDeg ();
|
||||||
|
|
|
@ -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 InsCod;
|
||||||
|
unsigned NumDpts;
|
||||||
|
} NumDptsInIns;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
long CtrCod;
|
long CtrCod;
|
||||||
|
|
|
@ -422,7 +422,7 @@ static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns)
|
||||||
|
|
||||||
/* Number of departments in this institution */
|
/* Number of departments in this institution */
|
||||||
HTM_TD_Begin ("class=\"%s RM %s\"",TxtClassNormal,BgColor);
|
HTM_TD_Begin ("class=\"%s RM %s\"",TxtClassNormal,BgColor);
|
||||||
HTM_Unsigned (Ins->NumDpts);
|
HTM_Unsigned (Dpt_GetNumDptsInIns (Ins->InsCod));
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/* Number of users in courses of this institution */
|
/* Number of users in courses of this institution */
|
||||||
|
@ -698,7 +698,7 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
|
||||||
switch (GetExtraData)
|
switch (GetExtraData)
|
||||||
{
|
{
|
||||||
case Ins_GET_BASIC_DATA:
|
case Ins_GET_BASIC_DATA:
|
||||||
Ins->Ctrs.Num = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0;
|
Ins->Ctrs.Num = Ins->NumDegs = Ins->NumCrss = 0;
|
||||||
break;
|
break;
|
||||||
case Ins_GET_EXTRA_DATA:
|
case Ins_GET_EXTRA_DATA:
|
||||||
/* Get number of centres in this institution */
|
/* Get number of centres in this institution */
|
||||||
|
@ -709,9 +709,6 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
|
||||||
|
|
||||||
/* Get number of degrees in this institution */
|
/* Get number of degrees in this institution */
|
||||||
Ins->NumCrss = Crs_GetNumCrssInIns (Ins->InsCod);
|
Ins->NumCrss = Crs_GetNumCrssInIns (Ins->InsCod);
|
||||||
|
|
||||||
/* Get number of departments in this institution */
|
|
||||||
Ins->NumDpts = Dpt_GetNumDptsInIns (Ins->InsCod);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -759,7 +756,7 @@ bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins,
|
||||||
Ins->ShrtName[0] =
|
Ins->ShrtName[0] =
|
||||||
Ins->FullName[0] =
|
Ins->FullName[0] =
|
||||||
Ins->WWW[0] = '\0';
|
Ins->WWW[0] = '\0';
|
||||||
Ins->Ctrs.Num = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0;
|
Ins->Ctrs.Num = Ins->NumDegs = Ins->NumCrss = 0;
|
||||||
|
|
||||||
/***** Check if institution code is correct *****/
|
/***** Check if institution code is correct *****/
|
||||||
if (Ins->InsCod > 0)
|
if (Ins->InsCod > 0)
|
||||||
|
@ -801,9 +798,6 @@ bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins,
|
||||||
/* Get number of centres in this institution */
|
/* Get number of centres in this institution */
|
||||||
Ins->Ctrs.Num = Ctr_GetNumCtrsInIns (Ins->InsCod);
|
Ins->Ctrs.Num = Ctr_GetNumCtrsInIns (Ins->InsCod);
|
||||||
|
|
||||||
/* Get number of departments in this institution */
|
|
||||||
Ins->NumDpts = Dpt_GetNumDptsInIns (Ins->InsCod);
|
|
||||||
|
|
||||||
/* Get number of degrees in this institution */
|
/* Get number of degrees in this institution */
|
||||||
Ins->NumDegs = Deg_GetNumDegsInIns (Ins->InsCod);
|
Ins->NumDegs = Deg_GetNumDegsInIns (Ins->InsCod);
|
||||||
}
|
}
|
||||||
|
@ -1359,6 +1353,7 @@ void Ins_RemoveInstitution (void)
|
||||||
/***** Flush caches *****/
|
/***** Flush caches *****/
|
||||||
Ins_FlushCacheShortNameOfInstitution ();
|
Ins_FlushCacheShortNameOfInstitution ();
|
||||||
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
Ins_FlushCacheFullNameAndCtyOfInstitution ();
|
||||||
|
Dpt_FlushCacheNumDptsInIns ();
|
||||||
Usr_FlushCacheNumUsrsWhoClaimToBelongToIns ();
|
Usr_FlushCacheNumUsrsWhoClaimToBelongToIns ();
|
||||||
Usr_FlushCacheNumUsrsInCrssOfIns ();
|
Usr_FlushCacheNumUsrsInCrssOfIns ();
|
||||||
|
|
||||||
|
@ -2039,7 +2034,6 @@ static void Ins_EditingInstitutionConstructor (void)
|
||||||
Ins_EditingIns->Ctrs.Num = 0;
|
Ins_EditingIns->Ctrs.Num = 0;
|
||||||
Ins_EditingIns->Ctrs.Lst = NULL;
|
Ins_EditingIns->Ctrs.Lst = NULL;
|
||||||
Ins_EditingIns->Ctrs.SelectedOrder = Ctr_ORDER_DEFAULT;
|
Ins_EditingIns->Ctrs.SelectedOrder = Ctr_ORDER_DEFAULT;
|
||||||
Ins_EditingIns->NumDpts = 0;
|
|
||||||
Ins_EditingIns->NumDegs = 0;
|
Ins_EditingIns->NumDegs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,6 @@ struct Instit
|
||||||
} Ctrs;
|
} Ctrs;
|
||||||
unsigned NumDegs;
|
unsigned NumDegs;
|
||||||
unsigned NumCrss;
|
unsigned NumCrss;
|
||||||
unsigned NumDpts;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Ins_NUM_ORDERS 2
|
#define Ins_NUM_ORDERS 2
|
||||||
|
|
Loading…
Reference in New Issue