Version 16.47

This commit is contained in:
Antonio Cañas Vargas 2016-11-06 15:36:26 +01:00
parent f4438fe9d5
commit 422a44a9bf
7 changed files with 78 additions and 20 deletions

View File

@ -79,7 +79,7 @@ static bool Acc_GetParamsNewAccount (char *NewNicknameWithoutArroba,
static void Acc_CreateNewEncryptedUsrCod (struct UsrData *UsrDat); static void Acc_CreateNewEncryptedUsrCod (struct UsrData *UsrDat);
static void Acc_PutLinkToRemoveMyAccount (void); static void Acc_PutLinkToRemoveMyAccount (void);
static void Acc_PutLinkToRemoveMyAccountParams (void); static void Acc_PutParamsToRemoveMyAccount (void);
static void Acc_PrintAccountSeparator (void); static void Acc_PrintAccountSeparator (void);
@ -503,13 +503,13 @@ static void Acc_PutLinkToRemoveMyAccount (void)
{ {
extern const char *Txt_Remove_account; extern const char *Txt_Remove_account;
Lay_PutContextualLink (ActReqRemMyAcc,Acc_PutLinkToRemoveMyAccountParams, Lay_PutContextualLink (ActReqRemMyAcc,Acc_PutParamsToRemoveMyAccount,
"remove-on64x64.png", "remove-on64x64.png",
Txt_Remove_account,Txt_Remove_account, Txt_Remove_account,Txt_Remove_account,
NULL); NULL);
} }
static void Acc_PutLinkToRemoveMyAccountParams (void) static void Acc_PutParamsToRemoveMyAccount (void)
{ {
Usr_PutParamUsrCodEncrypted (Gbl.Usrs.Me.UsrDat.EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (Gbl.Usrs.Me.UsrDat.EncryptedUsrCod);
Par_PutHiddenParamUnsigned ("RegRemAction",(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM); Par_PutHiddenParamUnsigned ("RegRemAction",(unsigned) Enr_ELIMINATE_ONE_USR_FROM_PLATFORM);

View File

@ -2722,7 +2722,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
// TabSta ****************************************************************** // TabSta ******************************************************************
// Actions in menu: // Actions in menu:
/* ActSeeAllSvy */{ 966, 0,TabSta,ActSeeAllSvy ,0x1F8,0x1F8,0x1F8,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Svy_SeeAllSurveys ,"survey64x64.gif" }, /* ActSeeAllSvy */{ 966, 0,TabSta,ActSeeAllSvy ,0x1F8,0x1F8,0x1F8,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Svy_SeeAllSurveys ,"survey64x64.gif" },
/* ActReqUseGbl */{ 761, 1,TabSta,ActReqUseGbl ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Sta_ReqUseOfPlatform ,"pie64x64.gif" }, /* ActReqUseGbl */{ 761, 1,TabSta,ActReqUseGbl ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Sta_ReqShowFigures ,"pie64x64.gif" },
/* ActSeePhoDeg */{ 447, 2,TabSta,ActSeePhoDeg ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Pho_ShowPhotoDegree ,"classphoto64x64.gif" }, /* ActSeePhoDeg */{ 447, 2,TabSta,ActSeePhoDeg ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Pho_ShowPhotoDegree ,"classphoto64x64.gif" },
/* ActReqStaCrs */{ 767, 3,TabSta,ActReqStaCrs ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ind_ReqIndicatorsCourses ,"tablestats64x64.gif" }, /* ActReqStaCrs */{ 767, 3,TabSta,ActReqStaCrs ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ind_ReqIndicatorsCourses ,"tablestats64x64.gif" },
/* ActReqAccGbl */{ 591, 4,TabSta,ActReqAccGbl ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,Sta_SetIniEndDates ,Sta_AskShowGblHits ,"stats64x64.gif" }, /* ActReqAccGbl */{ 591, 4,TabSta,ActReqAccGbl ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,Sta_SetIniEndDates ,Sta_AskShowGblHits ,"stats64x64.gif" },
@ -2748,7 +2748,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActReqRemSvyQst */{1524,-1,TabUnk,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Svy_RequestRemoveQst ,NULL}, /* ActReqRemSvyQst */{1524,-1,TabUnk,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Svy_RequestRemoveQst ,NULL},
/* ActRemSvyQst */{ 981,-1,TabUnk,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Svy_RemoveQst ,NULL}, /* ActRemSvyQst */{ 981,-1,TabUnk,ActSeeAllSvy ,0x1F0,0x1E0,0x1E0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Svy_RemoveQst ,NULL},
/* ActSeeUseGbl */{ 84,-1,TabUnk,ActReqUseGbl ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Sta_ShowUseOfPlatform ,NULL}, /* ActSeeUseGbl */{ 84,-1,TabUnk,ActReqUseGbl ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Sta_ShowFigures ,NULL},
/* ActPrnPhoDeg */{ 448,-1,TabUnk,ActSeePhoDeg ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Pho_PrintPhotoDegree ,NULL}, /* ActPrnPhoDeg */{ 448,-1,TabUnk,ActSeePhoDeg ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_BLNK_WINDOW,NULL ,Pho_PrintPhotoDegree ,NULL},
/* ActCalPhoDeg */{ 444,-1,TabUnk,ActSeePhoDeg ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Pho_CalcPhotoDegree ,NULL}, /* ActCalPhoDeg */{ 444,-1,TabUnk,ActSeePhoDeg ,0x1FF,0x1FF,0x1FF,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Pho_CalcPhotoDegree ,NULL},
/* ActSeeAccGbl */{ 79,-1,TabUnk,ActReqAccGbl ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Sta_SeeGblAccesses ,NULL}, /* ActSeeAccGbl */{ 79,-1,TabUnk,ActReqAccGbl ,0x1FE,0x1FE,0x1FE,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Sta_SeeGblAccesses ,NULL},

View File

@ -279,7 +279,7 @@ void Cal_DrawCalendar (void)
} }
/*****************************************************************************/ /*****************************************************************************/
/************************ Draw an academic calendar **************************/ /************************ Put icon to print calendar *************************/
/*****************************************************************************/ /*****************************************************************************/
static void Cal_PutIconToPrintCalendar (void) static void Cal_PutIconToPrintCalendar (void)
@ -291,4 +291,3 @@ static void Cal_PutIconToPrintCalendar (void)
Txt_Print,NULL, Txt_Print,NULL,
NULL); NULL);
} }

View File

@ -156,13 +156,15 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.46.9 (2016-11-06)" #define Log_PLATFORM_VERSION "SWAD 16.47 (2016-11-06)"
#define CSS_FILE "swad16.32.1.css" #define CSS_FILE "swad16.32.1.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.47: Nov 06, 2016 New functions to put a contextual icon to show a figure (statistics). (206113 lines)
Version 16.46.10: Nov 06, 2016 Code refactoring in statistics. (206080 lines)
Version 16.46.9: Nov 06, 2016 Fixed bug in figures (statistics). (206064 lines) Version 16.46.9: Nov 06, 2016 Fixed bug in figures (statistics). (206064 lines)
Version 16.46.8: Nov 05, 2016 Changes in texts related to notifications. (206047 lines) Version 16.46.8: Nov 05, 2016 Changes in texts related to notifications. (206047 lines)
Version 16.46.7: Nov 05, 2016 Changes in text related to forum statistics. (206046 lines) Version 16.46.7: Nov 05, 2016 Changes in text related to forum statistics. (206046 lines)

View File

@ -178,6 +178,10 @@ static void Sta_ShowNumHitsPerCourse (unsigned long NumRows,
static void Sta_DrawBarNumHits (char Color,float HitsNum,float HitsMax,float HitsTotal,unsigned MaxBarWidth); static void Sta_DrawBarNumHits (char Color,float HitsNum,float HitsMax,float HitsTotal,unsigned MaxBarWidth);
static void Sta_PutParamsToShowFigure (void);
static void Sta_PutHiddenParamFigureType (void);
static void Sta_PutHiddenParamScopeSta (void);
static void Sta_GetAndShowHierarchyStats (void); static void Sta_GetAndShowHierarchyStats (void);
static void Sta_WriteHeadDegsCrssInSWAD (void); static void Sta_WriteHeadDegsCrssInSWAD (void);
static void Sta_GetAndShowNumCtysInSWAD (void); static void Sta_GetAndShowNumCtysInSWAD (void);
@ -397,7 +401,14 @@ void Sta_AskShowCrsHits (void)
extern const char *Txt_results_per_page; extern const char *Txt_results_per_page;
extern const char *Txt_Show_hits; extern const char *Txt_Show_hits;
extern const char *Txt_No_teachers_or_students_found; extern const char *Txt_No_teachers_or_students_found;
static unsigned long RowsPerPage[] = {10,20,30,40,50,100,500,1000,5000,10000,50000,100000}; static unsigned long RowsPerPage[] =
{
10,20,30,40,50,
100,500,
1000,5000,
10000,50000,
100000
};
#define NUM_OPTIONS_ROWS_PER_PAGE (sizeof (RowsPerPage) / sizeof (RowsPerPage[0])) #define NUM_OPTIONS_ROWS_PER_PAGE (sizeof (RowsPerPage) / sizeof (RowsPerPage[0]))
unsigned NumTotalUsrs; unsigned NumTotalUsrs;
Sta_ClicksGroupedBy_t ClicksGroupedBy; Sta_ClicksGroupedBy_t ClicksGroupedBy;
@ -3777,7 +3788,7 @@ void Sta_WriteParamsDatesSeeAccesses (void)
/************************** Show use of the platform *************************/ /************************** Show use of the platform *************************/
/*****************************************************************************/ /*****************************************************************************/
void Sta_ReqUseOfPlatform (void) void Sta_ReqShowFigures (void)
{ {
extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_Statistic; extern const char *Txt_Statistic;
@ -3833,11 +3844,57 @@ void Sta_ReqUseOfPlatform (void)
Act_FormEnd (); Act_FormEnd ();
} }
/*****************************************************************************/
/************************* Put icon to show a figure *************************/
/*****************************************************************************/
// Gbl.Stat.FigureType must be set to the desired figure before calling this function
void Sta_PutIconToShowFigure (void)
{
extern const char *Txt_Show_statistic;
Lay_PutContextualLink (ActSeeUseGbl,Sta_PutParamsToShowFigure,
"pie64x64.gif",
Txt_Show_statistic,NULL,
NULL);
}
/*****************************************************************************/
/************* Put hidden parameters for figures (statistics) ****************/
/*****************************************************************************/
// Gbl.Stat.FigureType must be set to the desired figure before calling this function
static void Sta_PutParamsToShowFigure (void)
{
if (Gbl.CurrentCrs.Crs.CrsCod > 0)
Gbl.Scope.Current = Sco_SCOPE_CRS;
else if (Gbl.CurrentDeg.Deg.DegCod > 0)
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
Gbl.Scope.Current = Sco_SCOPE_SYS;
Sta_PutHiddenParamFigures ();
}
/*****************************************************************************/
/************* Put hidden parameters for figures (statistics) ****************/
/*****************************************************************************/
void Sta_PutHiddenParamFigures (void)
{
Sta_PutHiddenParamScopeSta ();
Sta_PutHiddenParamFigureType ();
}
/*****************************************************************************/ /*****************************************************************************/
/********* Put hidden parameter for the type of figure (statistic) ***********/ /********* Put hidden parameter for the type of figure (statistic) ***********/
/*****************************************************************************/ /*****************************************************************************/
void Sta_PutHiddenParamFigureType (void) static void Sta_PutHiddenParamFigureType (void)
{ {
Par_PutHiddenParamUnsigned ("FigureType",(unsigned) Gbl.Stat.FigureType); Par_PutHiddenParamUnsigned ("FigureType",(unsigned) Gbl.Stat.FigureType);
} }
@ -3846,7 +3903,7 @@ void Sta_PutHiddenParamFigureType (void)
/********* Put hidden parameter for the type of figure (statistic) ***********/ /********* Put hidden parameter for the type of figure (statistic) ***********/
/*****************************************************************************/ /*****************************************************************************/
void Sta_PutHiddenParamScopeSta (void) static void Sta_PutHiddenParamScopeSta (void)
{ {
Sco_PutParamScope ("ScopeSta",Gbl.Scope.Current); Sco_PutParamScope ("ScopeSta",Gbl.Scope.Current);
} }
@ -3855,7 +3912,7 @@ void Sta_PutHiddenParamScopeSta (void)
/************************** Show use of the platform *************************/ /************************** Show use of the platform *************************/
/*****************************************************************************/ /*****************************************************************************/
void Sta_ShowUseOfPlatform (void) void Sta_ShowFigures (void)
{ {
static void (*Sta_Function[Sta_NUM_FIGURES])(void) = // Array of pointers to functions static void (*Sta_Function[Sta_NUM_FIGURES])(void) = // Array of pointers to functions
{ {
@ -3895,7 +3952,7 @@ void Sta_ShowUseOfPlatform (void)
Gbl.Stat.FigureType = (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_ReqShowFigures ();
/***** Show the stat of use selected by user *****/ /***** Show the stat of use selected by user *****/
Sta_Function[Gbl.Stat.FigureType] (); Sta_Function[Gbl.Stat.FigureType] ();

View File

@ -160,10 +160,11 @@ void Sta_ComputeMaxAndTotalHits (struct Sta_Hits *Hits,
MYSQL_RES *mysql_res,unsigned Field, MYSQL_RES *mysql_res,unsigned Field,
unsigned Divisor); unsigned Divisor);
void Sta_ReqUseOfPlatform (void); void Sta_ReqShowFigures (void);
void Sta_PutHiddenParamFigureType (void); void Sta_PutIconToShowFigure (void);
void Sta_PutHiddenParamScopeSta (void); void Sta_PutHiddenParamFigures (void);
void Sta_ShowUseOfPlatform (void); void Sta_ShowFigures (void);
unsigned Sta_GetTotalNumberOfUsersInCourses (Sco_Scope_t Scope,Rol_Role_t Role); unsigned Sta_GetTotalNumberOfUsersInCourses (Sco_Scope_t Scope,Rol_Role_t Role);
void Sta_WriteParamsDatesSeeAccesses (void); void Sta_WriteParamsDatesSeeAccesses (void);

View File

@ -5232,8 +5232,7 @@ void Usr_PutExtraParamsUsrList (Act_Action_t NextAction)
} }
break; break;
case ActSeeUseGbl: case ActSeeUseGbl:
Sta_PutHiddenParamScopeSta (); Sta_PutHiddenParamFigures ();
Sta_PutHiddenParamFigureType ();
break; break;
case ActSeePhoDeg: case ActSeePhoDeg:
Pho_PutHiddenParamTypeOfAvg (); Pho_PutHiddenParamTypeOfAvg ();