From b21f9a936abb7a6a031a44ab2fd60a52b2523cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 4 Dec 2016 20:12:56 +0100 Subject: [PATCH] Version 16.86.4 --- swad_changelog.h | 3 ++- swad_global.h | 3 ++- swad_group.c | 10 ++++++++++ swad_group.h | 2 ++ swad_timetable.c | 43 +++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 57 insertions(+), 4 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 946f904a..2b001b10 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -183,13 +183,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.86.3 (2016-12-04)" +#define Log_PLATFORM_VERSION "SWAD 16.86.4 (2016-12-04)" #define CSS_FILE "swad16.82.2.css" #define JS_FILE "swad16.84.2.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.86.4: Dec 04, 2016 Contextual icons to change which groups to show. (209864 lines) Version 16.86.3: Dec 04, 2016 Changed icons related to hierarchy. (209815 lines) Version 16.86.2: Dec 04, 2016 Fixed bugs in my timetable. (209814 lines) Version 16.86.1: Dec 04, 2016 New action to show another user's agenda after log in. (209806 lines) diff --git a/swad_global.h b/swad_global.h index e875143c..4c13dc69 100644 --- a/swad_global.h +++ b/swad_global.h @@ -639,9 +639,10 @@ struct Globals long GrpCod; // Group code (-1 if no group selected) struct { - bool PutIconPrint; + bool PutIconWhichGroups; bool PutIconEditCrsTT; bool PutIconEditOfficeHours; + bool PutIconPrint; } ContextualIcons; } TimeTable; struct diff --git a/swad_group.c b/swad_group.c index 58bca87b..dc9aed18 100644 --- a/swad_group.c +++ b/swad_group.c @@ -4190,6 +4190,16 @@ void Grp_PutParamWhichGrps (void) Par_PutHiddenParamUnsigned ("WhichGrps",(unsigned) Gbl.CurrentCrs.Grps.WhichGrps); } +void Grp_PutParamWhichGrpsOnlyMyGrps (void) + { + Par_PutHiddenParamUnsigned ("WhichGrps",(unsigned) Grp_ONLY_MY_GROUPS); + } + +void Grp_PutParamWhichGrpsAllGrps (void) + { + Par_PutHiddenParamUnsigned ("WhichGrps",(unsigned) Grp_ALL_GROUPS); + } + /*****************************************************************************/ /********** Show selector to choice whether to show only my groups ***********/ /********** or all groups in timetable ***********/ diff --git a/swad_group.h b/swad_group.h index a8e44d3e..70e5dc06 100644 --- a/swad_group.h +++ b/swad_group.h @@ -180,6 +180,8 @@ void Grp_FreeListCodGrp (struct ListCodGrps *LstGrps); void Grp_PutParamAllGroups (void); void Grp_PutParamWhichGrps (void); +void Grp_PutParamWhichGrpsOnlyMyGrps (void); +void Grp_PutParamWhichGrpsAllGrps (void); void Grp_ShowSelectorWhichGrps (void); void Grp_GetParamWhichGrps (void); diff --git a/swad_timetable.c b/swad_timetable.c index b7b4bc43..5f6e9512 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -256,20 +256,25 @@ void TT_ShowClassTimeTable (void) default: Lay_ShowErrorAndExit ("Wrong action."); } - Gbl.TimeTable.ContextualIcons.PutIconPrint = !PrintView; + + Gbl.TimeTable.ContextualIcons.PutIconWhichGroups = Gbl.TimeTable.Type == TT_MY_TIMETABLE || + (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE && + Gbl.CurrentCrs.Grps.NumGrps); Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT = (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE && !PrintView && Gbl.Usrs.Me.LoggedRole >= Rol_TEACHER); Gbl.TimeTable.ContextualIcons.PutIconEditOfficeHours = (Gbl.TimeTable.Type == TT_MY_TIMETABLE && !PrintView && (Gbl.Usrs.Me.AvailableRoles & (1 << Rol_TEACHER))); + Gbl.TimeTable.ContextualIcons.PutIconPrint = !PrintView; /***** Get whether to show only my groups or all groups *****/ Grp_GetParamWhichGrps (); /***** Start frame *****/ Lay_StartRoundFrame ("100%",Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type], - (Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT || + (Gbl.TimeTable.ContextualIcons.PutIconWhichGroups || + Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT || Gbl.TimeTable.ContextualIcons.PutIconEditOfficeHours || Gbl.TimeTable.ContextualIcons.PutIconPrint) ? TT_PutContextualIcons : NULL, @@ -310,9 +315,43 @@ void TT_ShowClassTimeTable (void) static void TT_PutContextualIcons (void) { + extern const char *Txt_Show_WHICH_groups[2]; extern const char *Txt_Edit; extern const char *Txt_Edit_office_hours; extern const char *Txt_Print; + Act_Action_t Action; + + if (Gbl.TimeTable.ContextualIcons.PutIconWhichGroups) + { + switch (Gbl.TimeTable.Type) + { + case TT_COURSE_TIMETABLE: + Action = ActSeeCrsTT; + break; + case TT_MY_TIMETABLE: + Action = ActSeeMyTT; + break; + default: // Not used + Action = ActUnk; + break; + } + if (Action != ActUnk) // Always true + switch (Gbl.CurrentCrs.Grps.WhichGrps) + { + case Grp_ONLY_MY_GROUPS: + Lay_PutContextualLink (Action,Grp_PutParamWhichGrpsAllGrps, + "hierarchy64x64.png", + Txt_Show_WHICH_groups[Grp_ALL_GROUPS],NULL, + NULL); + break; + case Grp_ALL_GROUPS: + Lay_PutContextualLink (Action,Grp_PutParamWhichGrpsOnlyMyGrps, + "myhierarchy64x64.png", + Txt_Show_WHICH_groups[Grp_ONLY_MY_GROUPS],NULL, + NULL); + break; + } + } if (Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT) Lay_PutContextualLink (ActEdiCrsTT,Grp_PutParamWhichGrps,