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"); 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 **********************/ /******************* Get number of centres in a country **********************/
/*****************************************************************************/ /*****************************************************************************/
@ -1949,22 +1936,6 @@ unsigned Ctr_GetNumCtrsInCty (long CtyCod)
return Gbl.Cache.NumCtrsInCty.NumCtrs; 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 ********************/ /**************** Get number of centres in an institution ********************/
/*****************************************************************************/ /*****************************************************************************/
@ -1996,6 +1967,50 @@ unsigned Ctr_GetNumCtrsInIns (long InsCod)
return Gbl.Cache.NumCtrsInIns.NumCtrs; 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 *******/ /******* 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); void Ctr_RecFormNewCtr (void);
unsigned Ctr_GetNumCtrsInSys (void); unsigned Ctr_GetNumCtrsInSys (void);
unsigned Ctr_GetNumCtrsWithMapInSys (void);
void Ctr_FlushCacheNumCtrsInCty (void); void Ctr_FlushCacheNumCtrsInCty (void);
unsigned Ctr_GetNumCtrsInCty (long CtyCod); unsigned Ctr_GetNumCtrsInCty (long CtyCod);
unsigned Ctr_GetNumCtrsWithMapInCty (long CtyCod);
void Ctr_FlushCacheNumCtrsInIns (void); void Ctr_FlushCacheNumCtrsInIns (void);
unsigned Ctr_GetNumCtrsInIns (long InsCod); 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_GetNumCtrsInPlc (long PlcCod);
unsigned Ctr_GetNumCtrsWithDegs (const char *SubQuery); unsigned Ctr_GetNumCtrsWithDegs (const char *SubQuery);
unsigned Ctr_GetNumCtrsWithCrss (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: En OpenSWAD:
ps2pdf source.ps destination.pdf 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 CSS_FILE "swad19.118.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: Impedir la creación y edición de proyectos si no son editables. // 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é? // 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.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.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.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 *****/ number of courses *****/
CtyCfg_NumUsrs (); CtyCfg_NumUsrs ();
CtyCfg_NumInss (); CtyCfg_NumInss ();
HieCfg_NumCtrs (NumCtrs); HieCfg_NumCtrs (NumCtrs,
false); // Don't put form
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap); HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
CtyCfg_NumDegs (); CtyCfg_NumDegs ();
CtyCfg_NumCrss (); CtyCfg_NumCrss ();

View File

@ -232,9 +232,10 @@ void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod)
/************************** Show number of centres ***************************/ /************************** 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;
extern const char *Txt_Centres_of_INSTITUTION_X;
/***** Number of centres *****/ /***** Number of centres *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -243,8 +244,22 @@ void HieCfg_NumCtrs (unsigned NumCtrs)
Frm_LabelColumn ("RT",NULL,Txt_Centres); Frm_LabelColumn ("RT",NULL,Txt_Centres);
/* Data */ /* 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); HTM_Unsigned (NumCtrs);
if (PutForm)
{
HTM_BUTTON_End ();
Frm_EndForm ();
}
HTM_TD_End (); HTM_TD_End ();
HTM_TR_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, void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction,
const char WWW[Cns_MAX_BYTES_WWW + 1]); const char WWW[Cns_MAX_BYTES_WWW + 1]);
void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod); 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_NumCtrsWithMap (unsigned NumCtrs,unsigned NumCtrsWithMap);
void HieCfg_QR (const char *ParamName,long HieCod); 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_Shortcut (bool PrintView);
static void InsCfg_QR (void); static void InsCfg_QR (void);
static void InsCfg_NumUsrs (void); static void InsCfg_NumUsrs (void);
static void InsCfg_NumCtrs (void);
static void InsCfg_NumDegs (void); static void InsCfg_NumDegs (void);
static void InsCfg_NumCrss (void); static void InsCfg_NumCrss (void);
static void InsCfg_NumDpts (void); static void InsCfg_NumDpts (void);
@ -113,7 +112,8 @@ static void InsCfg_Configuration (bool PrintView)
bool PutFormCty; bool PutFormCty;
bool PutFormName; bool PutFormName;
bool PutFormWWW; bool PutFormWWW;
bool MapIsAvailable; unsigned NumCtrs;
unsigned NumCtrsWithMap;
/***** Trivial check *****/ /***** Trivial check *****/
if (Gbl.Hierarchy.Ins.InsCod <= 0) // No institution selected if (Gbl.Hierarchy.Ins.InsCod <= 0) // No institution selected
@ -156,18 +156,23 @@ static void InsCfg_Configuration (bool PrintView)
/***** Shortcut to the institution *****/ /***** Shortcut to the institution *****/
InsCfg_Shortcut (PrintView); InsCfg_Shortcut (PrintView);
NumCtrsWithMap = Ctr_GetNumCtrsWithMapInIns (Gbl.Hierarchy.Ins.InsCod);
if (PrintView) if (PrintView)
/***** QR code with link to the institution *****/ /***** QR code with link to the institution *****/
InsCfg_QR (); InsCfg_QR ();
else else
{ {
NumCtrs = Ctr_GetNumCtrsInIns (Gbl.Hierarchy.Ins.InsCod);
/***** Number of users who claim to belong to this institution, /***** Number of users who claim to belong to this institution,
number of centres, number of centres,
number of degrees, number of degrees,
number of courses, number of courses,
number of departments *****/ number of departments *****/
InsCfg_NumUsrs (); InsCfg_NumUsrs ();
InsCfg_NumCtrs (); HieCfg_NumCtrs (NumCtrs,
true); // Put form
HieCfg_NumCtrsWithMap (NumCtrs,NumCtrsWithMap);
InsCfg_NumDegs (); InsCfg_NumDegs ();
InsCfg_NumCrss (); InsCfg_NumCrss ();
InsCfg_NumDpts (); InsCfg_NumDpts ();
@ -186,10 +191,7 @@ static void InsCfg_Configuration (bool PrintView)
HTM_DIV_End (); HTM_DIV_End ();
/**************************** Right part **********************************/ /**************************** Right part **********************************/
/***** Check map *****/ if (NumCtrsWithMap)
MapIsAvailable = Ins_GetIfMapIsAvailable (Gbl.Hierarchy.Ins.InsCod);
if (MapIsAvailable)
{ {
HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\""); HTM_DIV_Begin ("class=\"HIE_CFG_RIGHT HIE_CFG_WIDTH\"");
@ -470,37 +472,6 @@ static void InsCfg_NumUsrs (void)
HTM_TR_End (); 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 *************/ /*********** Show number of degrees in institution configuration *************/
/*****************************************************************************/ /*****************************************************************************/

View File

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