diff --git a/swad_centre.c b/swad_centre.c index cc1d5a188..ea509e38b 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -707,24 +707,6 @@ static void Ctr_ListOneCentreForSeeing (struct Centre *Ctr,unsigned NumCtr) TxtClassNormal,BgColor, Ctr->NumCrss); - /***** Number of teachers in courses of this centre *****/ - /* - fprintf (Gbl.F.Out,"" - "%u" - "", - TxtClassNormal,BgColor, - Ctr->NumTchs); - */ - - /***** Number of students in courses of this centre *****/ - /* - fprintf (Gbl.F.Out,"" - "%u" - "", - TxtClassNormal,BgColor, - Ctr->NumStds); - */ - /***** Number of users in courses of this centre *****/ fprintf (Gbl.F.Out,"" "%u" @@ -909,9 +891,7 @@ void Ctr_GetListCentres (long InsCod) Ctr->NumCrss = Crs_GetNumCrssInCtr (Ctr->CtrCod); /* Get number of users in courses of this centre */ - Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs - // Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod); - // Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod); + Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users" } } else @@ -941,11 +921,8 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr) Ctr->FullName[0] = '\0'; Ctr->WWW[0] = '\0'; Ctr->NumUsrsWhoClaimToBelongToCtr = 0; - Ctr->NumDegs = 0; - Ctr->NumCrss = 0; + Ctr->NumDegs = Ctr->NumCrss = 0; Ctr->NumUsrs = 0; - // Ctr->NumTchs = 0; - // Ctr->NumStds = 0; /***** Check if centre code is correct *****/ if (Ctr->CtrCod > 0) @@ -1008,9 +985,7 @@ bool Ctr_GetDataOfCentreByCod (struct Centre *Ctr) Ctr->NumCrss = Crs_GetNumCrssInCtr (Ctr->CtrCod); /* Get number of users in courses of this centre */ - Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs - // Ctr->NumTchs = Usr_GetNumUsrsInCrssOfCtr (Rol_TEACHER,Ctr->CtrCod); - // Ctr->NumStds = Usr_GetNumUsrsInCrssOfCtr (Rol_STUDENT,Ctr->CtrCod); + Ctr->NumUsrs = Usr_GetNumUsrsInCrssOfCtr (Rol_UNKNOWN,Ctr->CtrCod); // Here Rol_UNKNOWN means "all users" /* Set return value */ CtrFound = true; @@ -1402,22 +1377,6 @@ static void Ctr_ListCentresForEdition (void) } fprintf (Gbl.F.Out,""); - /* Number of teachers */ - /* - fprintf (Gbl.F.Out,"" - "%u" - "", - Ctr->NumTchs); - */ - - /* Number of degrees */ - /* - fprintf (Gbl.F.Out,"" - "%u" - "", - Ctr->NumDegs); - */ - /* Centre status */ StatusTxt = Ctr_GetStatusTxtFromStatusBits (Ctr->Status); fprintf (Gbl.F.Out,""); @@ -2234,12 +2193,6 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable) "" "%s" "" - // "" - // "%s" - // "" - // "" - // "%s" - // "" "" "%s+
%s" "" @@ -2250,8 +2203,6 @@ static void Ctr_PutHeadCentresForSeeing (bool OrderSelectable) Txt_Place, Txt_Degrees_ABBREVIATION, Txt_Courses_ABBREVIATION, - // Txt_Teachers_ABBREVIATION, - // Txt_Students_ABBREVIATION, Txt_Teachers_ABBREVIATION, Txt_Students_ABBREVIATION, Txt_Status); diff --git a/swad_centre.h b/swad_centre.h index 1b4acfdd0..9665b0c99 100644 --- a/swad_centre.h +++ b/swad_centre.h @@ -71,8 +71,6 @@ struct Centre unsigned NumDegs; // Number of degrees in this centre unsigned NumCrss; // Number of courses in this centre unsigned NumUsrs; // Number of users in courses of this centre - // unsigned NumTchs; // Number of teachers in courses of this centre - // unsigned NumStds; // Number of students in courses of this centre }; typedef enum diff --git a/swad_changelog.h b/swad_changelog.h index e9719a7e9..b8d6e4034 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -120,12 +120,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.66 (2015/12/14)" +#define Log_PLATFORM_VERSION "SWAD 15.66.1 (2015/12/14)" #define CSS_FILE "swad15.65.1.css" // 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.66.1: Dec 14, 2015 Removed unused code related to list of countries, institutions and centres by reasons of speed. (186966 lines) Version 15.66: Dec 14, 2015 Number of teachers and number of students removed from list of countries, institutions and centres by reasons of speed. (187057 lines) Version 15.65.1: Dec 14, 2015 Changes in layout of profile. (187031 lines) Version 15.65: Dec 13, 2015 Change in layout of contextual links. (187009 lines) diff --git a/swad_country.c b/swad_country.c index 977b369ba..9fa64fc07 100644 --- a/swad_country.c +++ b/swad_country.c @@ -587,12 +587,6 @@ void Cty_ListCountries2 (void) "" "%u" "" - // "" - // "%u" - // "" - // "" - // "%u" - // "" "" "%u" "" @@ -602,8 +596,6 @@ void Cty_ListCountries2 (void) BgColor,Gbl.Ctys.Lst[NumCty].NumCtrs, BgColor,Gbl.Ctys.Lst[NumCty].NumDegs, BgColor,Gbl.Ctys.Lst[NumCty].NumCrss, - // BgColor,Gbl.Ctys.Lst[NumCty].NumTchs, - // BgColor,Gbl.Ctys.Lst[NumCty].NumStds, BgColor,Gbl.Ctys.Lst[NumCty].NumUsrs); Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; } @@ -675,12 +667,6 @@ void Cty_ListCountries2 (void) "" "%u" "" - // "" - // "0" - // "" - // "" - // "0" - // "" "" "0" "" @@ -1020,7 +1006,6 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData) } Cty->NumUsrsWhoClaimToBelongToCty = 0; Cty->NumInss = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0; - // Cty->NumUsrs = Cty->NumTchs = Cty->NumStds = 0; Cty->NumUsrs = 0; /* Get the name of the country in current language */ @@ -1053,9 +1038,7 @@ void Cty_GetListCountries (Cty_GetExtraData_t GetExtraData) Cty->NumCrss = Crs_GetNumCrssInCty (Cty->CtyCod); /* Get number of users in courses of this country */ - Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs - // Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod); - // Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod); + Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users" break; } } @@ -1181,10 +1164,8 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD Cty->WWW[Lan][0] = '\0'; } Cty->NumUsrsWhoClaimToBelongToCty = 0; + Cty->NumInss = Cty->NumCtrs = Cty->NumDegs = Cty->NumCrss = 0; Cty->NumUsrs = 0; - // Cty->NumStds = 0; - // Cty->NumTchs = 0; - Cty->NumInss = 0; /***** Check if country code is correct *****/ if (Cty->CtyCod == 0) @@ -1280,9 +1261,7 @@ bool Cty_GetDataOfCountryByCod (struct Country *Cty,Cty_GetExtraData_t GetExtraD Cty->NumUsrsWhoClaimToBelongToCty = 0; /* Get number of user in courses of this institution */ - Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs - // Cty->NumStds = Usr_GetNumUsrsInCrssOfCty (Rol_STUDENT,Cty->CtyCod); - // Cty->NumTchs = Usr_GetNumUsrsInCrssOfCty (Rol_TEACHER,Cty->CtyCod); + Cty->NumUsrs = Usr_GetNumUsrsInCrssOfCty (Rol_UNKNOWN,Cty->CtyCod); // Here Rol_UNKNOWN means "all users" /* Get number of institutions in this country */ Cty->NumInss = Ins_GetNumInssInCty (Cty->CtyCod); diff --git a/swad_country.h b/swad_country.h index dff872b30..303add3ad 100644 --- a/swad_country.h +++ b/swad_country.h @@ -53,8 +53,6 @@ struct Country unsigned NumDegs; unsigned NumCrss; unsigned NumUsrs; // Number of users in courses of the institution - // unsigned NumStds; // Number of students in courses of the institution - // unsigned NumTchs; // Number of teachers in courses of the institution }; typedef enum diff --git a/swad_course.c b/swad_course.c index 4355d96e5..d6e65af97 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1051,8 +1051,8 @@ static void Crs_GetListCoursesInDegree (Crs_WhatCourses_t WhatCourses) if (NumRows) // Courses found... { - // NumRows should be equal to Deg->NumCourses - Gbl.CurrentDeg.Deg.NumCourses = (unsigned) NumRows; + // NumRows should be equal to Deg->NumCrss + Gbl.CurrentDeg.Deg.NumCrss = (unsigned) NumRows; /***** Create list with courses in degree *****/ if ((Gbl.CurrentDeg.Deg.LstCrss = (struct Course *) calloc (NumRows,sizeof (struct Course))) == NULL) @@ -1060,7 +1060,7 @@ static void Crs_GetListCoursesInDegree (Crs_WhatCourses_t WhatCourses) /***** Get the courses in degree *****/ for (NumCrs = 0; - NumCrs < Gbl.CurrentDeg.Deg.NumCourses; + NumCrs < Gbl.CurrentDeg.Deg.NumCrss; NumCrs++) { Crs = &(Gbl.CurrentDeg.Deg.LstCrss[NumCrs]); @@ -1071,7 +1071,7 @@ static void Crs_GetListCoursesInDegree (Crs_WhatCourses_t WhatCourses) } } else - Gbl.CurrentDeg.Deg.NumCourses = 0; + Gbl.CurrentDeg.Deg.NumCrss = 0; /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); @@ -1088,7 +1088,7 @@ void Crs_FreeListCoursesInDegree (struct Degree *Deg) /***** Free memory used by the list of courses in degree *****/ free ((void *) Deg->LstCrss); Deg->LstCrss = NULL; - Deg->NumCourses = 0; + Deg->NumCrss = 0; } } @@ -1186,7 +1186,7 @@ static void Crs_ListCourses (void) extern const char *Txt_Create_course; bool ICanEdit = (Gbl.Usrs.Me.LoggedRole >= Rol__GUEST_); - if (Gbl.CurrentDeg.Deg.NumCourses) // There are courses in the current degree + if (Gbl.CurrentDeg.Deg.NumCrss) // There are courses in the current degree { if (ICanEdit) Lay_PutFormToEdit (ActEdiCrs); @@ -1210,7 +1210,7 @@ static void Crs_ListCourses (void) static void Crs_EditCourses (void) { - if (Gbl.CurrentDeg.Deg.NumCourses) + if (Gbl.CurrentDeg.Deg.NumCrss) /***** Put link (form) to view courses *****/ Lay_PutFormToView (ActSeeCrs); @@ -1218,7 +1218,7 @@ static void Crs_EditCourses (void) Crs_PutFormToCreateCourse (); /***** Forms to edit current courses *****/ - if (Gbl.CurrentDeg.Deg.NumCourses) + if (Gbl.CurrentDeg.Deg.NumCrss) Crs_ListCoursesForEdition (); } @@ -1271,7 +1271,7 @@ static bool Crs_ListCoursesOfAYearForSeeing (unsigned Year) /***** Write all the courses of this year *****/ for (NumCrs = 0; - NumCrs < Gbl.CurrentDeg.Deg.NumCourses; + NumCrs < Gbl.CurrentDeg.Deg.NumCrss; NumCrs++) { Crs = &(Gbl.CurrentDeg.Deg.LstCrss[NumCrs]); @@ -1390,7 +1390,7 @@ static void Crs_ListCoursesForEdition (void) Year <= Deg_MAX_YEARS_PER_DEGREE; Year++) for (NumCrs = 0; - NumCrs < Gbl.CurrentDeg.Deg.NumCourses; + NumCrs < Gbl.CurrentDeg.Deg.NumCrss; NumCrs++) { Crs = &(Gbl.CurrentDeg.Deg.LstCrss[NumCrs]); diff --git a/swad_degree.c b/swad_degree.c index 63984c61d..fe5149886 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -447,7 +447,7 @@ static void Deg_Configuration (bool PrintView) "" "", The_ClassForm[Gbl.Prefs.Theme], - Txt_Courses,Gbl.CurrentDeg.Deg.NumCourses); + Txt_Courses,Gbl.CurrentDeg.Deg.NumCrss); /***** Number of teachers *****/ fprintf (Gbl.F.Out,"" @@ -1313,11 +1313,11 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg) "", BgColor, Gbl.Prefs.IconsURL, - Deg->NumCourses ? "ok_green" : + Deg->NumCrss ? "ok_green" : "tr", - Deg->NumCourses ? Txt_DEGREE_With_courses : + Deg->NumCrss ? Txt_DEGREE_With_courses : Txt_DEGREE_Without_courses, - Deg->NumCourses ? Txt_DEGREE_With_courses : + Deg->NumCrss ? Txt_DEGREE_With_courses : Txt_DEGREE_Without_courses); /***** Number of degree in this list *****/ @@ -1355,7 +1355,7 @@ static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg) fprintf (Gbl.F.Out,"" "%u" "", - TxtClassNormal,BgColor,Deg->NumCourses); + TxtClassNormal,BgColor,Deg->NumCrss); /***** Degree status *****/ StatusTxt = Deg_GetStatusTxtFromStatusBits (Deg->Status); @@ -1410,7 +1410,7 @@ static void Deg_ListDegreesForEdition (void) /* Put icon to remove degree */ fprintf (Gbl.F.Out,"" ""); - if (Deg->NumCourses || // Degree has courses ==> deletion forbidden + if (Deg->NumCrss || // Degree has courses ==> deletion forbidden !ICanEdit) Lay_PutIconRemovalNotAllowed (); else @@ -1602,7 +1602,7 @@ static void Deg_ListDegreesForEdition (void) fprintf (Gbl.F.Out,"" "%u" "", - Deg->NumCourses); + Deg->NumCrss); /* Degree status */ StatusTxt = Deg_GetStatusTxtFromStatusBits (Deg->Status); @@ -2693,7 +2693,7 @@ void Deg_RemoveDegree (void) Deg_GetDataOfDegreeByCod (&Deg); /***** Check if this degree has courses *****/ - if (Deg.NumCourses) // Degree has courses ==> don't remove + if (Deg.NumCrss) // Degree has courses ==> don't remove Lay_ShowAlert (Lay_WARNING,Txt_To_remove_a_degree_you_must_first_remove_all_courses_in_the_degree); else // Degree has no courses ==> remove it { @@ -2863,7 +2863,7 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg) Deg->FirstYear = 0; Deg->LastYear = 0; Deg->WWW[0] = '\0'; - Deg->NumCourses = 0; + Deg->NumCrss = 0; Deg->LstCrss = NULL; return false; } @@ -2895,7 +2895,7 @@ bool Deg_GetDataOfDegreeByCod (struct Degree *Deg) Deg->FirstYear = 0; Deg->LastYear = 0; Deg->WWW[0] = '\0'; - Deg->NumCourses = 0; + Deg->NumCrss = 0; Deg->LstCrss = NULL; return false; } @@ -2947,7 +2947,7 @@ static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row) strcpy (Deg->WWW,row[9]); /***** Get number of courses *****/ - Deg->NumCourses = Crs_GetNumCrssInDeg (Deg->DegCod); + Deg->NumCrss = Crs_GetNumCrssInDeg (Deg->DegCod); } /*****************************************************************************/ diff --git a/swad_degree.h b/swad_degree.h index e9a5b2928..c6b47cdd3 100644 --- a/swad_degree.h +++ b/swad_degree.h @@ -79,7 +79,7 @@ struct Degree unsigned FirstYear; unsigned LastYear; char WWW[Cns_MAX_LENGTH_WWW+1]; - unsigned NumCourses; // Number of courses in the degree + unsigned NumCrss; // Number of courses in the degree struct Course *LstCrss; // List of courses in this degree }; struct DegreeType diff --git a/swad_global.c b/swad_global.c index 9e39a4c6b..1b72f3eed 100644 --- a/swad_global.c +++ b/swad_global.c @@ -244,7 +244,6 @@ void Gbl_InitializeGlobals (void) Gbl.Inss.EditingIns.ShortName[0] = '\0'; Gbl.Inss.EditingIns.FullName[0] = '\0'; Gbl.Inss.EditingIns.WWW[0] = '\0'; - // Gbl.Inss.EditingIns.NumStds = Gbl.Inss.EditingIns.NumTchs = Gbl.Inss.EditingIns.NumUsrs = Gbl.Inss.EditingIns.NumCtrs = Gbl.Inss.EditingIns.NumDpts = Gbl.Inss.EditingIns.NumDegs = 0; Gbl.Inss.EditingIns.NumUsrs = 0; @@ -310,7 +309,7 @@ void Gbl_InitializeGlobals (void) Gbl.Degs.EditingDeg.FirstYear = Gbl.Degs.EditingDeg.LastYear = 0; Gbl.Degs.EditingDeg.WWW[0] = '\0'; - Gbl.Degs.EditingDeg.NumCourses = 0; + Gbl.Degs.EditingDeg.NumCrss = 0; Gbl.Degs.EditingDeg.LstCrss = NULL; Gbl.Degs.EditingCrs.CrsCod = -1L; diff --git a/swad_institution.c b/swad_institution.c index f6218362f..d11bb4c8a 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -638,22 +638,6 @@ static void Ins_ListOneInstitutionForSeeing (struct Institution *Ins,unsigned Nu "", TxtClassNormal,BgColor,Ins->NumDpts); - /* Number of teachers in courses of this institution */ - /* - fprintf (Gbl.F.Out,"" - "%u" - "", - TxtClassNormal,BgColor,Ins->NumTchs); - */ - - /* Number of students in courses of this institution */ - /* - fprintf (Gbl.F.Out,"" - "%u" - "", - TxtClassNormal,BgColor,Ins->NumStds); - */ - /* Number of users in courses of this institution */ fprintf (Gbl.F.Out,"" "%u" @@ -897,7 +881,6 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData) Ins->NumUsrsWhoClaimToBelongToIns = 0; Ins->NumCtrs = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0; Ins->NumUsrs = 0; - // Ins->NumUsrs = Ins->NumTchs = Ins->NumStds = 0; break; case Ins_GET_EXTRA_DATA: /* Get number of users who claim to belong to this institution (row[7]) */ @@ -917,9 +900,7 @@ void Ins_GetListInstitutions (long CtyCod,Ins_GetExtraData_t GetExtraData) Ins->NumDpts = Dpt_GetNumberOfDepartmentsInInstitution (Ins->InsCod); /* Get number of users in courses */ - Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs - // Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod); - // Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod); + Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users" break; } } @@ -948,11 +929,11 @@ bool Ins_GetDataOfInstitutionByCod (struct Institution *Ins, Ins->Status = (Ins_Status_t) 0; Ins->RequesterUsrCod = -1L; Ins->ShortName[0] = - Ins->FullName[0] = - Ins->WWW[0] = '\0'; - // Ins->NumStds = Ins->NumTchs = Ins->NumUsrs = - Ins->NumUsrs = - Ins->NumCtrs = Ins->NumDpts = Ins->NumDegs = 0; + Ins->FullName[0] = + Ins->WWW[0] = '\0'; + Ins->NumUsrsWhoClaimToBelongToIns = 0; + Ins->NumCtrs = Ins->NumDegs = Ins->NumCrss = Ins->NumDpts = 0; + Ins->NumUsrs = 0; /***** Check if institution code is correct *****/ if (Ins->InsCod <= 0) @@ -1005,9 +986,7 @@ bool Ins_GetDataOfInstitutionByCod (struct Institution *Ins, Ins->NumDegs = Deg_GetNumDegsInIns (Ins->InsCod); /* Get number of users in courses of this institution */ - Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users", NumUsrs <= NumStds + NumTchs - // Ins->NumStds = Usr_GetNumUsrsInCrssOfIns (Rol_STUDENT,Ins->InsCod); - // Ins->NumTchs = Usr_GetNumUsrsInCrssOfIns (Rol_TEACHER,Ins->InsCod); + Ins->NumUsrs = Usr_GetNumUsrsInCrssOfIns (Rol_UNKNOWN,Ins->InsCod); // Here Rol_UNKNOWN means "all users" } } else diff --git a/swad_institution.h b/swad_institution.h index 670619718..b79cf26e3 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -70,8 +70,6 @@ struct Institution unsigned NumCrss; unsigned NumDpts; unsigned NumUsrs; // Number of users in courses of this institution - // unsigned NumTchs; // Number of teachers in courses of this institution - // unsigned NumStds; // Number of students in courses of this institution }; typedef enum