Version19.210.4

This commit is contained in:
acanas 2020-05-05 13:38:05 +02:00
parent b197ba44df
commit 85c3748a08
3 changed files with 43 additions and 29 deletions

View File

@ -544,10 +544,11 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 19.210.3 (2020-05-03)" #define Log_PLATFORM_VERSION "SWAD 19.210.4 (2020-05-05)"
#define CSS_FILE "swad19.193.1.css" #define CSS_FILE "swad19.193.1.css"
#define JS_FILE "swad19.193.1.js" #define JS_FILE "swad19.193.1.js"
/* /*
Version 19.210.4: May 05, 2020 Fixed bug searching courses. (301103 lines)
Version 19.210.3: May 03, 2020 All figures cacheable are cached everytime they are calculated. (301089 lines) Version 19.210.3: May 03, 2020 All figures cacheable are cached everytime they are calculated. (301089 lines)
Version 19.210.2: May 03, 2020 More figures cached. (301125 lines) Version 19.210.2: May 03, 2020 More figures cached. (301125 lines)
Version 19.210.1: May 03, 2020 More figures cached. (301129 lines) Version 19.210.1: May 03, 2020 More figures cached. (301129 lines)

View File

@ -2630,6 +2630,7 @@ void Crs_GetAndWriteCrssOfAUsr (const struct UsrData *UsrDat,Rol_Role_t Role)
HTM_TH (1,1,"CM",Txt_Year_OF_A_DEGREE); HTM_TH (1,1,"CM",Txt_Year_OF_A_DEGREE);
HTM_TH (1,1,"LM",Txt_Course); HTM_TH (1,1,"LM",Txt_Course);
HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH]); HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH]);
HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_NET]);
HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]); HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]);
HTM_TR_End (); HTM_TR_End ();
@ -2689,6 +2690,7 @@ void Crs_ListCrssFound (MYSQL_RES **mysql_res,unsigned NumCrss)
HTM_TH (1,1,"CM",Txt_Year_OF_A_DEGREE); HTM_TH (1,1,"CM",Txt_Year_OF_A_DEGREE);
HTM_TH (1,1,"LM",Txt_Course); HTM_TH (1,1,"LM",Txt_Course);
HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH]); HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_TCH]);
HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_NET]);
HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]); HTM_TH (1,1,"RM",Txt_ROLES_PLURAL_BRIEF_Abc[Rol_STD]);
HTM_TR_End (); HTM_TR_End ();
@ -2724,23 +2726,24 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
struct Degree Deg; struct Degree Deg;
long CrsCod; long CrsCod;
unsigned NumTchs;
unsigned NumStds; unsigned NumStds;
unsigned NumNETs;
unsigned NumTchs;
unsigned NumUsrs;
const char *ClassTxt; const char *ClassTxt;
const char *ClassLink; const char *ClassLink;
const char *BgColor; const char *BgColor;
bool Accepted; bool Accepted;
static unsigned RowEvenOdd = 1; static unsigned RowEvenOdd = 1;
/* /*
SELECT degrees.DegCod 0 SELECT degrees.DegCod row[0]
courses.CrsCod 1 courses.CrsCod row[1]
degrees.ShortName 2 degrees.ShortName row[2]
degrees.FullName 3 degrees.FullName row[3]
courses.Year 4 courses.Year row[4]
courses.FullName 5 courses.FullName row[5]
centres.ShortName 6 centres.ShortName row[6]
crs_usr.Accepted 7 (only if WriteColumnAccepted == true) crs_usr.Accepted row[7] (only if WriteColumnAccepted == true)
*/ */
/***** Get degree code (row[0]) *****/ /***** Get degree code (row[0]) *****/
@ -2754,12 +2757,11 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
Lay_ShowErrorAndExit ("Wrong code of course."); Lay_ShowErrorAndExit ("Wrong code of course.");
/***** Get number of teachers and students in this course *****/ /***** Get number of teachers and students in this course *****/
NumTchs = Usr_GetNumUsrsInCrss (Hie_CRS,CrsCod, NumStds = Usr_GetNumUsrsInCrss (Hie_CRS,CrsCod,1 << Rol_STD);
1 << Rol_NET | NumNETs = Usr_GetNumUsrsInCrss (Hie_CRS,CrsCod,1 << Rol_NET);
1 << Rol_TCH); NumTchs = Usr_GetNumUsrsInCrss (Hie_CRS,CrsCod,1 << Rol_TCH);
NumStds = Usr_GetNumUsrsInCrss (Hie_CRS,CrsCod, NumUsrs = NumStds + NumNETs + NumTchs;
1 << Rol_STD); if (NumUsrs)
if (NumTchs + NumStds)
{ {
ClassTxt = "DAT_N"; ClassTxt = "DAT_N";
ClassLink = "BT_LINK LT DAT_N"; ClassLink = "BT_LINK LT DAT_N";
@ -2827,6 +2829,11 @@ static void Crs_WriteRowCrsData (unsigned NumCrs,MYSQL_ROW row,bool WriteColumnA
HTM_Unsigned (NumTchs); HTM_Unsigned (NumTchs);
HTM_TD_End (); HTM_TD_End ();
/***** Write number of non-editing teachers in course *****/
HTM_TD_Begin ("class=\"%s RT %s\"",ClassTxt,BgColor);
HTM_Unsigned (NumNETs);
HTM_TD_End ();
/***** Write number of students in course *****/ /***** Write number of students in course *****/
HTM_TD_Begin ("class=\"%s RT %s\"",ClassTxt,BgColor); HTM_TD_Begin ("class=\"%s RT %s\"",ClassTxt,BgColor);
HTM_Unsigned (NumStds); HTM_Unsigned (NumStds);

View File

@ -607,18 +607,24 @@ static unsigned Sch_SearchCoursesInDB (const char *RangeQuery)
if (Sch_BuildSearchQuery (SearchQuery,"courses.FullName",NULL,NULL)) if (Sch_BuildSearchQuery (SearchQuery,"courses.FullName",NULL,NULL))
{ {
/***** Query database and list courses found *****/ /***** Query database and list courses found *****/
NumCrss = (unsigned) DB_QuerySELECT (&mysql_res,"can not get courses", NumCrss = (unsigned)
"SELECT degrees.DegCod,courses.CrsCod,degrees.ShortName,degrees.FullName," DB_QuerySELECT (&mysql_res,"can not get courses",
"courses.Year,courses.FullName,centres.ShortName" "SELECT degrees.DegCod," // row[0]
" FROM courses,degrees,centres,institutions,countries" "courses.CrsCod," // row[1]
" WHERE %s" "degrees.ShortName," // row[2]
" AND courses.DegCod=degrees.DegCod" "degrees.FullName," // row[3]
" AND degrees.CtrCod=centres.CtrCod" "courses.Year," // row[4]
" AND centres.InsCod=institutions.InsCod" "courses.FullName," // row[5]
" AND institutions.CtyCod=countries.CtyCod" "centres.ShortName" // row[6]
"%s" " FROM courses,degrees,centres,institutions,countries"
" ORDER BY courses.FullName,institutions.FullName,degrees.FullName,courses.Year", " WHERE %s"
SearchQuery,RangeQuery); " AND courses.DegCod=degrees.DegCod"
" AND degrees.CtrCod=centres.CtrCod"
" AND centres.InsCod=institutions.InsCod"
" AND institutions.CtyCod=countries.CtyCod"
"%s"
" ORDER BY courses.FullName,institutions.FullName,degrees.FullName,courses.Year",
SearchQuery,RangeQuery);
Crs_ListCrssFound (&mysql_res,NumCrss); Crs_ListCrssFound (&mysql_res,NumCrss);
return NumCrss; return NumCrss;
} }