From f9de0cff9b665b1e73250630e93d7d6662224111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 11 Nov 2015 21:14:33 +0100 Subject: [PATCH] Version 15.37.3 --- css/swad_desktop.css | 10 +++- css/swad_mobile.css | 10 +++- swad_changelog.h | 4 +- swad_country.c | 128 ++++++++++++++++++++----------------------- swad_country.h | 6 +- swad_degree.c | 3 +- swad_statistic.c | 20 ++----- 7 files changed, 86 insertions(+), 95 deletions(-) diff --git a/css/swad_desktop.css b/css/swad_desktop.css index 2c4bf4f6..0c475b23 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -551,13 +551,19 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} margin-right:10px; vertical-align:top; } +.COUNTRY_MAP_TINY + { + width:20px; height:20px; + vertical-align:middle; + } .COUNTRY_MAP_SMALL { - width:62px; height:62px; + width:64px; height:64px; + vertical-align:middle; } .COUNTRY_MAP_SHOW { - width:312px; height:312px; + width:320px; height:320px; margin:10px; } .COUNTRY_MAP_PRINT diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 29e7908d..59682e80 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -511,13 +511,19 @@ form {margin:0; display:inline;} margin-right:10px; vertical-align:top; } +.COUNTRY_MAP_TINY + { + width:20px; height:20px; + vertical-align:middle; + } .COUNTRY_MAP_SMALL { - width:62px; height:62px; + width:64px; height:64px; + vertical-align:middle; } .COUNTRY_MAP_SHOW { - width:312px; height:312px; + width:320px; height:320px; margin:10px; } .COUNTRY_MAP_PRINT diff --git a/swad_changelog.h b/swad_changelog.h index bbe6820c..e5430996 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -104,7 +104,6 @@ // TODO: System admin should be able to remove/edit user's mail (when he/she detects a recipient does not exists, for example) // TODO: When a new assignment/attendance/survey is incorrect, the second time the form is shown, it should be filled with partial data, now is always empty // TODO: Remove columns "first year, last year, optional, status" when listing degrees? -// TODO: The image of a country (the Earth) in listing of pending countries should link to the country inside SWAD // TODO: Row with total of users in figures // TODO: Remove total rows in listing of places // TODO: Show message indicating that mail could be in SPAM folder @@ -114,11 +113,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.37.1 (2015/11/11)" +#define Log_PLATFORM_VERSION "SWAD 15.37.3 (2015/11/11)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.37.3: Nov 11, 2015 Changes in country map images. (186898 lines) Version 15.37.2: Nov 11, 2015 Change in layout (background). (186912 lines) Version 15.37.1: Nov 11, 2015 Minor changes in sessions. (186912 lines) Version 15.37: Nov 11, 2015 Changes to speed up queries related to time. diff --git a/swad_country.c b/swad_country.c index 435a6ffd..58b0bccd 100644 --- a/swad_country.c +++ b/swad_country.c @@ -87,7 +87,6 @@ void Cty_SeeCtyWithPendingInss (void) extern const char *Txt_Countries_with_pending_institutions; extern const char *Txt_Country; extern const char *Txt_Institutions_ABBREVIATION; - extern const char *Txt_Go_to_X; extern const char *Txt_There_are_no_countries_with_requests_for_institutions_to_be_confirmed; char Query[1024]; MYSQL_RES *mysql_res; @@ -119,7 +118,6 @@ void Cty_SeeCtyWithPendingInss (void) /***** Write heading *****/ Lay_StartRoundFrameTable (NULL,2,Txt_Countries_with_pending_institutions); fprintf (Gbl.F.Out,"" - "" "" "%s" "" @@ -148,27 +146,10 @@ void Cty_SeeCtyWithPendingInss (void) /* Country map */ fprintf (Gbl.F.Out,"" - "", + "", BgColor); - if (Cty_CheckIfCountryMapExists (&Cty)) - { - fprintf (Gbl.F.Out,"", - Cty.WWW[Gbl.Prefs.Language]); - Cty_DrawCountryMap (&Cty,"COUNTRY_MAP_SMALL"); - fprintf (Gbl.F.Out,""); - } - fprintf (Gbl.F.Out,""); - - /* Country name */ - fprintf (Gbl.F.Out,"", - BgColor); - Act_FormGoToStart (ActSeeIns); - Cty_PutParamCtyCod (Cty.CtyCod); - sprintf (Gbl.Title,Txt_Go_to_X,Cty.Name[Gbl.Prefs.Language]); - Act_LinkFormSubmit (Gbl.Title,"DAT"); - fprintf (Gbl.F.Out,"%s", - Cty.Name[Gbl.Prefs.Language]); - Act_FormEnd (); + Cty_DrawCountryMapWithLinkToSeeCtyInf (&Cty,ActSeeIns, + "DAT_NOBR","COUNTRY_MAP_SMALL"); fprintf (Gbl.F.Out,""); /* Number of pending institutions (row[1]) */ @@ -475,7 +456,6 @@ void Cty_ListCountries2 (void) extern const char *Txt_Students_ABBREVIATION; extern const char *Txt_Teachers_ABBREVIATION; extern const char *Txt_Institutions_ABBREVIATION; - extern const char *Txt_Go_to_X; extern const char *Txt_Other_countries; extern const char *Txt_Country_unspecified; Cty_CtysOrderType_t Order; @@ -497,8 +477,7 @@ void Cty_ListCountries2 (void) /***** Table head *****/ Lay_StartRoundFrameTable (NULL,2,Txt_Countries); - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,""); for (Order = Cty_ORDER_BY_COUNTRY; Order <= Cty_ORDER_BY_NUM_USRS; Order++) @@ -540,34 +519,10 @@ void Cty_ListCountries2 (void) /***** Country map (and link to WWW if exists) *****/ fprintf (Gbl.F.Out,"" - "", + "", BgColor); - if (Cty_CheckIfCountryMapExists (&Gbl.Ctys.Lst[NumCty])) - { - /* Map image */ - Act_FormGoToStart (ActSeeCtyInf); - Cty_PutParamCtyCod (Gbl.Ctys.Lst[NumCty].CtyCod); - sprintf (Gbl.Title,Txt_Go_to_X, - Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); - Act_LinkFormSubmit (Gbl.Title,NULL); - Cty_DrawCountryMap (&Gbl.Ctys.Lst[NumCty],"COUNTRY_MAP_SMALL"); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); - } - fprintf (Gbl.F.Out,""); - - /* Name and link to go to this country */ - fprintf (Gbl.F.Out,"", - BgColor); - Act_FormGoToStart (ActSeeCtyInf); - Cty_PutParamCtyCod (Gbl.Ctys.Lst[NumCty].CtyCod); - sprintf (Gbl.Title,Txt_Go_to_X, - Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); - Act_LinkFormSubmit (Gbl.Title,"DAT"); - fprintf (Gbl.F.Out,"%s (%s)", - Gbl.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language], - Gbl.Ctys.Lst[NumCty].Alpha2); - Act_FormEnd (); + Cty_DrawCountryMapWithLinkToSeeCtyInf (&Gbl.Ctys.Lst[NumCty],ActSeeCtyInf, + "DAT_NOBR","COUNTRY_MAP_SMALL"); fprintf (Gbl.F.Out,""); /* Write stats of this country */ @@ -682,6 +637,57 @@ void Cty_ListCountries2 (void) /*********************** Check if country map exists *************************/ /*****************************************************************************/ +void Cty_DrawCountryMapWithLinkToSeeCtyInf (struct Country *Cty,Act_Action_t Action, + const char *ClassLink,const char *ClassMap) + { + extern const char *Txt_Go_to_X; + + /***** Start form *****/ + Act_FormGoToStart (Action); + Cty_PutParamCtyCod (Cty->CtyCod); + + /***** Link to action *****/ + sprintf (Gbl.Title,Txt_Go_to_X,Cty->Name[Gbl.Prefs.Language]); + Act_LinkFormSubmit (Gbl.Title,ClassLink); + + /***** Draw country map *****/ + Cty_DrawCountryMap (Cty,ClassMap); + + /***** End link *****/ + fprintf (Gbl.F.Out," %s (%s)", + Cty->Name[Gbl.Prefs.Language], + Cty->Alpha2); + + /***** End form *****/ + Act_FormEnd (); + } + +/*****************************************************************************/ +/***************************** Draw country map ******************************/ +/*****************************************************************************/ + +void Cty_DrawCountryMap (struct Country *Cty,const char *Class) + { + /***** Draw country map *****/ + fprintf (Gbl.F.Out,"Alpha2, + Cty->Alpha2); + else + fprintf (Gbl.F.Out,"%s/tr16x16.gif", // TODO: Change for a 1x1 image or a generic image + Gbl.Prefs.IconsURL); + fprintf (Gbl.F.Out,"\" alt=\"%s\" title=\"%s\" class=\"%s\" />", + Cty->Alpha2, + Cty->Name[Gbl.Prefs.Language], + Class); + } + +/*****************************************************************************/ +/*********************** Check if country map exists *************************/ +/*****************************************************************************/ + bool Cty_CheckIfCountryMapExists (struct Country *Cty) { char PathMap[PATH_MAX+1]; @@ -695,24 +701,6 @@ bool Cty_CheckIfCountryMapExists (struct Country *Cty) return Fil_CheckIfPathExists (PathMap); } -/*****************************************************************************/ -/***************************** Draw country map ******************************/ -/*****************************************************************************/ - -void Cty_DrawCountryMap (struct Country *Cty,const char *Class) - { - /***** Draw country map *****/ - fprintf (Gbl.F.Out,"\"%s\"", - Gbl.Prefs.IconsURL,Cfg_ICON_FOLDER_COUNTRIES, - Cty->Alpha2, - Cty->Alpha2, - Cty->Alpha2, - Cty->Name[Gbl.Prefs.Language], - Class); - } - /*****************************************************************************/ /********************** Write script for Google Geochart *********************/ /*****************************************************************************/ diff --git a/swad_country.h b/swad_country.h index 347b9906..da446130 100644 --- a/swad_country.h +++ b/swad_country.h @@ -79,8 +79,12 @@ void Cty_PrintConfiguration (void); void Cty_ListCountries (void); void Cty_ListCountries1 (void); void Cty_ListCountries2 (void); -bool Cty_CheckIfCountryMapExists (struct Country *Cty); + +void Cty_DrawCountryMapWithLinkToSeeCtyInf (struct Country *Cty,Act_Action_t Action, + const char *ClassLink,const char *ClassMap); void Cty_DrawCountryMap (struct Country *Cty,const char *Class); +bool Cty_CheckIfCountryMapExists (struct Country *Cty); + void Cty_WriteScriptGoogleGeochart (void); void Cty_PutHiddenParamCtyOrderType (void); void Cty_EditCountries (void); diff --git a/swad_degree.c b/swad_degree.c index 1d37bb42..18e11747 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -763,8 +763,7 @@ void Deg_WriteBigNameCtyInsCtrDegCrs (void) Log_DrawLogo (Sco_SCOPE_INS,Gbl.CurrentIns.Ins.InsCod, Gbl.CurrentIns.Ins.ShortName,32,"TOP_LOGO",false); else if (Gbl.CurrentCty.Cty.CtyCod > 0) - if (Cty_CheckIfCountryMapExists (&Gbl.CurrentCty.Cty)) - Cty_DrawCountryMap (&Gbl.CurrentCty.Cty,"COUNTRY_MAP_TITLE"); + Cty_DrawCountryMap (&Gbl.CurrentCty.Cty,"COUNTRY_MAP_TITLE"); } fprintf (Gbl.F.Out,"%s" "", diff --git a/swad_statistic.c b/swad_statistic.c index 491a13a7..72a3ed92 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -3234,11 +3234,10 @@ static void Sta_ShowNumHitsPerCountry (unsigned long NumRows, static void Sta_WriteCountry (long CtyCod) { - extern const char *Txt_Go_to_X; struct Country Cty; /***** Start cell *****/ - fprintf (Gbl.F.Out,""); if (CtyCod > 0) // Hit with a country selected { @@ -3246,24 +3245,13 @@ static void Sta_WriteCountry (long CtyCod) Cty.CtyCod = CtyCod; Cty_GetDataOfCountryByCod (&Cty); - /***** Title in cell *****/ - fprintf (Gbl.F.Out,"title=\"%s\">", - Cty.Name[Gbl.Prefs.Language]); - /***** Form to go to country *****/ - Act_FormGoToStart (ActSeeCtyInf); - Cty_PutParamCtyCod (CtyCod); - sprintf (Gbl.Title,Txt_Go_to_X,Cty.Name[Gbl.Prefs.Language]); - Act_LinkFormSubmit (Gbl.Title,"LOG"); - Log_DrawLogo (Sco_SCOPE_CTY,Cty.CtyCod,Cty.Name[Gbl.Prefs.Language], - 16,"CENTER_TOP",true); - fprintf (Gbl.F.Out," %s ", - Cty.Name[Gbl.Prefs.Language]); - Act_FormEnd (); + Cty_DrawCountryMapWithLinkToSeeCtyInf (&Cty,ActSeeCtyInf, + "LOG","COUNTRY_MAP_TINY"); } else // Hit with no country selected /***** No country selected *****/ - fprintf (Gbl.F.Out,"> - "); + fprintf (Gbl.F.Out," - "); /***** End cell *****/ fprintf (Gbl.F.Out,"");