From faa0d1740f39fe51cf276f91968a60e8970dd348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 8 Jun 2016 13:19:17 +0200 Subject: [PATCH] Version 15.220 --- swad_changelog.h | 8 +++- swad_indicator.c | 104 ++++++++++++++++++++++++----------------------- 2 files changed, 59 insertions(+), 53 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 6422553fe..ccd4337ab 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -125,19 +125,23 @@ // TODO: Messages in msg_content_deleted older than a certain time should be deleted to ensure the protection of personal data // 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: Highlight row with number of indicators selected in blue background, as part of the form, instead of current field to select number of indicators +// TODO: Do not show users without name in users to follow + +// 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 /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.219.1 (2016-06-05)" +#define Log_PLATFORM_VERSION "SWAD 15.220 (2016-06-08)" #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.220: Jun 08, 2016 Number of indicators now appears inside form. (202029 lines) Version 15.219.1: Jun 05, 2016 Highlighted row with number of indicators selected. (202023 lines) Version 15.219: Jun 04, 2016 Changes in listing of indicators of courses. (202001 lines) Version 15.218.5: Jun 04, 2016 Fix bug in social notes, reported by Raymon Moreno Colina. (201940 lines) diff --git a/swad_indicator.c b/swad_indicator.c index 71908654f..50bb84b11 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -68,7 +68,7 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss); static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS], unsigned NumCrss,MYSQL_RES *mysql_res); static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS], - unsigned NumCrss); + unsigned NumCrss,bool PutForm); static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout, unsigned NumCrss,MYSQL_RES *mysql_res); static unsigned long Ind_GetNumFilesOfCrsFileZoneFromDB (Brw_FileBrowser_t FileBrowser,long CrsCod); @@ -86,12 +86,10 @@ void Ind_ReqIndicatorsCourses (void) extern const char *Txt_only_if_the_scope_is_X; extern const char *Txt_Department; extern const char *Txt_No_of_indicators; - extern const char *Txt_Any_number; extern const char *Txt_Update_indicators; extern const char *Txt_Indicators_of_courses; extern const char *Txt_Show_more_details; MYSQL_RES *mysql_res; - unsigned Ind; unsigned NumCrss; unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS]; unsigned NumCrssToList; @@ -149,33 +147,32 @@ void Ind_ReqIndicatorsCourses (void) /* Show only courses with a number of indicators */ Gbl.Stat.NumIndicators = Ind_GetParamNumIndicators (); + + /***** Get courses from database *****/ + /* The result will contain courses with any number of indicators + If Gbl.Stat.NumIndicators < 0 ==> all courses in result will be listed + If Gbl.Stat.NumIndicators >= 0 ==> only those courses in result + with Gbl.Stat.NumIndicators set to yes + will be listed */ + NumCrss = Ind_GetTableOfCourses (&mysql_res); + + /***** Get vector with numbers of courses with 0, 1, 2... indicators set to yes *****/ + Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res); + + /***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/ fprintf (Gbl.F.Out,"" - "" + "" "" "" - "" - "" - "" + Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,true); + fprintf (Gbl.F.Out,"" ""); /* Send button */ fprintf (Gbl.F.Out,"" - ""); + ""); Act_LinkFormSubmitAnimated (Txt_Update_indicators,The_ClassFormBold[Gbl.Prefs.Theme]); Lay_PutCalculateIconWithText (Txt_Update_indicators,Txt_Update_indicators); fprintf (Gbl.F.Out,"" @@ -185,28 +182,13 @@ void Ind_ReqIndicatorsCourses (void) /* End form */ Act_FormEnd (); - /***** Get courses from database *****/ - // The result will contain courses with any number of indicators - // If Gbl.Stat.NumIndicators < 0 ==> all courses in result will be listed - // If Gbl.Stat.NumIndicators >= 0 ==> only those courses in result - // with Gbl.Stat.NumIndicators set to yes - // will be listed - NumCrss = Ind_GetTableOfCourses (&mysql_res); - - /***** Get vector with numbers of courses with 0, 1, 2... indicators set to yes *****/ - Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res); - - /***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/ - Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss); - + /***** Show the stats of courses *****/ if (Gbl.Stat.NumIndicators < 0) // -1 means any number of indicators NumCrssToList = NumCrss; else NumCrssToList = NumCrssWithIndicatorYes[(unsigned) Gbl.Stat.NumIndicators]; - if (Ind_GetIfShowBigList (NumCrssToList)) { - /***** Show the stats of courses *****/ /* Show table */ Ind_ShowTableOfCoursesWithIndicators (Ind_INDICATORS_BRIEF,NumCrss,mysql_res); @@ -264,7 +246,7 @@ void Ind_ShowIndicatorsCourses (void) Ind_GetNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,mysql_res); /***** Show table with numbers of courses with 0, 1, 2... indicators set to yes *****/ - Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss); + Ind_ShowNumCoursesWithIndicators (NumCrssWithIndicatorYes,NumCrss,false); /***** Show the stats of courses *****/ Ind_ShowTableOfCoursesWithIndicators (Ind_INDICATORS_FULL,NumCrss,mysql_res); @@ -560,11 +542,11 @@ static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+ /*****************************************************************************/ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1+Ind_NUM_INDICATORS], - unsigned NumCrss) + unsigned NumCrss,bool PutForm) { extern const char *Txt_No_of_indicators; extern const char *Txt_Courses; - extern const char *Txt_Total; + extern const char *Txt_Any_number; unsigned Ind; const char *Class; const char *ClassNormal = "DAT RIGHT_MIDDLE"; @@ -573,10 +555,11 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 const char *ClassTotalHighlight = "DAT_N_LINE_TOP RIGHT_MIDDLE LIGHT_BLUE"; /***** Write number of courses with each number of indicators valid *****/ - fprintf (Gbl.F.Out,"" - "" - "
" + fprintf (Gbl.F.Out,"" + ""); + if (PutForm) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" "" - ""); + if (PutForm) + { + fprintf (Gbl.F.Out,""); + } + fprintf (Gbl.F.Out,"" "" - ""); + if (PutForm) + { + fprintf (Gbl.F.Out,""); + } + fprintf (Gbl.F.Out,"" "" "
" "%s" "" @@ -591,8 +574,18 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 { Class = (Ind == Gbl.Stat.NumIndicators) ? ClassHighlight : ClassNormal; - fprintf (Gbl.F.Out,"
" + fprintf (Gbl.F.Out,"
" + "" + "" "%u" "" @@ -614,8 +607,18 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 /***** Write total of courses *****/ Class = (Gbl.Stat.NumIndicators < 0) ? ClassTotalHighlight : ClassTotalNormal; - fprintf (Gbl.F.Out,"
" + fprintf (Gbl.F.Out,"
" + "" + "" "%s" "" @@ -627,7 +630,7 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 "
", Class, - Txt_Total, + Txt_Any_number, Class, NumCrss, Class, @@ -669,7 +672,6 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat extern const char *Txt_INFO_SRC_SHORT_TEXT[Inf_NUM_INFO_SOURCES]; extern const char *Txt_No_of_indicators; extern const char *Txt_Courses; - extern const char *Txt_Total; MYSQL_ROW row; unsigned NumCrs; long CrsCod;