Version 16.47.14

This commit is contained in:
Antonio Cañas Vargas 2016-11-07 01:44:50 +01:00
parent 8a58de2b72
commit 284f213779
2 changed files with 31 additions and 7 deletions

View File

@ -63,6 +63,8 @@ extern struct Globals Gbl;
/*****************************************************************************/
static void Asg_ShowAllAssignments (void);
static bool Asg_CheckIfICanCreateAssignments (void);
static void Asg_PutIconsListAssignments (void);
static void Asg_PutIconToCreateNewAsg (void);
static void Asg_PutButtonToCreateNewAsg (void);
static void Asg_PutParamsToCreateNewAsg (void);
@ -119,8 +121,6 @@ static void Asg_ShowAllAssignments (void)
tAsgsOrderType Order;
struct Pagination Pagination;
unsigned NumAsg;
bool ICanEdit = (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
/***** Get list of assignments *****/
Asg_GetListAssignments ();
@ -136,9 +136,7 @@ static void Asg_ShowAllAssignments (void)
Pag_WriteLinksToPagesCentered (Pag_ASSIGNMENTS,0,&Pagination);
/***** Start frame *****/
Lay_StartRoundFrame ("100%",Txt_Assignments,
ICanEdit ? Asg_PutIconToCreateNewAsg :
NULL);
Lay_StartRoundFrame ("100%",Txt_Assignments,Asg_PutIconsListAssignments);
/***** Select whether show only my groups or all groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps)
@ -195,7 +193,7 @@ static void Asg_ShowAllAssignments (void)
Lay_ShowAlert (Lay_INFO,Txt_No_assignments);
/***** Button to create a new assignment *****/
if (ICanEdit)
if (Asg_CheckIfICanCreateAssignments ())
Asg_PutButtonToCreateNewAsg ();
/***** End frame *****/
@ -209,6 +207,31 @@ static void Asg_ShowAllAssignments (void)
Asg_FreeListAssignments ();
}
/*****************************************************************************/
/******************** Check if I can create assignments **********************/
/*****************************************************************************/
static bool Asg_CheckIfICanCreateAssignments (void)
{
return (bool) (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER ||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
}
/*****************************************************************************/
/*************** Put contextual icons in list of assignments *****************/
/*****************************************************************************/
static void Asg_PutIconsListAssignments (void)
{
/***** Put icon to create a new assignment *****/
if (Asg_CheckIfICanCreateAssignments ())
Asg_PutIconToCreateNewAsg ();
/***** Put icon to show a figure *****/
Gbl.Stat.FigureType = Sta_ASSIGNMENTS;
Sta_PutIconToShowFigure ();
}
/*****************************************************************************/
/******************* Put icon to create a new assignment *********************/
/*****************************************************************************/

View File

@ -156,13 +156,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.47.13 (2016-11-07)"
#define Log_PLATFORM_VERSION "SWAD 16.47.14 (2016-11-07)"
#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.14: Nov 07, 2016 Icon in list of assignments to show figure (statistics). (206314 lines)
Version 16.47.13: Nov 07, 2016 Icon in list of guests to show figure (statistics). (206295 lines)
Version 16.47.12: Nov 07, 2016 Icon in list of teachers to show figure (statistics). (206278 lines)
Version 16.47.11: Nov 07, 2016 Icon in list of students to show figure (statistics). (206262 lines)