Version 21.52.1: Nov 06, 2021 Fixed database query in departments.

This commit is contained in:
acanas 2021-11-06 10:38:14 +01:00
parent 25091b6664
commit 2e61500a79
4 changed files with 4 additions and 9 deletions

View File

@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo. TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/ */
#define Log_PLATFORM_VERSION "SWAD 21.52 (2021-11-05)" #define Log_PLATFORM_VERSION "SWAD 21.52.1 (2021-11-06)"
#define CSS_FILE "swad20.45.css" #define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.1.js" #define JS_FILE "swad20.69.1.js"
/* /*
TODO: Rename CENTRE to CENTER in help wiki. TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 21.52.1: Nov 06, 2021 Fixed database query in departments. (321828 lines)
Version 21.52: Nov 05, 2021 Changed SELECT COUNT to SELECT EXISTS in some queries. (321833 lines) Version 21.52: Nov 05, 2021 Changed SELECT COUNT to SELECT EXISTS in some queries. (321833 lines)
Version 21.51: Nov 04, 2021 Eliminated the limit of origin courses in messages. (321735 lines) Version 21.51: Nov 04, 2021 Eliminated the limit of origin courses in messages. (321735 lines)
Version 21.50.1: Nov 03, 2021 Queries moved to module swad_user_database and other modules. (321759 lines) Version 21.50.1: Nov 03, 2021 Queries moved to module swad_user_database and other modules. (321759 lines)

View File

@ -984,12 +984,7 @@ unsigned Dpt_GetNumDptsInIns (long InsCod)
/***** 3. Slow: number of departments of an institution from database *****/ /***** 3. Slow: number of departments of an institution from database *****/
Gbl.Cache.NumDptsInIns.InsCod = InsCod; Gbl.Cache.NumDptsInIns.InsCod = InsCod;
Gbl.Cache.NumDptsInIns.NumDpts = (unsigned) Gbl.Cache.NumDptsInIns.NumDpts = Dpt_DB_GetNumDepartmentsInInstitution (InsCod);
DB_QueryCOUNT ("can not get number of departments in an institution",
"SELECT COUNT(*)"
" FROM dpt_departments"
" WHERE InsCod=%ld",
InsCod);
return Gbl.Cache.NumDptsInIns.NumDpts; return Gbl.Cache.NumDptsInIns.NumDpts;
} }

View File

@ -181,7 +181,6 @@ bool Dpt_DB_CheckIfDepartmentNameExists (const char *FieldName,const char *Name,
unsigned Dpt_DB_GetNumDepartmentsInInstitution (long InsCod) unsigned Dpt_DB_GetNumDepartmentsInInstitution (long InsCod)
{ {
/***** Get number of departments in an institution from database *****/
return (unsigned) return (unsigned)
DB_QueryCOUNT ("can not get number of departments in an institution", DB_QueryCOUNT ("can not get number of departments in an institution",
"SELECT COUNT(*)" "SELECT COUNT(*)"

View File

@ -502,7 +502,7 @@ static void InsCfg_NumDpts (void)
/* Data */ /* Data */
HTM_TD_Begin ("class=\"DAT LB\""); HTM_TD_Begin ("class=\"DAT LB\"");
HTM_Unsigned (Dpt_DB_GetNumDepartmentsInInstitution (Gbl.Hierarchy.Ins.InsCod)); HTM_Unsigned (Dpt_GetNumDptsInIns (Gbl.Hierarchy.Ins.InsCod));
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();