diff --git a/swad_changelog.h b/swad_changelog.h index 041a4ad40..8db25de0c 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -471,10 +471,11 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.19 (2019-09-29)" +#define Log_PLATFORM_VERSION "SWAD 19.19.2 (2019-09-29)" #define CSS_FILE "swad19.15.css" #define JS_FILE "swad19.15.js" /* + Version 19.19.2: Sep 29, 2019 Students will not see icons to remove matches. (246619 lines) Version 19.19.1: Sep 29, 2019 Students will not see matches for groups to which they don't belong. (246601 lines) Version 19.19: Sep 29, 2019 Selections of my groups/all groups in listing of matches. Removed column with number of match. (246596 lines) diff --git a/swad_game.c b/swad_game.c index 840a36e91..eba3e328d 100644 --- a/swad_game.c +++ b/swad_game.c @@ -274,7 +274,7 @@ static void Gam_ListAllGames (void) } /*****************************************************************************/ -/******************* Check if I can create a new game **********************/ +/************************ Check if I can edit games **************************/ /*****************************************************************************/ static bool Gam_CheckIfICanEditGames (void) @@ -282,9 +282,6 @@ static bool Gam_CheckIfICanEditGames (void) switch (Gbl.Usrs.Me.Role.Logged) { case Rol_TCH: - case Rol_DEG_ADM: - case Rol_CTR_ADM: - case Rol_INS_ADM: case Rol_SYS_ADM: return true; default: diff --git a/swad_match.c b/swad_match.c index fb4426a59..5c19d7a58 100644 --- a/swad_match.c +++ b/swad_match.c @@ -116,6 +116,7 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game, unsigned NumMatches, MYSQL_RES *mysql_res); static void Mch_ListOneOrMoreMatchesHeading (void); +static bool Mch_CheckIfICanEditMatches (void); static void Mch_ListOneOrMoreMatchesIcons (const struct Match *Match); static void Mch_ListOneOrMoreMatchesAuthor (const struct Match *Match); static void Mch_ListOneOrMoreMatchesTimes (const struct Match *Match,unsigned UniqueId); @@ -398,7 +399,8 @@ static void Mch_ListOneOrMoreMatches (struct Game *Game, fprintf (Gbl.F.Out,""); /* Icons */ - Mch_ListOneOrMoreMatchesIcons (&Match); + if (Mch_CheckIfICanEditMatches ()) + Mch_ListOneOrMoreMatchesIcons (&Match); /* Match player */ Mch_ListOneOrMoreMatchesAuthor (&Match); @@ -438,9 +440,15 @@ static void Mch_ListOneOrMoreMatchesHeading (void) extern const char *Txt_Status; extern const char *Txt_Result; - fprintf (Gbl.F.Out,"" - "" - "" + /***** Start row *****/ + fprintf (Gbl.F.Out,""); + + /***** Column for icons *****/ + if (Mch_CheckIfICanEditMatches ()) + fprintf (Gbl.F.Out,""); + + /***** The rest of columns *****/ + fprintf (Gbl.F.Out,"" "%s" "" "" @@ -460,8 +468,7 @@ static void Mch_ListOneOrMoreMatchesHeading (void) "" "" "%s" - "" - "", + "", Txt_ROLES_SINGUL_Abc[Rol_TCH][Usr_SEX_UNKNOWN], Txt_START_END_TIME[Gam_ORDER_BY_START_DATE], Txt_START_END_TIME[Gam_ORDER_BY_END_DATE], @@ -469,6 +476,27 @@ static void Mch_ListOneOrMoreMatchesHeading (void) Txt_Players, Txt_Status, Txt_Result); + + /***** End row *****/ + fprintf (Gbl.F.Out,""); + } + +/*****************************************************************************/ +/************************ Check if I can edit games **************************/ +/*****************************************************************************/ + +static bool Mch_CheckIfICanEditMatches (void) + { + switch (Gbl.Usrs.Me.Role.Logged) + { + case Rol_NET: + case Rol_TCH: + case Rol_SYS_ADM: + return true; + default: + return false; + } + return false; } /*****************************************************************************/ @@ -661,9 +689,6 @@ static void Mch_ListOneOrMoreMatchesStatus (const struct Match *Match,unsigned N break; case Rol_NET: case Rol_TCH: - case Rol_DEG_ADM: - case Rol_CTR_ADM: - case Rol_INS_ADM: case Rol_SYS_ADM: /* Icon to resume */ Mch_CurrentMchCod = Match->MchCod;