Version19.120

This commit is contained in:
Antonio Cañas Vargas 2020-01-25 22:18:01 +01:00
parent 5aa20a0749
commit 917b8469b6
8 changed files with 87 additions and 90 deletions

View File

@ -1899,7 +1899,7 @@ static void Ctr_CreateCentre (unsigned Status)
/************************** Get number of centres ****************************/
/*****************************************************************************/
unsigned Ctr_GetNumCtrsTotal (void)
unsigned Ctr_GetNumCtrsInSys (void)
{
/***** Get total number of centres from database *****/
return (unsigned) DB_GetNumRowsTable ("centres");
@ -1909,7 +1909,7 @@ unsigned Ctr_GetNumCtrsTotal (void)
/********************** Get number of centres with map ***********************/
/*****************************************************************************/
unsigned Ctr_GetNumCtrsWithMap (void)
unsigned Ctr_GetNumCtrsWithMapInSys (void)
{
/***** Get number of centres with map from database
(coordinates 0, 0 means not set ==> don't show map) *****/
@ -1949,6 +1949,22 @@ unsigned Ctr_GetNumCtrsInCty (long CtyCod)
return Gbl.Cache.NumCtrsInCty.NumCtrs;
}
/*****************************************************************************/
/********************** Get number of centres with map ***********************/
/*****************************************************************************/
unsigned Ctr_GetNumCtrsWithMapInCty (long CtyCod)
{
/***** Get number of centres with map from database
(coordinates 0, 0 means not set ==> don't show map) *****/
return (unsigned) DB_QueryCOUNT ("can not get if map is available",
"SELECT COUNT(*) FROM institutions,centres"
" WHERE institutions.CtyCod=%ld"
" AND institutions.InsCod=centres.InsCod"
" AND (centres.Latitude<>0 OR centres.Longitude<>0)",
CtyCod);
}
/*****************************************************************************/
/**************** Get number of centres in an institution ********************/
/*****************************************************************************/

View File

@ -132,10 +132,11 @@ void Ctr_ContEditAfterChgCtr (void);
void Ctr_RecFormReqCtr (void);
void Ctr_RecFormNewCtr (void);
unsigned Ctr_GetNumCtrsTotal (void);
unsigned Ctr_GetNumCtrsWithMap (void);
unsigned Ctr_GetNumCtrsInSys (void);
unsigned Ctr_GetNumCtrsWithMapInSys (void);
void Ctr_FlushCacheNumCtrsInCty (void);
unsigned Ctr_GetNumCtrsInCty (long CtyCod);
unsigned Ctr_GetNumCtrsWithMapInCty (long CtyCod);
void Ctr_FlushCacheNumCtrsInIns (void);
unsigned Ctr_GetNumCtrsInIns (long InsCod);
unsigned Ctr_GetNumCtrsInPlc (long PlcCod);

View File

@ -494,7 +494,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.119 (2020-01-25)"
#define Log_PLATFORM_VERSION "SWAD 19.120 (2020-01-25)"
#define CSS_FILE "swad19.118.css"
#define JS_FILE "swad19.91.1.js"
/*
@ -502,6 +502,7 @@ ps2pdf source.ps destination.pdf
// 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é?
Version 19.120: Jan 25, 2020 Number of centres with map shown in country configuration. (278592 lines)
Version 19.119: Jan 25, 2020 Number of centres with map shown in platform configuration. (278591 lines)
Version 19.118.2: Jan 23, 2020 Fixed bug in enrolment notifications. (278559 lines)
Version 19.118.1: Jan 23, 2020 Fixed bug in marks, reported by Diana Alexandra Dumitru. (278554 lines)

View File

@ -73,7 +73,6 @@ static void CtyCfg_Shortcut (bool PrintView);
static void CtyCfg_QR (void);
static void CtyCfg_NumUsrs (void);
static void CtyCfg_NumInss (void);
static void CtyCfg_NumCtrs (void);
static void CtyCfg_NumDegs (void);
static void CtyCfg_NumCrss (void);
static void CtyCfg_NumUsrsInCrssOfCty (Rol_Role_t Role);
@ -110,8 +109,9 @@ static void CtyCfg_Configuration (bool PrintView)
{
extern const char *Hlp_COUNTRY_Information;
bool PutLink;
bool MapIsAvailable;
bool MapImageExists;
unsigned NumCtrs;
unsigned NumCtrsWithMap;
/***** Trivial check *****/
if (Gbl.Hierarchy.Cty.CtyCod <= 0) // No country selected
@ -146,11 +146,14 @@ static void CtyCfg_Configuration (bool PrintView)
/***** Shortcut to the country *****/
CtyCfg_Shortcut (PrintView);
NumCtrsWithMap = Ctr_GetNumCtrsWithMapInCty (Gbl.Hierarchy.Cty.CtyCod);
if (PrintView)
/***** QR code with link to the country *****/
CtyCfg_QR ();
else
{
NumCtrs = Ctr_GetNumCtrsInCty (Gbl.Hierarchy.Cty.CtyCod);
/***** Number of users who claim to belong to this country,
number of institutions,
number of centres,
@ -158,7 +161,8 @@ static void CtyCfg_Configuration (bool PrintView)
number of courses *****/
CtyCfg_NumUsrs ();
CtyCfg_NumInss ();
CtyCfg_NumCtrs ();
HieCfg_NumCtrs (NumCtrs);
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
CtyCfg_NumDegs ();
CtyCfg_NumCrss ();
@ -176,18 +180,15 @@ static void CtyCfg_Configuration (bool PrintView)
HTM_DIV_End ();
/**************************** Right part **********************************/
/***** Check map *****/
MapIsAvailable = Cty_GetIfMapIsAvailable (Gbl.Hierarchy.Cty.CtyCod);
/***** Check country map *****/
MapImageExists = Cty_CheckIfCountryPhotoExists (&Gbl.Hierarchy.Cty);
if (MapIsAvailable || MapImageExists)
if (NumCtrsWithMap || MapImageExists)
{
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
/***** Country map *****/
if (MapIsAvailable)
if (NumCtrsWithMap)
CtyCfg_Map ();
/***** Country map image *****/
@ -516,28 +517,6 @@ static void CtyCfg_NumInss (void)
HTM_TR_End ();
}
/*****************************************************************************/
/************* Show number of centres in country configuration ***************/
/*****************************************************************************/
static void CtyCfg_NumCtrs (void)
{
extern const char *Txt_Centres;
/***** Number of centres *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("RT",NULL,Txt_Centres);
/* Data */
HTM_TD_Begin ("class=\"DAT LB\"");
HTM_Unsigned (Ctr_GetNumCtrsInCty (Gbl.Hierarchy.Cty.CtyCod));
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/
/************* Show number of degrees in country configuration ***************/
/*****************************************************************************/

View File

@ -927,7 +927,7 @@ static void Fig_GetAndShowHierarchyTotal (void)
case Hie_SYS:
NumCtysTotal = Cty_GetNumCtysTotal ();
NumInssTotal = Ins_GetNumInssTotal ();
NumCtrsTotal = Ctr_GetNumCtrsTotal ();
NumCtrsTotal = Ctr_GetNumCtrsInSys ();
NumDegsTotal = Deg_GetNumDegsTotal ();
NumCrssTotal = Crs_GetNumCrssTotal ();
break;

View File

@ -228,6 +228,54 @@ void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod)
HTM_TR_End ();
}
/*****************************************************************************/
/************************** Show number of centres ***************************/
/*****************************************************************************/
void HieCfg_NumCtrs (unsigned NumCtrs)
{
extern const char *Txt_Centres;
/***** Number of centres *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("RT",NULL,Txt_Centres);
/* Data */
HTM_TD_Begin ("class=\"DAT LB\"");
HTM_Unsigned (NumCtrs);
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/
/********************* Show number of centres with map ***********************/
/*****************************************************************************/
void HieCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap)
{
extern const char *Txt_Centres_with_map;
/***** Number of centres with map *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("RT",NULL,Txt_Centres_with_map);
/* Data */
HTM_TD_Begin ("class=\"DAT LB\"");
HTM_TxtF ("%u (%.1lf%%)",
NumCtrsWithMap,
NumCtrs ? (double) NumCtrsWithMap * 100.0 /
(double) NumCtrs :
0.0);
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/
/************************* Show QR in configuration **************************/
/*****************************************************************************/

View File

@ -53,6 +53,8 @@ void HieCfg_ShrtName (bool PutForm,Act_Action_t NextAction,
void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
const char WWW[Cns_MAX_BYTES_WWW + 1]);
void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod);
void HieCfg_NumCtrs (unsigned NumCtrs);
void HieCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap);
void HieCfg_QR (const char *ParamName,long HieCod);
#endif

View File

@ -73,8 +73,6 @@ static void SysCfg_Shortcut (bool PrintView);
static void SysCfg_QR (void);
static void SysCfg_NumCtys (void);
static void SysCfg_NumInss (void);
static void SysCfg_NumCtrs (unsigned NumCtrs);
static void SysCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap);
static void SysCfg_NumDegs (void);
static void SysCfg_NumCrss (void);
static void SysCfg_NumUsrsInCrss (Rol_Role_t Role);
@ -130,13 +128,13 @@ static void SysCfg_Configuration (bool PrintView)
/***** Shortcut to the country *****/
SysCfg_Shortcut (PrintView);
NumCtrsWithMap = Ctr_GetNumCtrsWithMap ();
NumCtrsWithMap = Ctr_GetNumCtrsWithMapInSys ();
if (PrintView)
/***** QR code with link to the country *****/
SysCfg_QR ();
else
{
NumCtrs = Ctr_GetNumCtrsTotal ();
NumCtrs = Ctr_GetNumCtrsInSys ();
/***** Number of countries,
number of institutions,
@ -145,8 +143,8 @@ static void SysCfg_Configuration (bool PrintView)
number of courses *****/
SysCfg_NumCtys ();
SysCfg_NumInss ();
SysCfg_NumCtrs (NumCtrs);
SysCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
HieCfg_NumCtrs (NumCtrs);
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
SysCfg_NumDegs ();
SysCfg_NumCrss ();
@ -375,54 +373,6 @@ static void SysCfg_NumInss (void)
HTM_TR_End ();
}
/*****************************************************************************/
/************** Show number of centres in system configuration ***************/
/*****************************************************************************/
static void SysCfg_NumCtrs (unsigned NumCtrs)
{
extern const char *Txt_Centres;
/***** Number of centres *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("RT",NULL,Txt_Centres);
/* Data */
HTM_TD_Begin ("class=\"DAT LB\"");
HTM_Unsigned (NumCtrs);
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/
/********** Show number of centres with map in system configuration **********/
/*****************************************************************************/
static void SysCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap)
{
extern const char *Txt_Centres_with_map;
/***** Number of centres *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("RT",NULL,Txt_Centres_with_map);
/* Data */
HTM_TD_Begin ("class=\"DAT LB\"");
HTM_TxtF ("%u (%.1lf%%)",
NumCtrsWithMap,
NumCtrs ? (double) NumCtrsWithMap * 100.0 /
(double) NumCtrs :
0.0);
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/
/************* Show number of degrees in system configuration ****************/
/*****************************************************************************/