Version 15.37.3

This commit is contained in:
Antonio Cañas Vargas 2015-11-11 21:14:33 +01:00
parent c521b70d44
commit f9de0cff9b
7 changed files with 86 additions and 95 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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,"<tr>"
"<th></th>"
"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
@ -148,27 +146,10 @@ void Cty_SeeCtyWithPendingInss (void)
/* Country map */
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"CENTER_MIDDLE %s\">",
"<td class=\"LEFT_MIDDLE %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 LEFT_MIDDLE %s\">",
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</a>",
Cty.Name[Gbl.Prefs.Language]);
Act_FormEnd ();
Cty_DrawCountryMapWithLinkToSeeCtyInf (&Cty,ActSeeIns,
"DAT_NOBR","COUNTRY_MAP_SMALL");
fprintf (Gbl.F.Out,"</td>");
/* 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,"<tr>"
"<th class=\"COUNTRY_MAP_SMALL\"></th>");
fprintf (Gbl.F.Out,"<tr>");
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,"<tr>"
"<td class=\"COUNTRY_MAP_SMALL CENTER_MIDDLE %s\">",
"<td class=\"LEFT_MIDDLE %s\">",
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,"</a>");
Act_FormEnd ();
}
fprintf (Gbl.F.Out,"</td>");
/* Name and link to go to this country */
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE %s\">",
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)</a>",
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,"</td>");
/* 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,"&nbsp;%s (%s)</a>",
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,"<img src=\"");
if (Cty_CheckIfCountryMapExists (Cty))
fprintf (Gbl.F.Out,"%s/%s/%s/%s.png",
Gbl.Prefs.IconsURL,Cfg_ICON_FOLDER_COUNTRIES,
Cty->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,"<img src=\"%s/%s/%s/%s.png\""
" alt=\"%s\" title=\"%s\""
" class=\"%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 *********************/
/*****************************************************************************/

View File

@ -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);

View File

@ -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"
"</div>",

View File

@ -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,"<td class=\"LOG LEFT_MIDDLE\"");
fprintf (Gbl.F.Out,"<td class=\"LOG LEFT_MIDDLE\">");
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,"&nbsp;%s&nbsp;</a>",
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,">&nbsp;-&nbsp;");
fprintf (Gbl.F.Out,"&nbsp;-&nbsp;");
/***** End cell *****/
fprintf (Gbl.F.Out,"</td>");