Version19.121

This commit is contained in:
Antonio Cañas Vargas 2020-01-26 14:10:27 +01:00
parent 917b8469b6
commit 5e8d3fc467
8 changed files with 80 additions and 75 deletions

View File

@ -1905,19 +1905,6 @@ unsigned Ctr_GetNumCtrsInSys (void)
return (unsigned) DB_GetNumRowsTable ("centres");
}
/*****************************************************************************/
/********************** Get number of centres with map ***********************/
/*****************************************************************************/
unsigned Ctr_GetNumCtrsWithMapInSys (void)
{
/***** 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 centres"
" WHERE Latitude<>0 OR Longitude<>0");
}
/*****************************************************************************/
/******************* Get number of centres in a country **********************/
/*****************************************************************************/
@ -1949,22 +1936,6 @@ 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 ********************/
/*****************************************************************************/
@ -1996,6 +1967,50 @@ unsigned Ctr_GetNumCtrsInIns (long InsCod)
return Gbl.Cache.NumCtrsInIns.NumCtrs;
}
/*****************************************************************************/
/********************** Get number of centres with map ***********************/
/*****************************************************************************/
unsigned Ctr_GetNumCtrsWithMapInSys (void)
{
/***** 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 number of centres with map",
"SELECT COUNT(*) FROM centres"
" WHERE Latitude<>0 OR Longitude<>0");
}
/*****************************************************************************/
/************** Get number of centres with map in a country ******************/
/*****************************************************************************/
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 ("ccan not get number of centres with map",
"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 with map in an institution **************/
/*****************************************************************************/
unsigned Ctr_GetNumCtrsWithMapInIns (long InsCod)
{
/***** 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 number of centres with map",
"SELECT COUNT(*) FROM centres"
" WHERE InsCod=%ld"
" AND (Latitude<>0 OR Longitude<>0)",
InsCod);
}
/*****************************************************************************/
/******* Get number of centres (of the current institution) in a place *******/
/*****************************************************************************/

View File

@ -133,12 +133,13 @@ void Ctr_RecFormReqCtr (void);
void Ctr_RecFormNewCtr (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_GetNumCtrsWithMapInSys (void);
unsigned Ctr_GetNumCtrsWithMapInCty (long CtyCod);
unsigned Ctr_GetNumCtrsWithMapInIns (long InsCod);
unsigned Ctr_GetNumCtrsInPlc (long PlcCod);
unsigned Ctr_GetNumCtrsWithDegs (const char *SubQuery);
unsigned Ctr_GetNumCtrsWithCrss (const char *SubQuery);

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.120 (2020-01-25)"
#define Log_PLATFORM_VERSION "SWAD 19.121 (2020-01-26)"
#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.121: Jan 26, 2020 Number of centres with map shown in institution configuration. (278601 lines)
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)

View File

@ -161,7 +161,8 @@ static void CtyCfg_Configuration (bool PrintView)
number of courses *****/
CtyCfg_NumUsrs ();
CtyCfg_NumInss ();
HieCfg_NumCtrs (NumCtrs);
HieCfg_NumCtrs (NumCtrs,
false); // Don't put form
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
CtyCfg_NumDegs ();
CtyCfg_NumCrss ();

View File

@ -232,9 +232,10 @@ void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod)
/************************** Show number of centres ***************************/
/*****************************************************************************/
void HieCfg_NumCtrs (unsigned NumCtrs)
void HieCfg_NumCtrs (unsigned NumCtrs,bool PutForm)
{
extern const char *Txt_Centres;
extern const char *Txt_Centres_of_INSTITUTION_X;
/***** Number of centres *****/
HTM_TR_Begin (NULL);
@ -243,8 +244,22 @@ void HieCfg_NumCtrs (unsigned NumCtrs)
Frm_LabelColumn ("RT",NULL,Txt_Centres);
/* Data */
HTM_TD_Begin ("class=\"DAT LB\"");
HTM_TD_Begin ("class=\"LB\"");
if (PutForm)
{
Frm_StartFormGoTo (ActSeeCtr);
Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod);
HTM_BUTTON_SUBMIT_Begin (Str_BuildStringStr (Txt_Centres_of_INSTITUTION_X,
Gbl.Hierarchy.Ins.ShrtName),
"BT_LINK DAT",NULL);
Str_FreeString ();
}
HTM_Unsigned (NumCtrs);
if (PutForm)
{
HTM_BUTTON_End ();
Frm_EndForm ();
}
HTM_TD_End ();
HTM_TR_End ();

View File

@ -53,7 +53,7 @@ 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_NumCtrs (unsigned NumCtrs,bool PutForm);
void HieCfg_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap);
void HieCfg_QR (const char *ParamName,long HieCod);

View File

@ -74,7 +74,6 @@ static void InsCfg_WWW (bool PrintView,bool PutForm);
static void InsCfg_Shortcut (bool PrintView);
static void InsCfg_QR (void);
static void InsCfg_NumUsrs (void);
static void InsCfg_NumCtrs (void);
static void InsCfg_NumDegs (void);
static void InsCfg_NumCrss (void);
static void InsCfg_NumDpts (void);
@ -113,7 +112,8 @@ static void InsCfg_Configuration (bool PrintView)
bool PutFormCty;
bool PutFormName;
bool PutFormWWW;
bool MapIsAvailable;
unsigned NumCtrs;
unsigned NumCtrsWithMap;
/***** Trivial check *****/
if (Gbl.Hierarchy.Ins.InsCod <= 0) // No institution selected
@ -156,18 +156,23 @@ static void InsCfg_Configuration (bool PrintView)
/***** Shortcut to the institution *****/
InsCfg_Shortcut (PrintView);
NumCtrsWithMap = Ctr_GetNumCtrsWithMapInIns (Gbl.Hierarchy.Ins.InsCod);
if (PrintView)
/***** QR code with link to the institution *****/
InsCfg_QR ();
else
{
NumCtrs = Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod);
/***** Number of users who claim to belong to this institution,
number of centres,
number of degrees,
number of courses,
number of departments *****/
InsCfg_NumUsrs ();
InsCfg_NumCtrs ();
HieCfg_NumCtrs (NumCtrs,
true); // Put form
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
InsCfg_NumDegs ();
InsCfg_NumCrss ();
InsCfg_NumDpts ();
@ -186,10 +191,7 @@ static void InsCfg_Configuration (bool PrintView)
HTM_DIV_End ();
/**************************** Right part **********************************/
/***** Check map *****/
MapIsAvailable = Ins_GetIfMapIsAvailable (Gbl.Hierarchy.Ins.InsCod);
if (MapIsAvailable)
if (NumCtrsWithMap)
{
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
@ -470,37 +472,6 @@ static void InsCfg_NumUsrs (void)
HTM_TR_End ();
}
/*****************************************************************************/
/*********** Show number of centres in institution configuration *************/
/*****************************************************************************/
static void InsCfg_NumCtrs (void)
{
extern const char *Txt_Centres;
extern const char *Txt_Centres_of_INSTITUTION_X;
/***** Number of centres *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("RT",NULL,Txt_Centres);
/* Data */
HTM_TD_Begin ("class=\"LB\"");
Frm_StartFormGoTo (ActSeeCtr);
Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod);
HTM_BUTTON_SUBMIT_Begin (Str_BuildStringStr (Txt_Centres_of_INSTITUTION_X,
Gbl.Hierarchy.Ins.ShrtName),
"BT_LINK DAT",NULL);
Str_FreeString ();
HTM_Unsigned (Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod));
HTM_BUTTON_End ();
Frm_EndForm ();
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/
/*********** Show number of degrees in institution configuration *************/
/*****************************************************************************/

View File

@ -143,7 +143,8 @@ static void SysCfg_Configuration (bool PrintView)
number of courses *****/
SysCfg_NumCtys ();
SysCfg_NumInss ();
HieCfg_NumCtrs (NumCtrs);
HieCfg_NumCtrs (NumCtrs,
false); // Don't put form
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
SysCfg_NumDegs ();
SysCfg_NumCrss ();