From eac87bfc3b8e76412b756b266d7ce543318263e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 4 Jun 2016 13:07:33 +0200 Subject: [PATCH] Version 15.218.1 --- swad_changelog.h | 6 +++--- swad_course.c | 56 ++++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 6df8f70e2..df79b9095 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -128,20 +128,20 @@ // TODO: FIX BUG: In Statistics > Indicators, if we select only 5 indicators, the message "The list is too big..." is shown. // TODO: FIX BUG: A teacher uploads a document in course documents zone, then he/she unregister from course, the he/she search for his/her documents, a document is shown in results but he/she can not view it // TODO: FIX BUG: Txt_Save_file_properties does not have sense in briefcase, because nothing to save (license should be editable in briefcase?) -// TODO: In listing of courses, teachers column is before than students column. In edition of courses, students column is before teachers column. -// TODO: Check value returned by setlocale in all calls +// TODO: Check value returned by setlocale in all calls. /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.218 (2016-06-03)" +#define Log_PLATFORM_VERSION "SWAD 15.218.1 (2016-06-04)" #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.218.1: Jun 04, 2016 Change in listing of courses. (201934 lines) Version 15.218: Jun 03, 2016 New module swad_MFU for most frequently used actions. Change in layout of most frequent actions. (201934 lines) Version 15.217.2: Jun 03, 2016 Fixed bug in copy-paste from briefcase to another file browser. (201827 lines) diff --git a/swad_course.c b/swad_course.c index 12fd57cc3..880a6073e 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1143,7 +1143,7 @@ static void Crs_ListCourses (void) Year++) if (Crs_ListCoursesOfAYearForSeeing (Year)) // If this year has courses ==> Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; // ==> change color for the next year - Crs_ListCoursesOfAYearForSeeing (0); // Courses without a year selected + Crs_ListCoursesOfAYearForSeeing (0); // Courses without a year selected /***** End table *****/ fprintf (Gbl.F.Out,""); @@ -1464,18 +1464,18 @@ static void Crs_ListCoursesForEdition (void) fprintf (Gbl.F.Out,"%s",Crs->FullName); fprintf (Gbl.F.Out,""); - /* Current number of students in this course */ - fprintf (Gbl.F.Out,"" - "%u" - "", - Crs->NumStds); - /* Current number of teachers in this course */ fprintf (Gbl.F.Out,"" "%u" "", Crs->NumTchs); + /* Current number of students in this course */ + fprintf (Gbl.F.Out,"" + "%u" + "", + Crs->NumStds); + /* Course status */ StatusTxt = Crs_GetStatusTxtFromStatusBits (Crs->Status); fprintf (Gbl.F.Out,""); @@ -1663,12 +1663,12 @@ static void Crs_PutFormToCreateCourse (void) "", Crs_MAX_LENGTH_COURSE_FULL_NAME,Crs->FullName); - /***** Current number of students in this course *****/ + /***** Current number of teachers in this course *****/ fprintf (Gbl.F.Out,"" "0" ""); - /***** Current number of teachers in this course *****/ + /***** Current number of students in this course *****/ fprintf (Gbl.F.Out,"" "0" ""); @@ -1705,8 +1705,8 @@ static void Crs_PutHeadCoursesForSeeing (void) extern const char *Txt_Institutional_BR_code; extern const char *Txt_Year_OF_A_DEGREE; extern const char *Txt_Course; - extern const char *Txt_Students_ABBREVIATION; extern const char *Txt_Teachers_ABBREVIATION; + extern const char *Txt_Students_ABBREVIATION; extern const char *Txt_Status; fprintf (Gbl.F.Out,"" @@ -1751,8 +1751,8 @@ static void Crs_PutHeadCoursesForEdition (void) extern const char *Txt_Year_OF_A_DEGREE; extern const char *Txt_Short_name_of_the_course; extern const char *Txt_Full_name_of_the_course; - extern const char *Txt_Students_ABBREVIATION; extern const char *Txt_Teachers_ABBREVIATION; + extern const char *Txt_Students_ABBREVIATION; extern const char *Txt_Status; extern const char *Txt_Requester; @@ -1795,8 +1795,8 @@ static void Crs_PutHeadCoursesForEdition (void) Txt_Year_OF_A_DEGREE, Txt_Short_name_of_the_course, Txt_Full_name_of_the_course, - Txt_Students_ABBREVIATION, Txt_Teachers_ABBREVIATION, + Txt_Students_ABBREVIATION, Txt_Status, Txt_Requester); } @@ -2079,12 +2079,12 @@ static void Crs_GetDataOfCourseFromRow (struct Course *Crs,MYSQL_ROW row) strncpy (Crs->FullName,row[7],Crs_MAX_LENGTH_COURSE_FULL_NAME); Crs->FullName[Crs_MAX_LENGTH_COURSE_FULL_NAME] = '\0'; - /***** Get number of students *****/ - Crs->NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,Crs->CrsCod); - /***** Get number of teachers *****/ Crs->NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,Crs->CrsCod); + /***** Get number of students *****/ + Crs->NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,Crs->CrsCod); + Crs->NumUsrs = Crs->NumStds + Crs->NumTchs; } @@ -2879,8 +2879,8 @@ void Crs_GetAndWriteCrssOfAUsr (long UsrCod,Rol_Role_t Role) extern const char *Txt_Degree; extern const char *Txt_Year_OF_A_DEGREE; extern const char *Txt_Course; - extern const char *Txt_Students_ABBREVIATION; extern const char *Txt_Teachers_ABBREVIATION; + extern const char *Txt_Students_ABBREVIATION; char Query[1024]; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -2925,8 +2925,8 @@ void Crs_GetAndWriteCrssOfAUsr (long UsrCod,Rol_Role_t Role) Txt_Degree, Txt_Year_OF_A_DEGREE, Txt_Course, - Txt_Students_ABBREVIATION, - Txt_Teachers_ABBREVIATION); + Txt_Teachers_ABBREVIATION, + Txt_Students_ABBREVIATION); /* Write courses */ for (NumCrs = 1; @@ -3036,8 +3036,8 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA extern const char *Txt_YEAR_OF_DEGREE[1+Deg_MAX_YEARS_PER_DEGREE]; struct Degree Deg; long CrsCod; - unsigned NumStds; unsigned NumTchs; + unsigned NumStds; const char *Style; const char *StyleNoBR; const char *BgColor; @@ -3063,10 +3063,10 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA if ((CrsCod = Str_ConvertStrCodToLongCod (row[1])) < 0) Lay_ShowErrorAndExit ("Wrong code of course."); - /***** Get number of students and teachers in this course *****/ - NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,CrsCod); + /***** Get number of teachers and students in this course *****/ NumTchs = Usr_GetNumUsrsInCrs (Rol_TEACHER,CrsCod); - if (NumStds + NumTchs) + NumStds = Usr_GetNumUsrsInCrs (Rol_STUDENT,CrsCod); + if (NumTchs + NumStds) { Style = "DAT_N"; StyleNoBR = "DAT_NOBR_N"; @@ -3139,12 +3139,6 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA Act_FormEnd (); fprintf (Gbl.F.Out,""); - /***** Write number of students in course *****/ - fprintf (Gbl.F.Out,"" - "%u" - "", - Style,BgColor,NumStds); - /***** Write number of teachers in course *****/ fprintf (Gbl.F.Out,"" "%u" @@ -3152,6 +3146,12 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA "", Style,BgColor,NumTchs); + /***** Write number of students in course *****/ + fprintf (Gbl.F.Out,"" + "%u" + "", + Style,BgColor,NumStds); + Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; }