mirror of https://github.com/acanas/swad-core.git
Version 20.51.6: Mar 18, 2021 Files database table renamed.
This commit is contained in:
parent
eb3a037556
commit
72959c7f0d
68
sql/swad.sql
68
sql/swad.sql
|
@ -164,6 +164,40 @@ CREATE TABLE IF NOT EXISTS brw_expanded_folders (
|
|||
INDEX(FileBrowser,Cod),
|
||||
INDEX(WorksUsrCod));
|
||||
--
|
||||
-- Table file_cache: stores the media private paths linked from public directories in current session
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS file_cache (
|
||||
SessionId CHAR(43) NOT NULL,
|
||||
PrivPath TEXT COLLATE latin1_bin NOT NULL,
|
||||
TmpPubDir TEXT COLLATE latin1_bin NOT NULL,
|
||||
INDEX(SessionId));
|
||||
--
|
||||
-- Table file_view: stores the number of times each user has seen each file
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS file_view (
|
||||
FilCod INT NOT NULL,
|
||||
UsrCod INT NOT NULL,
|
||||
NumViews INT NOT NULL DEFAULT 0,
|
||||
UNIQUE INDEX(FilCod,UsrCod),INDEX(UsrCod));
|
||||
--
|
||||
-- Table brw_files: stores metadata about each file
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS brw_files (
|
||||
FilCod INT NOT NULL AUTO_INCREMENT,
|
||||
FileBrowser TINYINT NOT NULL,
|
||||
Cod INT NOT NULL DEFAULT -1,
|
||||
ZoneUsrCod INT NOT NULL DEFAULT -1,
|
||||
PublisherUsrCod INT NOT NULL,
|
||||
FileType TINYINT NOT NULL DEFAULT 0,
|
||||
Path TEXT COLLATE latin1_bin NOT NULL,
|
||||
Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
Public ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
License TINYINT NOT NULL DEFAULT 0,
|
||||
UNIQUE INDEX(FilCod),
|
||||
INDEX(FileBrowser,Cod,ZoneUsrCod),
|
||||
INDEX(ZoneUsrCod),
|
||||
INDEX(PublisherUsrCod));
|
||||
--
|
||||
-- Table brw_last: stores the last click of every user in each file browser zone
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS brw_last (
|
||||
|
@ -604,40 +638,6 @@ CREATE TABLE IF NOT EXISTS fig_figures (
|
|||
LastUpdate TIMESTAMP,
|
||||
UNIQUE INDEX(Figure,Scope,Cod));
|
||||
--
|
||||
-- Table file_cache: stores the media private paths linked from public directories in current session
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS file_cache (
|
||||
SessionId CHAR(43) NOT NULL,
|
||||
PrivPath TEXT COLLATE latin1_bin NOT NULL,
|
||||
TmpPubDir TEXT COLLATE latin1_bin NOT NULL,
|
||||
INDEX(SessionId));
|
||||
--
|
||||
-- Table file_view: stores the number of times each user has seen each file
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS file_view (
|
||||
FilCod INT NOT NULL,
|
||||
UsrCod INT NOT NULL,
|
||||
NumViews INT NOT NULL DEFAULT 0,
|
||||
UNIQUE INDEX(FilCod,UsrCod),INDEX(UsrCod));
|
||||
--
|
||||
-- Table files: stores metadata about each file
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS files (
|
||||
FilCod INT NOT NULL AUTO_INCREMENT,
|
||||
FileBrowser TINYINT NOT NULL,
|
||||
Cod INT NOT NULL DEFAULT -1,
|
||||
ZoneUsrCod INT NOT NULL DEFAULT -1,
|
||||
PublisherUsrCod INT NOT NULL,
|
||||
FileType TINYINT NOT NULL DEFAULT 0,
|
||||
Path TEXT COLLATE latin1_bin NOT NULL,
|
||||
Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
Public ENUM('N','Y') NOT NULL DEFAULT 'N',
|
||||
License TINYINT NOT NULL DEFAULT 0,
|
||||
UNIQUE INDEX(FilCod),
|
||||
INDEX(FileBrowser,Cod,ZoneUsrCod),
|
||||
INDEX(ZoneUsrCod),
|
||||
INDEX(PublisherUsrCod));
|
||||
--
|
||||
-- Table firewall_banned: stores the banned IPs in order to mitigate denial of service attacks
|
||||
--
|
||||
CREATE TABLE IF NOT EXISTS firewall_banned (
|
||||
|
|
|
@ -600,14 +600,18 @@ 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.5 (2021-03-18)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 20.51.6 (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)
|
||||
Version 20.51.6: Mar 18, 2021 Files database table renamed. (307697 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE files TO brw_files;
|
||||
|
||||
Version 20.51.5: Mar 18, 2021 File-browser-size database table renamed. (307594 lines)
|
||||
1 change necessary in database:
|
||||
RENAME TABLE file_browser_size TO brw_sizes;
|
||||
|
||||
|
|
144
swad_database.c
144
swad_database.c
|
@ -435,6 +435,78 @@ mysql> DESCRIBE brw_expanded_folders;
|
|||
"INDEX(FileBrowser,Cod),"
|
||||
"INDEX(WorksUsrCod))");
|
||||
|
||||
/***** Table file_cache *****/
|
||||
/*
|
||||
mysql> DESCRIBE file_cache;
|
||||
+-----------+----------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+-----------+----------+------+-----+---------+-------+
|
||||
| SessionId | char(43) | NO | MUL | NULL | |
|
||||
| PrivPath | text | NO | | NULL | |
|
||||
| TmpPubDir | text | NO | | NULL | |
|
||||
+-----------+----------+------+-----+---------+-------+
|
||||
3 rows in set (0.01 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_cache ("
|
||||
"SessionId CHAR(43) NOT NULL," // Cns_BYTES_SESSION_ID
|
||||
"PrivPath VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||
"TmpPubDir VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||
"UNIQUE INDEX(SessionId))");
|
||||
|
||||
/***** Table file_view *****/
|
||||
/*
|
||||
mysql> DESCRIBE file_view;
|
||||
+----------+---------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+----------+---------+------+-----+---------+-------+
|
||||
| FilCod | int(11) | NO | PRI | NULL | |
|
||||
| UsrCod | int(11) | NO | PRI | NULL | |
|
||||
| NumViews | int(11) | NO | | 0 | |
|
||||
+----------+---------+------+-----+---------+-------+
|
||||
3 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_view ("
|
||||
"FilCod INT NOT NULL,"
|
||||
"UsrCod INT NOT NULL,"
|
||||
"NumViews INT NOT NULL DEFAULT 0,"
|
||||
"UNIQUE INDEX(FilCod,UsrCod),"
|
||||
"INDEX(UsrCod))");
|
||||
|
||||
/***** Table brw_files *****/
|
||||
/*
|
||||
mysql> DESCRIBE brw_files;
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
| FilCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||
| FileBrowser | tinyint(4) | NO | MUL | NULL | |
|
||||
| Cod | int(11) | NO | | -1 | |
|
||||
| ZoneUsrCod | int(11) | NO | MUL | -1 | |
|
||||
| PublisherUsrCod | int(11) | NO | MUL | NULL | |
|
||||
| FileType | tinyint(4) | NO | | 0 | |
|
||||
| Path | text | NO | | NULL | |
|
||||
| Hidden | enum('N','Y') | NO | | N | |
|
||||
| Public | enum('N','Y') | NO | | N | |
|
||||
| License | tinyint(4) | NO | | 0 | |
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
10 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS brw_files ("
|
||||
"FilCod INT NOT NULL AUTO_INCREMENT,"
|
||||
"FileBrowser TINYINT NOT NULL,"
|
||||
"Cod INT NOT NULL DEFAULT -1,"
|
||||
"ZoneUsrCod INT NOT NULL DEFAULT -1,"
|
||||
"PublisherUsrCod INT NOT NULL,"
|
||||
"FileType TINYINT NOT NULL DEFAULT 0,"
|
||||
"Path TEXT COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||
"Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"Public ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"License TINYINT NOT NULL DEFAULT 0,"
|
||||
"UNIQUE INDEX(FilCod),"
|
||||
"INDEX(FileBrowser,Cod,ZoneUsrCod),"
|
||||
"INDEX(ZoneUsrCod),"
|
||||
"INDEX(PublisherUsrCod))");
|
||||
|
||||
/***** Table brw_last *****/
|
||||
/*
|
||||
mysql> DESCRIBE brw_last;
|
||||
|
@ -1326,78 +1398,6 @@ mysql> DESCRIBE fig_figures;
|
|||
"LastUpdate TIMESTAMP,"
|
||||
"UNIQUE INDEX(Figure,Scope,Cod))");
|
||||
|
||||
/***** Table file_cache *****/
|
||||
/*
|
||||
mysql> DESCRIBE file_cache;
|
||||
+-----------+----------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+-----------+----------+------+-----+---------+-------+
|
||||
| SessionId | char(43) | NO | MUL | NULL | |
|
||||
| PrivPath | text | NO | | NULL | |
|
||||
| TmpPubDir | text | NO | | NULL | |
|
||||
+-----------+----------+------+-----+---------+-------+
|
||||
3 rows in set (0.01 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_cache ("
|
||||
"SessionId CHAR(43) NOT NULL," // Cns_BYTES_SESSION_ID
|
||||
"PrivPath VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||
"TmpPubDir VARCHAR(4096) COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||
"UNIQUE INDEX(SessionId))");
|
||||
|
||||
/***** Table file_view *****/
|
||||
/*
|
||||
mysql> DESCRIBE file_view;
|
||||
+----------+---------+------+-----+---------+-------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+----------+---------+------+-----+---------+-------+
|
||||
| FilCod | int(11) | NO | PRI | NULL | |
|
||||
| UsrCod | int(11) | NO | PRI | NULL | |
|
||||
| NumViews | int(11) | NO | | 0 | |
|
||||
+----------+---------+------+-----+---------+-------+
|
||||
3 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_view ("
|
||||
"FilCod INT NOT NULL,"
|
||||
"UsrCod INT NOT NULL,"
|
||||
"NumViews INT NOT NULL DEFAULT 0,"
|
||||
"UNIQUE INDEX(FilCod,UsrCod),"
|
||||
"INDEX(UsrCod))");
|
||||
|
||||
/***** Table files *****/
|
||||
/*
|
||||
mysql> DESCRIBE files;
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
| Field | Type | Null | Key | Default | Extra |
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
| FilCod | int(11) | NO | PRI | NULL | auto_increment |
|
||||
| FileBrowser | tinyint(4) | NO | MUL | NULL | |
|
||||
| Cod | int(11) | NO | | -1 | |
|
||||
| ZoneUsrCod | int(11) | NO | MUL | -1 | |
|
||||
| PublisherUsrCod | int(11) | NO | MUL | NULL | |
|
||||
| FileType | tinyint(4) | NO | | 0 | |
|
||||
| Path | text | NO | | NULL | |
|
||||
| Hidden | enum('N','Y') | NO | | N | |
|
||||
| Public | enum('N','Y') | NO | | N | |
|
||||
| License | tinyint(4) | NO | | 0 | |
|
||||
+-----------------+---------------+------+-----+---------+----------------+
|
||||
10 rows in set (0.00 sec)
|
||||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS files ("
|
||||
"FilCod INT NOT NULL AUTO_INCREMENT,"
|
||||
"FileBrowser TINYINT NOT NULL,"
|
||||
"Cod INT NOT NULL DEFAULT -1,"
|
||||
"ZoneUsrCod INT NOT NULL DEFAULT -1,"
|
||||
"PublisherUsrCod INT NOT NULL,"
|
||||
"FileType TINYINT NOT NULL DEFAULT 0,"
|
||||
"Path TEXT COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||
"Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"Public ENUM('N','Y') NOT NULL DEFAULT 'N',"
|
||||
"License TINYINT NOT NULL DEFAULT 0,"
|
||||
"UNIQUE INDEX(FilCod),"
|
||||
"INDEX(FileBrowser,Cod,ZoneUsrCod),"
|
||||
"INDEX(ZoneUsrCod),"
|
||||
"INDEX(PublisherUsrCod))");
|
||||
|
||||
/***** Table firewall_banned *****/
|
||||
/*
|
||||
mysql> DESCRIBE firewall_banned;
|
||||
|
|
104
swad_figure.c
104
swad_figure.c
|
@ -2965,9 +2965,9 @@ static void Fig_GetNumberOfOERsFromDB (Hie_Lvl_Level_t Scope,Brw_License_t Licen
|
|||
case Hie_Lvl_SYS:
|
||||
NumRows = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of OERs",
|
||||
"SELECT Public,"
|
||||
"COUNT(*)"
|
||||
" FROM files"
|
||||
"SELECT Public," // row[0]
|
||||
"COUNT(*)" // row[1]
|
||||
" FROM brw_files"
|
||||
" WHERE License=%u"
|
||||
" GROUP BY Public",
|
||||
(unsigned) License);
|
||||
|
@ -2975,21 +2975,21 @@ static void Fig_GetNumberOfOERsFromDB (Hie_Lvl_Level_t Scope,Brw_License_t Licen
|
|||
case Hie_Lvl_CTY:
|
||||
NumRows = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of OERs",
|
||||
"SELECT files.Public,"
|
||||
"COUNT(*)"
|
||||
" FROM ins_instits,"
|
||||
"ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"files"
|
||||
"SELECT brw_files.Public," // row[0]
|
||||
"COUNT(*)" // row[1]
|
||||
" FROM ins_instits,"
|
||||
"ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"brw_files"
|
||||
" WHERE ins_instits.CtyCod=%ld"
|
||||
" AND ins_instits.InsCod=ctr_centers.InsCod"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.License=%u"
|
||||
" GROUP BY files.Public",
|
||||
" AND ins_instits.InsCod=ctr_centers.InsCod"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=brw_files.Cod"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.License=%u"
|
||||
" GROUP BY brw_files.Public",
|
||||
Gbl.Hierarchy.Cty.CtyCod,
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
(unsigned) Brw_ADMI_SHR_CRS,
|
||||
|
@ -2998,19 +2998,19 @@ static void Fig_GetNumberOfOERsFromDB (Hie_Lvl_Level_t Scope,Brw_License_t Licen
|
|||
case Hie_Lvl_INS:
|
||||
NumRows = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of OERs",
|
||||
"SELECT files.Public,"
|
||||
"COUNT(*)"
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"files"
|
||||
"SELECT brw_files.Public," // row[0]
|
||||
"COUNT(*)" // row[1]
|
||||
" FROM ctr_centers,"
|
||||
"deg_degrees,"
|
||||
"crs_courses,"
|
||||
"brw_files"
|
||||
" WHERE ctr_centers.InsCod=%ld"
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.License=%u"
|
||||
" GROUP BY files.Public",
|
||||
" AND ctr_centers.CtrCod=deg_degrees.CtrCod"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=brw_files.Cod"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.License=%u"
|
||||
" GROUP BY brw_files.Public",
|
||||
Gbl.Hierarchy.Ins.InsCod,
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
(unsigned) Brw_ADMI_SHR_CRS,
|
||||
|
@ -3019,17 +3019,17 @@ static void Fig_GetNumberOfOERsFromDB (Hie_Lvl_Level_t Scope,Brw_License_t Licen
|
|||
case Hie_Lvl_CTR:
|
||||
NumRows = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of OERs",
|
||||
"SELECT files.Public,"
|
||||
"COUNT(*)"
|
||||
" FROM deg_degrees,"
|
||||
"crs_courses,"
|
||||
"files"
|
||||
"SELECT brw_files.Public," // row[0]
|
||||
"COUNT(*)" // row[1]
|
||||
" FROM deg_degrees,"
|
||||
"crs_courses,"
|
||||
"brw_files"
|
||||
" WHERE deg_degrees.CtrCod=%ld"
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.License=%u"
|
||||
" GROUP BY files.Public",
|
||||
" AND deg_degrees.DegCod=crs_courses.DegCod"
|
||||
" AND crs_courses.CrsCod=brw_files.Cod"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.License=%u"
|
||||
" GROUP BY brw_files.Public",
|
||||
Gbl.Hierarchy.Ctr.CtrCod,
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
(unsigned) Brw_ADMI_SHR_CRS,
|
||||
|
@ -3038,15 +3038,15 @@ static void Fig_GetNumberOfOERsFromDB (Hie_Lvl_Level_t Scope,Brw_License_t Licen
|
|||
case Hie_Lvl_DEG:
|
||||
NumRows = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of OERs",
|
||||
"SELECT files.Public,"
|
||||
"COUNT(*)"
|
||||
" FROM crs_courses,"
|
||||
"files"
|
||||
"SELECT brw_files.Public," // row[0]
|
||||
"COUNT(*)" // row[1]
|
||||
" FROM crs_courses,"
|
||||
"brw_files"
|
||||
" WHERE crs_courses.DegCod=%ld"
|
||||
" AND crs_courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.License=%u"
|
||||
" GROUP BY files.Public",
|
||||
" AND crs_courses.CrsCod=brw_files.Cod"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.License=%u"
|
||||
" GROUP BY brw_files.Public",
|
||||
Gbl.Hierarchy.Deg.DegCod,
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
(unsigned) Brw_ADMI_SHR_CRS,
|
||||
|
@ -3055,12 +3055,12 @@ static void Fig_GetNumberOfOERsFromDB (Hie_Lvl_Level_t Scope,Brw_License_t Licen
|
|||
case Hie_Lvl_CRS:
|
||||
NumRows = (unsigned)
|
||||
DB_QuerySELECT (&mysql_res,"can not get number of OERs",
|
||||
"SELECT Public,"
|
||||
"COUNT(*)"
|
||||
" FROM files"
|
||||
"SELECT Public," // row[0]
|
||||
"COUNT(*)" // row[1]
|
||||
" FROM brw_files"
|
||||
" WHERE Cod=%ld"
|
||||
" AND FileBrowser IN (%u,%u)"
|
||||
" AND License=%u"
|
||||
" AND FileBrowser IN (%u,%u)"
|
||||
" AND License=%u"
|
||||
" GROUP BY Public",
|
||||
Gbl.Hierarchy.Crs.CrsCod,
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
|
|
|
@ -4174,11 +4174,11 @@ void Brw_RemoveInsFilesFromDB (long InsCod)
|
|||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views to files of an institution",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_INS,
|
||||
(unsigned) Brw_ADMI_SHR_INS,
|
||||
InsCod);
|
||||
|
@ -4225,7 +4225,7 @@ void Brw_RemoveInsFilesFromDB (long InsCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files of an institution",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u)"
|
||||
" AND Cod=%ld",
|
||||
(unsigned) Brw_ADMI_DOC_INS,
|
||||
|
@ -4242,11 +4242,11 @@ void Brw_RemoveCtrFilesFromDB (long CtrCod)
|
|||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views to files of a center",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_CTR,
|
||||
(unsigned) Brw_ADMI_SHR_CTR,
|
||||
CtrCod);
|
||||
|
@ -4289,7 +4289,7 @@ void Brw_RemoveCtrFilesFromDB (long CtrCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files of a center",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u)"
|
||||
" AND Cod=%ld",
|
||||
(unsigned) Brw_ADMI_DOC_CTR,
|
||||
|
@ -4306,10 +4306,11 @@ void Brw_RemoveDegFilesFromDB (long DegCod)
|
|||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views to files of a degree",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_DEG,
|
||||
(unsigned) Brw_ADMI_SHR_DEG,
|
||||
DegCod);
|
||||
|
@ -4352,7 +4353,7 @@ void Brw_RemoveDegFilesFromDB (long DegCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files of a degree",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u)"
|
||||
" AND Cod=%ld",
|
||||
(unsigned) Brw_ADMI_DOC_DEG,
|
||||
|
@ -4388,11 +4389,11 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
DB_QueryDELETE ("can not remove the properties of marks"
|
||||
" associated to a course",
|
||||
"DELETE FROM marks_properties"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"marks_properties"
|
||||
" WHERE files.FileBrowser=%u"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
||||
(unsigned) Brw_ADMI_MRK_CRS,
|
||||
CrsCod);
|
||||
|
||||
|
@ -4400,11 +4401,11 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
/* Remove from course file zones */
|
||||
DB_QueryDELETE ("can not remove file views to files of a course",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u,%u,%u,%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u,%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
(unsigned) Brw_ADMI_TCH_CRS,
|
||||
(unsigned) Brw_ADMI_SHR_CRS,
|
||||
|
@ -4416,11 +4417,11 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
/* Remove from group file zones */
|
||||
DB_QueryDELETE ("can not remove file views to files of a course",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND files.Cod IN %s"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod IN %s"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_GRP,
|
||||
(unsigned) Brw_ADMI_TCH_GRP,
|
||||
(unsigned) Brw_ADMI_SHR_GRP,
|
||||
|
@ -4430,11 +4431,11 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
/* Remove from project file zones */
|
||||
DB_QueryDELETE ("can not remove file views to files of a course",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod IN %s"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod IN %s"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_PRJ,
|
||||
(unsigned) Brw_ADMI_ASS_PRJ,
|
||||
SubqueryPrj);
|
||||
|
@ -4583,7 +4584,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
/***** Remove from database the entries that store the data files *****/
|
||||
/* Remove from course file zones */
|
||||
DB_QueryDELETE ("can not remove files of a course",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u,%u,%u,%u,%u)"
|
||||
" AND Cod=%ld",
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
|
@ -4596,7 +4597,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
|
||||
/* Remove from group file zones */
|
||||
DB_QueryDELETE ("can not remove files of a course",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND Cod IN %s",
|
||||
(unsigned) Brw_ADMI_DOC_GRP,
|
||||
|
@ -4607,7 +4608,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
|||
|
||||
/* Remove from project file zones */
|
||||
DB_QueryDELETE ("can not remove files of a course",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u)"
|
||||
" AND Cod IN %s",
|
||||
(unsigned) Brw_ADMI_DOC_PRJ,
|
||||
|
@ -4625,20 +4626,22 @@ void Brw_RemoveGrpFilesFromDB (long GrpCod)
|
|||
DB_QueryDELETE ("can not remove the properties of marks"
|
||||
" associated to a group",
|
||||
"DELETE FROM marks_properties"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"marks_properties"
|
||||
" WHERE files.FileBrowser=%u"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
||||
(unsigned) Brw_ADMI_MRK_GRP,
|
||||
GrpCod);
|
||||
|
||||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views to files of a group",
|
||||
"DELETE FROM file_view USING file_view,files"
|
||||
" WHERE files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
"DELETE FROM file_view"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_GRP,
|
||||
(unsigned) Brw_ADMI_TCH_GRP,
|
||||
(unsigned) Brw_ADMI_SHR_GRP,
|
||||
|
@ -4691,9 +4694,9 @@ void Brw_RemoveGrpFilesFromDB (long GrpCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files of a group",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND Cod=%ld",
|
||||
" AND Cod=%ld",
|
||||
(unsigned) Brw_ADMI_DOC_GRP,
|
||||
(unsigned) Brw_ADMI_TCH_GRP,
|
||||
(unsigned) Brw_ADMI_SHR_GRP,
|
||||
|
@ -4710,11 +4713,11 @@ void Brw_RemovePrjFilesFromDB (long PrjCod)
|
|||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views to files of a project",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_DOC_PRJ,
|
||||
(unsigned) Brw_ADMI_ASS_PRJ,
|
||||
PrjCod);
|
||||
|
@ -4757,7 +4760,7 @@ void Brw_RemovePrjFilesFromDB (long PrjCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files of a project",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u)"
|
||||
" AND Cod=%ld",
|
||||
(unsigned) Brw_ADMI_DOC_PRJ,
|
||||
|
@ -4877,12 +4880,12 @@ void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod)
|
|||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.ZoneUsrCod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.ZoneUsrCod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) Brw_ADMI_ASG_USR,
|
||||
(unsigned) Brw_ADMI_WRK_USR,
|
||||
CrsCod,UsrCod);
|
||||
|
@ -4919,7 +4922,7 @@ void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u)"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld",
|
||||
|
@ -4939,10 +4942,10 @@ void Brw_RemoveUsrFilesFromDB (long UsrCod)
|
|||
// in order to take into account his/her views
|
||||
DB_QueryDELETE ("can not remove file views to files of a user",
|
||||
"DELETE FROM file_view"
|
||||
" USING files,"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE files.ZoneUsrCod=%ld"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
" WHERE brw_files.ZoneUsrCod=%ld"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
UsrCod);
|
||||
|
||||
/***** Remove from database expanded folders *****/
|
||||
|
@ -4971,7 +4974,7 @@ void Brw_RemoveUsrFilesFromDB (long UsrCod)
|
|||
|
||||
/***** Remove from database the entries that store the data files *****/
|
||||
DB_QueryDELETE ("can not remove files in user's file zones",
|
||||
"DELETE FROM files"
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE ZoneUsrCod=%ld",
|
||||
UsrCod);
|
||||
}
|
||||
|
@ -9363,9 +9366,12 @@ bool Brw_CheckIfFileOrFolderIsSetAsHiddenInDB (Brw_FileType_t FileType,const cha
|
|||
|
||||
/***** Get if a file or folder is hidden from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not check if a file is hidden",
|
||||
"SELECT Hidden FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
"SELECT Hidden" // row[0]
|
||||
" FROM brw_files" // row[1]
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,ZoneUsrCod,
|
||||
Path))
|
||||
|
@ -9400,10 +9406,12 @@ bool Brw_CheckIfFileOrFolderIsHidden (struct FileMetadata *FileMetadata)
|
|||
2) the argument Path begins by 'x/', where x is a path stored in database
|
||||
*/
|
||||
return (DB_QueryCOUNT ("can not check if a file or folder is hidden",
|
||||
"SELECT COUNT(*) FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Hidden='Y'"
|
||||
" AND (Path='%s' OR LOCATE(CONCAT(Path,'/'),'%s')=1)",
|
||||
"SELECT COUNT(*) FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Hidden='Y'"
|
||||
" AND (Path='%s' OR LOCATE(CONCAT(Path,'/'),'%s')=1)",
|
||||
FileMetadata->FileBrowser,
|
||||
FileMetadata->Cod,
|
||||
FileMetadata->ZoneUsrCod,
|
||||
|
@ -10355,9 +10363,12 @@ long Brw_GetFilCodByPath (const char *Path,bool OnlyIfPublic)
|
|||
|
||||
/***** Get code of a file from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get file code",
|
||||
"SELECT FilCod FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'%s",
|
||||
"SELECT FilCod"
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'%s",
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,ZoneUsrCod,
|
||||
Path,
|
||||
|
@ -10395,11 +10406,21 @@ void Brw_GetFileMetadataByPath (struct FileMetadata *FileMetadata)
|
|||
|
||||
/***** Get metadata of a file from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get file metadata",
|
||||
"SELECT FilCod,FileBrowser,Cod,ZoneUsrCod,"
|
||||
"PublisherUsrCod,FileType,Path,Hidden,Public,License"
|
||||
" FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
"SELECT FilCod," // row[0]
|
||||
"FileBrowser," // row[1]
|
||||
"Cod," // row[2]
|
||||
"ZoneUsrCod," // row[3]
|
||||
"PublisherUsrCod," // row[4]
|
||||
"FileType," // row[5]
|
||||
"Path," // row[6]
|
||||
"Hidden," // row[7]
|
||||
"Public," // row[8]
|
||||
"License" // row[9]
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,ZoneUsrCod,
|
||||
Gbl.FileBrowser.FilFolLnk.Full))
|
||||
|
@ -10527,9 +10548,17 @@ void Brw_GetFileMetadataByCod (struct FileMetadata *FileMetadata)
|
|||
|
||||
/***** Get metadata of a file from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get file metadata",
|
||||
"SELECT FilCod,FileBrowser,Cod,ZoneUsrCod,"
|
||||
"PublisherUsrCod,FileType,Path,Hidden,Public,License"
|
||||
" FROM files"
|
||||
"SELECT FilCod," // row[0]
|
||||
"FileBrowser," // row[1]
|
||||
"Cod," // row[2]
|
||||
"ZoneUsrCod," // row[3]
|
||||
"PublisherUsrCod," // row[4]
|
||||
"FileType," // row[5]
|
||||
"Path," // row[6]
|
||||
"Hidden," // row[7]
|
||||
"Public," // row[8]
|
||||
"License" // row[9]
|
||||
" FROM brw_files"
|
||||
" WHERE FilCod=%ld",
|
||||
FileMetadata->FilCod))
|
||||
{
|
||||
|
@ -10908,9 +10937,13 @@ static bool Brw_GetIfFolderHasPublicFiles (const char Path[PATH_MAX + 1])
|
|||
|
||||
/***** Get if a file or folder is public from database *****/
|
||||
return (DB_QueryCOUNT ("can not check if a folder contains public files",
|
||||
"SELECT COUNT(*) FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path LIKE '%s/%%' AND Public='Y'",
|
||||
"SELECT COUNT(*)"
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path LIKE '%s/%%'"
|
||||
" AND Public='Y'",
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,ZoneUsrCod,
|
||||
Path) != 0);
|
||||
|
@ -10925,9 +10958,10 @@ unsigned Brw_GetNumFilesUsr (long UsrCod)
|
|||
/***** Get current number of files published by a user from database *****/
|
||||
return
|
||||
(unsigned) DB_QueryCOUNT ("can not get number of files from a user",
|
||||
"SELECT COUNT(*) FROM files"
|
||||
"SELECT COUNT(*)"
|
||||
" FROM brw_files"
|
||||
" WHERE PublisherUsrCod=%ld"
|
||||
" AND FileType IN (%u,%u)",
|
||||
" AND FileType IN (%u,%u)",
|
||||
UsrCod,
|
||||
(unsigned) Brw_IS_FILE,
|
||||
(unsigned) Brw_IS_UNKNOWN); // Unknown entries are counted as files
|
||||
|
@ -10942,10 +10976,11 @@ unsigned Brw_GetNumPublicFilesUsr (long UsrCod)
|
|||
/***** Get current number of public files published by a user from database *****/
|
||||
return
|
||||
(unsigned) DB_QueryCOUNT ("can not get number of public files from a user",
|
||||
"SELECT COUNT(*) FROM files"
|
||||
"SELECT COUNT(*)"
|
||||
" FROM brw_files"
|
||||
" WHERE PublisherUsrCod=%ld"
|
||||
" AND FileType IN (%u,%u)"
|
||||
" AND Public='Y'",
|
||||
" AND FileType IN (%u,%u)"
|
||||
" AND Public='Y'",
|
||||
UsrCod,
|
||||
(unsigned) Brw_IS_FILE,
|
||||
(unsigned) Brw_IS_UNKNOWN); // Unknown entries are counted as files
|
||||
|
@ -10962,9 +10997,12 @@ static void Brw_ChangeFileOrFolderHiddenInDB (const char Path[PATH_MAX + 1],bool
|
|||
|
||||
/***** Mark file as hidden in database *****/
|
||||
DB_QueryUPDATE ("can not change status of a file in database",
|
||||
"UPDATE files SET Hidden='%c'"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
"UPDATE brw_files"
|
||||
" SET Hidden='%c'"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
IsHidden ? 'Y' :
|
||||
'N',
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
|
@ -10988,9 +11026,14 @@ static void Brw_ChangeFilePublicInDB (struct FileMetadata *FileMetadata,
|
|||
|
||||
/***** Change publisher, public and license of file in database *****/
|
||||
DB_QueryUPDATE ("can not change metadata of a file in database",
|
||||
"UPDATE files SET Public='%c',License=%u"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND FilCod=%ld AND Path='%s'",
|
||||
"UPDATE brw_files"
|
||||
" SET Public='%c',"
|
||||
"License=%u"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND FilCod=%ld"
|
||||
" AND Path='%s'",
|
||||
IsPublic ? 'Y' :
|
||||
'N',
|
||||
(unsigned) License,
|
||||
|
@ -11169,7 +11212,7 @@ long Brw_AddPathToDB (long PublisherUsrCod,Brw_FileType_t FileType,
|
|||
/***** Add path to the database *****/
|
||||
return
|
||||
DB_QueryINSERTandReturnCode ("can not add path to database",
|
||||
"INSERT INTO files"
|
||||
"INSERT INTO brw_files"
|
||||
" (FileBrowser,Cod,ZoneUsrCod,"
|
||||
"PublisherUsrCod,FileType,Path,Hidden,Public,License)"
|
||||
" VALUES"
|
||||
|
@ -11206,26 +11249,33 @@ static void Brw_RemoveOneFileOrFolderFromDB (const char Path[PATH_MAX + 1])
|
|||
FileBrowser == Brw_ADMI_MRK_GRP)
|
||||
DB_QueryDELETE ("can not remove properties of marks from database",
|
||||
"DELETE FROM marks_properties"
|
||||
" USING files,marks_properties"
|
||||
" WHERE files.FileBrowser=%u AND files.Cod=%ld"
|
||||
" AND files.Path='%s'"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
" USING brw_files,"
|
||||
"marks_properties"
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.Path='%s'"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
||||
(unsigned) FileBrowser,Cod,Path);
|
||||
|
||||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views from database",
|
||||
"DELETE FROM file_view USING file_view,files"
|
||||
" WHERE files.FileBrowser=%u AND files.Cod=%ld"
|
||||
" AND files.ZoneUsrCod=%ld"
|
||||
" AND files.Path='%s'"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
"DELETE FROM file_view"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.ZoneUsrCod=%ld"
|
||||
" AND brw_files.Path='%s'"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) FileBrowser,Cod,ZoneUsrCod,Path);
|
||||
|
||||
/***** Remove from database the entry that stores the data of a file *****/
|
||||
DB_QueryDELETE ("can not remove path from database",
|
||||
"DELETE FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
(unsigned) FileBrowser,Cod,ZoneUsrCod,Path);
|
||||
}
|
||||
|
||||
|
@ -11250,26 +11300,33 @@ static void Brw_RemoveChildrenOfFolderFromDB (const char Path[PATH_MAX + 1])
|
|||
FileBrowser == Brw_ADMI_MRK_GRP)
|
||||
DB_QueryDELETE ("can not remove properties of marks from database",
|
||||
"DELETE FROM marks_properties"
|
||||
" USING files,marks_properties"
|
||||
" WHERE files.FileBrowser=%u AND files.Cod=%ld"
|
||||
" AND files.Path LIKE '%s/%%'"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
" USING brw_files,"
|
||||
"marks_properties"
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.Path LIKE '%s/%%'"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
||||
(unsigned) FileBrowser,Cod,Path);
|
||||
|
||||
/***** Remove from database the entries that store the file views *****/
|
||||
DB_QueryDELETE ("can not remove file views from database",
|
||||
"DELETE FROM file_view USING file_view,files"
|
||||
" WHERE files.FileBrowser=%u AND files.Cod=%ld"
|
||||
" AND files.ZoneUsrCod=%ld"
|
||||
" AND files.Path LIKE '%s/%%'"
|
||||
" AND files.FilCod=file_view.FilCod",
|
||||
"DELETE FROM file_view"
|
||||
" USING brw_files,"
|
||||
"file_view"
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.ZoneUsrCod=%ld"
|
||||
" AND brw_files.Path LIKE '%s/%%'"
|
||||
" AND brw_files.FilCod=file_view.FilCod",
|
||||
(unsigned) FileBrowser,Cod,ZoneUsrCod,Path);
|
||||
|
||||
/***** Remove from database the entries that store the data of files *****/
|
||||
DB_QueryDELETE ("can not remove paths from database",
|
||||
"DELETE FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path LIKE '%s/%%'",
|
||||
"DELETE FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path LIKE '%s/%%'",
|
||||
(unsigned) FileBrowser,Cod,ZoneUsrCod,Path);
|
||||
}
|
||||
|
||||
|
@ -11285,8 +11342,12 @@ static void Brw_RenameOneFolderInDB (const char OldPath[PATH_MAX + 1],
|
|||
|
||||
/***** Update file or folder in table of common files *****/
|
||||
DB_QueryUPDATE ("can not update folder name in a common zone",
|
||||
"UPDATE files SET Path='%s'"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld AND Path='%s'",
|
||||
"UPDATE brw_files"
|
||||
" SET Path='%s'"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path='%s'",
|
||||
NewPath,
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,ZoneUsrCod,
|
||||
|
@ -11306,9 +11367,12 @@ static void Brw_RenameChildrenFilesOrFoldersInDB (const char OldPath[PATH_MAX +
|
|||
|
||||
/***** Update children of a folder in table of files *****/
|
||||
DB_QueryUPDATE ("can not rename file or folder names in a common zone",
|
||||
"UPDATE files SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||
" AND Path LIKE '%s/%%'",
|
||||
"UPDATE brw_files"
|
||||
" SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND ZoneUsrCod=%ld"
|
||||
" AND Path LIKE '%s/%%'",
|
||||
NewPath,StartFinalSubpathNotChanged,
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,ZoneUsrCod,
|
||||
|
@ -11662,9 +11726,11 @@ static long Brw_GetPublisherOfSubtree (void)
|
|||
/***** Get all common files that are equal to full path (including filename)
|
||||
or that are under that full path from database *****/
|
||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get publishers of files",
|
||||
"SELECT DISTINCT(PublisherUsrCod) FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld"
|
||||
" AND (Path='%s' OR Path LIKE '%s/%%')",
|
||||
"SELECT DISTINCT(PublisherUsrCod)"
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND (Path='%s' OR Path LIKE '%s/%%')",
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,
|
||||
Gbl.FileBrowser.FilFolLnk.Full,
|
||||
|
|
40
swad_mark.c
40
swad_mark.c
|
@ -177,13 +177,16 @@ static void Mrk_GetNumRowsHeaderAndFooter (struct MarksProperties *Marks)
|
|||
get the number of rows of the more recent file. */
|
||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get the number of rows"
|
||||
" in header and footer",
|
||||
"SELECT marks_properties.%s,marks_properties.%s"
|
||||
" FROM files,marks_properties"
|
||||
" WHERE files.FileBrowser=%u"
|
||||
" AND files.Cod=%ld"
|
||||
" AND files.Path='%s'"
|
||||
" AND files.FilCod=marks_properties.FilCod"
|
||||
" ORDER BY files.FilCod DESC LIMIT 1", // On duplicate entries, get the more recent
|
||||
"SELECT marks_properties.%s," // row[0]
|
||||
"marks_properties.%s" // row[1]
|
||||
" FROM brw_files,"
|
||||
"marks_properties"
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.Path='%s'"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod"
|
||||
" ORDER BY brw_files.FilCod DESC"
|
||||
" LIMIT 1", // On duplicate entries, get the more recent
|
||||
Mrk_HeadOrFootStr[Brw_HEADER],
|
||||
Mrk_HeadOrFootStr[Brw_FOOTER],
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
|
@ -252,10 +255,13 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
|
|||
/***** Update properties of marks in the database *****/
|
||||
Cod = Brw_GetCodForFiles ();
|
||||
DB_QueryUPDATE ("can not update properties of marks",
|
||||
"UPDATE marks_properties,files"
|
||||
"UPDATE marks_properties,"
|
||||
"brw_files"
|
||||
" SET marks_properties.%s=%u"
|
||||
" WHERE files.FileBrowser=%u AND files.Cod=%ld AND files.Path='%s'"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
" WHERE brw_files.FileBrowser=%u"
|
||||
" AND brw_files.Cod=%ld"
|
||||
" AND brw_files.Path='%s'"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
||||
Mrk_HeadOrFootStr[HeaderOrFooter],NumRows,
|
||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||
Cod,
|
||||
|
@ -723,11 +729,15 @@ void Mrk_GetNotifMyMarks (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
|||
/***** Get subject of message from database *****/
|
||||
if (DB_QuerySELECT (&mysql_res,"can not get the number of rows"
|
||||
" in header and footer",
|
||||
"SELECT files.FileBrowser,files.Cod,files.Path,"
|
||||
"marks_properties.Header,marks_properties.Footer"
|
||||
" FROM files,marks_properties"
|
||||
" WHERE files.FilCod=%ld"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
"SELECT brw_files.FileBrowser,"
|
||||
"brw_files.Cod,"
|
||||
"brw_files.Path,"
|
||||
"marks_properties.Header,"
|
||||
"marks_properties.Footer"
|
||||
" FROM brw_files,"
|
||||
"marks_properties"
|
||||
" WHERE brw_files.FilCod=%ld"
|
||||
" AND brw_files.FilCod=marks_properties.FilCod",
|
||||
MrkCod) == 1) // Result should have a unique row
|
||||
{
|
||||
/***** Get data of this file of marks *****/
|
||||
|
|
|
@ -1101,11 +1101,15 @@ void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path)
|
|||
return;
|
||||
}
|
||||
DB_QueryUPDATE ("can not set notification(s) as removed",
|
||||
"UPDATE notif SET Status=(Status | %u)"
|
||||
" WHERE NotifyEvent=%u AND Cod IN"
|
||||
" (SELECT FilCod FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld"
|
||||
" AND Path LIKE '%s/%%')",
|
||||
"UPDATE notif"
|
||||
" SET Status=(Status | %u)"
|
||||
" WHERE NotifyEvent=%u"
|
||||
" AND Cod IN"
|
||||
" (SELECT FilCod"
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND Path LIKE '%s/%%')",
|
||||
(unsigned) Ntf_STATUS_BIT_REMOVED,
|
||||
(unsigned) NotifyEvent,
|
||||
(unsigned) FileBrowser,Cod,
|
||||
|
@ -1124,10 +1128,14 @@ void Ntf_MarkNotifFilesInGroupAsRemoved (long GrpCod)
|
|||
{
|
||||
/***** Set notifications as removed *****/
|
||||
DB_QueryUPDATE ("can not set notification(s) as removed",
|
||||
"UPDATE notif SET Status=(Status | %u)"
|
||||
" WHERE NotifyEvent IN (%u,%u,%u,%u) AND Cod IN"
|
||||
" (SELECT FilCod FROM files"
|
||||
" WHERE FileBrowser IN (%u,%u,%u,%u) AND Cod=%ld)",
|
||||
"UPDATE notif"
|
||||
" SET Status=(Status | %u)"
|
||||
" WHERE NotifyEvent IN (%u,%u,%u,%u)"
|
||||
" AND Cod IN"
|
||||
" (SELECT FilCod"
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND Cod=%ld)",
|
||||
(unsigned) Ntf_STATUS_BIT_REMOVED,
|
||||
(unsigned) Ntf_EVENT_DOCUMENT_FILE,
|
||||
(unsigned) Ntf_EVENT_TEACHERS_FILE,
|
||||
|
|
383
swad_search.c
383
swad_search.c
|
@ -703,8 +703,8 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
DB_QuerySELECT (&mysql_res,"can not get files",
|
||||
"SELECT * FROM "
|
||||
"("
|
||||
"SELECT files.FilCod," // Institution
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Institution
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"-1 AS CtrCod,"
|
||||
|
@ -714,20 +714,21 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
"-1 AS CrsCod,"
|
||||
"'' AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.Public='Y' AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.Public='Y'"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Center
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Center
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -737,21 +738,21 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
"-1 AS CrsCod,"
|
||||
"'' AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.Public='Y' AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.Public='Y' AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Degree
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Degree
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -760,22 +761,22 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
"deg_degrees.ShortName AS DegShortName,"
|
||||
"-1,'' AS CrsShortName,"
|
||||
"-1"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.Public='Y' AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.Public='Y' AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Course
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Course
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -785,20 +786,20 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
"crs_courses.CrsCod,"
|
||||
"crs_courses.ShortName AS CrsShortName,"
|
||||
"-1"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.Public='Y' AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.Public='Y' AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
") AS selected_files"
|
||||
" WHERE PathFromRoot<>''"
|
||||
" ORDER BY InsShortName,"
|
||||
|
@ -849,7 +850,7 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
/***** Check user's permission *****/
|
||||
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_DOCUM_IN_MY_COURSES))
|
||||
/***** Split document string into words *****/
|
||||
if (Sch_BuildSearchQuery (SearchQuery,"SUBSTRING_INDEX(files.Path,'/',-1)",
|
||||
if (Sch_BuildSearchQuery (SearchQuery,"SUBSTRING_INDEX(brw_files.Path,'/',-1)",
|
||||
"_latin1 "," COLLATE latin1_general_ci"))
|
||||
{
|
||||
/***** Create temporary table with codes of files in documents and shared areas accessible by me.
|
||||
|
@ -861,10 +862,12 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
"CREATE TEMPORARY TABLE my_files_crs"
|
||||
" (FilCod INT NOT NULL,UNIQUE INDEX(FilCod))"
|
||||
" ENGINE=MEMORY"
|
||||
" SELECT files.FilCod FROM crs_usr,files"
|
||||
" WHERE crs_usr.UsrCod=%ld"
|
||||
" AND crs_usr.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN (%u,%u,%u,%u)",
|
||||
" SELECT brw_files.FilCod"
|
||||
" FROM crs_usr,"
|
||||
"brw_files"
|
||||
" WHERE crs_usr.UsrCod=%ld"
|
||||
" AND crs_usr.CrsCod=brw_files.Cod"
|
||||
" AND brw_files.FileBrowser IN (%u,%u,%u,%u)",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
(unsigned) Brw_ADMI_DOC_CRS,
|
||||
(unsigned) Brw_ADMI_TCH_CRS,
|
||||
|
@ -875,10 +878,11 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
"CREATE TEMPORARY TABLE my_files_grp"
|
||||
" (FilCod INT NOT NULL,UNIQUE INDEX(FilCod))"
|
||||
" ENGINE=MEMORY"
|
||||
" SELECT files.FilCod FROM crs_grp_usr,files"
|
||||
" WHERE crs_grp_usr.UsrCod=%ld"
|
||||
" AND crs_grp_usr.GrpCod=files.Cod"
|
||||
" AND files.FileBrowser IN (%u,%u,%u,%u)",
|
||||
" SELECT brw_files.FilCod"
|
||||
" FROM crs_grp_usr,brw_files"
|
||||
" WHERE crs_grp_usr.UsrCod=%ld"
|
||||
" AND crs_grp_usr.GrpCod=brw_files.Cod"
|
||||
" AND brw_files.FileBrowser IN (%u,%u,%u,%u)",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
(unsigned) Brw_ADMI_DOC_GRP,
|
||||
(unsigned) Brw_ADMI_TCH_GRP,
|
||||
|
@ -890,8 +894,8 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
DB_QuerySELECT (&mysql_res,"can not get files",
|
||||
"SELECT * FROM "
|
||||
"("
|
||||
"SELECT files.FilCod,"
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod,"
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -901,23 +905,24 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
"crs_courses.CrsCod,"
|
||||
"crs_courses.ShortName AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.FilCod IN (SELECT FilCod FROM my_files_crs) AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND files.Cod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.FilCod IN (SELECT FilCod FROM my_files_crs)"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod,"
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod,"
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -927,24 +932,25 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
"crs_courses.CrsCod,"
|
||||
"crs_courses.ShortName AS CrsShortName,"
|
||||
"crs_grp.GrpCod"
|
||||
" FROM files,"
|
||||
"crs_grp,"
|
||||
"crs_grp_types,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.FilCod IN (SELECT FilCod FROM my_files_grp) AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp_types.CrsCod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_grp,"
|
||||
"crs_grp_types,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.FilCod IN (SELECT FilCod FROM my_files_grp)"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp_types.CrsCod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
") AS selected_files"
|
||||
" WHERE PathFromRoot<>''"
|
||||
" ORDER BY InsShortName,"
|
||||
|
@ -995,7 +1001,7 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
/***** Check user's permission *****/
|
||||
if (Sch_CheckIfIHavePermissionToSearch (Sch_SEARCH_MY_DOCUMENTS))
|
||||
/***** Split document string into words *****/
|
||||
if (Sch_BuildSearchQuery (SearchQuery,"SUBSTRING_INDEX(files.Path,'/',-1)",
|
||||
if (Sch_BuildSearchQuery (SearchQuery,"SUBSTRING_INDEX(brw_files.Path,'/',-1)",
|
||||
"_latin1 "," COLLATE latin1_general_ci"))
|
||||
{
|
||||
/***** Build the query *****/
|
||||
|
@ -1003,8 +1009,8 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
DB_QuerySELECT (&mysql_res,"can not get files",
|
||||
"SELECT * FROM "
|
||||
"("
|
||||
"SELECT files.FilCod," // Institution
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Institution
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"-1 AS CtrCod,"
|
||||
|
@ -1014,20 +1020,21 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"-1 AS CrsCod,"
|
||||
"'' AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.PublisherUsrCod=%ld AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.PublisherUsrCod=%ld"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Center
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Center
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -1037,21 +1044,21 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"-1 AS CrsCod,"
|
||||
"'' AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.PublisherUsrCod=%ld AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.PublisherUsrCod=%ld AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Degree
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Degree
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -1061,22 +1068,23 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"-1 AS CrsCod,"
|
||||
"'' AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.PublisherUsrCod=%ld AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u)"
|
||||
" AND files.Cod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.PublisherUsrCod=%ld"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u)"
|
||||
" AND brw_files.Cod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Course
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Course
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -1086,23 +1094,24 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"crs_courses.CrsCod,"
|
||||
"crs_courses.ShortName AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.PublisherUsrCod=%ld AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND files.Cod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.PublisherUsrCod=%ld"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Group
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Group
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"ins_instits.InsCod,"
|
||||
"ins_instits.ShortName AS InsShortName,"
|
||||
"ctr_centers.CtrCod,"
|
||||
|
@ -1112,27 +1121,28 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"crs_courses.CrsCod,"
|
||||
"crs_courses.ShortName AS CrsShortName,"
|
||||
"crs_grp.GrpCod"
|
||||
" FROM files,"
|
||||
"crs_grp,"
|
||||
"crs_grp_types,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE files.PublisherUsrCod=%ld AND %s"
|
||||
" AND files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp_types.CrsCod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" FROM brw_files,"
|
||||
"crs_grp,"
|
||||
"crs_grp_types,"
|
||||
"crs_courses,"
|
||||
"deg_degrees,"
|
||||
"ctr_centers,"
|
||||
"ins_instits,"
|
||||
"cty_countrs"
|
||||
" WHERE brw_files.PublisherUsrCod=%ld"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser IN (%u,%u,%u,%u)"
|
||||
" AND brw_files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp_types.CrsCod=crs_courses.CrsCod"
|
||||
" AND crs_courses.DegCod=deg_degrees.DegCod"
|
||||
" AND deg_degrees.CtrCod=ctr_centers.CtrCod"
|
||||
" AND ctr_centers.InsCod=ins_instits.InsCod"
|
||||
" AND ins_instits.CtyCod=cty_countrs.CtyCod"
|
||||
"%s"
|
||||
" UNION "
|
||||
"SELECT files.FilCod," // Briefcase
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"SELECT brw_files.FilCod," // Briefcase
|
||||
"SUBSTRING(brw_files.Path,LOCATE('/',brw_files.Path)) AS PathFromRoot,"
|
||||
"-1 AS InsCod,"
|
||||
"'' AS InsShortName,"
|
||||
"-1 AS CtrCod,"
|
||||
|
@ -1142,9 +1152,10 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"-1 AS CrsCod,"
|
||||
"'' AS CrsShortName,"
|
||||
"-1 AS GrpCod"
|
||||
" FROM files"
|
||||
" WHERE files.PublisherUsrCod=%ld AND %s"
|
||||
" AND files.FileBrowser=%u"
|
||||
" FROM brw_files"
|
||||
" WHERE brw_files.PublisherUsrCod=%ld"
|
||||
" AND %s"
|
||||
" AND brw_files.FileBrowser=%u"
|
||||
") AS selected_files"
|
||||
" WHERE PathFromRoot<>''"
|
||||
" ORDER BY InsShortName,"
|
||||
|
|
|
@ -200,11 +200,16 @@ void Tml_DB_MarkNotesChildrenOfFolderAsUnavailable (Tml_Not_NoteType_t NoteType,
|
|||
{
|
||||
/***** Mark notes as unavailable *****/
|
||||
DB_QueryUPDATE ("can not mark notes as unavailable",
|
||||
"UPDATE tml_notes SET Unavailable='Y'"
|
||||
" WHERE NoteType=%u AND Cod IN"
|
||||
" (SELECT FilCod FROM files"
|
||||
" WHERE FileBrowser=%u AND Cod=%ld"
|
||||
" AND Path LIKE '%s/%%' AND Public='Y')", // Only public files
|
||||
"UPDATE tml_notes"
|
||||
" SET Unavailable='Y'"
|
||||
" WHERE NoteType=%u"
|
||||
" AND Cod IN"
|
||||
" (SELECT FilCod"
|
||||
" FROM brw_files"
|
||||
" WHERE FileBrowser=%u"
|
||||
" AND Cod=%ld"
|
||||
" AND Path LIKE '%s/%%'"
|
||||
" AND Public='Y')", // Only public files
|
||||
(unsigned) NoteType,
|
||||
(unsigned) FileBrowser,Cod,
|
||||
Path);
|
||||
|
|
Loading…
Reference in New Issue