diff --git a/swad_changelog.h b/swad_changelog.h index a7fb228ad..9ec14d9d5 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.80.7 (2015/03/09)" +#define Log_PLATFORM_VERSION "SWAD 14.80.8 (2015/03/09)" // 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 | tail -1 /* + Version 14.80.8: Mar 09, 2015 Scope country for statistic of forums. (179138 lines) Version 14.80.7: Mar 09, 2015 Scope country for statistic of surveys. (179021 lines) Version 14.80.6: Mar 09, 2015 Scope country for statistic of columns. (178987 lines) Version 14.80.5: Mar 09, 2015 Scope country for statistic of menu. (178974 lines) diff --git a/swad_forum.c b/swad_forum.c index 6eac1188d..a7fbc55fb 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -2609,7 +2609,7 @@ static void For_WriteNumThrsAndPsts (unsigned NumThrs,unsigned NumThrsWithNewPos /*****************************************************************************/ unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod) + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod) { char Query[1024]; MYSQL_RES *mysql_res; @@ -2629,7 +2629,14 @@ unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, " WHERE ForumType='%u'" " AND Location='%ld'", (unsigned) ForumType,InsCod); - else // InsCod <= 0 ==> Number of institutions forums for the whole platform + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of institution forums for a country + sprintf (Query,"SELECT COUNT(DISTINCT forum_thread.Location)" + " FROM forum_thread,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); + else // CtyCod <= 0 ==> Number of institutions forums for the whole platform sprintf (Query,"SELECT COUNT(DISTINCT Location)" " FROM forum_thread" " WHERE ForumType='%u'", @@ -2649,6 +2656,14 @@ unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, " AND forum_thread.Location=centres.CtrCod" " AND centres.InsCod='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of centre forums for a country + sprintf (Query,"SELECT COUNT(DISTINCT forum_thread.Location)" + " FROM forum_thread,centres,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of centre forums for the whole platform sprintf (Query,"SELECT COUNT(DISTINCT Location)" " FROM forum_thread" @@ -2677,6 +2692,15 @@ unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, " AND degrees.CtrCod=centres.CtrCod" " AND centres.InsCod='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of degree forums for a country + sprintf (Query,"SELECT COUNT(DISTINCT forum_thread.Location)" + " FROM forum_thread,degrees,centres,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=degrees.DegCod" + " AND degrees.CtrCod=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of degree forums for the whole platform sprintf (Query,"SELECT COUNT(DISTINCT Location)" " FROM forum_thread" @@ -2714,6 +2738,16 @@ unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, " AND degrees.CtrCod=centres.CtrCod" " AND centres.InsCod='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of course forums for a country + sprintf (Query,"SELECT COUNT(DISTINCT forum_thread.Location)" + " FROM forum_thread,courses,degrees,centres,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=courses.CrsCod" + " AND courses.DegCod=degrees.DegCod" + " AND degrees.CtrCod=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of course forums for the whole platform sprintf (Query,"SELECT COUNT(DISTINCT Location)" " FROM forum_thread" @@ -2741,7 +2775,7 @@ unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, /*****************************************************************************/ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod) + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod) { char Query[512]; @@ -2757,12 +2791,19 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, (unsigned) ForumType); break; case For_FORUM_INSTITUTION_USRS: case For_FORUM_INSTITUTION_TCHS: - if (InsCod > 0) // InsCod > 0 ==> 0 <= number of threads in institution forums for an institution <= 1 + if (InsCod > 0) // InsCod > 0 ==> Number of threads in institution forums for an institution sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" " WHERE ForumType='%u'" " AND Location='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of threads in institution forums for a country + sprintf (Query,"SELECT COUNT(*)" + " FROM forum_thread,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of threads in institution forums for the whole platform sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" @@ -2770,19 +2811,27 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, (unsigned) ForumType); break; case For_FORUM_CENTRE_USRS: case For_FORUM_CENTRE_TCHS: - if (CtrCod > 0) // CtrCod > 0 ==> 0 <= number of threads in centre forums for a centre <= 1 + if (CtrCod > 0) // CtrCod > 0 ==> 0 <= Number of threads in centre forums for a centre <= 1 sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" " WHERE ForumType='%u'" " AND Location='%ld'", (unsigned) ForumType,CtrCod); - else if (InsCod > 0) // CtrCod <= 0 && InsCod > 0 ==> 0 <= number of threads in centre forums for an institution <= 1 + else if (InsCod > 0) // CtrCod <= 0 && InsCod > 0 ==> Number of threads in centre forums for an institution sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread,centres" " WHERE forum_thread.ForumType='%u'" " AND forum_thread.Location=centres.CtrCod" " AND centres.InsCod='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of threads in centre forums for a country + sprintf (Query,"SELECT COUNT(*)" + " FROM forum_thread,centres,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of threads in centre forums for the whole platform sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" @@ -2790,7 +2839,7 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, (unsigned) ForumType); break; case For_FORUM_DEGREE_USRS: case For_FORUM_DEGREE_TCHS: - if (DegCod > 0) // DegCod > 0 ==> number of threads in degree forums for a degree + if (DegCod > 0) // DegCod > 0 ==> Number of threads in degree forums for a degree sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" " WHERE ForumType='%u'" @@ -2803,7 +2852,7 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, " AND forum_thread.Location=degrees.DegCod" " AND degrees.CtrCod='%ld'", (unsigned) ForumType,CtrCod); - else if (InsCod > 0) // CtrCod <= 0 && InsCod > 0 ==> 0 <= number of threads in degree forums for an institution <= 1 + else if (InsCod > 0) // CtrCod <= 0 && InsCod > 0 ==> Number of threads in degree forums for an institution sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread,degrees,centres" " WHERE forum_thread.ForumType='%u'" @@ -2811,6 +2860,15 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, " AND degrees.CtrCod=centres.CtrCod" " AND centres.InsCod='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of threads in degree forums for a country + sprintf (Query,"SELECT COUNT(*)" + " FROM forum_thread,degrees,centres,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=degrees.DegCod" + " AND degrees.CtrCod=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of threads in degree forums for the whole platform sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" @@ -2818,7 +2876,7 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, (unsigned) ForumType); break; case For_FORUM_COURSE_USRS: case For_FORUM_COURSE_TCHS: - if (CrsCod > 0) // CrsCod > 0 ==> 0 <= number of threads in course forums for a course + if (CrsCod > 0) // CrsCod > 0 ==> 0 <= Number of threads in course forums for a course sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" " WHERE ForumType='%u'" @@ -2839,7 +2897,7 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, " AND courses.DegCod=degrees.DegCod" " AND degrees.CtrCod='%ld'", (unsigned) ForumType,CtrCod); - else if (InsCod > 0) // CtrCod <= 0 && InsCod > 0 ==> 0 <= number of threads in course forums for an institution <= 1 + else if (InsCod > 0) // CtrCod <= 0 && InsCod > 0 ==> Number of threads in course forums for an institution sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread,courses,degrees,centres" " WHERE forum_thread.ForumType='%u'" @@ -2848,6 +2906,16 @@ unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, " AND degrees.CtrCod=centres.CtrCod" " AND centres.InsCod='%ld'", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of threads in course forums for a country + sprintf (Query,"SELECT COUNT(*)" + " FROM forum_thread,courses,degrees,centres,institutions" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=courses.CrsCod" + " AND courses.DegCod=degrees.DegCod" + " AND degrees.CtrCod=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of threads in course forums for the whole platform sprintf (Query,"SELECT COUNT(*)" " FROM forum_thread" @@ -2896,7 +2964,7 @@ unsigned For_GetNumThrsInForum (For_ForumType_t ForumType) /*****************************************************************************/ unsigned For_GetNumTotalPstsInForumsOfType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod, + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod, unsigned *NumUsrsToBeNotifiedByEMail) { char Query[1024]; @@ -2924,6 +2992,14 @@ unsigned For_GetNumTotalPstsInForumsOfType (For_ForumType_t ForumType, " AND forum_thread.Location='%ld'" " AND forum_thread.ThrCod=forum_post.ThrCod", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of posts in institutions forums for a country + sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" + " FROM forum_thread,institutions,forum_post" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=institutions.InsCod" + " AND institutions.CtyCod='%ld'" + " AND forum_thread.ThrCod=forum_post.ThrCod", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of posts in institution forums for the whole platform sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" " FROM forum_thread,forum_post " @@ -2947,6 +3023,15 @@ unsigned For_GetNumTotalPstsInForumsOfType (For_ForumType_t ForumType, " AND centres.InsCod='%ld'" " AND forum_thread.ThrCod=forum_post.ThrCod", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of posts in centre forums for a country + sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" + " FROM forum_thread,centres,institutions,forum_post" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'" + " AND forum_thread.ThrCod=forum_post.ThrCod", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of posts in centre forums for the whole platform sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" " FROM forum_thread,forum_post " @@ -2979,6 +3064,16 @@ unsigned For_GetNumTotalPstsInForumsOfType (For_ForumType_t ForumType, " AND centres.InsCod='%ld'" " AND forum_thread.ThrCod=forum_post.ThrCod", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of posts in degree forums for a country + sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" + " FROM forum_thread,degrees,centres,institutions,forum_post" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=degrees.DegCod" + " AND degrees.CtrCod=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'" + " AND forum_thread.ThrCod=forum_post.ThrCod", + (unsigned) ForumType,CtyCod); else // InsCod <= 0 ==> Number of posts in degree forums for the whole platform sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" " FROM forum_thread,forum_post " @@ -3021,6 +3116,17 @@ unsigned For_GetNumTotalPstsInForumsOfType (For_ForumType_t ForumType, " AND centres.InsCod='%ld'" " AND forum_thread.ThrCod=forum_post.ThrCod", (unsigned) ForumType,InsCod); + else if (CtyCod > 0) // InsCod <= 0 && CtyCod > 0 ==> Number of posts in course forums for a country + sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" + " FROM forum_thread,courses,degrees,centres,institutions,forum_post" + " WHERE forum_thread.ForumType='%u'" + " AND forum_thread.Location=courses.CrsCod" + " AND courses.DegCod=degrees.DegCod" + " AND degrees.CtrCod=centres.CtrCod" + " AND centres.InsCod=institutions.InsCod" + " AND institutions.CtyCod='%ld'" + " AND forum_thread.ThrCod=forum_post.ThrCod", + (unsigned) ForumType,CtyCod); else // CrsCod <= 0 && DegCod <= 0 && CtrCod <= 0 ==> Number of posts in course forums for the whole platform sprintf (Query,"SELECT COUNT(*),SUM(forum_post.NumNotif)" " FROM forum_thread,forum_post " diff --git a/swad_forum.h b/swad_forum.h index c1df7e9c3..63c8db3c6 100644 --- a/swad_forum.h +++ b/swad_forum.h @@ -128,12 +128,12 @@ void For_SetForumName (For_ForumType_t ForumType, unsigned For_GetNumThrsWithNewPstsInForum (For_ForumType_t ForumType,unsigned NumThreads); void For_ShowForumThrs (void); unsigned For_GetNumTotalForumsOfType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod); + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod); unsigned For_GetNumTotalThrsInForumsOfType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod); + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod); unsigned For_GetNumThrsInForum (For_ForumType_t ForumType); unsigned For_GetNumTotalPstsInForumsOfType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod, + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod, unsigned *NumUsrsToBeNotifiedByEMail); unsigned For_GetNumPstsInForum (For_ForumType_t ForumType); void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],struct Pagination *PaginationThrs); diff --git a/swad_statistic.c b/swad_statistic.c index 356eb0d61..cd68cc4d5 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -150,10 +150,10 @@ static void Sta_GetAndShowMsgsStats (void); static void Sta_GetAndShowForumStats (void); static void Sta_ShowStatOfAForumType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod, + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod, struct Sta_StatsForum *StatsForum); static void Sta_WriteForumTitleAndStats (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod, + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod, const char *Icon,struct Sta_StatsForum *StatsForum, const char *ForumName1,const char *ForumName2); static void Sta_WriteForumTotalStats (struct Sta_StatsForum *StatsForum); @@ -5977,46 +5977,56 @@ static void Sta_GetAndShowForumStats (void) switch (Gbl.Scope.Current) { case Sco_SCOPE_SYS: - Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_USRS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_TCHS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_SWAD_USRS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_SWAD_TCHS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,-1L,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_USRS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_GLOBAL_TCHS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_SWAD_USRS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_SWAD_TCHS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,-1L,-1L,-1L,-1L,-1L,&StatsForum); + break; + case Sco_SCOPE_CTY: + Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS ,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS ,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS ,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,Gbl.CurrentCty.Cty.CtyCod,-1L,-1L,-1L,-1L,&StatsForum); break; case Sco_SCOPE_INS: - Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_USRS,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_INSTITUTION_TCHS,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS ,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS ,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS ,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS ,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS ,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS ,-1L,Gbl.CurrentIns.Ins.InsCod,-1L,-1L,-1L,&StatsForum); break; case Sco_SCOPE_CTR: - Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_USRS,-1L,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_CENTRE_TCHS,-1L,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS,-1L,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,Gbl.CurrentCtr.Ctr.CtrCod,-1L,-1L,&StatsForum); break; case Sco_SCOPE_DEG: - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_USRS,-1L,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_DEGREE_TCHS,-1L,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,-1L,Gbl.CurrentDeg.Deg.DegCod,-1L,&StatsForum); break; case Sco_SCOPE_CRS: - Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum); - Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_USRS,-1L,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum); + Sta_ShowStatOfAForumType (For_FORUM_COURSE_TCHS,-1L,-1L,-1L,-1L,Gbl.CurrentCrs.Crs.CrsCod,&StatsForum); break; default: Lay_ShowErrorAndExit ("Wrong scope."); @@ -6034,7 +6044,7 @@ static void Sta_GetAndShowForumStats (void) /*****************************************************************************/ static void Sta_ShowStatOfAForumType (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod, + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod, struct Sta_StatsForum *StatsForum) { extern const char *Txt_Courses; @@ -6047,62 +6057,62 @@ static void Sta_ShowStatOfAForumType (For_ForumType_t ForumType, switch (ForumType) { case For_FORUM_COURSE_USRS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "coursesdegree16x16.gif",StatsForum, Txt_Courses,""); break; case For_FORUM_COURSE_TCHS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "coursesdegree16x16.gif",StatsForum, Txt_Courses,Txt_only_teachers); break; case For_FORUM_DEGREE_USRS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "grouptypes16x16.gif",StatsForum, Txt_Degrees,""); break; case For_FORUM_DEGREE_TCHS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "grouptypes16x16.gif",StatsForum, Txt_Degrees,Txt_only_teachers); break; case For_FORUM_CENTRE_USRS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "house16x16.gif",StatsForum, Txt_Centres,""); break; case For_FORUM_CENTRE_TCHS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "house16x16.gif",StatsForum, Txt_Centres,Txt_only_teachers); break; case For_FORUM_INSTITUTION_USRS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "institution16x16.gif",StatsForum, Txt_Institutions,""); break; case For_FORUM_INSTITUTION_TCHS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "institution16x16.gif",StatsForum, Txt_Institutions,Txt_only_teachers); break; case For_FORUM_GLOBAL_USRS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "ballon16x16.gif",StatsForum, Txt_General,""); break; case For_FORUM_GLOBAL_TCHS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "ballon16x16.gif",StatsForum, Txt_General,Txt_only_teachers); break; case For_FORUM_SWAD_USRS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "swad16x16.gif",StatsForum, Cfg_PLATFORM_SHORT_NAME,""); break; case For_FORUM_SWAD_TCHS: - Sta_WriteForumTitleAndStats (ForumType,InsCod,CtrCod,DegCod,CrsCod, + Sta_WriteForumTitleAndStats (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod, "swad16x16.gif",StatsForum, Cfg_PLATFORM_SHORT_NAME,Txt_only_teachers); break; @@ -6114,7 +6124,7 @@ static void Sta_ShowStatOfAForumType (For_ForumType_t ForumType, /*****************************************************************************/ static void Sta_WriteForumTitleAndStats (For_ForumType_t ForumType, - long InsCod,long CtrCod,long DegCod,long CrsCod, + long CtyCod,long InsCod,long CtrCod,long DegCod,long CrsCod, const char *Icon,struct Sta_StatsForum *StatsForum, const char *ForumName1,const char *ForumName2) { @@ -6127,9 +6137,9 @@ static void Sta_WriteForumTitleAndStats (For_ForumType_t ForumType, float NumPostsPerForum; /***** Compute number of forums, number of threads and number of posts *****/ - NumForums = For_GetNumTotalForumsOfType (ForumType,InsCod,CtrCod,DegCod,CrsCod); - NumThreads = For_GetNumTotalThrsInForumsOfType (ForumType,InsCod,CtrCod,DegCod,CrsCod); - NumPosts = For_GetNumTotalPstsInForumsOfType (ForumType,InsCod,CtrCod,DegCod,CrsCod,&NumUsrsToBeNotifiedByEMail); + NumForums = For_GetNumTotalForumsOfType (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod); + NumThreads = For_GetNumTotalThrsInForumsOfType (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod); + NumPosts = For_GetNumTotalPstsInForumsOfType (ForumType,CtyCod,InsCod,CtrCod,DegCod,CrsCod,&NumUsrsToBeNotifiedByEMail); /***** Compute number of threads per forum, number of posts per forum and number of posts per thread *****/ NumThrsPerForum = (NumForums ? (float) NumThreads / (float) NumForums :