diff --git a/swad_changelog.h b/swad_changelog.h
index 491c131ee..95edbf95e 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -156,13 +156,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.47.5 (2016-11-06)"
+#define Log_PLATFORM_VERSION "SWAD 16.47.6 (2016-11-06)"
#define CSS_FILE "swad16.32.1.css"
#define JS_FILE "swad16.46.1.js"
// 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 16.47.6: Nov 06, 2016 Code refactoring in countries. (206171 lines)
Version 16.47.5: Nov 06, 2016 Code refactoring in countries. (206162 lines)
Version 16.47.4: Nov 06, 2016 Code refactoring in notices. (206153 lines)
Version 16.47.3: Nov 06, 2016 Icon in list of institutions to show figure (statistics). (206155 lines)
diff --git a/swad_country.c b/swad_country.c
index cb8be26a1..1e0f9a3d9 100644
--- a/swad_country.c
+++ b/swad_country.c
@@ -66,7 +66,7 @@ extern struct Globals Gbl;
static void Cty_Configuration (bool PrintView);
static void Cty_PutIconToPrint (void);
-static bool Cty_CheckIfICanEditNotices (void);
+static bool Cty_CheckIfICanEditCountries (void);
static void Cty_PutIconsCountries (void);
static void Cty_PutIconToEditCountries (void);
@@ -259,7 +259,7 @@ static void Cty_Configuration (bool PrintView)
fprintf (Gbl.F.Out,"");
/* Map attribution */
- if (!PrintView && Cty_CheckIfICanEditNotices ())
+ if (!PrintView && Cty_CheckIfICanEditCountries ())
{
fprintf (Gbl.F.Out,"
");
Act_FormStart (ActChgCtyMapAtt);
@@ -694,7 +694,7 @@ void Cty_ListCountries2 (void)
/********************** Check if I can edit countries ************************/
/*****************************************************************************/
-static bool Cty_CheckIfICanEditNotices (void)
+static bool Cty_CheckIfICanEditCountries (void)
{
return (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
}
@@ -706,7 +706,7 @@ static bool Cty_CheckIfICanEditNotices (void)
static void Cty_PutIconsCountries (void)
{
/***** Put icon to edit countries *****/
- if (Cty_CheckIfICanEditNotices ())
+ if (Cty_CheckIfICanEditCountries ())
Cty_PutIconToEditCountries ();
/***** Put icon to show a figure *****/
diff --git a/swad_institution.c b/swad_institution.c
index 429b6fc08..0aea34b76 100644
--- a/swad_institution.c
+++ b/swad_institution.c
@@ -67,6 +67,7 @@ static void Ins_Configuration (bool PrintView);
static void Ins_PutIconsToPrintAndUpload (void);
static void Ins_ListInstitutions (void);
+static bool Ins_CheckIfICanEditInstitutions (void);
static void Ins_PutIconsInstitutions (void);
static void Ins_PutIconToEditInstitutions (void);
static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns);
@@ -682,7 +683,7 @@ static void Ins_ListInstitutions (void)
Lay_ShowAlert (Lay_INFO,Txt_No_institutions);
/***** Button to create institution *****/
- if (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_)
+ if (Ins_CheckIfICanEditInstitutions ())
{
Act_FormStart (ActEdiIns);
Lay_PutConfirmButton (Gbl.Inss.Num ? Txt_Create_another_institution :
@@ -693,6 +694,15 @@ static void Ins_ListInstitutions (void)
Lay_EndRoundFrame ();
}
+/*****************************************************************************/
+/******************** Check if I can edit institutions ***********************/
+/*****************************************************************************/
+
+static bool Ins_CheckIfICanEditInstitutions (void)
+ {
+ return (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_);
+ }
+
/*****************************************************************************/
/*************** Put contextual icons in list of institutions ****************/
/*****************************************************************************/
@@ -700,7 +710,7 @@ static void Ins_ListInstitutions (void)
static void Ins_PutIconsInstitutions (void)
{
/***** Put icon to edit countries *****/
- if (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_)
+ if (Ins_CheckIfICanEditInstitutions ())
Ins_PutIconToEditInstitutions ();
/***** Put icon to show a figure *****/