From 9a9b8fb6e9a9253feea72573c202ddd18f5b9aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 9 Jun 2016 18:04:18 +0200 Subject: [PATCH] Version 15.222.4 --- swad_changelog.h | 4 ++-- swad_indicator.c | 45 +++++++++++++++++++-------------------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index a496cd6d9..1aad0d5d0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -126,7 +126,6 @@ // TODO: Request confirmation to remove user's photo // TODO: FIX BUG: A teacher uploads a document in course documents zone, then he/she unregister from course, then he/she search for his/her documents, a document is shown in results but he/she can not view it // TODO: Do not show users without name in users to follow -// TODO: Store number of indicators of a course in database table courses. When should this number be updated? // TODO: Modify WS function getUsers changing: userRole to indicate all users, and a new parameter filter (search string (name, @nickname, mail)) to restring number of users // TODO: Add a new WS function to count the nunmber of users to return in call to function getUsers @@ -135,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.222.3 (2016-06-09)" +#define Log_PLATFORM_VERSION "SWAD 15.222.4 (2016-06-09)" #define CSS_FILE "swad15.218.css" #define JS_FILE "swad15.216.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 15.222.4: Jun 09, 2016 Code refactoring in indicators. (202208 lines) Version 15.222.3: Jun 09, 2016 Indicators form is sended automatically when any parameter changes. (202214 lines) Version 15.222.2: Jun 09, 2016 Code refactoring in indicators. (202233 lines) Version 15.222.1: Jun 09, 2016 Optimization in number of indicators. (202230 lines) diff --git a/swad_indicator.c b/swad_indicator.c index 19079f544..a6db119a8 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -60,6 +60,7 @@ typedef enum /***************************** Internal prototypes ***************************/ /*****************************************************************************/ +static void Ind_GetParamsIndicators (void); static void Ind_GetParamNumIndicators (void); static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res); static bool Ind_GetIfShowBigList (unsigned NumCrss); @@ -101,25 +102,7 @@ void Ind_ReqIndicatorsCourses (void) unsigned Ind; /***** Get parameters *****/ - /* Get scope */ - Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS | - 1 << Sco_SCOPE_CTY | - 1 << Sco_SCOPE_INS | - 1 << Sco_SCOPE_CTR | - 1 << Sco_SCOPE_DEG | - 1 << Sco_SCOPE_CRS; - Gbl.Scope.Default = Sco_SCOPE_CRS; - Sco_GetScope (); - - /* Get degree type code */ - Gbl.Stat.DegTypCod = (Gbl.Scope.Current == Sco_SCOPE_SYS) ? DT_GetParamOtherDegTypCod () : - -1L; - - /* Get department code */ - Gbl.Stat.DptCod = Dpt_GetParamDptCod (); - - /* Get number of indicators */ - Ind_GetParamNumIndicators (); + Ind_GetParamsIndicators (); /***** Start frame *****/ Lay_StartRoundFrame (NULL,Txt_Indicators_of_courses,NULL); @@ -221,16 +204,12 @@ void Ind_ReqIndicatorsCourses (void) } /*****************************************************************************/ -/*********************** Show statistics of courses **************************/ +/************* Get parameters related to indicators of courses ***************/ /*****************************************************************************/ -void Ind_ShowIndicatorsCourses (void) +static void Ind_GetParamsIndicators (void) { - MYSQL_RES *mysql_res; - unsigned NumCrss; - unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS]; - - /***** Get users range for statistics of courses *****/ + /***** Get scope *****/ Gbl.Scope.Allowed = 1 << Sco_SCOPE_SYS | 1 << Sco_SCOPE_CTY | 1 << Sco_SCOPE_INS | @@ -249,6 +228,20 @@ void Ind_ShowIndicatorsCourses (void) /***** Get number of indicators *****/ Ind_GetParamNumIndicators (); + } + +/*****************************************************************************/ +/*********************** Show statistics of courses **************************/ +/*****************************************************************************/ + +void Ind_ShowIndicatorsCourses (void) + { + MYSQL_RES *mysql_res; + unsigned NumCrss; + unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS]; + + /***** Get parameters *****/ + Ind_GetParamsIndicators (); /***** Get courses from database *****/ NumCrss = Ind_GetTableOfCourses (&mysql_res);