mirror of https://github.com/acanas/swad-core.git
Version 16.143.5
This commit is contained in:
parent
f6ff5d5c37
commit
936d259e14
|
@ -198,13 +198,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.144.4 (2017-03-01)"
|
#define Log_PLATFORM_VERSION "SWAD 16.144.5 (2017-03-02)"
|
||||||
#define CSS_FILE "swad16.144.css"
|
#define CSS_FILE "swad16.144.css"
|
||||||
#define JS_FILE "swad16.144.js"
|
#define JS_FILE "swad16.144.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 16.144.5: Mar 02, 2017 Label with the user's institution under her/his enlarged photo. (213442 lines)
|
||||||
Version 16.144.4: Mar 01, 2017 Fixed bug in link to another user's QR code from record card. (213338 lines)
|
Version 16.144.4: Mar 01, 2017 Fixed bug in link to another user's QR code from record card. (213338 lines)
|
||||||
Version 16.144.3: Mar 01, 2017 Button to create a new place when no places have been created. (213334 lines)
|
Version 16.144.3: Mar 01, 2017 Button to create a new place when no places have been created. (213334 lines)
|
||||||
Version 16.144.2: Mar 01, 2017 Button to create a new group when no groups have been created. (213300 lines)
|
Version 16.144.2: Mar 01, 2017 Button to create a new group when no groups have been created. (213300 lines)
|
||||||
|
|
|
@ -1198,7 +1198,7 @@ void Cty_WriteSelectorOfCountry (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************************** Get country full name **************************/
|
/***************************** Write country name ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// If ClassLink == NULL ==> do not put link
|
// If ClassLink == NULL ==> do not put link
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,10 @@ static void Ins_PutIconToEditInstitutions (void);
|
||||||
static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns);
|
static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns);
|
||||||
static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable);
|
static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable);
|
||||||
static void Ins_GetParamInsOrder (void);
|
static void Ins_GetParamInsOrder (void);
|
||||||
|
|
||||||
|
static void Ins_GetFullNameAndCtyOfInstitutionByCod (struct Instit *Ins,
|
||||||
|
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME + 1]);
|
||||||
|
|
||||||
static void Ins_ListInstitutionsForEdition (void);
|
static void Ins_ListInstitutionsForEdition (void);
|
||||||
static bool Ins_CheckIfICanEdit (struct Instit *Ins);
|
static bool Ins_CheckIfICanEdit (struct Instit *Ins);
|
||||||
static Ins_StatusTxt_t Ins_GetStatusTxtFromStatusBits (Ins_Status_t Status);
|
static Ins_StatusTxt_t Ins_GetStatusTxtFromStatusBits (Ins_Status_t Status);
|
||||||
|
@ -1074,6 +1078,24 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData)
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************** Write institution full name and country *******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
// If ClassLink == NULL ==> do not put link
|
||||||
|
|
||||||
|
void Ins_WriteInstitutionNameAndCty (long InsCod)
|
||||||
|
{
|
||||||
|
struct Instit Ins;
|
||||||
|
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME + 1];
|
||||||
|
|
||||||
|
/***** Get institution full name *****/
|
||||||
|
Ins.InsCod = InsCod;
|
||||||
|
Ins_GetFullNameAndCtyOfInstitutionByCod (&Ins,CtyName);
|
||||||
|
|
||||||
|
/***** Write institution full name *****/
|
||||||
|
fprintf (Gbl.F.Out,"%s<br />%s",Ins.FullName,CtyName);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Get data of an institution ************************/
|
/************************* Get data of an institution ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1169,24 +1191,111 @@ void Ins_GetShortNameOfInstitutionByCod (struct Instit *Ins)
|
||||||
char Query[128];
|
char Query[128];
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
static struct
|
||||||
Ins->ShrtName[0] = '\0';
|
|
||||||
if (Ins->InsCod > 0)
|
|
||||||
{
|
{
|
||||||
/***** Get the short name of an institution from database *****/
|
long InsCod;
|
||||||
sprintf (Query,"SELECT ShortName FROM institutions WHERE InsCod ='%ld'",
|
char ShrtName[Ins_MAX_LENGTH_INSTIT_SHRT_NAME + 1];
|
||||||
Ins->InsCod);
|
} Cached =
|
||||||
if (DB_QuerySELECT (Query,&mysql_res,"can not get the short name of an institution") == 1)
|
{
|
||||||
{
|
-1L,
|
||||||
/***** Get the short name of this institution *****/
|
{'\0'}
|
||||||
row = mysql_fetch_row (mysql_res);
|
};
|
||||||
|
|
||||||
Str_Copy (Ins->ShrtName,row[0],
|
if (Ins->InsCod <= 0)
|
||||||
Ins_MAX_LENGTH_INSTIT_SHRT_NAME);
|
Ins->ShrtName[0] = '\0'; // Empty name
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Ins->InsCod != Cached.InsCod) // If not cached...
|
||||||
|
{
|
||||||
|
/***** Get the short name of an institution from database *****/
|
||||||
|
sprintf (Query,"SELECT ShortName FROM institutions"
|
||||||
|
" WHERE InsCod ='%ld'",
|
||||||
|
Ins->InsCod);
|
||||||
|
if (DB_QuerySELECT (Query,&mysql_res,"can not get the short name of an institution") == 1)
|
||||||
|
{
|
||||||
|
/***** Get the short name of this institution *****/
|
||||||
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
|
Str_Copy (Cached.ShrtName,row[0],
|
||||||
|
Ins_MAX_LENGTH_INSTIT_SHRT_NAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Cached.ShrtName[0] = '\0';
|
||||||
|
|
||||||
|
/***** Free structure that stores the query result *****/
|
||||||
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
Str_Copy (Ins->ShrtName,Cached.ShrtName,
|
||||||
DB_FreeMySQLResult (&mysql_res);
|
Ins_MAX_LENGTH_INSTIT_SHRT_NAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************ Get the full name of an institution from its code **************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Ins_GetFullNameAndCtyOfInstitutionByCod (struct Instit *Ins,
|
||||||
|
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME + 1])
|
||||||
|
{
|
||||||
|
extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES];
|
||||||
|
char Query[256];
|
||||||
|
MYSQL_RES *mysql_res;
|
||||||
|
MYSQL_ROW row;
|
||||||
|
static struct
|
||||||
|
{
|
||||||
|
long InsCod;
|
||||||
|
char FullName[Ins_MAX_LENGTH_INSTIT_FULL_NAME + 1];
|
||||||
|
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME + 1];
|
||||||
|
} Cached =
|
||||||
|
{
|
||||||
|
-1L,
|
||||||
|
{'\0'},
|
||||||
|
{'\0'},
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Ins->InsCod <= 0)
|
||||||
|
{
|
||||||
|
Ins->FullName[0] = '\0'; // Empty name
|
||||||
|
CtyName[0] = '\0'; // Empty name
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Ins->InsCod != Cached.InsCod) // If not cached...
|
||||||
|
{
|
||||||
|
/***** Get the short name of an institution from database *****/
|
||||||
|
sprintf (Query,"SELECT institutions.FullName,countries.Name_%s"
|
||||||
|
" FROM institutions,countries"
|
||||||
|
" WHERE institutions.InsCod ='%ld'"
|
||||||
|
" AND institutions.CtyCod=countries.CtyCod",
|
||||||
|
Txt_STR_LANG_ID[Gbl.Prefs.Language],Ins->InsCod);
|
||||||
|
if (DB_QuerySELECT (Query,&mysql_res,"can not get the full name of an institution") == 1)
|
||||||
|
{
|
||||||
|
/* Get row */
|
||||||
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
|
/* Get the full name of this institution (row[0]) */
|
||||||
|
Str_Copy (Cached.FullName,row[0],
|
||||||
|
Ins_MAX_LENGTH_INSTIT_FULL_NAME);
|
||||||
|
|
||||||
|
/* Get the name of the country (row[1]) */
|
||||||
|
Str_Copy (Cached.CtyName,row[1],
|
||||||
|
Cty_MAX_BYTES_COUNTRY_NAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Cached.FullName[0] = '\0';
|
||||||
|
Cached.CtyName[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Free structure that stores the query result *****/
|
||||||
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
}
|
||||||
|
|
||||||
|
Str_Copy (Ins->FullName,Cached.FullName,
|
||||||
|
Ins_MAX_LENGTH_INSTIT_FULL_NAME);
|
||||||
|
Str_Copy (CtyName,Cached.CtyName,
|
||||||
|
Cty_MAX_BYTES_COUNTRY_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,9 +105,12 @@ void Ins_PrintConfiguration (void);
|
||||||
void Ins_ShowInssOfCurrentCty (void);
|
void Ins_ShowInssOfCurrentCty (void);
|
||||||
void Ins_EditInstitutions (void);
|
void Ins_EditInstitutions (void);
|
||||||
void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData);
|
void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData);
|
||||||
|
|
||||||
|
void Ins_WriteInstitutionNameAndCty (long InsCod);
|
||||||
bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins,
|
bool Ins_GetDataOfInstitutionByCod (struct Instit *Ins,
|
||||||
Ins_GetExtraData_t GetExtraData);
|
Ins_GetExtraData_t GetExtraData);
|
||||||
void Ins_GetShortNameOfInstitutionByCod (struct Instit *Ins);
|
void Ins_GetShortNameOfInstitutionByCod (struct Instit *Ins);
|
||||||
|
|
||||||
void Ins_FreeListInstitutions (void);
|
void Ins_FreeListInstitutions (void);
|
||||||
void Ins_WriteSelectorOfInstitution (void);
|
void Ins_WriteSelectorOfInstitution (void);
|
||||||
void Ins_PutParamInsCod (long InsCod);
|
void Ins_PutParamInsCod (long InsCod);
|
||||||
|
|
11
swad_photo.c
11
swad_photo.c
|
@ -1155,8 +1155,15 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
|
||||||
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
|
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
|
||||||
/* Country */
|
/* Institution full name and institution country */
|
||||||
if (UsrDat->CtyCod > 0)
|
if (UsrDat->InsCod > 0)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<div class=\"ZOOM_TXT_LINE DAT_SMALL\">");
|
||||||
|
Ins_WriteInstitutionNameAndCty (UsrDat->InsCod);
|
||||||
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
}
|
||||||
|
/* User's country */
|
||||||
|
else if (UsrDat->CtyCod > 0)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<div class=\"ZOOM_TXT_LINE DAT_SMALL\">");
|
fprintf (Gbl.F.Out,"<div class=\"ZOOM_TXT_LINE DAT_SMALL\">");
|
||||||
Cty_WriteCountryName (UsrDat->CtyCod,
|
Cty_WriteCountryName (UsrDat->CtyCod,
|
||||||
|
|
Loading…
Reference in New Issue