diff --git a/swad_changelog.h b/swad_changelog.h index 73e8013e..639ed9a8 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -178,13 +178,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.71.5 (2016-11-26)" +#define Log_PLATFORM_VERSION "SWAD 16.71.6 (2016-11-26)" #define CSS_FILE "swad16.69.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.71.6: Nov 26, 2016 Selector "Only my groups"/"All groups" only of the course has groups. + Code refactoring in timetable. (207619 lines) Version 16.71.5: Nov 26, 2016 Contextual help on course timetable. (207611 lines) Version 16.71.4: Nov 26, 2016 Contextual help on user's timetable. (207607 lines) Version 16.71.3: Nov 26, 2016 Change in layout of notifications. (207597 lines) diff --git a/swad_timetable.c b/swad_timetable.c index d8670cae..9f683f3c 100644 --- a/swad_timetable.c +++ b/swad_timetable.c @@ -116,7 +116,6 @@ bool TimeTableHoursChecked[TT_HOURS_PER_DAY*2]; static void TT_ShowTimeTableGrpsSelected (void); static void TT_GetParamsTimeTable (void); static void TT_PutContextualIcons (void); -static void TT_ShowSelectorWhichGrps (Act_Action_t Action); static void TT_PutIconToViewCrsTT (void); static void TT_PutIconToViewMyTT (void); @@ -231,6 +230,18 @@ void TT_ShowClassTimeTable (void) Hlp_PROFILE_Timetable, // TT_MY_TIMETABLE NULL, // TT_TUTOR_TIMETABLE }; + Act_Action_t ActSeeTT[TT_NUM_TIMETABLE_TYPES] = + { + ActSeeCrsTT, // TT_COURSE_TIMETABLE + ActSeeMyTT, // TT_MY_TIMETABLE + ActUnk, // TT_TUTOR_TIMETABLE + }; + Act_Action_t ActChgTT1stDay[TT_NUM_TIMETABLE_TYPES] = + { + ActChgCrsTT1stDay,// TT_COURSE_TIMETABLE + ActChgMyTT1stDay, // TT_MY_TIMETABLE + ActUnk, // TT_TUTOR_TIMETABLE + }; bool PrintView = (Gbl.Action.Act == ActPrnCrsTT || Gbl.Action.Act == ActPrnMyTT);; @@ -280,12 +291,15 @@ void TT_ShowClassTimeTable (void) else { /***** Select whether show only my groups or all groups *****/ - TT_ShowSelectorWhichGrps (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE ? ActSeeCrsTT : - ActSeeMyTT); + if (Gbl.CurrentCrs.Grps.NumGrps) + { + Act_FormStart (ActSeeTT[Gbl.TimeTable.Type]); + Grp_ShowSelectorWhichGrps (); + Act_FormEnd (); + } /***** Show form to change first day of week *****/ - Cal_ShowFormToSelFirstDayOfWeek (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE ? ActChgCrsTT1stDay : - ActChgMyTT1stDay, + Cal_ShowFormToSelFirstDayOfWeek (ActChgTT1stDay[Gbl.TimeTable.Type], "ICO25x25"); } @@ -327,17 +341,6 @@ static void TT_PutContextualIcons (void) NULL); } -/*****************************************************************************/ -/************* Select whether show only my groups or all groups **************/ -/*****************************************************************************/ - -static void TT_ShowSelectorWhichGrps (Act_Action_t Action) - { - Act_FormStart (Action); - Grp_ShowSelectorWhichGrps (); - Act_FormEnd (); - } - /*****************************************************************************/ /********************** Show course timetable for edition ********************/ /*****************************************************************************/