diff --git a/swad_changelog.h b/swad_changelog.h index 461758b5..7a0463a3 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -94,7 +94,6 @@ ----------Otros ....Etc..... */ -// TODO: Link to user's country in public profile // TODO: Show guests in connected users. // TODO: A teacher should may confirm a student ID? In what conditions? (Necessary in order to a student can view his/her marks) // TODO: Put headers Content-type and Content-disposition when redirecting with Location: @@ -112,14 +111,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.60.1 (2015/12/07)" +#define Log_PLATFORM_VERSION "SWAD 15.60.2 (2015/12/08)" #define CSS_FILE "swad15.59.4.css" // 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.60.2: Dec 08, 2015 Link to user's country in public profile. (186592 lines) Version 15.60.1: Dec 07, 2015 Fixed names of some small icons. - New link in student's record card to see her/his attendance. (? lines) + New link in student's record card to see her/his attendance. (186576 lines) Version 15.60: Dec 07, 2015 By default, the language of a new user is unknown. Fixed bugs when registering a new user. (? lines) Version 15.59.4: Dec 06, 2015 Changes in some small icons. (186462 lines) diff --git a/swad_connected.c b/swad_connected.c index 0e3af813..69a585e5 100644 --- a/swad_connected.c +++ b/swad_connected.c @@ -271,15 +271,15 @@ void Con_GetAndShowLastClicks (void) if (sscanf (row[2],"%ld",&TimeDiff) != 1) TimeDiff = (time_t) 0; - /* Get degree code (row[4]) */ + /* Get country code (row[4]) */ Cty.CtyCod = Str_ConvertStrCodToLongCod (row[4]); Cty_GetCountryName (Cty.CtyCod,Cty.Name[Gbl.Prefs.Language]); - /* Get degree code (row[5]) */ + /* Get institution code (row[5]) */ Ins.InsCod = Str_ConvertStrCodToLongCod (row[5]); Ins_GetShortNameOfInstitutionByCod (&Ins); - /* Get degree code (row[6]) */ + /* Get centre code (row[6]) */ Ctr.CtrCod = Str_ConvertStrCodToLongCod (row[6]); Ctr_GetShortNameOfCentreByCod (&Ctr); diff --git a/swad_country.c b/swad_country.c index b7e1c989..866fce41 100644 --- a/swad_country.c +++ b/swad_country.c @@ -46,6 +46,7 @@ /*****************************************************************************/ extern struct Globals Gbl; +extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; /*****************************************************************************/ /***************************** Private constants *****************************/ @@ -1023,6 +1024,27 @@ void Cty_WriteSelectorOfCountry (void) /**************************** Get country full name **************************/ /*****************************************************************************/ +void Cty_WriteCountryName (long CtyCod,const char *Class) + { + char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1]; + char ActTxt[Act_MAX_LENGTH_ACTION_TXT+1]; + + /***** Get country name *****/ + Cty_GetCountryName (CtyCod,CtyName); + + /***** Link to country information *****/ + Act_FormStart (ActSeeCtyInf); + Cty_PutParamCtyCod (CtyCod); + Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtyInf].ActCod,ActTxt), + Class); + fprintf (Gbl.F.Out,"%s",CtyName); + Act_FormEnd (); + } + +/*****************************************************************************/ +/**************************** Get country full name **************************/ +/*****************************************************************************/ + bool Cty_GetDataOfCountryByCod (struct Country *Cty) { extern const char *Txt_Another_country; diff --git a/swad_country.h b/swad_country.h index c0ee2101..46d32390 100644 --- a/swad_country.h +++ b/swad_country.h @@ -91,6 +91,7 @@ void Cty_EditCountries (void); void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData); void Cty_FreeListCountries (void); void Cty_WriteSelectorOfCountry (void); +void Cty_WriteCountryName (long CtyCod,const char *Class); bool Cty_GetDataOfCountryByCod (struct Country *Cty); void Cty_GetCountryName (long CtyCod,char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1]); void Cty_PutParamCtyCod (long CtyCod); diff --git a/swad_record.c b/swad_record.c index a3c42e89..aa42dfb6 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2065,7 +2065,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, Rol_Role_t Role; Rol_Role_t DefaultRoleInCurrentCrs; bool ShowPhoto; - char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1]; unsigned NumCty; struct Institution Ins; struct Centre Ctr; @@ -2444,10 +2443,8 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, "", ClassData,TopC2Width); if (ShowData && UsrDat->CtyCod > 0) - { - Cty_GetCountryName (UsrDat->CtyCod,CtyName); - fprintf (Gbl.F.Out,"%s",CtyName); - } + /* Link to see country information */ + Cty_WriteCountryName (UsrDat->CtyCod,ClassData); fprintf (Gbl.F.Out,""); /***** User's web and social networks *****/