mirror of https://github.com/acanas/swad-core.git
Version 15.14.2
This commit is contained in:
parent
8bc2041f38
commit
290da880fd
|
@ -174,7 +174,7 @@ void Ctr_SeeCtrWithPendingDegs (void)
|
|||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||
BgColor,Ctr.WWW,Ctr.FullName);
|
||||
Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShortName,
|
||||
16,"CENTER_TOP",true);
|
||||
16,"CENTER_MIDDLE",true);
|
||||
fprintf (Gbl.F.Out,"</a>"
|
||||
"</td>");
|
||||
|
||||
|
@ -610,12 +610,12 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr)
|
|||
NumCtr);
|
||||
|
||||
/***** Centre logo *****/
|
||||
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP %s\">"
|
||||
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_MIDDLE %s\">"
|
||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||
TxtClass,BgColor,
|
||||
Ctr->WWW,Ctr->FullName);
|
||||
Log_DrawLogo (Sco_SCOPE_CTR,Ctr->CtrCod,Ctr->ShortName,
|
||||
16,"CENTER_TOP",true);
|
||||
16,"CENTER_MIDDLE",true);
|
||||
fprintf (Gbl.F.Out,"</a>"
|
||||
"</td>");
|
||||
|
||||
|
|
|
@ -107,12 +107,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.14 (2015/10/15)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.14.2 (2015/10/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 sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 15.14: Oct 15, 2015 Table log (historical log) renamed as log_full. (? lines)
|
||||
Version 15.14.2: Oct 16, 2015 Minor changes in layout. (186166 lines)
|
||||
Version 15.14.1: Oct 16, 2015 Fixed minor bug in edition of degrees. (186170 lines)
|
||||
Version 15.14: Oct 15, 2015 Table log (historical log) renamed as log_full. (186169 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE log TO log_full;
|
||||
|
||||
|
|
|
@ -1138,35 +1138,30 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty)
|
|||
/***************************** Get country name ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Cty_GetCountryName (long CtyCod,char *CtyName)
|
||||
void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1])
|
||||
{
|
||||
extern const char *Txt_Another_country;
|
||||
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
|
||||
char Query[512];
|
||||
char Query[128];
|
||||
MYSQL_RES *mysql_res;
|
||||
MYSQL_ROW row;
|
||||
unsigned long NumRows;
|
||||
|
||||
/***** Default value: empty name *****/
|
||||
CtyName[0] = '\0';
|
||||
|
||||
/***** Check if country code is correct *****/
|
||||
if (CtyCod <= 0)
|
||||
strcpy (CtyName,Txt_Another_country);
|
||||
else
|
||||
if (CtyCod > 0)
|
||||
{
|
||||
/***** Get name of the country from database *****/
|
||||
sprintf (Query,"SELECT Name_%s"
|
||||
" FROM countries"
|
||||
" WHERE CtyCod='%03ld'",
|
||||
sprintf (Query,"SELECT Name_%s FROM countries WHERE CtyCod='%03ld'",
|
||||
Txt_STR_LANG_ID[Gbl.Prefs.Language],CtyCod);
|
||||
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get the name of a country");
|
||||
|
||||
/***** Count number of rows in result *****/
|
||||
if (NumRows) // Country found...
|
||||
if (DB_QuerySELECT (Query,&mysql_res,"can not get the name of a country")) // Country found...
|
||||
{
|
||||
/* Get row */
|
||||
row = mysql_fetch_row (mysql_res);
|
||||
|
||||
/* Get the name of the country */
|
||||
strcpy (CtyName,row[0]);
|
||||
strncpy (CtyName,row[0],Cty_MAX_BYTES_COUNTRY_NAME);
|
||||
CtyName[Cty_MAX_BYTES_COUNTRY_NAME] = '\0';
|
||||
}
|
||||
|
||||
/***** Free structure that stores the query result *****/
|
||||
|
@ -1325,7 +1320,7 @@ static void Cty_ListCountriesForEdition (void)
|
|||
Par_PutHiddenParamUnsigned ("Lan",(unsigned) Lan);
|
||||
fprintf (Gbl.F.Out,"<input type=\"text\" name=\"Name\" size=\"15\" maxlength=\"%u\" value=\"%s\""
|
||||
" onchange=\"javascript:document.getElementById('%s').submit();\" />",
|
||||
Cty_MAX_LENGTH_COUNTRY_NAME,
|
||||
Cty_MAX_BYTES_COUNTRY_NAME,
|
||||
Cty->Name[Lan],Gbl.FormId);
|
||||
Act_FormEnd ();
|
||||
fprintf (Gbl.F.Out,"</td>");
|
||||
|
@ -1430,7 +1425,7 @@ void Cty_RenameCountry (void)
|
|||
extern const char *Txt_The_name_of_the_country_X_has_not_changed;
|
||||
char Query[512];
|
||||
struct Country *Cty;
|
||||
char NewCtyName[Cty_MAX_LENGTH_COUNTRY_NAME+1];
|
||||
char NewCtyName[Cty_MAX_BYTES_COUNTRY_NAME+1];
|
||||
Txt_Language_t Language;
|
||||
|
||||
Cty = &Gbl.Ctys.EditingCty;
|
||||
|
@ -1444,7 +1439,7 @@ void Cty_RenameCountry (void)
|
|||
Language = Pre_GetParamLanguage ();
|
||||
|
||||
/* Get the new name for the country */
|
||||
Par_GetParToText ("Name",NewCtyName,Cty_MAX_LENGTH_COUNTRY_NAME);
|
||||
Par_GetParToText ("Name",NewCtyName,Cty_MAX_BYTES_COUNTRY_NAME);
|
||||
|
||||
/***** Get from the database the data of the country *****/
|
||||
Cty_GetDataOfCountryByCod (Cty);
|
||||
|
@ -1562,7 +1557,7 @@ void Cty_ChangeCtyWWW (void)
|
|||
Language = Pre_GetParamLanguage ();
|
||||
|
||||
/* Get the new WWW for the country */
|
||||
Par_GetParToText ("WWW",NewWWW,Cty_MAX_LENGTH_COUNTRY_NAME);
|
||||
Par_GetParToText ("WWW",NewWWW,Cty_MAX_BYTES_COUNTRY_NAME);
|
||||
|
||||
/***** Get from the database the data of the country *****/
|
||||
Cty_GetDataOfCountryByCod (Cty);
|
||||
|
@ -1681,7 +1676,7 @@ static void Cty_PutFormToCreateCountry (void)
|
|||
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
|
||||
"<input type=\"text\" name=\"Name_%s\" size=\"15\" maxlength=\"%u\" value=\"%s\" />"
|
||||
"</td>",
|
||||
Txt_STR_LANG_ID[Lan],Cty_MAX_LENGTH_COUNTRY_NAME,Cty->Name[Lan]);
|
||||
Txt_STR_LANG_ID[Lan],Cty_MAX_BYTES_COUNTRY_NAME,Cty->Name[Lan]);
|
||||
|
||||
/* WWW */
|
||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
|
||||
|
@ -1809,7 +1804,7 @@ void Cty_RecFormNewCountry (void)
|
|||
Lan++)
|
||||
{
|
||||
sprintf (ParamName,"Name_%s",Txt_STR_LANG_ID[Lan]);
|
||||
Par_GetParToText (ParamName,Cty->Name[Lan],Cty_MAX_LENGTH_COUNTRY_NAME);
|
||||
Par_GetParToText (ParamName,Cty->Name[Lan],Cty_MAX_BYTES_COUNTRY_NAME);
|
||||
|
||||
if (Cty->Name[Lan][0]) // If there's a country name
|
||||
{
|
||||
|
@ -1855,10 +1850,10 @@ static void Cty_CreateCountry (struct Country *Cty)
|
|||
Txt_Language_t Lan;
|
||||
char StrField[32];
|
||||
char SubQueryNam1[Txt_NUM_LANGUAGES*32];
|
||||
char SubQueryNam2[Txt_NUM_LANGUAGES*Cty_MAX_LENGTH_COUNTRY_NAME];
|
||||
char SubQueryNam2[Txt_NUM_LANGUAGES*Cty_MAX_BYTES_COUNTRY_NAME];
|
||||
char SubQueryWWW1[Txt_NUM_LANGUAGES*32];
|
||||
char SubQueryWWW2[Txt_NUM_LANGUAGES*Cty_MAX_LENGTH_COUNTRY_WWW];
|
||||
char Query[1024+Txt_NUM_LANGUAGES*(32+Cty_MAX_LENGTH_COUNTRY_NAME+32+Cty_MAX_LENGTH_COUNTRY_WWW)];
|
||||
char Query[1024+Txt_NUM_LANGUAGES*(32+Cty_MAX_BYTES_COUNTRY_NAME+32+Cty_MAX_LENGTH_COUNTRY_WWW)];
|
||||
|
||||
/***** Create a new country *****/
|
||||
SubQueryNam1[0] = '\0';
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
/************************** Public types and constants ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Cty_MAX_LENGTH_COUNTRY_NAME 255
|
||||
#define Cty_MAX_BYTES_COUNTRY_NAME 255
|
||||
#define Cty_MAX_LENGTH_COUNTRY_WWW 255
|
||||
#define Cty_MAX_LENGTH_MAP_ATTRIBUTION (4*1024)
|
||||
|
||||
|
@ -45,7 +45,7 @@ struct Country
|
|||
{
|
||||
long CtyCod;
|
||||
char Alpha2[2+1];
|
||||
char Name[Txt_NUM_LANGUAGES][Cty_MAX_LENGTH_COUNTRY_NAME+1];
|
||||
char Name[Txt_NUM_LANGUAGES][Cty_MAX_BYTES_COUNTRY_NAME+1];
|
||||
char WWW[Txt_NUM_LANGUAGES][Cty_MAX_LENGTH_COUNTRY_WWW+1];
|
||||
unsigned NumUsrs;
|
||||
unsigned NumStds;
|
||||
|
@ -88,7 +88,7 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData);
|
|||
void Cty_FreeListCountries (void);
|
||||
void Cty_WriteSelectorOfCountry (void);
|
||||
bool Cty_GetDataOfCountryByCod (struct Country *Cty);
|
||||
void Cty_GetCountryName (long CtyCod,char *CtyName);
|
||||
void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1]);
|
||||
void Cty_PutParamCtyCod (long CtyCod);
|
||||
long Cty_GetParamOtherCtyCod (void);
|
||||
void Cty_RemoveCountry (void);
|
||||
|
|
|
@ -225,7 +225,7 @@ void Deg_SeeDegWithPendingCrss (void)
|
|||
" target=\"_blank\">",
|
||||
BgColor,Deg.WWW,Deg.FullName);
|
||||
Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShortName,
|
||||
16,"CENTER_TOP",true);
|
||||
16,"CENTER_MIDDLE",true);
|
||||
fprintf (Gbl.F.Out,"</a>"
|
||||
"</td>");
|
||||
|
||||
|
@ -1283,7 +1283,7 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg)
|
|||
BgColor,
|
||||
Deg->WWW,Deg->FullName);
|
||||
Log_DrawLogo (Sco_SCOPE_DEG,Deg->DegCod,Deg->ShortName,
|
||||
16,"CENTER_TOP",true);
|
||||
16,"CENTER_MIDDLE",true);
|
||||
fprintf (Gbl.F.Out,"</a>"
|
||||
"</td>");
|
||||
|
||||
|
@ -1504,7 +1504,7 @@ static void Deg_ListDegreesForEdition (void)
|
|||
fprintf (Gbl.F.Out,"</td>");
|
||||
|
||||
/* Degree first year */
|
||||
fprintf (Gbl.F.Out,"<td class=\"DAT CENTER_MIDDLE\"");
|
||||
fprintf (Gbl.F.Out,"<td class=\"DAT CENTER_MIDDLE\">");
|
||||
if (ICanEdit)
|
||||
{
|
||||
Act_FormStart (ActChgDegFstYea);
|
||||
|
|
|
@ -2058,7 +2058,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
|
|||
Rol_Role_t Role;
|
||||
Rol_Role_t DefaultRoleInCurrentCrs;
|
||||
bool ShowPhoto;
|
||||
char CtyName[Cty_MAX_LENGTH_COUNTRY_NAME+1];
|
||||
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1];
|
||||
unsigned NumCty;
|
||||
struct Institution Ins;
|
||||
struct Centre Ctr;
|
||||
|
|
Loading…
Reference in New Issue