diff --git a/swad_centre.c b/swad_centre.c index 9d4b9587..67589226 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -95,6 +95,8 @@ static void Ctr_CreateCentre (unsigned Status); static void Ctr_EditingCentreConstructor (void); static void Ctr_EditingCentreDestructor (void); +static void Ctr_FormToGoToMap (struct Centre *Ctr); + /*****************************************************************************/ /******************* List centres with pending degrees ***********************/ /*****************************************************************************/ @@ -223,6 +225,9 @@ void Ctr_DrawCentreLogoAndNameWithLink (struct Centre *Ctr,Act_Action_t Action, /***** End form *****/ Frm_EndForm (); + + /***** Map *****/ + Ctr_FormToGoToMap (Ctr); } /*****************************************************************************/ @@ -2126,11 +2131,11 @@ static void Ctr_EditingCentreDestructor (void) /************************ Form to go to centre map ***************************/ /*****************************************************************************/ -void Ctr_FormToGoToMap (struct Centre *Ctr) +static void Ctr_FormToGoToMap (struct Centre *Ctr) { extern const char *Txt_Map; - if (Ctr_GetIfMapIsAvailable (&Ctr)) + if (Ctr_GetIfMapIsAvailable (Ctr)) { Ctr_EditingCtr = Ctr; // Used to pass parameter with the code of the centre Lay_PutContextualLinkOnlyIcon (ActSeeCtrInf,NULL,Ctr_PutParamGoToCtr, diff --git a/swad_centre.h b/swad_centre.h index e2a5eefd..3f12eeb7 100644 --- a/swad_centre.h +++ b/swad_centre.h @@ -144,7 +144,6 @@ unsigned Ctr_GetNumCtrsWithUsrs (Rol_Role_t Role,const char *SubQuery); void Ctr_ListCtrsFound (MYSQL_RES **mysql_res,unsigned NumCtrs); -void Ctr_FormToGoToMap (struct Centre *Ctr); bool Ctr_GetIfMapIsAvailable (const struct Centre *Ctr); #endif diff --git a/swad_changelog.h b/swad_changelog.h index 3b42835b..dea41948 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -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.116.2 (2020-01-14)" +#define Log_PLATFORM_VERSION "SWAD 19.116.3 (2020-01-14)" #define CSS_FILE "swad19.115.css" #define JS_FILE "swad19.91.1.js" /* @@ -503,6 +503,7 @@ ps2pdf source.ps destination.pdf // TODO: No se puede entrar con DNI '1' suponiendo que no tenga password ¿por qué? // TODO: Mapas más estrechos en móvil + Version 19.116.3: Jan 14, 2020 Form to go to country map in statistics. (278547 lines) Version 19.116.2: Jan 14, 2020 Form to go to institution map in statistics. (278529 lines) Version 19.116.1: Jan 14, 2020 Form to go to centre map in statistics. (278518 lines) Version 19.116: Jan 11, 2020 Changes in number of digits printed in doubles. diff --git a/swad_country.c b/swad_country.c index ffa31f8d..0a905cbb 100644 --- a/swad_country.c +++ b/swad_country.c @@ -94,6 +94,8 @@ static void Cty_CreateCountry (void); static void Cty_EditingCountryConstructor (void); static void Cty_EditingCountryDestructor (void); +static void Cty_FormToGoToMap (struct Country *Cty); + /*****************************************************************************/ /***************** List countries with pending institutions ******************/ /*****************************************************************************/ @@ -533,6 +535,9 @@ void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action, /***** End form *****/ HTM_DIV_End (); Frm_EndForm (); + + /***** Map *****/ + Cty_FormToGoToMap (Cty); } /*****************************************************************************/ @@ -2085,6 +2090,23 @@ static void Cty_EditingCountryDestructor (void) } } +/*****************************************************************************/ +/************************ Form to go to country map **************************/ +/*****************************************************************************/ + +static void Cty_FormToGoToMap (struct Country *Cty) + { + extern const char *Txt_Map; + + if (Cty_GetIfMapIsAvailable (Cty->CtyCod)) + { + Cty_EditingCty = Cty; // Used to pass parameter with the code of the country + Lay_PutContextualLinkOnlyIcon (ActSeeCtyInf,NULL,Cty_PutParamGoToCty, + "map-marker-alt.svg", + Txt_Map); + } + } + /*****************************************************************************/ /************ Check if any of the centres in a country has map ***************/ /*****************************************************************************/ diff --git a/swad_institution.c b/swad_institution.c index 0469f79c..b2d72c4e 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -99,6 +99,8 @@ static void Ins_CreateInstitution (unsigned Status); static void Ins_EditingInstitutionConstructor (); static void Ins_EditingInstitutionDestructor (); +static void Ins_FormToGoToMap (struct Instit *Ins); + /*****************************************************************************/ /***************** List institutions with pending centres ********************/ /*****************************************************************************/ @@ -253,6 +255,9 @@ void Ins_DrawInstitutionLogoAndNameWithLink (struct Instit *Ins,Act_Action_t Act /***** End form *****/ Frm_EndForm (); + + /***** Map *****/ + Ins_FormToGoToMap (Ins); } /*****************************************************************************/ @@ -2107,10 +2112,10 @@ static void Ins_EditingInstitutionDestructor (void) } /*****************************************************************************/ -/************************ Form to go to centre map ***************************/ +/********************* Form to go to institution map *************************/ /*****************************************************************************/ -void Ins_FormToGoToMap (struct Instit *Ins) +static void Ins_FormToGoToMap (struct Instit *Ins) { extern const char *Txt_Map; diff --git a/swad_institution.h b/swad_institution.h index c356840d..ae92a912 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -139,7 +139,6 @@ unsigned Ins_GetNumInssWithUsrs (Rol_Role_t Role,const char *SubQuery); void Ins_ListInssFound (MYSQL_RES **mysql_res,unsigned NumInss); -void Ins_FormToGoToMap (struct Instit *Ins); bool Ins_GetIfMapIsAvailable (long InsCod); #endif diff --git a/swad_statistic.c b/swad_statistic.c index 078be49f..b3171398 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -3376,9 +3376,6 @@ static void Sta_WriteInstit (long InsCod) /***** Form to go to institution *****/ Ins_DrawInstitutionLogoAndNameWithLink (&Ins,ActSeeInsInf, "BT_LINK LT LOG","CT"); - - /***** Map *****/ - Ins_FormToGoToMap (&Ins); } else // Hit with no institution selected { @@ -3471,9 +3468,6 @@ static void Sta_WriteCentre (long CtrCod) /***** Form to go to centre *****/ Ctr_DrawCentreLogoAndNameWithLink (&Ctr,ActSeeCtrInf, "BT_LINK LT LOG","CT"); - - /***** Map *****/ - Ctr_FormToGoToMap (&Ctr); } else // Hit with no centre selected {