From 5788439dfc67e9620f013a379c8ad4655cf9c521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 19 Nov 2015 18:33:16 +0100 Subject: [PATCH] Version 15.40.3 --- swad_changelog.h | 3 ++- swad_country.c | 10 ++++----- swad_country.h | 4 ++-- swad_institution.c | 53 +++++++++++++++++++++++++++++----------------- swad_institution.h | 3 +++ swad_statistic.c | 18 +++++----------- 6 files changed, 50 insertions(+), 41 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 220c0bae..2a8e5772 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -111,11 +111,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.40.2 (2015/11/19)" +#define Log_PLATFORM_VERSION "SWAD 15.40.3 (2015/11/19)" // 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.40.3: Nov 19, 2015 Code refactoring in institutions. (187281 lines) Version 15.40.2: Nov 19, 2015 Some links to countries, institutions, centres and degrees removed. (187281 lines) Version 15.40.1: Nov 19, 2015 Changes in behaviour of links to countries, institutions, centres and degrees. (187288 lines) Version 15.40: Nov 17, 2015 Changes in statistics of number of users. diff --git a/swad_country.c b/swad_country.c index 19054ee7..ce55bf82 100644 --- a/swad_country.c +++ b/swad_country.c @@ -149,7 +149,7 @@ void Cty_SeeCtyWithPendingInss (void) fprintf (Gbl.F.Out,"" "", BgColor); - Cty_DrawCountryMapWithLinkToSeeCtyInf (&Cty,ActSeeIns, + Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeIns, "DAT_NOBR","COUNTRY_MAP_SMALL"); fprintf (Gbl.F.Out,""); @@ -516,7 +516,7 @@ void Cty_ListCountries2 (void) fprintf (Gbl.F.Out,"" "", BgColor); - Cty_DrawCountryMapWithLinkToSeeCtyInf (&Gbl.Ctys.Lst[NumCty],ActSeeIns, + Cty_DrawCountryMapAndNameWithLink (&Gbl.Ctys.Lst[NumCty],ActSeeIns, "DAT_NOBR_N","COUNTRY_MAP_SMALL"); fprintf (Gbl.F.Out,""); @@ -636,11 +636,11 @@ static unsigned Cty_GetNumUsrsWhoClaimToBelongToCty (long CtyCod) } /*****************************************************************************/ -/*********************** Check if country map exists *************************/ +/********************* Draw country map and name with link *******************/ /*****************************************************************************/ -void Cty_DrawCountryMapWithLinkToSeeCtyInf (struct Country *Cty,Act_Action_t Action, - const char *ClassLink,const char *ClassMap) +void Cty_DrawCountryMapAndNameWithLink (struct Country *Cty,Act_Action_t Action, + const char *ClassLink,const char *ClassMap) { extern const char *Txt_Go_to_X; diff --git a/swad_country.h b/swad_country.h index da446130..db8933f3 100644 --- a/swad_country.h +++ b/swad_country.h @@ -80,8 +80,8 @@ void Cty_ListCountries (void); void Cty_ListCountries1 (void); void Cty_ListCountries2 (void); -void Cty_DrawCountryMapWithLinkToSeeCtyInf (struct Country *Cty,Act_Action_t Action, - const char *ClassLink,const char *ClassMap); +void Cty_DrawCountryMapAndNameWithLink (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); diff --git a/swad_institution.c b/swad_institution.c index 8016cf47..7c8b2660 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -92,7 +92,6 @@ void Ins_SeeInsWithPendingCtrs (void) extern const char *Txt_Institutions_with_pending_centres; extern const char *Txt_Institution; extern const char *Txt_Centres_ABBREVIATION; - extern const char *Txt_Go_to_X; extern const char *Txt_There_are_no_institutions_with_requests_for_centres_to_be_confirmed; char Query[1024]; MYSQL_RES *mysql_res; @@ -162,15 +161,8 @@ void Ins_SeeInsWithPendingCtrs (void) fprintf (Gbl.F.Out,"" "", BgColor); - Act_FormGoToStart (ActSeeCtr); - Ins_PutParamInsCod (Ins.InsCod); - sprintf (Gbl.Title,Txt_Go_to_X,Ins.FullName); - Act_LinkFormSubmit (Gbl.Title,"DAT_NOBR"); - Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName, - 16,"CENTER_MIDDLE",true); - fprintf (Gbl.F.Out," %s", - Ins.FullName); - Act_FormEnd (); + Ins_DrawInstitutionLogoAndNameWithLink (&Ins,ActSeeCtr, + "DAT_NOBR","CENTER_MIDDLE"); fprintf (Gbl.F.Out,""); /* Number of pending centres (row[1]) */ @@ -192,6 +184,35 @@ void Ins_SeeInsWithPendingCtrs (void) DB_FreeMySQLResult (&mysql_res); } + +/*****************************************************************************/ +/****************** Draw institution logo and name with link *****************/ +/*****************************************************************************/ + +void Ins_DrawInstitutionLogoAndNameWithLink (struct Institution *Ins,Act_Action_t Action, + const char *ClassLink,const char *ClassLogo) + { + extern const char *Txt_Go_to_X; + + /***** Start form *****/ + Act_FormGoToStart (Action); + Ins_PutParamInsCod (Ins->InsCod); + + /***** Link to action *****/ + sprintf (Gbl.Title,Txt_Go_to_X,Ins->FullName); + Act_LinkFormSubmit (Gbl.Title,ClassLink); + + /***** Draw institution logo *****/ + Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->ShortName, + 16,ClassLogo,true); + + /***** End link *****/ + fprintf (Gbl.F.Out," %s",Ins->FullName); + + /***** End form *****/ + Act_FormEnd (); + } + /*****************************************************************************/ /*************** Show information of the current institution *****************/ /*****************************************************************************/ @@ -523,7 +544,6 @@ static void Ins_ListInstitutionsForSeeing (void) static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned NumIns) { - extern const char *Txt_Go_to_X; extern const char *Txt_INSTITUTION_STATUS[Ins_NUM_STATUS_TXT]; const char *TxtClassNormal; const char *TxtClassStrong; @@ -554,15 +574,8 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu /***** Institution logo and name *****/ fprintf (Gbl.F.Out,"", TxtClassStrong,BgColor); - Act_FormGoToStart (ActSeeCtr); - Ins_PutParamInsCod (Ins->InsCod); - sprintf (Gbl.Title,Txt_Go_to_X,Ins->FullName); - Act_LinkFormSubmit (Gbl.Title,TxtClassStrong); - Log_DrawLogo (Sco_SCOPE_INS,Ins->InsCod,Ins->ShortName, - 16,NULL,true); - fprintf (Gbl.F.Out," %s", - Ins->FullName); - Act_FormEnd (); + Ins_DrawInstitutionLogoAndNameWithLink (Ins,ActSeeCtr, + "DAT_NOBR","CENTER_MIDDLE"); fprintf (Gbl.F.Out,""); /***** Stats *****/ diff --git a/swad_institution.h b/swad_institution.h index 09d6dcb1..70432ec4 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -92,6 +92,9 @@ typedef enum void Ins_SeeInsWithPendingCtrs (void); +void Ins_DrawInstitutionLogoAndNameWithLink (struct Institution *Ins,Act_Action_t Action, + const char *ClassLink,const char *ClassLogo); + void Ins_ShowConfiguration (void); void Ins_PrintConfiguration (void); diff --git a/swad_statistic.c b/swad_statistic.c index d50e8e1d..b51bc4e0 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -3232,7 +3232,7 @@ static void Sta_ShowNumHitsPerCountry (unsigned long NumRows, "" "%s" "" - "" + "" "%s" "" "" @@ -3291,7 +3291,7 @@ static void Sta_WriteCountry (long CtyCod) Cty_GetDataOfCountryByCod (&Cty); /***** Form to go to country *****/ - Cty_DrawCountryMapWithLinkToSeeCtyInf (&Cty,ActSeeCtyInf, + Cty_DrawCountryMapAndNameWithLink (&Cty,ActSeeCtyInf, "LOG","COUNTRY_MAP_TINY"); } else // Hit with no country selected @@ -3323,7 +3323,7 @@ static void Sta_ShowNumHitsPerInstitution (unsigned long NumRows, "" "%s" "" - "" + "" "%s" "" "" @@ -3370,7 +3370,6 @@ static void Sta_ShowNumHitsPerInstitution (unsigned long NumRows, static void Sta_WriteInstitution (long InsCod) { - extern const char *Txt_Go_to_X; struct Institution Ins; /***** Start cell *****/ @@ -3387,15 +3386,8 @@ static void Sta_WriteInstitution (long InsCod) Ins.FullName); /***** Form to go to institution *****/ - Act_FormGoToStart (ActSeeInsInf); - Ins_PutParamInsCod (InsCod); - sprintf (Gbl.Title,Txt_Go_to_X,Ins.ShortName); - Act_LinkFormSubmit (Gbl.Title,"LOG"); - Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName, - 16,"CENTER_TOP",true); - fprintf (Gbl.F.Out," %s ", - Ins.ShortName); - Act_FormEnd (); + Ins_DrawInstitutionLogoAndNameWithLink (&Ins,ActSeeInsInf, + "LOG","CENTER_TOP"); } else // Hit with no institution selected /***** No institution selected *****/