Version 20.51.5: Mar 18, 2021 File-browser-size database table renamed.

This commit is contained in:
acanas 2021-03-18 10:42:43 +01:00
parent ce8a273648
commit eb3a037556
6 changed files with 604 additions and 572 deletions

View File

@ -173,9 +173,9 @@ CREATE TABLE IF NOT EXISTS brw_last (
LastClick DATETIME NOT NULL,
UNIQUE INDEX(UsrCod,FileBrowser,Cod));
--
-- Table file_browser_size: stores the sizes of the file zones
-- Table brw_sizes: stores the sizes of the file zones
--
CREATE TABLE IF NOT EXISTS file_browser_size (
CREATE TABLE IF NOT EXISTS brw_sizes (
FileBrowser TINYINT NOT NULL,
Cod INT NOT NULL DEFAULT -1,
ZoneUsrCod INT NOT NULL DEFAULT -1,

View File

@ -600,13 +600,17 @@ TODO: Salvador Romero Cort
TODO: FIX BUG, URGENT! En las fechas como parámetro Dat_WriteParamsIniEndDates(), por ejemplo al cambiar el color de la gráfica de accesos por día y hora, no se respeta la zona horaria.
*/
#define Log_PLATFORM_VERSION "SWAD 20.51.4 (2021-03-18)"
#define Log_PLATFORM_VERSION "SWAD 20.51.5 (2021-03-18)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.6.2.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 20.51.5: Mar 18, 2021 File-browser-size database table renamed. (307563 lines)
1 change necessary in database:
RENAME TABLE file_browser_size TO brw_sizes;
Version 20.51.4: Mar 18, 2021 File-browser-last database table renamed. (307563 lines)
1 change necessary in database:
RENAME TABLE file_browser_last TO brw_last;

View File

@ -455,9 +455,9 @@ mysql> DESCRIBE brw_last;
"LastClick DATETIME NOT NULL,"
"UNIQUE INDEX(UsrCod,FileBrowser,Cod))");
/***** Table file_browser_size *****/
/***** Table brw_sizes *****/
/*
mysql> DESCRIBE file_browser_size;
mysql> DESCRIBE brw_sizes;
+-------------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------+------+-----+---------+-------+
@ -471,7 +471,7 @@ mysql> DESCRIBE file_browser_size;
+-------------+------------+------+-----+---------+-------+
7 rows in set (0.00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_browser_size ("
DB_CreateTable ("CREATE TABLE IF NOT EXISTS brw_sizes ("
"FileBrowser TINYINT NOT NULL,"
"Cod INT NOT NULL DEFAULT -1,"
"ZoneUsrCod INT NOT NULL DEFAULT -1,"

File diff suppressed because it is too large Load Diff

View File

@ -91,7 +91,7 @@ struct Brw_NumObjects
/***************************** Public constants ******************************/
/*****************************************************************************/
// Browsers types for database "files" and "file_browser_size" tables
// Browsers types for database "files" and "brw_sizes" tables
const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER] =
{
[Brw_UNKNOWN ] = Brw_UNKNOWN,
@ -4151,7 +4151,7 @@ static void Brw_StoreSizeOfFileTreeInDB (void)
/***** Update size of the file browser in database *****/
DB_QueryREPLACE ("can not store the size of a file browser",
"REPLACE INTO file_browser_size"
"REPLACE INTO brw_sizes"
" (FileBrowser,Cod,ZoneUsrCod,"
"NumLevels,NumFolders,NumFiles,TotalSize)"
" VALUES"
@ -4216,7 +4216,7 @@ void Brw_RemoveInsFilesFromDB (long InsCod)
/***** Remove from database the entries that store
the sizes of the file zones *****/
DB_QueryDELETE ("can not remove sizes of file zones of an institution",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u)"
" AND Cod=%ld",
(unsigned) Brw_ADMI_DOC_INS,
@ -4280,7 +4280,7 @@ void Brw_RemoveCtrFilesFromDB (long CtrCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
DB_QueryDELETE ("can not remove sizes of file zones of a center",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u)"
" AND Cod=%ld",
(unsigned) Brw_ADMI_DOC_CTR,
@ -4343,7 +4343,7 @@ void Brw_RemoveDegFilesFromDB (long DegCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
DB_QueryDELETE ("can not remove sizes of file zones of a degree",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u)"
" AND Cod=%ld",
(unsigned) Brw_ADMI_DOC_DEG,
@ -4549,7 +4549,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
/* Remove from course file zones */
DB_QueryDELETE ("can not remove sizes of file zones of a course",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u,%u,%u,%u,%u)"
" AND Cod=%ld",
(unsigned) Brw_ADMI_DOC_CRS,
@ -4562,7 +4562,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
/* Remove from group file zones */
DB_QueryDELETE ("can not remove sizes of file zones of a course",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u,%u,%u)"
" AND Cod IN %s",
(unsigned) Brw_ADMI_DOC_GRP,
@ -4573,7 +4573,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
/* Remove from project file zones */
DB_QueryDELETE ("can not remove sizes of file zones of a course",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u)"
" AND Cod IN %s",
(unsigned) Brw_ADMI_DOC_PRJ,
@ -4680,7 +4680,7 @@ void Brw_RemoveGrpFilesFromDB (long GrpCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
DB_QueryDELETE ("can not remove sizes of file zones of a group",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u,%u,%u)"
" AND Cod=%ld",
(unsigned) Brw_ADMI_DOC_GRP,
@ -4748,7 +4748,7 @@ void Brw_RemovePrjFilesFromDB (long PrjCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
DB_QueryDELETE ("can not remove sizes of file zones of a project",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u)"
" AND Cod=%ld",
(unsigned) Brw_ADMI_DOC_PRJ,
@ -4909,7 +4909,7 @@ void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
DB_QueryDELETE ("can not remove file browser sizes",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE FileBrowser IN (%u,%u)"
" AND Cod=%ld"
" AND ZoneUsrCod=%ld",
@ -4965,7 +4965,7 @@ void Brw_RemoveUsrFilesFromDB (long UsrCod)
/***** Remove from database the entries that store the sizes of the file zones *****/
DB_QueryDELETE ("can not remove sizes of user's file zones",
"DELETE FROM file_browser_size"
"DELETE FROM brw_sizes"
" WHERE ZoneUsrCod=%ld",
UsrCod);

View File

@ -1491,14 +1491,16 @@ static unsigned long Ind_GetNumFilesInDocumZonesOfCrsFromDB (long CrsCod)
DB_QuerySELECT (&mysql_res,"can not get the number of files",
"SELECT"
" (SELECT COALESCE(SUM(NumFiles),0)"
" FROM file_browser_size"
" WHERE FileBrowser=%u AND Cod=%ld) +"
" (SELECT COALESCE(SUM(file_browser_size.NumFiles),0)"
" FROM crs_grp_types,crs_grp,file_browser_size"
" WHERE crs_grp_types.CrsCod=%ld"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
" AND file_browser_size.FileBrowser=%u"
" AND file_browser_size.Cod=crs_grp.GrpCod)",
" FROM brw_sizes"
" WHERE FileBrowser=%u AND Cod=%ld) +"
" (SELECT COALESCE(SUM(brw_sizes.NumFiles),0)"
" FROM crs_grp_types,"
"crs_grp,"
"brw_sizes"
" WHERE crs_grp_types.CrsCod=%ld"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
" AND brw_sizes.FileBrowser=%u"
" AND brw_sizes.Cod=crs_grp.GrpCod)",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_DOC_CRS],
CrsCod,
CrsCod,
@ -1532,14 +1534,16 @@ static unsigned long Ind_GetNumFilesInShareZonesOfCrsFromDB (long CrsCod)
DB_QuerySELECT (&mysql_res,"can not get the number of files",
"SELECT"
" (SELECT COALESCE(SUM(NumFiles),0)"
" FROM file_browser_size"
" WHERE FileBrowser=%u AND Cod=%ld) +"
" (SELECT COALESCE(SUM(file_browser_size.NumFiles),0)"
" FROM crs_grp_types,crs_grp,file_browser_size"
" WHERE crs_grp_types.CrsCod=%ld"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
" AND file_browser_size.FileBrowser=%u"
" AND file_browser_size.Cod=crs_grp.GrpCod)",
" FROM brw_sizes"
" WHERE FileBrowser=%u AND Cod=%ld) +"
" (SELECT COALESCE(SUM(brw_sizes.NumFiles),0)"
" FROM crs_grp_types,"
"crs_grp,"
"brw_sizes"
" WHERE crs_grp_types.CrsCod=%ld"
" AND crs_grp_types.GrpTypCod=crs_grp.GrpTypCod"
" AND brw_sizes.FileBrowser=%u"
" AND brw_sizes.Cod=crs_grp.GrpCod)",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_SHR_CRS],
CrsCod,
CrsCod,
@ -1572,8 +1576,9 @@ static unsigned long Ind_GetNumFilesInAssigZonesOfCrsFromDB (long CrsCod)
/***** Get number of files in document zones of a course from database *****/
DB_QuerySELECT (&mysql_res,"can not get the number of files",
"SELECT COALESCE(SUM(NumFiles),0)"
" FROM file_browser_size"
" WHERE FileBrowser=%u AND Cod=%ld",
" FROM brw_sizes"
" WHERE FileBrowser=%u"
" AND Cod=%ld",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_ASG_USR],
CrsCod);
@ -1604,8 +1609,9 @@ static unsigned long Ind_GetNumFilesInWorksZonesOfCrsFromDB (long CrsCod)
/***** Get number of files in document zones of a course from database *****/
DB_QuerySELECT (&mysql_res,"can not get the number of files",
"SELECT COALESCE(SUM(NumFiles),0)"
" FROM file_browser_size"
" WHERE FileBrowser=%u AND Cod=%ld",
" FROM brw_sizes"
" WHERE FileBrowser=%u"
" AND Cod=%ld",
(unsigned) Brw_FileBrowserForDB_files[Brw_ADMI_WRK_USR],
CrsCod);