mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-01 06:15:31 +02:00
Version 20.51.2: Mar 18, 2021 Expanded folders database table renamed.
This commit is contained in:
parent
7810833e07
commit
881849f3e7
26
sql/swad.sql
26
sql/swad.sql
|
@ -151,6 +151,19 @@ CREATE TABLE IF NOT EXISTS brw_clipboards (
|
||||||
INDEX(FileBrowser,Cod),
|
INDEX(FileBrowser,Cod),
|
||||||
INDEX(WorksUsrCod));
|
INDEX(WorksUsrCod));
|
||||||
--
|
--
|
||||||
|
-- Table brw_expanded_folders: stores the expanded folders for each user
|
||||||
|
--
|
||||||
|
CREATE TABLE IF NOT EXISTS brw_expanded_folders (
|
||||||
|
UsrCod INT NOT NULL,
|
||||||
|
FileBrowser TINYINT NOT NULL,
|
||||||
|
Cod INT NOT NULL DEFAULT -1,
|
||||||
|
WorksUsrCod INT NOT NULL,
|
||||||
|
Path TEXT COLLATE latin1_bin NOT NULL,
|
||||||
|
ClickTime DATETIME NOT NULL,
|
||||||
|
INDEX(UsrCod,FileBrowser,Cod),
|
||||||
|
INDEX(FileBrowser,Cod),
|
||||||
|
INDEX(WorksUsrCod));
|
||||||
|
--
|
||||||
-- Table cfe_calls_for_exams: stores the calls for examination
|
-- Table cfe_calls_for_exams: stores the calls for examination
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS cfe_calls_for_exams (
|
CREATE TABLE IF NOT EXISTS cfe_calls_for_exams (
|
||||||
|
@ -558,19 +571,6 @@ CREATE TABLE IF NOT EXISTS exa_sets (
|
||||||
UNIQUE INDEX(SetCod),
|
UNIQUE INDEX(SetCod),
|
||||||
UNIQUE INDEX(ExaCod,SetInd));
|
UNIQUE INDEX(ExaCod,SetInd));
|
||||||
--
|
--
|
||||||
-- Table expanded_folders: stores the expanded folders for each user
|
|
||||||
--
|
|
||||||
CREATE TABLE IF NOT EXISTS expanded_folders (
|
|
||||||
UsrCod INT NOT NULL,
|
|
||||||
FileBrowser TINYINT NOT NULL,
|
|
||||||
Cod INT NOT NULL DEFAULT -1,
|
|
||||||
WorksUsrCod INT NOT NULL,
|
|
||||||
Path TEXT COLLATE latin1_bin NOT NULL,
|
|
||||||
ClickTime DATETIME NOT NULL,
|
|
||||||
INDEX(UsrCod,FileBrowser,Cod),
|
|
||||||
INDEX(FileBrowser,Cod),
|
|
||||||
INDEX(WorksUsrCod));
|
|
||||||
--
|
|
||||||
-- Table figures: stores cached figures for quick retrieval of figures (i.e. number of students in the platform)
|
-- Table figures: stores cached figures for quick retrieval of figures (i.e. number of students in the platform)
|
||||||
--
|
--
|
||||||
CREATE TABLE IF NOT EXISTS figures (
|
CREATE TABLE IF NOT EXISTS figures (
|
||||||
|
|
|
@ -607,6 +607,10 @@ TODO: FIX BUG, URGENT! En las fechas como par
|
||||||
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 20.51.2: Mar 18, 2021 Expanded folders database table renamed. (307539 lines)
|
||||||
|
1 change necessary in database:
|
||||||
|
RENAME TABLE expanded_folders TO brw_expanded_folders;
|
||||||
|
|
||||||
Version 20.51.1: Mar 18, 2021 Calls for exams database table renamed. (? lines)
|
Version 20.51.1: Mar 18, 2021 Calls for exams database table renamed. (? lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
RENAME TABLE exam_announcements TO cfe_calls_for_exams;
|
RENAME TABLE exam_announcements TO cfe_calls_for_exams;
|
||||||
|
|
|
@ -409,6 +409,32 @@ mysql> DESCRIBE brw_clipboards;
|
||||||
"INDEX(FileBrowser,Cod),"
|
"INDEX(FileBrowser,Cod),"
|
||||||
"INDEX(WorksUsrCod))");
|
"INDEX(WorksUsrCod))");
|
||||||
|
|
||||||
|
/***** Table brw_expanded_folders *****/
|
||||||
|
/*
|
||||||
|
mysql> DESCRIBE brw_expanded_folders;
|
||||||
|
+-------------+------------+------+-----+---------+-------+
|
||||||
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
|
+-------------+------------+------+-----+---------+-------+
|
||||||
|
| UsrCod | int(11) | NO | MUL | NULL | |
|
||||||
|
| FileBrowser | tinyint(4) | NO | MUL | NULL | |
|
||||||
|
| Cod | int(11) | NO | | -1 | |
|
||||||
|
| WorksUsrCod | int(11) | NO | MUL | NULL | |
|
||||||
|
| Path | text | NO | | NULL | |
|
||||||
|
| ClickTime | datetime | NO | | NULL | |
|
||||||
|
+-------------+------------+------+-----+---------+-------+
|
||||||
|
6 rows in set (0.00 sec)
|
||||||
|
*/
|
||||||
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS brw_expanded_folders ("
|
||||||
|
"UsrCod INT NOT NULL,"
|
||||||
|
"FileBrowser TINYINT NOT NULL,"
|
||||||
|
"Cod INT NOT NULL DEFAULT -1,"
|
||||||
|
"WorksUsrCod INT NOT NULL,"
|
||||||
|
"Path TEXT COLLATE latin1_bin NOT NULL," // PATH_MAX
|
||||||
|
"ClickTime DATETIME NOT NULL,"
|
||||||
|
"INDEX(UsrCod,FileBrowser,Cod),"
|
||||||
|
"INDEX(FileBrowser,Cod),"
|
||||||
|
"INDEX(WorksUsrCod))");
|
||||||
|
|
||||||
/***** Table cfe_calls_for_exams *****/
|
/***** Table cfe_calls_for_exams *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE cfe_calls_for_exams;
|
mysql> DESCRIBE cfe_calls_for_exams;
|
||||||
|
@ -1229,32 +1255,6 @@ mysql> DESCRIBE exa_sets;
|
||||||
"UNIQUE INDEX(SetCod),"
|
"UNIQUE INDEX(SetCod),"
|
||||||
"UNIQUE INDEX(ExaCod,SetInd))");
|
"UNIQUE INDEX(ExaCod,SetInd))");
|
||||||
|
|
||||||
/***** Table expanded_folders *****/
|
|
||||||
/*
|
|
||||||
mysql> DESCRIBE expanded_folders;
|
|
||||||
+-------------+------------+------+-----+---------+-------+
|
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
|
||||||
+-------------+------------+------+-----+---------+-------+
|
|
||||||
| UsrCod | int(11) | NO | MUL | NULL | |
|
|
||||||
| FileBrowser | tinyint(4) | NO | MUL | NULL | |
|
|
||||||
| Cod | int(11) | NO | | -1 | |
|
|
||||||
| WorksUsrCod | int(11) | NO | MUL | NULL | |
|
|
||||||
| Path | text | NO | | NULL | |
|
|
||||||
| ClickTime | datetime | NO | | NULL | |
|
|
||||||
+-------------+------------+------+-----+---------+-------+
|
|
||||||
6 rows in set (0.00 sec)
|
|
||||||
*/
|
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS expanded_folders ("
|
|
||||||
"UsrCod INT NOT NULL,"
|
|
||||||
"FileBrowser TINYINT NOT NULL,"
|
|
||||||
"Cod INT NOT NULL DEFAULT -1,"
|
|
||||||
"WorksUsrCod INT NOT NULL,"
|
|
||||||
"Path TEXT COLLATE latin1_bin NOT NULL," // PATH_MAX
|
|
||||||
"ClickTime DATETIME NOT NULL,"
|
|
||||||
"INDEX(UsrCod,FileBrowser,Cod),"
|
|
||||||
"INDEX(FileBrowser,Cod),"
|
|
||||||
"INDEX(WorksUsrCod))");
|
|
||||||
|
|
||||||
/***** Table figures *****/
|
/***** Table figures *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE figures;
|
mysql> DESCRIBE figures;
|
||||||
|
|
|
@ -4185,7 +4185,7 @@ void Brw_RemoveInsFilesFromDB (long InsCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders of an institution",
|
DB_QueryDELETE ("can not remove expanded folders of an institution",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u)"
|
" WHERE FileBrowser IN (%u,%u)"
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
(unsigned) Brw_ADMI_DOC_INS,
|
(unsigned) Brw_ADMI_DOC_INS,
|
||||||
|
@ -4253,7 +4253,7 @@ void Brw_RemoveCtrFilesFromDB (long CtrCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a center",
|
DB_QueryDELETE ("can not remove expanded folders of a center",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u)"
|
" WHERE FileBrowser IN (%u,%u)"
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
(unsigned) Brw_ADMI_DOC_CTR,
|
(unsigned) Brw_ADMI_DOC_CTR,
|
||||||
|
@ -4316,7 +4316,7 @@ void Brw_RemoveDegFilesFromDB (long DegCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a degree",
|
DB_QueryDELETE ("can not remove expanded folders of a degree",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u)"
|
" WHERE FileBrowser IN (%u,%u)"
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
(unsigned) Brw_ADMI_DOC_DEG,
|
(unsigned) Brw_ADMI_DOC_DEG,
|
||||||
|
@ -4442,7 +4442,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
/* Remove from course file zones */
|
/* Remove from course file zones */
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a course",
|
DB_QueryDELETE ("can not remove expanded folders of a course",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u,%u,%u,%u,%u,%u,%u)"
|
" WHERE FileBrowser IN (%u,%u,%u,%u,%u,%u,%u,%u)"
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
(unsigned) Brw_ADMI_DOC_CRS,
|
(unsigned) Brw_ADMI_DOC_CRS,
|
||||||
|
@ -4457,7 +4457,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
||||||
|
|
||||||
/* Remove from group file zones */
|
/* Remove from group file zones */
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a course",
|
DB_QueryDELETE ("can not remove expanded folders of a course",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
||||||
" AND Cod IN %s",
|
" AND Cod IN %s",
|
||||||
(unsigned) Brw_ADMI_DOC_GRP,
|
(unsigned) Brw_ADMI_DOC_GRP,
|
||||||
|
@ -4468,7 +4468,7 @@ void Brw_RemoveCrsFilesFromDB (long CrsCod)
|
||||||
|
|
||||||
/* Remove from project file zones */
|
/* Remove from project file zones */
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a course",
|
DB_QueryDELETE ("can not remove expanded folders of a course",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u)"
|
" WHERE FileBrowser IN (%u,%u)"
|
||||||
" AND Cod IN %s",
|
" AND Cod IN %s",
|
||||||
(unsigned) Brw_ADMI_DOC_PRJ,
|
(unsigned) Brw_ADMI_DOC_PRJ,
|
||||||
|
@ -4647,7 +4647,7 @@ void Brw_RemoveGrpFilesFromDB (long GrpCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a group",
|
DB_QueryDELETE ("can not remove expanded folders of a group",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
" WHERE FileBrowser IN (%u,%u,%u,%u)"
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
(unsigned) Brw_ADMI_DOC_GRP,
|
(unsigned) Brw_ADMI_DOC_GRP,
|
||||||
|
@ -4721,7 +4721,7 @@ void Brw_RemovePrjFilesFromDB (long PrjCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a project",
|
DB_QueryDELETE ("can not remove expanded folders of a project",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u)"
|
" WHERE FileBrowser IN (%u,%u)"
|
||||||
" AND Cod=%ld",
|
" AND Cod=%ld",
|
||||||
(unsigned) Brw_ADMI_DOC_PRJ,
|
(unsigned) Brw_ADMI_DOC_PRJ,
|
||||||
|
@ -4773,7 +4773,7 @@ void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long UsrCod,long CrsCod)
|
||||||
{
|
{
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders for a user in a course",
|
DB_QueryDELETE ("can not remove expanded folders for a user in a course",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" AND ("
|
" AND ("
|
||||||
"(FileBrowser IN (%u,%u,%u,%u,%u,%u,%u,%u)"
|
"(FileBrowser IN (%u,%u,%u,%u,%u,%u,%u,%u)"
|
||||||
|
@ -4889,7 +4889,7 @@ void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders of a group",
|
DB_QueryDELETE ("can not remove expanded folders of a group",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE FileBrowser IN (%u,%u)"
|
" WHERE FileBrowser IN (%u,%u)"
|
||||||
" AND Cod=%ld"
|
" AND Cod=%ld"
|
||||||
" AND WorksUsrCod=%ld",
|
" AND WorksUsrCod=%ld",
|
||||||
|
@ -4947,7 +4947,7 @@ void Brw_RemoveUsrFilesFromDB (long UsrCod)
|
||||||
|
|
||||||
/***** Remove from database expanded folders *****/
|
/***** Remove from database expanded folders *****/
|
||||||
DB_QueryDELETE ("can not remove expanded folders for a user",
|
DB_QueryDELETE ("can not remove expanded folders for a user",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld",
|
" WHERE UsrCod=%ld",
|
||||||
UsrCod);
|
UsrCod);
|
||||||
|
|
||||||
|
@ -7375,7 +7375,7 @@ static void Brw_InsertFolderInExpandedFolders (const char Path[PATH_MAX + 1])
|
||||||
/***** Update path time in table of expanded folders *****/
|
/***** Update path time in table of expanded folders *****/
|
||||||
// Path must be stored with final '/'
|
// Path must be stored with final '/'
|
||||||
DB_QueryINSERT ("can not expand the content of a folder",
|
DB_QueryINSERT ("can not expand the content of a folder",
|
||||||
"INSERT INTO expanded_folders"
|
"INSERT INTO brw_expanded_folders"
|
||||||
" (UsrCod,FileBrowser,Cod,WorksUsrCod,Path,ClickTime)"
|
" (UsrCod,FileBrowser,Cod,WorksUsrCod,Path,ClickTime)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%u,%ld,%ld,'%s/',NOW())",
|
" (%ld,%u,%ld,%ld,'%s/',NOW())",
|
||||||
|
@ -7400,26 +7400,33 @@ static void Brw_UpdateClickTimeOfThisFileBrowserInExpandedFolders (void)
|
||||||
{
|
{
|
||||||
if (WorksUsrCod > 0)
|
if (WorksUsrCod > 0)
|
||||||
DB_QueryUPDATE ("can not update expanded folder",
|
DB_QueryUPDATE ("can not update expanded folder",
|
||||||
"UPDATE expanded_folders SET ClickTime=NOW()"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" SET ClickTime=NOW()"
|
||||||
" AND Cod=%ld AND WorksUsrCod=%ld",
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND WorksUsrCod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,
|
Cod,
|
||||||
WorksUsrCod);
|
WorksUsrCod);
|
||||||
else
|
else
|
||||||
DB_QueryUPDATE ("can not update expanded folder",
|
DB_QueryUPDATE ("can not update expanded folder",
|
||||||
"UPDATE expanded_folders SET ClickTime=NOW()"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" SET ClickTime=NOW()"
|
||||||
" AND Cod=%ld",
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod);
|
Cod);
|
||||||
}
|
}
|
||||||
else // Briefcase
|
else // Briefcase
|
||||||
DB_QueryUPDATE ("can not update expanded folder",
|
DB_QueryUPDATE ("can not update expanded folder",
|
||||||
"UPDATE expanded_folders SET ClickTime=NOW()"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u",
|
" SET ClickTime=NOW()"
|
||||||
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND FileBrowser=%u",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders);
|
(unsigned) FileBrowserForExpandedFolders);
|
||||||
}
|
}
|
||||||
|
@ -7439,25 +7446,31 @@ static void Brw_RemoveFolderFromExpandedFolders (const char Path[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
if (WorksUsrCod > 0)
|
if (WorksUsrCod > 0)
|
||||||
DB_QueryDELETE ("can not contract the content of a folder",
|
DB_QueryDELETE ("can not contract the content of a folder",
|
||||||
"DELETE FROM expanded_folders"
|
"DELETE FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Cod=%ld AND WorksUsrCod=%ld AND Path='%s/'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND WorksUsrCod=%ld"
|
||||||
|
" AND Path='%s/'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) FileBrowserForExpandedFolders,
|
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,WorksUsrCod,Path);
|
Cod,WorksUsrCod,Path);
|
||||||
else
|
else
|
||||||
DB_QueryDELETE ("can not contract the content of a folder",
|
DB_QueryDELETE ("can not contract the content of a folder",
|
||||||
"DELETE FROM expanded_folders"
|
"DELETE FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Cod=%ld AND Path='%s/'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND Path='%s/'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,Path);
|
Cod,Path);
|
||||||
}
|
}
|
||||||
else // Briefcase
|
else // Briefcase
|
||||||
DB_QueryDELETE ("can not contract the content of a folder",
|
DB_QueryDELETE ("can not contract the content of a folder",
|
||||||
"DELETE FROM expanded_folders"
|
"DELETE FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Path='%s/'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Path='%s/'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) FileBrowserForExpandedFolders,
|
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) FileBrowserForExpandedFolders,
|
||||||
Path);
|
Path);
|
||||||
}
|
}
|
||||||
|
@ -7477,25 +7490,31 @@ static void Brw_RemoveAffectedExpandedFolders (const char Path[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
if (WorksUsrCod > 0)
|
if (WorksUsrCod > 0)
|
||||||
DB_QueryDELETE ("can not remove expanded folders",
|
DB_QueryDELETE ("can not remove expanded folders",
|
||||||
"DELETE FROM expanded_folders"
|
"DELETE FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Cod=%ld AND WorksUsrCod=%ld AND Path LIKE '%s/%%'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND WorksUsrCod=%ld"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) FileBrowserForExpandedFolders,
|
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,WorksUsrCod,Path);
|
Cod,WorksUsrCod,Path);
|
||||||
else
|
else
|
||||||
DB_QueryDELETE ("can not remove expanded folders",
|
DB_QueryDELETE ("can not remove expanded folders",
|
||||||
"DELETE FROM expanded_folders"
|
"DELETE FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Cod=%ld AND Path LIKE '%s/%%'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,Path);
|
Cod,Path);
|
||||||
}
|
}
|
||||||
else // Briefcase
|
else // Briefcase
|
||||||
DB_QueryDELETE ("can not remove expanded folders",
|
DB_QueryDELETE ("can not remove expanded folders",
|
||||||
"DELETE FROM expanded_folders"
|
"DELETE FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Path LIKE '%s/%%'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Path);
|
Path);
|
||||||
|
@ -7520,20 +7539,25 @@ static void Brw_RenameAffectedExpandedFolders (Brw_FileBrowser_t FileBrowser,
|
||||||
{
|
{
|
||||||
if (WorksUsrCod > 0)
|
if (WorksUsrCod > 0)
|
||||||
DB_QueryUPDATE ("can not update expanded folders",
|
DB_QueryUPDATE ("can not update expanded folders",
|
||||||
"UPDATE expanded_folders SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||||
" AND Cod=%ld AND WorksUsrCod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Path LIKE '%s/%%'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND WorksUsrCod=%ld"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
NewPath,StartFinalSubpathNotChanged,
|
NewPath,StartFinalSubpathNotChanged,
|
||||||
MyUsrCod,(unsigned) FileBrowserForExpandedFolders,
|
MyUsrCod,(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,WorksUsrCod,
|
Cod,WorksUsrCod,
|
||||||
OldPath);
|
OldPath);
|
||||||
else
|
else
|
||||||
DB_QueryUPDATE ("can not update expanded folders",
|
DB_QueryUPDATE ("can not update expanded folders",
|
||||||
"UPDATE expanded_folders SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||||
" AND Cod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Path LIKE '%s/%%'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
NewPath,StartFinalSubpathNotChanged,
|
NewPath,StartFinalSubpathNotChanged,
|
||||||
MyUsrCod,(unsigned) FileBrowserForExpandedFolders,
|
MyUsrCod,(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,
|
Cod,
|
||||||
|
@ -7543,19 +7567,23 @@ static void Brw_RenameAffectedExpandedFolders (Brw_FileBrowser_t FileBrowser,
|
||||||
{
|
{
|
||||||
if (WorksUsrCod > 0)
|
if (WorksUsrCod > 0)
|
||||||
DB_QueryUPDATE ("can not update expanded folders",
|
DB_QueryUPDATE ("can not update expanded folders",
|
||||||
"UPDATE expanded_folders SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE FileBrowser=%u AND Cod=%ld"
|
" SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||||
" AND WorksUsrCod=%ld"
|
" WHERE FileBrowser=%u"
|
||||||
" AND Path LIKE '%s/%%'",
|
" AND Cod=%ld"
|
||||||
|
" AND WorksUsrCod=%ld"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
NewPath,StartFinalSubpathNotChanged,
|
NewPath,StartFinalSubpathNotChanged,
|
||||||
(unsigned) FileBrowserForExpandedFolders,Cod,
|
(unsigned) FileBrowserForExpandedFolders,Cod,
|
||||||
WorksUsrCod,
|
WorksUsrCod,
|
||||||
OldPath);
|
OldPath);
|
||||||
else
|
else
|
||||||
DB_QueryUPDATE ("can not update expanded folders",
|
DB_QueryUPDATE ("can not update expanded folders",
|
||||||
"UPDATE expanded_folders SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE FileBrowser=%u AND Cod=%ld"
|
" SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||||
" AND Path LIKE '%s/%%'",
|
" WHERE FileBrowser=%u"
|
||||||
|
" AND Cod=%ld"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
NewPath,StartFinalSubpathNotChanged,
|
NewPath,StartFinalSubpathNotChanged,
|
||||||
(unsigned) FileBrowserForExpandedFolders,Cod,
|
(unsigned) FileBrowserForExpandedFolders,Cod,
|
||||||
OldPath);
|
OldPath);
|
||||||
|
@ -7563,9 +7591,11 @@ static void Brw_RenameAffectedExpandedFolders (Brw_FileBrowser_t FileBrowser,
|
||||||
}
|
}
|
||||||
else // Briefcase
|
else // Briefcase
|
||||||
DB_QueryUPDATE ("can not update expanded folders",
|
DB_QueryUPDATE ("can not update expanded folders",
|
||||||
"UPDATE expanded_folders SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
"UPDATE brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" SET Path=CONCAT('%s','/',SUBSTRING(Path,%u))"
|
||||||
" AND Path LIKE '%s/%%'",
|
" WHERE UsrCod=%ld"
|
||||||
|
" AND FileBrowser=%u"
|
||||||
|
" AND Path LIKE '%s/%%'",
|
||||||
NewPath,StartFinalSubpathNotChanged,
|
NewPath,StartFinalSubpathNotChanged,
|
||||||
MyUsrCod,
|
MyUsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
|
@ -7588,20 +7618,23 @@ static bool Brw_GetIfExpandedTree (const char Path[PATH_MAX + 1])
|
||||||
{
|
{
|
||||||
if (WorksUsrCod > 0)
|
if (WorksUsrCod > 0)
|
||||||
Expanded = (DB_QueryCOUNT ("can not get check if a folder is expanded",
|
Expanded = (DB_QueryCOUNT ("can not get check if a folder is expanded",
|
||||||
"SELECT COUNT(*) FROM expanded_folders"
|
"SELECT COUNT(*) FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Cod=%ld AND WorksUsrCod=%ld"
|
" AND FileBrowser=%u"
|
||||||
" AND Path='%s/'",
|
" AND Cod=%ld"
|
||||||
|
" AND WorksUsrCod=%ld"
|
||||||
|
" AND Path='%s/'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,WorksUsrCod,
|
Cod,WorksUsrCod,
|
||||||
Path) != 0);
|
Path) != 0);
|
||||||
else
|
else
|
||||||
Expanded = (DB_QueryCOUNT ("can not get check if a folder is expanded",
|
Expanded = (DB_QueryCOUNT ("can not get check if a folder is expanded",
|
||||||
"SELECT COUNT(*) FROM expanded_folders"
|
"SELECT COUNT(*) FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Cod=%ld"
|
" AND FileBrowser=%u"
|
||||||
" AND Path='%s/'",
|
" AND Cod=%ld"
|
||||||
|
" AND Path='%s/'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Cod,
|
Cod,
|
||||||
|
@ -7609,9 +7642,10 @@ static bool Brw_GetIfExpandedTree (const char Path[PATH_MAX + 1])
|
||||||
}
|
}
|
||||||
else // Briefcase
|
else // Briefcase
|
||||||
Expanded = (DB_QueryCOUNT ("can not get check if a folder is expanded",
|
Expanded = (DB_QueryCOUNT ("can not get check if a folder is expanded",
|
||||||
"SELECT COUNT(*) FROM expanded_folders"
|
"SELECT COUNT(*) FROM brw_expanded_folders"
|
||||||
" WHERE UsrCod=%ld AND FileBrowser=%u"
|
" WHERE UsrCod=%ld"
|
||||||
" AND Path='%s/'",
|
" AND FileBrowser=%u"
|
||||||
|
" AND Path='%s/'",
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
(unsigned) FileBrowserForExpandedFolders,
|
(unsigned) FileBrowserForExpandedFolders,
|
||||||
Path) != 0);
|
Path) != 0);
|
||||||
|
@ -7678,7 +7712,7 @@ void Brw_RemoveExpiredExpandedFolders (void)
|
||||||
{
|
{
|
||||||
/***** Remove all expired clipboards *****/
|
/***** Remove all expired clipboards *****/
|
||||||
DB_QueryDELETE ("can not remove old expanded folders",
|
DB_QueryDELETE ("can not remove old expanded folders",
|
||||||
"DELETE LOW_PRIORITY FROM expanded_folders"
|
"DELETE LOW_PRIORITY FROM brw_expanded_folders"
|
||||||
" WHERE ClickTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-%lu)",
|
" WHERE ClickTime<FROM_UNIXTIME(UNIX_TIMESTAMP()-%lu)",
|
||||||
Cfg_TIME_TO_DELETE_BROWSER_EXPANDED_FOLDERS);
|
Cfg_TIME_TO_DELETE_BROWSER_EXPANDED_FOLDERS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user