mirror of https://github.com/acanas/swad-core.git
Version 15.15
This commit is contained in:
parent
290da880fd
commit
f26f1533e2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -107,11 +107,12 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.14.2 (2015/10/16)"
|
#define Log_PLATFORM_VERSION "SWAD 15.15 (2015/10/19)"
|
||||||
|
|
||||||
// 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 15.15: Oct 19, 2015 Statistic figure about institutions can be displayed as a class photo or as a list. (186251 lines)
|
||||||
Version 15.14.2: Oct 16, 2015 Minor changes in layout. (186166 lines)
|
Version 15.14.2: Oct 16, 2015 Minor changes in layout. (186166 lines)
|
||||||
Version 15.14.1: Oct 16, 2015 Fixed minor bug in edition of degrees. (186170 lines)
|
Version 15.14.1: Oct 16, 2015 Fixed minor bug in edition of degrees. (186170 lines)
|
||||||
Version 15.14: Oct 15, 2015 Table log (historical log) renamed as log_full. (186169 lines)
|
Version 15.14: Oct 15, 2015 Table log (historical log) renamed as log_full. (186169 lines)
|
||||||
|
|
|
@ -2842,7 +2842,8 @@ void Brw_AskEditWorksCrs (void)
|
||||||
/***** Get parameters related to file browser *****/
|
/***** Get parameters related to file browser *****/
|
||||||
Brw_GetParAndInitFileBrowser ();
|
Brw_GetParAndInitFileBrowser ();
|
||||||
|
|
||||||
/***** Get and update type of list, number of columns in class photo
|
/***** Get and update type of list,
|
||||||
|
number of columns in class photo
|
||||||
and preference about view photos *****/
|
and preference about view photos *****/
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
|
|
|
@ -405,7 +405,7 @@ void Gbl_InitializeGlobals (void)
|
||||||
Gbl.Stat.Role = Sta_IDENTIFIED_USRS;
|
Gbl.Stat.Role = Sta_IDENTIFIED_USRS;
|
||||||
Gbl.Stat.NumAction = ActAll;
|
Gbl.Stat.NumAction = ActAll;
|
||||||
Gbl.Stat.RowsPerPage = 50;
|
Gbl.Stat.RowsPerPage = 50;
|
||||||
Gbl.Stat.UseStatType = Sta_USERS;
|
Gbl.Stat.FigureType = Sta_USERS;
|
||||||
|
|
||||||
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
Gbl.Scope.Current = Sco_SCOPE_CRS;
|
||||||
|
|
||||||
|
|
|
@ -655,7 +655,7 @@ struct Globals
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
Sta_ClicksGroupedBy_t ClicksGroupedBy;
|
Sta_ClicksGroupedBy_t ClicksGroupedBy;
|
||||||
Sta_FigureType_t UseStatType;
|
Sta_FigureType_t FigureType;
|
||||||
Sta_Role_t Role;
|
Sta_Role_t Role;
|
||||||
Sta_CountType_t CountType;
|
Sta_CountType_t CountType;
|
||||||
Act_Action_t NumAction;
|
Act_Action_t NumAction;
|
||||||
|
|
|
@ -165,7 +165,7 @@ void Ins_SeeInsWithPendingCtrs (void)
|
||||||
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
"<a href=\"%s\" title=\"%s\" class=\"DAT\" target=\"_blank\">",
|
||||||
BgColor,Ins.WWW,Ins.FullName);
|
BgColor,Ins.WWW,Ins.FullName);
|
||||||
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
||||||
16,"CENTER_TOP",true);
|
16,"CENTER_MIDDLE",true);
|
||||||
fprintf (Gbl.F.Out,"</a>"
|
fprintf (Gbl.F.Out,"</a>"
|
||||||
"</td>");
|
"</td>");
|
||||||
|
|
||||||
|
|
|
@ -281,8 +281,9 @@ static void Msg_PutFormMsgUsrs (const char *Content)
|
||||||
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
if (Gbl.Usrs.Me.IBelongToCurrentCrs || // If there is a course selected and I belong to it
|
||||||
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
|
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
|
||||||
{
|
{
|
||||||
/***** Get and update type of list, number of columns in class photo
|
/***** Get and update type of list,
|
||||||
and preference about view photos *****/
|
number of columns in class photo
|
||||||
|
and preference about view photos *****/
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Form to select groups *****/
|
/***** Form to select groups *****/
|
||||||
|
|
|
@ -1486,7 +1486,9 @@ void Pho_ShowOrPrintPhotoDegree (Pho_AvgPhotoSeeOrPrint_t SeeOrPrint)
|
||||||
/***** Get how to order degrees from form *****/
|
/***** Get how to order degrees from form *****/
|
||||||
Gbl.Stat.DegPhotos.HowOrderDegrees = Pho_GetHowOrderDegreesFromForm ();
|
Gbl.Stat.DegPhotos.HowOrderDegrees = Pho_GetHowOrderDegreesFromForm ();
|
||||||
|
|
||||||
/***** Get and update type of list, number of columns in class photo and preference about view photos *****/
|
/***** Get and update type of list,
|
||||||
|
number of columns in class photo
|
||||||
|
and preference about view photos *****/
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
if (SeeOrPrint == Pho_DEGREES_SEE)
|
if (SeeOrPrint == Pho_DEGREES_SEE)
|
||||||
|
|
|
@ -755,7 +755,7 @@ static void Prf_ShowRanking (unsigned long Rank,unsigned long NumUsrs)
|
||||||
/***** Rank in form to go to ranking *****/
|
/***** Rank in form to go to ranking *****/
|
||||||
Act_FormStart (ActSeeUseGbl);
|
Act_FormStart (ActSeeUseGbl);
|
||||||
Sco_PutParamScope (Sco_SCOPE_SYS);
|
Sco_PutParamScope (Sco_SCOPE_SYS);
|
||||||
Par_PutHiddenParamUnsigned ("UseStatType",(unsigned) Sta_USERS_RANKING);
|
Par_PutHiddenParamUnsigned ("FigureType",(unsigned) Sta_USERS_RANKING);
|
||||||
Act_LinkFormSubmit (Gbl.Title,The_ClassForm[Gbl.Prefs.Theme]);
|
Act_LinkFormSubmit (Gbl.Title,The_ClassForm[Gbl.Prefs.Theme]);
|
||||||
fprintf (Gbl.F.Out,"#%lu</a>",Rank);
|
fprintf (Gbl.F.Out,"#%lu</a>",Rank);
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
|
|
219
swad_statistic.c
219
swad_statistic.c
|
@ -175,6 +175,7 @@ static void Sta_GetAndShowInssOrderedByNumCrss (void);
|
||||||
static void Sta_GetAndShowInssOrderedByNumUsrsInCrss (void);
|
static void Sta_GetAndShowInssOrderedByNumUsrsInCrss (void);
|
||||||
static void Sta_GetAndShowInssOrderedByNumUsrsWhoClaimToBelongToThem (void);
|
static void Sta_GetAndShowInssOrderedByNumUsrsWhoClaimToBelongToThem (void);
|
||||||
static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure);
|
static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure);
|
||||||
|
static unsigned Sta_GetInsAndStat (struct Institution *Ins,MYSQL_RES *mysql_res);
|
||||||
|
|
||||||
static void Sta_GetAndShowUsersStats (void);
|
static void Sta_GetAndShowUsersStats (void);
|
||||||
static void Sta_GetAndShowUsersRanking (void);
|
static void Sta_GetAndShowUsersRanking (void);
|
||||||
|
@ -451,7 +452,9 @@ void Sta_AskShowCrsHits (void)
|
||||||
Sta_ClicksGroupedBy_t ClicksGroupedBy;
|
Sta_ClicksGroupedBy_t ClicksGroupedBy;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
|
|
||||||
/***** Get and update type of list, number of columns in class photo and preference about view photos *****/
|
/***** Get and update type of list,
|
||||||
|
number of columns in class photo
|
||||||
|
and preference about view photos *****/
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Show form to select the grupos *****/
|
/***** Show form to select the grupos *****/
|
||||||
|
@ -3799,7 +3802,7 @@ void Sta_ReqUseOfPlatform (void)
|
||||||
extern const char *Txt_Scope;
|
extern const char *Txt_Scope;
|
||||||
extern const char *Txt_STAT_USE_STAT_TYPES[Sta_NUM_FIGURES];
|
extern const char *Txt_STAT_USE_STAT_TYPES[Sta_NUM_FIGURES];
|
||||||
extern const char *Txt_Show_statistic;
|
extern const char *Txt_Show_statistic;
|
||||||
Sta_FigureType_t UseStatType;
|
Sta_FigureType_t FigureType;
|
||||||
|
|
||||||
/***** Form to show statistic *****/
|
/***** Form to show statistic *****/
|
||||||
Act_FormStart (ActSeeUseGbl);
|
Act_FormStart (ActSeeUseGbl);
|
||||||
|
@ -3823,20 +3826,20 @@ void Sta_ReqUseOfPlatform (void)
|
||||||
|
|
||||||
/***** Type of statistic *****/
|
/***** Type of statistic *****/
|
||||||
fprintf (Gbl.F.Out,"<br />"
|
fprintf (Gbl.F.Out,"<br />"
|
||||||
"%s: <select name=\"UseStatType\">",
|
"%s: <select name=\"FigureType\">",
|
||||||
Txt_Statistic);
|
Txt_Statistic);
|
||||||
for (UseStatType = (Sta_FigureType_t) 0;
|
for (FigureType = (Sta_FigureType_t) 0;
|
||||||
UseStatType < Sta_NUM_FIGURES;
|
FigureType < Sta_NUM_FIGURES;
|
||||||
UseStatType++)
|
FigureType++)
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<option value=\"%u\"",
|
fprintf (Gbl.F.Out,"<option value=\"%u\"",
|
||||||
(unsigned) UseStatType);
|
(unsigned) FigureType);
|
||||||
if (UseStatType == Gbl.Stat.UseStatType)
|
if (FigureType == Gbl.Stat.FigureType)
|
||||||
fprintf (Gbl.F.Out," selected=\"selected\"");
|
fprintf (Gbl.F.Out," selected=\"selected\"");
|
||||||
fprintf (Gbl.F.Out," />"
|
fprintf (Gbl.F.Out," />"
|
||||||
"%s"
|
"%s"
|
||||||
"</option>",
|
"</option>",
|
||||||
Txt_STAT_USE_STAT_TYPES[UseStatType]);
|
Txt_STAT_USE_STAT_TYPES[FigureType]);
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</select>"
|
fprintf (Gbl.F.Out,"</select>"
|
||||||
"</div>");
|
"</div>");
|
||||||
|
@ -3848,6 +3851,15 @@ void Sta_ReqUseOfPlatform (void)
|
||||||
Act_FormEnd ();
|
Act_FormEnd ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/********* Put hidden parameter for the type of figure (statistic) ***********/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Pho_PutHiddenParamFigureType (void)
|
||||||
|
{
|
||||||
|
Par_PutHiddenParamUnsigned ("FigureType",(unsigned) Gbl.Stat.FigureType);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Show use of the platform *************************/
|
/************************** Show use of the platform *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3858,18 +3870,18 @@ void Sta_ShowUseOfPlatform (void)
|
||||||
unsigned UnsignedNum;
|
unsigned UnsignedNum;
|
||||||
|
|
||||||
/***** Get the type of stat of use ******/
|
/***** Get the type of stat of use ******/
|
||||||
Par_GetParToText ("UseStatType",UnsignedStr,10);
|
Par_GetParToText ("FigureType",UnsignedStr,10);
|
||||||
if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1)
|
if (sscanf (UnsignedStr,"%u",&UnsignedNum) != 1)
|
||||||
Lay_ShowErrorAndExit ("Type of stat is missing.");
|
Lay_ShowErrorAndExit ("Type of stat is missing.");
|
||||||
if (UnsignedNum >= Sta_NUM_FIGURES)
|
if (UnsignedNum >= Sta_NUM_FIGURES)
|
||||||
Lay_ShowErrorAndExit ("Type of stat is missing.");
|
Lay_ShowErrorAndExit ("Type of stat is missing.");
|
||||||
Gbl.Stat.UseStatType = (Sta_FigureType_t) UnsignedNum;
|
Gbl.Stat.FigureType = (Sta_FigureType_t) UnsignedNum;
|
||||||
|
|
||||||
/***** Show again the form to see use of the platform *****/
|
/***** Show again the form to see use of the platform *****/
|
||||||
Sta_ReqUseOfPlatform ();
|
Sta_ReqUseOfPlatform ();
|
||||||
|
|
||||||
/***** Show the stat of use selected by user *****/
|
/***** Show the stat of use selected by user *****/
|
||||||
switch (Gbl.Stat.UseStatType)
|
switch (Gbl.Stat.FigureType)
|
||||||
{
|
{
|
||||||
case Sta_USERS_RANKING:
|
case Sta_USERS_RANKING:
|
||||||
/***** Users ranking *****/
|
/***** Users ranking *****/
|
||||||
|
@ -4700,6 +4712,17 @@ static void Sta_GetAndShowNumCrssInSWAD (void)
|
||||||
|
|
||||||
static void Sta_GetAndShowInstitutionsStats (void)
|
static void Sta_GetAndShowInstitutionsStats (void)
|
||||||
{
|
{
|
||||||
|
extern const char *Txt_Institutions;
|
||||||
|
|
||||||
|
/***** Get and update type of list, number of columns in class photo
|
||||||
|
and preference about view photos *****/
|
||||||
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
|
/***** Form to select type of list used to display degree photos *****/
|
||||||
|
Lay_StartRoundFrame (NULL,Txt_Institutions);
|
||||||
|
Usr_ShowFormsToSelectUsrListType (ActSeeUseGbl);
|
||||||
|
Lay_EndRoundFrame ();
|
||||||
|
|
||||||
/****** Institutions ordered by number of centres ******/
|
/****** Institutions ordered by number of centres ******/
|
||||||
Sta_GetAndShowInssOrderedByNumCtrs ();
|
Sta_GetAndShowInssOrderedByNumCtrs ();
|
||||||
|
|
||||||
|
@ -5000,77 +5023,121 @@ static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure)
|
||||||
extern const char *The_ClassForm[The_NUM_THEMES];
|
extern const char *The_ClassForm[The_NUM_THEMES];
|
||||||
extern const char *Txt_Institution;
|
extern const char *Txt_Institution;
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
|
||||||
unsigned NumInss;
|
unsigned NumInss;
|
||||||
unsigned NumIns;
|
unsigned NumIns;
|
||||||
unsigned NumOrder;
|
unsigned NumOrder;
|
||||||
unsigned NumberLastRow;
|
unsigned NumberLastRow;
|
||||||
unsigned NumberThisRow;
|
unsigned NumberThisRow;
|
||||||
struct Institution Ins;
|
struct Institution Ins;
|
||||||
|
bool TRIsOpen = false;
|
||||||
|
|
||||||
/***** Query database *****/
|
/***** Query database *****/
|
||||||
if ((NumInss = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get institutions")))
|
if ((NumInss = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get institutions")))
|
||||||
{
|
{
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
/* Draw the classphoto/list */
|
||||||
"<th></th>"
|
switch (Gbl.Usrs.Me.ListType)
|
||||||
"<th class=\"LEFT_MIDDLE\">"
|
|
||||||
"%s"
|
|
||||||
"</th>"
|
|
||||||
"<th class=\"RIGHT_MIDDLE\">"
|
|
||||||
"%s"
|
|
||||||
"</th>"
|
|
||||||
"</tr>",
|
|
||||||
Txt_Institution,
|
|
||||||
TxtFigure);
|
|
||||||
|
|
||||||
for (NumIns = 1, NumOrder = 1, NumberLastRow = 0;
|
|
||||||
NumIns <= NumInss;
|
|
||||||
NumIns++)
|
|
||||||
{
|
{
|
||||||
/***** Get next institution *****/
|
case Usr_CLASS_PHOTO:
|
||||||
row = mysql_fetch_row (mysql_res);
|
/***** Draw institutions as a class photo *****/
|
||||||
|
for (NumIns = 0;
|
||||||
|
NumIns < NumInss;)
|
||||||
|
{
|
||||||
|
if ((NumIns % Gbl.Usrs.ClassPhoto.Cols) == 0)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
|
TRIsOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get data of this institution (row[0]) */
|
/***** Get institution data and statistic *****/
|
||||||
Ins.InsCod = Str_ConvertStrCodToLongCod (row[0]);
|
NumberThisRow = Sta_GetInsAndStat (&Ins,mysql_res);
|
||||||
if (!Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_MINIMAL_DATA))
|
|
||||||
Lay_ShowErrorAndExit ("Institution not found.");
|
|
||||||
|
|
||||||
/* Get statistic (row[1]) */
|
/***** Write link to institution *****/
|
||||||
if (sscanf (row[1],"%u",&NumberThisRow) != 1)
|
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_MIDDLE\">",
|
||||||
Lay_ShowErrorAndExit ("Error in statistic");
|
The_ClassForm[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
/***** Number of order *****/
|
/* Icon and name of this institution */
|
||||||
if (NumberThisRow != NumberLastRow)
|
Act_FormStart (ActSeeInsInf);
|
||||||
NumOrder = NumIns;
|
Ins_PutParamInsCod (Ins.InsCod);
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
Act_LinkFormSubmit (Ins.FullName,The_ClassForm[Gbl.Prefs.Theme]);
|
||||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.FullName,
|
||||||
"%u"
|
32,NULL,true);
|
||||||
"</td>",
|
fprintf (Gbl.F.Out,"<br />%u</a>",NumberThisRow);
|
||||||
NumOrder);
|
Act_FormEnd ();
|
||||||
|
|
||||||
/***** Write link to institution *****/
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE\">",
|
|
||||||
The_ClassForm[Gbl.Prefs.Theme]);
|
|
||||||
|
|
||||||
/* Icon and name of this institution */
|
/***** End of user's cell *****/
|
||||||
Act_FormStart (ActSeeInsInf);
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
Ins_PutParamInsCod (Ins.InsCod);
|
|
||||||
Act_LinkFormSubmit (Ins.ShortName,The_ClassForm[Gbl.Prefs.Theme]);
|
|
||||||
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
|
||||||
32,NULL,true);
|
|
||||||
fprintf (Gbl.F.Out," %s</a>",Ins.FullName);
|
|
||||||
Act_FormEnd ();
|
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
if ((++NumIns % Gbl.Usrs.ClassPhoto.Cols) == 0)
|
||||||
|
{
|
||||||
|
fprintf (Gbl.F.Out,"</tr>");
|
||||||
|
TRIsOpen = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (TRIsOpen)
|
||||||
|
fprintf (Gbl.F.Out,"</tr>");
|
||||||
|
|
||||||
/***** Write statistic *****/
|
break;
|
||||||
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
|
case Usr_LIST:
|
||||||
"%u"
|
/***** Draw institutions as a list *****/
|
||||||
"</td>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"</tr>",
|
"<th></th>"
|
||||||
NumberThisRow);
|
"<th class=\"LEFT_MIDDLE\">"
|
||||||
|
"%s"
|
||||||
|
"</th>"
|
||||||
|
"<th class=\"RIGHT_MIDDLE\">"
|
||||||
|
"%s"
|
||||||
|
"</th>"
|
||||||
|
"</tr>",
|
||||||
|
Txt_Institution,
|
||||||
|
TxtFigure);
|
||||||
|
|
||||||
NumberLastRow = NumberThisRow;
|
for (NumIns = 1, NumOrder = 1, NumberLastRow = 0;
|
||||||
|
NumIns <= NumInss;
|
||||||
|
NumIns++)
|
||||||
|
{
|
||||||
|
/***** Get institution data and statistic *****/
|
||||||
|
NumberThisRow = Sta_GetInsAndStat (&Ins,mysql_res);
|
||||||
|
|
||||||
|
/***** Number of order *****/
|
||||||
|
if (NumberThisRow != NumberLastRow)
|
||||||
|
NumOrder = NumIns;
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
|
"%u"
|
||||||
|
"</td>",
|
||||||
|
NumOrder);
|
||||||
|
|
||||||
|
/***** Write link to institution *****/
|
||||||
|
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_MIDDLE\">",
|
||||||
|
The_ClassForm[Gbl.Prefs.Theme]);
|
||||||
|
|
||||||
|
/* Icon and name of this institution */
|
||||||
|
Act_FormStart (ActSeeInsInf);
|
||||||
|
Ins_PutParamInsCod (Ins.InsCod);
|
||||||
|
Act_LinkFormSubmit (Ins.ShortName,The_ClassForm[Gbl.Prefs.Theme]);
|
||||||
|
if (Gbl.Usrs.Listing.WithPhotos)
|
||||||
|
{
|
||||||
|
Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShortName,
|
||||||
|
32,NULL,true);
|
||||||
|
fprintf (Gbl.F.Out," ");
|
||||||
|
}
|
||||||
|
fprintf (Gbl.F.Out,"%s</a>",Ins.FullName);
|
||||||
|
Act_FormEnd ();
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
|
|
||||||
|
/***** Write statistic *****/
|
||||||
|
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||||
|
"%u"
|
||||||
|
"</td>"
|
||||||
|
"</tr>",
|
||||||
|
NumberThisRow);
|
||||||
|
|
||||||
|
NumberLastRow = NumberThisRow;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5082,6 +5149,30 @@ static void Sta_GetAndShowInss (const char *Query,const char *TxtFigure)
|
||||||
/************************* Get total number of users *************************/
|
/************************* Get total number of users *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static unsigned Sta_GetInsAndStat (struct Institution *Ins,MYSQL_RES *mysql_res)
|
||||||
|
{
|
||||||
|
MYSQL_ROW row;
|
||||||
|
unsigned NumberThisRow;
|
||||||
|
|
||||||
|
/***** Get next institution *****/
|
||||||
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
|
/***** Get data of this institution (row[0]) *****/
|
||||||
|
Ins->InsCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
if (!Ins_GetDataOfInstitutionByCod (Ins,Ins_GET_MINIMAL_DATA))
|
||||||
|
Lay_ShowErrorAndExit ("Institution not found.");
|
||||||
|
|
||||||
|
/***** Get statistic (row[1]) *****/
|
||||||
|
if (sscanf (row[1],"%u",&NumberThisRow) != 1)
|
||||||
|
Lay_ShowErrorAndExit ("Error in statistic");
|
||||||
|
|
||||||
|
return NumberThisRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/************************* Get total number of users *************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role)
|
||||||
{
|
{
|
||||||
char Query[512];
|
char Query[512];
|
||||||
|
|
|
@ -147,6 +147,7 @@ void Sta_SetIniEndDates (void);
|
||||||
void Sta_SeeGblAccesses (void);
|
void Sta_SeeGblAccesses (void);
|
||||||
void Sta_SeeCrsAccesses (void);
|
void Sta_SeeCrsAccesses (void);
|
||||||
void Sta_ReqUseOfPlatform (void);
|
void Sta_ReqUseOfPlatform (void);
|
||||||
|
void Pho_PutHiddenParamFigureType (void);
|
||||||
void Sta_ShowUseOfPlatform (void);
|
void Sta_ShowUseOfPlatform (void);
|
||||||
unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role);
|
unsigned Sta_GetTotalNumberOfUsers (Sco_Scope_t Scope,Rol_Role_t Role);
|
||||||
void Sta_WriteParamsDatesSeeAccesses (void);
|
void Sta_WriteParamsDatesSeeAccesses (void);
|
||||||
|
|
|
@ -5889,7 +5889,8 @@ void Tst_SelUsrsToSeeUsrsTstExams (void)
|
||||||
extern const char *Txt_Users;
|
extern const char *Txt_Users;
|
||||||
extern const char *Txt_See_exams;
|
extern const char *Txt_See_exams;
|
||||||
|
|
||||||
/***** Get and update type of list, number of columns in class photo
|
/***** Get and update type of list,
|
||||||
|
number of columns in class photo
|
||||||
and preference about view photos *****/
|
and preference about view photos *****/
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
|
|
29
swad_user.c
29
swad_user.c
|
@ -4779,7 +4779,7 @@ void Usr_FreeListOtherRecipients (void)
|
||||||
|
|
||||||
void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction)
|
void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction)
|
||||||
{
|
{
|
||||||
/***** Select USR_CLASS_ROOM *****/
|
/***** Select Usr_CLASS_PHOTO *****/
|
||||||
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_4\" style=\"margin:4px auto;\">"
|
fprintf (Gbl.F.Out,"<table class=\"CELLS_PAD_4\" style=\"margin:4px auto;\">"
|
||||||
"<tr>"
|
"<tr>"
|
||||||
"<td class=\"%s LEFT_MIDDLE\">",
|
"<td class=\"%s LEFT_MIDDLE\">",
|
||||||
|
@ -4869,6 +4869,9 @@ void Usr_PutExtraParamsUsrList (Act_Action_t NextAction)
|
||||||
Usr_PutParamOtherUsrCodEncrypted ();
|
Usr_PutParamOtherUsrCodEncrypted ();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ActSeeUseGbl:
|
||||||
|
Pho_PutHiddenParamFigureType ();
|
||||||
|
break;
|
||||||
case ActSeePhoDeg:
|
case ActSeePhoDeg:
|
||||||
Pho_PutHiddenParamTypeOfAvg ();
|
Pho_PutHiddenParamTypeOfAvg ();
|
||||||
Pho_PutHiddenParamPhotoSize ();
|
Pho_PutHiddenParamPhotoSize ();
|
||||||
|
@ -5707,11 +5710,11 @@ void Usr_ListAllDataTchs (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
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 |
|
||||||
1 << Sco_SCOPE_DEG |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_CRS;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
@ -6756,11 +6759,11 @@ void Usr_SeeTeachers (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
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 |
|
||||||
1 << Sco_SCOPE_DEG |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_CRS;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
@ -6991,11 +6994,11 @@ void Usr_SeeTchClassPhotoPrn (void)
|
||||||
Usr_GetAndUpdatePrefsAboutUsrList ();
|
Usr_GetAndUpdatePrefsAboutUsrList ();
|
||||||
|
|
||||||
/***** Get scope *****/
|
/***** Get scope *****/
|
||||||
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 |
|
||||||
1 << Sco_SCOPE_DEG |
|
1 << Sco_SCOPE_DEG |
|
||||||
1 << Sco_SCOPE_CRS;
|
1 << Sco_SCOPE_CRS;
|
||||||
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
Gbl.Scope.Default = Sco_SCOPE_CRS;
|
||||||
Sco_GetScope ();
|
Sco_GetScope ();
|
||||||
|
|
Loading…
Reference in New Issue