Version 14.55.5

This commit is contained in:
Antonio Cañas Vargas 2015-01-16 22:02:21 +01:00
parent 2f7424bd7d
commit acee6c9455
4 changed files with 34 additions and 34 deletions

View File

@ -39,11 +39,12 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 14.55.4 (2015/01/16)"
#define Log_PLATFORM_VERSION "SWAD 14.55.5 (2015/01/16)"
// 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 | tail -1
/*
Version 14.55.5: Jan 16, 2015 Code refactoring related to maps of countries. (173573 lines)
Version 14.55.4: Jan 16, 2015 Fixed bugs in enrollment.
New MIME type, reported by Francisco Ocaña Lara. (173576 lines)
Version 14.55.3: Jan 16, 2015 Link in course information to request registration in course.

View File

@ -148,12 +148,16 @@ void Cty_SeeCtyWithPendingInss (void)
/* Country map */
fprintf (Gbl.F.Out,"<tr>"
"<td style=\"text-align:center;"
" vertical-align:middle; background-color:%s;\">"
"<a href=\"%s\" target=\"_blank\">",
BgColor,Cty.WWW[Gbl.Prefs.Language]);
Cty_DrawCountryMap (&Cty,"COUNTRY_MAP_SMALL");
fprintf (Gbl.F.Out,"</a>"
"</td>");
" vertical-align:middle; background-color:%s;\">",
BgColor);
if (Cty_CheckIfCountryMapExists (&Cty))
{
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\">",
Cty.WWW[Gbl.Prefs.Language]);
Cty_DrawCountryMap (&Cty,"COUNTRY_MAP_SMALL");
fprintf (Gbl.F.Out,"</a>");
}
fprintf (Gbl.F.Out,"</td>");
/* Country name */
fprintf (Gbl.F.Out,"<td class=\"DAT\" style=\"text-align:left;"
@ -221,7 +225,6 @@ static void Cty_Configuration (bool PrintView)
extern const char *Txt_Degrees;
extern const char *Txt_Courses;
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
char PathMap[PATH_MAX+1];
char *MapAttribution = NULL;
bool PutLink = !PrintView && Gbl.CurrentCty.Cty.WWW[Gbl.Prefs.Language][0];
@ -255,13 +258,7 @@ static void Cty_Configuration (bool PrintView)
"</tr>");
/***** Country map (and link to WWW if exists) *****/
sprintf (PathMap,"%s/%s/%s/%s/%s.png",
Cfg_PATH_SWAD_PUBLIC,
Cfg_FOLDER_PUBLIC_ICON,
Cfg_ICON_FOLDER_COUNTRIES,
Gbl.CurrentCty.Cty.Alpha2,
Gbl.CurrentCty.Cty.Alpha2);
if (Fil_CheckIfPathExists (PathMap))
if (Cty_CheckIfCountryMapExists (&Gbl.CurrentCty.Cty))
{
/* Get map attribution */
Cty_GetMapAttribution (Gbl.CurrentCty.Cty.CtyCod,&MapAttribution);
@ -495,7 +492,6 @@ void Cty_ListCountries2 (void)
extern const char *Txt_Country_unspecified;
Cty_CtysOrderType_t Order;
unsigned NumCty;
char PathMap[PATH_MAX+1];
unsigned NumUsrs;
unsigned NumStds;
unsigned NumTchs;
@ -560,13 +556,7 @@ void Cty_ListCountries2 (void)
"<td class=\"COUNTRY_MAP_SMALL\""
" style=\"text-align:center; background-color:%s;\">",
BgColor);
sprintf (PathMap,"%s/%s/%s/%s/%s.png",
Cfg_PATH_SWAD_PUBLIC,
Cfg_FOLDER_PUBLIC_ICON,
Cfg_ICON_FOLDER_COUNTRIES,
Gbl.Ctys.Lst[NumCty].Alpha2,
Gbl.Ctys.Lst[NumCty].Alpha2);
if (Fil_CheckIfPathExists (PathMap))
if (Cty_CheckIfCountryMapExists (&Gbl.Ctys.Lst[NumCty]))
{
/* Map image */
Act_FormGoToStart (ActSeeIns);
@ -707,7 +697,24 @@ void Cty_ListCountries2 (void)
}
/*****************************************************************************/
/**************************** Draw institution logo **************************/
/*********************** Check if country map exists *************************/
/*****************************************************************************/
bool Cty_CheckIfCountryMapExists (struct Country *Cty)
{
char PathMap[PATH_MAX+1];
sprintf (PathMap,"%s/%s/%s/%s/%s.png",
Cfg_PATH_SWAD_PUBLIC,
Cfg_FOLDER_PUBLIC_ICON,
Cfg_ICON_FOLDER_COUNTRIES,
Cty->Alpha2,
Cty->Alpha2);
return Fil_CheckIfPathExists (PathMap);
}
/*****************************************************************************/
/***************************** Draw country map ******************************/
/*****************************************************************************/
void Cty_DrawCountryMap (struct Country *Cty,const char *Class)

View File

@ -78,6 +78,7 @@ void Cty_PrintConfiguration (void);
void Cty_ListCountries (void);
void Cty_ListCountries1 (void);
void Cty_ListCountries2 (void);
bool Cty_CheckIfCountryMapExists (struct Country *Cty);
void Cty_DrawCountryMap (struct Country *Cty,const char *Class);
void Cty_WriteScriptGoogleGeochart (void);
void Cty_PutHiddenParamCtyOrderType (void);

View File

@ -726,7 +726,6 @@ void Deg_WriteBigNameCtyInsCtrDegCrs (void)
{
extern const char *The_ClassCourse[The_NUM_THEMES];
char FullName[Deg_MAX_LENGTH_FULL_NAME+1]; // Full name of course / degree
char PathMap[PATH_MAX+1];
if (Gbl.CurrentCty.Cty.CtyCod > 0 ||
Gbl.CurrentIns.Ins.InsCod > 0 ||
@ -758,16 +757,8 @@ void Deg_WriteBigNameCtyInsCtrDegCrs (void)
Ins_DrawInstitutionLogo (Gbl.CurrentIns.Ins.Logo,Gbl.CurrentIns.Ins.ShortName,32,
"vertical-align:top; margin-right:8px;");
else if (Gbl.CurrentCty.Cty.CtyCod > 0)
{
sprintf (PathMap,"%s/%s/%s/%s/%s.png",
Cfg_PATH_SWAD_PUBLIC,
Cfg_FOLDER_PUBLIC_ICON,
Cfg_ICON_FOLDER_COUNTRIES,
Gbl.CurrentCty.Cty.Alpha2,
Gbl.CurrentCty.Cty.Alpha2);
if (Fil_CheckIfPathExists (PathMap))
if (Cty_CheckIfCountryMapExists (&Gbl.CurrentCty.Cty))
Cty_DrawCountryMap (&Gbl.CurrentCty.Cty,"COUNTRY_MAP_TITLE");
}
}
fprintf (Gbl.F.Out,"%s"
"</div>",