Version 16.86.4

This commit is contained in:
Antonio Cañas Vargas 2016-12-04 20:12:56 +01:00
parent 9464c0d7b4
commit b21f9a936a
5 changed files with 57 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -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 ***********/

View File

@ -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);

View File

@ -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,