mirror of https://github.com/acanas/swad-core.git
Version 16.72
This commit is contained in:
parent
ddad450eda
commit
33abc42946
|
@ -178,14 +178,16 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.71.9 (2016-11-26)"
|
#define Log_PLATFORM_VERSION "SWAD 16.72 (2016-11-27)"
|
||||||
#define CSS_FILE "swad16.69.css"
|
#define CSS_FILE "swad16.69.css"
|
||||||
#define JS_FILE "swad16.46.1.js"
|
#define JS_FILE "swad16.46.1.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// 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.9: Nov 26, 2016 Fixed bug in list of students, reported by Javier Fernández Baldomero. (207641 lines)
|
Version 16.72: Nov 27, 2016 Link to show all users' data.
|
||||||
|
Code refactoring in scopes. (207698 lines)
|
||||||
|
Version 16.71.9: Nov 27, 2016 Fixed bug in list of students, reported by Javier Fernández Baldomero. (207641 lines)
|
||||||
Version 16.71.8: Nov 26, 2016 Contextual help on email to students.
|
Version 16.71.8: Nov 26, 2016 Contextual help on email to students.
|
||||||
Contextual help on global announcements. (207634 lines)
|
Contextual help on global announcements. (207634 lines)
|
||||||
Version 16.71.7: Nov 26, 2016 Code refactoring in timetable. (207626 lines)
|
Version 16.71.7: Nov 26, 2016 Code refactoring in timetable. (207626 lines)
|
||||||
|
|
25
swad_scope.c
25
swad_scope.c
|
@ -177,7 +177,7 @@ void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************* Put hidden parameter with location range *********************/
|
/********************** Put hidden parameter scope ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Sco_PutParamScope (const char *ParamName,Sco_Scope_t Scope)
|
void Sco_PutParamScope (const char *ParamName,Sco_Scope_t Scope)
|
||||||
|
@ -186,7 +186,7 @@ void Sco_PutParamScope (const char *ParamName,Sco_Scope_t Scope)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************* Get users range for listing ***********************/
|
/*************************** Get parameter scope *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Sco_GetScope (const char *ParamName)
|
void Sco_GetScope (const char *ParamName)
|
||||||
|
@ -195,7 +195,20 @@ void Sco_GetScope (const char *ParamName)
|
||||||
|
|
||||||
/***** Get parameter location range if exists *****/
|
/***** Get parameter location range if exists *****/
|
||||||
Par_GetParToText (ParamName,UnsignedStr,10);
|
Par_GetParToText (ParamName,UnsignedStr,10);
|
||||||
if ((Gbl.Scope.Current = Sco_GetScopeFromUnsignedStr (UnsignedStr)) == Sco_SCOPE_UNK)
|
Gbl.Scope.Current = Sco_GetScopeFromUnsignedStr (UnsignedStr);
|
||||||
|
|
||||||
|
/***** Adjust scope avoiding impossible or forbidden scopes *****/
|
||||||
|
Sco_AdjustScope ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*********** Adjust scope avoiding impossible or forbidden scopes ************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Sco_AdjustScope (void)
|
||||||
|
{
|
||||||
|
/***** Is scope is unknow, use default scope *****/
|
||||||
|
if (Gbl.Scope.Current == Sco_SCOPE_UNK)
|
||||||
Gbl.Scope.Current = Gbl.Scope.Default;
|
Gbl.Scope.Current = Gbl.Scope.Default;
|
||||||
|
|
||||||
/***** Avoid impossible scopes *****/
|
/***** Avoid impossible scopes *****/
|
||||||
|
@ -237,11 +250,11 @@ void Sco_SetScopesForListingGuests (void)
|
||||||
Gbl.Scope.Default = Sco_SCOPE_INS;
|
Gbl.Scope.Default = Sco_SCOPE_INS;
|
||||||
break;
|
break;
|
||||||
case Rol_SYS_ADM:
|
case Rol_SYS_ADM:
|
||||||
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS |
|
||||||
1 << Sco_SCOPE_CTY |
|
1 << Sco_SCOPE_CTY |
|
||||||
1 << Sco_SCOPE_INS |
|
1 << Sco_SCOPE_INS |
|
||||||
1 << Sco_SCOPE_CTR;
|
1 << Sco_SCOPE_CTR;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_INS;
|
Gbl.Scope.Default = Sco_SCOPE_SYS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Gbl.Scope.Allowed = 0;
|
Gbl.Scope.Allowed = 0;
|
||||||
|
|
|
@ -57,6 +57,8 @@ typedef enum
|
||||||
void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange);
|
void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange);
|
||||||
void Sco_PutParamScope (const char *ParamName,Sco_Scope_t Scope);
|
void Sco_PutParamScope (const char *ParamName,Sco_Scope_t Scope);
|
||||||
void Sco_GetScope (const char *ParamName);
|
void Sco_GetScope (const char *ParamName);
|
||||||
|
void Sco_AdjustScope (void);
|
||||||
|
|
||||||
void Sco_SetScopesForListingGuests (void);
|
void Sco_SetScopesForListingGuests (void);
|
||||||
void Sco_SetScopesForListingStudents (void);
|
void Sco_SetScopesForListingStudents (void);
|
||||||
|
|
||||||
|
|
|
@ -3868,18 +3868,9 @@ void Sta_PutIconToShowFigure (void)
|
||||||
|
|
||||||
static void Sta_PutParamsToShowFigure (void)
|
static void Sta_PutParamsToShowFigure (void)
|
||||||
{
|
{
|
||||||
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
|
/***** Set default scope (used only if Gbl.Scope.Current is unknown) *****/
|
||||||
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
else if (Gbl.CurrentDeg.Deg.DegCod > 0)
|
Sco_AdjustScope ();
|
||||||
Gbl.Scope.Current = Sco_SCOPE_DEG;
|
|
||||||
else if (Gbl.CurrentCtr.Ctr.CtrCod > 0)
|
|
||||||
Gbl.Scope.Current = Sco_SCOPE_CTR;
|
|
||||||
else if (Gbl.CurrentIns.Ins.InsCod > 0)
|
|
||||||
Gbl.Scope.Current = Sco_SCOPE_INS;
|
|
||||||
else if (Gbl.CurrentCty.Cty.CtyCod > 0)
|
|
||||||
Gbl.Scope.Current = Sco_SCOPE_CTY;
|
|
||||||
else
|
|
||||||
Gbl.Scope.Current = Sco_SCOPE_SYS;
|
|
||||||
|
|
||||||
Sta_PutHiddenParamFigures ();
|
Sta_PutHiddenParamFigures ();
|
||||||
}
|
}
|
||||||
|
|
132
swad_user.c
132
swad_user.c
|
@ -187,8 +187,11 @@ static void Usr_PutIconToPrintGsts (void);
|
||||||
static void Usr_PutIconToPrintStds (void);
|
static void Usr_PutIconToPrintStds (void);
|
||||||
static void Usr_PutIconToPrintTchs (void);
|
static void Usr_PutIconToPrintTchs (void);
|
||||||
static void Usr_PutIconToShowGstsAllData (void);
|
static void Usr_PutIconToShowGstsAllData (void);
|
||||||
|
static void Usr_PutLinkToShowGstsAllData (void);
|
||||||
static void Usr_PutIconToShowStdsAllData (void);
|
static void Usr_PutIconToShowStdsAllData (void);
|
||||||
|
static void Usr_PutLinkToShowStdsAllData (void);
|
||||||
static void Usr_PutIconToShowTchsAllData (void);
|
static void Usr_PutIconToShowTchsAllData (void);
|
||||||
|
static void Usr_PutLinkToShowTchsAllData (void);
|
||||||
static void Usr_ShowGstsAllDataParams (void);
|
static void Usr_ShowGstsAllDataParams (void);
|
||||||
static void Usr_ShowStdsAllDataParams (void);
|
static void Usr_ShowStdsAllDataParams (void);
|
||||||
static void Usr_ShowTchsAllDataParams (void);
|
static void Usr_ShowTchsAllDataParams (void);
|
||||||
|
@ -5255,6 +5258,8 @@ void Usr_PutExtraParamsUsrList (Act_Action_t NextAction)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ActSeeUseGbl:
|
case ActSeeUseGbl:
|
||||||
|
/* Used in selector of "Class photo"/"List"
|
||||||
|
in STATS > Figures > Institutions */
|
||||||
Sta_PutHiddenParamFigures ();
|
Sta_PutHiddenParamFigures ();
|
||||||
break;
|
break;
|
||||||
case ActSeePhoDeg:
|
case ActSeePhoDeg:
|
||||||
|
@ -6790,18 +6795,24 @@ void Usr_SeeGuests (void)
|
||||||
/***** Form to select type of list of users *****/
|
/***** Form to select type of list of users *****/
|
||||||
Usr_ShowFormsToSelectUsrListType (ActLstGst);
|
Usr_ShowFormsToSelectUsrListType (ActLstGst);
|
||||||
|
|
||||||
/***** Draw a class photo with students of the course *****/
|
/***** Draw a class photo with guests *****/
|
||||||
|
switch (Gbl.Usrs.Me.ListType)
|
||||||
|
{
|
||||||
|
case Usr_CLASS_PHOTO:
|
||||||
|
Lay_WriteHeaderClassPhoto (false,true,
|
||||||
|
(Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
|
-1L,
|
||||||
|
-1L,
|
||||||
|
-1L);
|
||||||
|
break;
|
||||||
|
case Usr_LIST:
|
||||||
|
Usr_PutLinkToShowGstsAllData ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Start form */
|
/* Start form */
|
||||||
Act_FormStart (ActSeeRecSevGst);
|
Act_FormStart (ActSeeRecSevGst);
|
||||||
Grp_PutParamsCodGrps ();
|
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
|
||||||
Lay_WriteHeaderClassPhoto (false,true,
|
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
|
||||||
-1L,
|
|
||||||
-1L,
|
|
||||||
-1L);
|
|
||||||
|
|
||||||
/* Start table */
|
/* Start table */
|
||||||
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
|
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
|
||||||
|
@ -6940,6 +6951,26 @@ void Usr_SeeStudents (void)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActLstStd);
|
Usr_ShowFormsToSelectUsrListType (ActLstStd);
|
||||||
|
|
||||||
/***** Draw a class photo with students of the course *****/
|
/***** Draw a class photo with students of the course *****/
|
||||||
|
switch (Gbl.Usrs.Me.ListType)
|
||||||
|
{
|
||||||
|
case Usr_CLASS_PHOTO:
|
||||||
|
Lay_WriteHeaderClassPhoto (false,true,
|
||||||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
|
-1L,
|
||||||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
||||||
|
-1L,
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
||||||
|
-1L);
|
||||||
|
break;
|
||||||
|
case Usr_LIST:
|
||||||
|
Usr_PutLinkToShowStdsAllData ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Start form */
|
/* Start form */
|
||||||
if (ICanViewRecords)
|
if (ICanViewRecords)
|
||||||
{
|
{
|
||||||
|
@ -6947,19 +6978,6 @@ void Usr_SeeStudents (void)
|
||||||
Grp_PutParamsCodGrps ();
|
Grp_PutParamsCodGrps ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
|
||||||
Lay_WriteHeaderClassPhoto (false,true,
|
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
|
||||||
-1L,
|
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
|
||||||
-1L,
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
|
||||||
-1L);
|
|
||||||
|
|
||||||
/* Start table */
|
/* Start table */
|
||||||
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
|
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
|
||||||
|
|
||||||
|
@ -7087,23 +7105,31 @@ void Usr_SeeTeachers (void)
|
||||||
Usr_ShowFormsToSelectUsrListType (ActLstTch);
|
Usr_ShowFormsToSelectUsrListType (ActLstTch);
|
||||||
|
|
||||||
/***** Draw a class photo with teachers of the course *****/
|
/***** Draw a class photo with teachers of the course *****/
|
||||||
|
switch (Gbl.Usrs.Me.ListType)
|
||||||
|
{
|
||||||
|
case Usr_CLASS_PHOTO:
|
||||||
|
Lay_WriteHeaderClassPhoto (false,true,
|
||||||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
||||||
|
-1L,
|
||||||
|
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
||||||
|
-1L,
|
||||||
|
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
||||||
|
-1L);
|
||||||
|
break;
|
||||||
|
case Usr_LIST:
|
||||||
|
if (Gbl.Usrs.Me.LoggedRole >= Rol_DEG_ADM)
|
||||||
|
Usr_PutLinkToShowTchsAllData ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Start form */
|
/* Start form */
|
||||||
if (ICanViewRecords)
|
if (ICanViewRecords)
|
||||||
Act_FormStart (ActSeeRecSevTch);
|
Act_FormStart (ActSeeRecSevTch);
|
||||||
|
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_CLASS_PHOTO)
|
|
||||||
Lay_WriteHeaderClassPhoto (false,true,
|
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEG ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CTR ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_INS) ? Gbl.CurrentIns.Ins.InsCod :
|
|
||||||
-1L,
|
|
||||||
(Gbl.Scope.Current == Sco_SCOPE_CRS ||
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_DEG) ? Gbl.CurrentDeg.Deg.DegCod :
|
|
||||||
-1L,
|
|
||||||
Gbl.Scope.Current == Sco_SCOPE_CRS ? Gbl.CurrentCrs.Crs.CrsCod :
|
|
||||||
-1L);
|
|
||||||
|
|
||||||
/* Start table */
|
/* Start table */
|
||||||
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
|
fprintf (Gbl.F.Out,"<table style=\"width:100%%;\">");
|
||||||
|
|
||||||
|
@ -7244,6 +7270,10 @@ static void Usr_PutIconToPrintTchs (void)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/**************** Functions used to list all data of users *******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Usr_PutIconToShowGstsAllData (void)
|
static void Usr_PutIconToShowGstsAllData (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Show_all_data;
|
extern const char *Txt_Show_all_data;
|
||||||
|
@ -7254,6 +7284,16 @@ static void Usr_PutIconToShowGstsAllData (void)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Usr_PutLinkToShowGstsAllData (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Show_all_data;
|
||||||
|
|
||||||
|
Lay_PutContextualLink (ActLstGstAll,Usr_ShowGstsAllDataParams,
|
||||||
|
"table64x64.gif",
|
||||||
|
Txt_Show_all_data,Txt_Show_all_data,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void Usr_PutIconToShowStdsAllData (void)
|
static void Usr_PutIconToShowStdsAllData (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Show_all_data;
|
extern const char *Txt_Show_all_data;
|
||||||
|
@ -7264,6 +7304,16 @@ static void Usr_PutIconToShowStdsAllData (void)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Usr_PutLinkToShowStdsAllData (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Show_all_data;
|
||||||
|
|
||||||
|
Lay_PutContextualLink (ActLstStdAll,Usr_ShowStdsAllDataParams,
|
||||||
|
"table64x64.gif",
|
||||||
|
Txt_Show_all_data,Txt_Show_all_data,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void Usr_PutIconToShowTchsAllData (void)
|
static void Usr_PutIconToShowTchsAllData (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Show_all_data;
|
extern const char *Txt_Show_all_data;
|
||||||
|
@ -7274,6 +7324,16 @@ static void Usr_PutIconToShowTchsAllData (void)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Usr_PutLinkToShowTchsAllData (void)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Show_all_data;
|
||||||
|
|
||||||
|
Lay_PutContextualLink (ActLstTchAll,Usr_ShowTchsAllDataParams,
|
||||||
|
"table64x64.gif",
|
||||||
|
Txt_Show_all_data,Txt_Show_all_data,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void Usr_ShowGstsAllDataParams (void)
|
static void Usr_ShowGstsAllDataParams (void)
|
||||||
{
|
{
|
||||||
Usr_PutParamListWithPhotos ();
|
Usr_PutParamListWithPhotos ();
|
||||||
|
|
Loading…
Reference in New Issue