From 2e562d8e061a1cfb8f6ad73ad9d241f91aa34278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 9 Jan 2020 16:44:14 +0100 Subject: [PATCH] Version19.115 --- swad_QR.c | 12 ++++-------- swad_changelog.h | 3 ++- swad_country.c | 17 ++++++++++++++++- swad_hierarchy_config.c | 17 ++++++----------- swad_system_config.c | 2 +- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/swad_QR.c b/swad_QR.c index 2a6118a2..36e4b05f 100644 --- a/swad_QR.c +++ b/swad_QR.c @@ -132,23 +132,19 @@ void QR_ImageQRCode (const char *QRString) void QR_LinkTo (unsigned Size,const char *ParamName,long Cod) { extern const char *Txt_Shortcut; - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; char *URL; /***** Show QR code with link *****/ if (ParamName) { - if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/%s?%s=%ld", - Size,Size, - Cfg_URL_SWAD_CGI,Lan_STR_LANG_ID[Gbl.Prefs.Language], - ParamName,Cod) < 0) + if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/?%s=%ld", + Size,Size,Cfg_URL_SWAD_CGI,ParamName,Cod) < 0) Lay_NotEnoughMemoryExit (); } else { - if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/%s", - Size,Size, - Cfg_URL_SWAD_CGI,Lan_STR_LANG_ID[Gbl.Prefs.Language]) < 0) + if (asprintf (&URL,"https://chart.googleapis.com/chart?cht=qr&chs=%ux%u&chl=%s/", + Size,Size,Cfg_URL_SWAD_CGI) < 0) Lay_NotEnoughMemoryExit (); } HTM_IMG (URL,NULL,Txt_Shortcut, diff --git a/swad_changelog.h b/swad_changelog.h index e91c58c2..5b63eb6a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -502,7 +502,8 @@ ps2pdf source.ps destination.pdf // TODO: Mapas más estrechos en móvil Version 19.115: Jan 09, 2020 Map column in listing of institutions. - Fixed bug in edition of timetable, reported by Miguel Damas Hermoso. (? lines) + Fixed bug in edition of timetable, reported by Miguel Damas Hermoso. + Language removed from shortcuts. (278515 lines) Version 19.114: Jan 08, 2020 New option in System tab to view platform configuration. Optimizations in number of users in courses. (278462 lines) Version 19.113: Jan 08, 2020 Code refactoring related to hierarchy. diff --git a/swad_country.c b/swad_country.c index 9a2a9c51..ffa31f8d 100644 --- a/swad_country.c +++ b/swad_country.c @@ -342,6 +342,7 @@ static void Cty_PutHeadCountriesForSeeing (bool OrderSelectable) { extern const char *Txt_COUNTRIES_HELP_ORDER[2]; extern const char *Txt_COUNTRIES_ORDER[2]; + extern const char *Txt_Map; extern const char *Txt_Institutions_ABBREVIATION; extern const char *Txt_Centres_ABBREVIATION; extern const char *Txt_Degrees_ABBREVIATION; @@ -377,6 +378,7 @@ static void Cty_PutHeadCountriesForSeeing (bool OrderSelectable) HTM_TH_End (); } + HTM_TH (1,1,"CM",Txt_Map); HTM_TH (1,1,"RM",Txt_Institutions_ABBREVIATION); HTM_TH (1,1,"RM",Txt_Centres_ABBREVIATION); HTM_TH (1,1,"RM",Txt_Degrees_ABBREVIATION); @@ -396,6 +398,7 @@ static void Cty_PutHeadCountriesForSeeing (bool OrderSelectable) static void Cty_ListOneCountryForSeeing (struct Country *Cty,unsigned NumCty) { + extern const char *Txt_Map; const char *BgColor; BgColor = (Cty->CtyCod == Gbl.Hierarchy.Cty.CtyCod) ? "LIGHT_BLUE" : @@ -416,11 +419,23 @@ static void Cty_ListOneCountryForSeeing (struct Country *Cty,unsigned NumCty) "BT_LINK DAT_N"); HTM_TD_End (); - /* Write stats of this country */ + /***** Number of users who claim to belong to this country *****/ HTM_TD_Begin ("class=\"DAT RM %s\"",BgColor); HTM_Unsigned (Usr_GetNumUsrsWhoClaimToBelongToCty (Cty)); HTM_TD_End (); + /***** Map *****/ + HTM_TD_Begin ("class=\"DAT CM %s\"",BgColor); + 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); + } + HTM_TD_End (); + + /***** Other stats *****/ HTM_TD_Begin ("class=\"DAT RM %s\"",BgColor); HTM_Unsigned (Ins_GetNumInssInCty (Cty->CtyCod)); HTM_TD_End (); diff --git a/swad_hierarchy_config.c b/swad_hierarchy_config.c index eba1d09d..aa9adfe2 100644 --- a/swad_hierarchy_config.c +++ b/swad_hierarchy_config.c @@ -194,7 +194,6 @@ void HieCfg_WWW (bool PrintView,bool PutForm,Act_Action_t NextAction, void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod) { - extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; extern const char *Txt_Shortcut; /***** Short cut *****/ @@ -208,24 +207,20 @@ void HieCfg_Shortcut (bool PrintView,const char *ParamName,long HieCod) if (!PrintView) { if (ParamName) - HTM_A_Begin ("href=\"%s/%s?%s=%ld\" class=\"DAT\" target=\"_blank\"", + HTM_A_Begin ("href=\"%s/?%s=%ld\" class=\"DAT\" target=\"_blank\"", Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], ParamName,HieCod); else - HTM_A_Begin ("href=\"%s/%s\" class=\"DAT\" target=\"_blank\"", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language]); + HTM_A_Begin ("href=\"%s/\" class=\"DAT\" target=\"_blank\"", + Cfg_URL_SWAD_CGI); } if (ParamName) - HTM_TxtF ("%s/%s?%s=%ld", + HTM_TxtF ("%s/?%s=%ld", Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language], ParamName,HieCod); else - HTM_TxtF ("%s/%s", - Cfg_URL_SWAD_CGI, - Lan_STR_LANG_ID[Gbl.Prefs.Language]); + HTM_TxtF ("%s/", + Cfg_URL_SWAD_CGI); if (!PrintView) HTM_A_End (); HTM_TD_End (); diff --git a/swad_system_config.c b/swad_system_config.c index f72b99b3..aa2c6f0e 100644 --- a/swad_system_config.c +++ b/swad_system_config.c @@ -204,7 +204,7 @@ static bool SysCfg_GetIfMapIsAvailable (void) { /* Get if map is available */ row = mysql_fetch_row (mysql_res); - MapIsAvailable = (row[0] == '1'); + MapIsAvailable = (row[0][0] == '1'); } /* Free structure that stores the query result */