diff --git a/swad_changelog.h b/swad_changelog.h index 2752c635b..3b42835b7 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.1 (2020-01-14)" +#define Log_PLATFORM_VERSION "SWAD 19.116.2 (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.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. Code refactoring related to printing some strings. (278506 lines) diff --git a/swad_institution.c b/swad_institution.c index 07b2b9040..0469f79c1 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -369,7 +369,6 @@ static void Ins_PutIconToEditInstitutions (void) static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns) { - extern const char *Txt_Map; extern const char *Txt_INSTITUTION_STATUS[Ins_NUM_STATUS_TXT]; const char *TxtClassNormal; const char *TxtClassStrong; @@ -409,13 +408,7 @@ static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns) /***** Map *****/ HTM_TD_Begin ("class=\"%s CM %s\"",TxtClassNormal,BgColor); - if (Ins_GetIfMapIsAvailable (Ins->InsCod)) - { - Ins_EditingIns = Ins; // Used to pass parameter with the code of the institution - Lay_PutContextualLinkOnlyIcon (ActSeeInsInf,NULL,Ins_PutParamGoToIns, - "map-marker-alt.svg", - Txt_Map); - } + Ins_FormToGoToMap (Ins); HTM_TD_End (); /***** Other stats *****/ @@ -2113,6 +2106,23 @@ static void Ins_EditingInstitutionDestructor (void) } } +/*****************************************************************************/ +/************************ Form to go to centre map ***************************/ +/*****************************************************************************/ + +void Ins_FormToGoToMap (struct Instit *Ins) + { + extern const char *Txt_Map; + + if (Ins_GetIfMapIsAvailable (Ins->InsCod)) + { + Ins_EditingIns = Ins; // Used to pass parameter with the code of the institution + Lay_PutContextualLinkOnlyIcon (ActSeeInsInf,NULL,Ins_PutParamGoToIns, + "map-marker-alt.svg", + Txt_Map); + } + } + /*****************************************************************************/ /********** Check if any of the centres in an institution has map ************/ /*****************************************************************************/ diff --git a/swad_institution.h b/swad_institution.h index ae92a9121..c356840d0 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -139,6 +139,7 @@ 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 1ee869f02..078be49f7 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -139,7 +139,7 @@ static void Sta_ShowNumHitsPerCountry (unsigned long NumRows, static void Sta_WriteCountry (long CtyCod); static void Sta_ShowNumHitsPerInstitution (unsigned long NumRows, MYSQL_RES *mysql_res); -static void Sta_WriteInstitution (long InsCod); +static void Sta_WriteInstit (long InsCod); static void Sta_ShowNumHitsPerCentre (unsigned long NumRows, MYSQL_RES *mysql_res); static void Sta_WriteCentre (long CtrCod); @@ -3344,7 +3344,7 @@ static void Sta_ShowNumHitsPerInstitution (unsigned long NumRows, HTM_TD_End (); /* Write institution */ - Sta_WriteInstitution (InsCod); + Sta_WriteInstit (InsCod); /* Draw bar proportional to number of hits */ Hits.Num = Str_GetDoubleFromStr (row[1]); @@ -3359,7 +3359,7 @@ static void Sta_ShowNumHitsPerInstitution (unsigned long NumRows, /********************** Write institution with an icon ***********************/ /*****************************************************************************/ -static void Sta_WriteInstitution (long InsCod) +static void Sta_WriteInstit (long InsCod) { struct Instit Ins; @@ -3376,6 +3376,9 @@ static void Sta_WriteInstitution (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 {