mirror of https://github.com/acanas/swad-core.git
Version 14.68
This commit is contained in:
parent
0358f6ca96
commit
8fe68819d6
|
@ -689,12 +689,20 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
|
|||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
}
|
||||
|
||||
/***** Remove user's clipboards *****/
|
||||
Brw_RemoveUsrClipboard (UsrDat->UsrCod);
|
||||
/***** Remove user's clipboard in forums *****/
|
||||
For_RemoveUsrFromThrClipboard (UsrDat->UsrCod);
|
||||
|
||||
/***** Remove user's expanded folders *****/
|
||||
Brw_RemoveUsrExpandedFolders (UsrDat->UsrCod);
|
||||
/***** Remove some files of the user's from database *****/
|
||||
Brw_RemoveUsrFilesFromDB (UsrDat->UsrCod);
|
||||
|
||||
/***** Remove the file tree of a user *****/
|
||||
Acc_RemoveUsrBriefcase (UsrDat);
|
||||
if (QuietOrVerbose == Cns_VERBOSE)
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_Virtual_pendrive_of_THE_USER_X_has_been_removed,
|
||||
UsrDat->FullName);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
}
|
||||
|
||||
/***** Remove exams made by user in all courses *****/
|
||||
Tst_RemoveExamsMadeByUsrInAllCrss (UsrDat->UsrCod);
|
||||
|
@ -734,15 +742,6 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
|
|||
/***** Remove the user from the list of users without photo *****/
|
||||
Pho_RemoveUsrFromTableClicksWithoutPhoto (UsrDat->UsrCod);
|
||||
|
||||
/***** Remove the file tree of a user *****/
|
||||
Acc_RemoveUsrBriefcase (UsrDat);
|
||||
if (QuietOrVerbose == Cns_VERBOSE)
|
||||
{
|
||||
sprintf (Gbl.Message,Txt_Virtual_pendrive_of_THE_USER_X_has_been_removed,
|
||||
UsrDat->FullName);
|
||||
Lay_ShowAlert (Lay_SUCCESS,Gbl.Message);
|
||||
}
|
||||
|
||||
/***** Remove user's photo *****/
|
||||
PhotoRemoved = Pho_RemovePhoto (UsrDat);
|
||||
if (PhotoRemoved && QuietOrVerbose == Cns_VERBOSE)
|
||||
|
@ -770,15 +769,9 @@ static void Acc_RemoveUsrBriefcase (struct UsrData *UsrDat)
|
|||
{
|
||||
char PathRelUsr[PATH_MAX+1];
|
||||
|
||||
/***** Remove the briefcase of the user *****/
|
||||
/***** Remove files of the user's briefcase from disc *****/
|
||||
Usr_ConstructPathUsr (UsrDat->UsrCod,PathRelUsr);
|
||||
Brw_RemoveTree (PathRelUsr);
|
||||
|
||||
/***** Remove files in the course from database *****/
|
||||
Brw_RemoveFilesFromDB (-1L,-1L,-1L,-1L,-1L,UsrDat->UsrCod);
|
||||
|
||||
/***** Remove size of the briefcase of the user from database *****/
|
||||
Brw_RemoveSizeOfFileTreeFromDB (-1L,-1L,UsrDat->UsrCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -1409,6 +1409,7 @@ void Ctr_RemoveCentre (void)
|
|||
extern const char *Txt_Centre_X_removed;
|
||||
char Query[512];
|
||||
struct Centre Ctr;
|
||||
char PathCtr[PATH_MAX+1];
|
||||
|
||||
/***** Get centre code *****/
|
||||
if ((Ctr.CtrCod = Ctr_GetParamOtherCtrCod ()) < 0)
|
||||
|
@ -1424,16 +1425,14 @@ void Ctr_RemoveCentre (void)
|
|||
else // Centre has no teachers ==> remove it
|
||||
{
|
||||
/***** Remove information related to files in centre *****/
|
||||
/* Remove clipboards related to the centre */
|
||||
sprintf (Query,"DELETE FROM clipboard WHERE CtrCod='%ld'",
|
||||
Ctr.CtrCod);
|
||||
DB_QueryDELETE (Query,"can not remove clipboards in a centre");
|
||||
Brw_RemoveCtrFilesFromDB (Ctr.CtrCod);
|
||||
|
||||
/* Remove last accesses to file browsers related with this centre */
|
||||
Brw_RemoveFileBrowserLast (Brw_FILE_BRW_ADMIN_DOCUMENTS_CTR,Ctr.CtrCod);
|
||||
|
||||
/* Remove files in the centre from database */
|
||||
Brw_RemoveFilesFromDB (-1L,Ctr.CtrCod,-1L,-1L,-1L,-1L);
|
||||
/***** Remove directories of the centre *****/
|
||||
sprintf (PathCtr,"%s/%s/%02u/%u",
|
||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_CTR,
|
||||
(unsigned) (Ctr.CtrCod % 100),
|
||||
(unsigned) Ctr.CtrCod);
|
||||
Brw_RemoveTree (PathCtr);
|
||||
|
||||
/***** Remove centre *****/
|
||||
sprintf (Query,"DELETE FROM centres WHERE CtrCod='%ld'",
|
||||
|
|
|
@ -39,11 +39,22 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 14.67.1 (2015/01/25)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 14.68 (2015/01/25)"
|
||||
|
||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1
|
||||
/*
|
||||
Version 14.68: Jan 25, 2015 Changes in file_browser_size table. (175606 lines)
|
||||
8 changes necessary in database:
|
||||
DROP INDEX FileBrowser ON file_browser_size;
|
||||
DROP INDEX UsrCod ON file_browser_size;
|
||||
ALTER TABLE file_browser_size CHANGE COLUMN UsrCod ZoneUsrCod INT NOT NULL DEFAULT -1,ADD INDEX (ZoneUsrCod);
|
||||
ALTER TABLE file_browser_size ADD COLUMN Cod INT NOT NULL DEFAULT -1 AFTER FileBrowser, ADD UNIQUE INDEX (FileBrowser,Cod,ZoneUsrCod);
|
||||
UPDATE file_browser_size SET Cod=CrsCod WHERE CrsCod>'0' AND GrpCod<='0';
|
||||
UPDATE file_browser_size SET Cod=GrpCod WHERE GrpCod>'0';
|
||||
ALTER TABLE file_browser_size DROP COLUMN CrsCod;
|
||||
ALTER TABLE file_browser_size DROP COLUMN GrpCod;
|
||||
|
||||
Version 14.67.1: Jan 25, 2015 Fixed bugs in file browsers. (175395 lines)
|
||||
Version 14.67: Jan 25, 2015 Changes in files table. (175369 lines)
|
||||
16 changes necessary in database:
|
||||
|
@ -56,7 +67,7 @@ CREATE INDEX ZoneUsrCod ON files (ZoneUsrCod);
|
|||
UPDATE files SET Cod=InsCod WHERE InsCod>'0';
|
||||
UPDATE files SET Cod=CtrCod WHERE CtrCod>'0';
|
||||
UPDATE files SET Cod=DegCod WHERE DegCod>'0';
|
||||
UPDATE files SET Cod=CrsCod WHERE CrsCod>'0';
|
||||
UPDATE files SET Cod=CrsCod WHERE CrsCod>'0' AND GrpCod<='0';
|
||||
UPDATE files SET Cod=GrpCod WHERE GrpCod>'0';
|
||||
ALTER TABLE files DROP COLUMN InsCod;
|
||||
ALTER TABLE files DROP COLUMN CtrCod;
|
||||
|
@ -73,7 +84,7 @@ CREATE INDEX WorksUsrCod ON clipboard (WorksUsrCod);
|
|||
UPDATE clipboard SET Cod=InsCod WHERE InsCod>'0';
|
||||
UPDATE clipboard SET Cod=CtrCod WHERE CtrCod>'0';
|
||||
UPDATE clipboard SET Cod=DegCod WHERE DegCod>'0';
|
||||
UPDATE clipboard SET Cod=CrsCod WHERE CrsCod>'0';
|
||||
UPDATE clipboard SET Cod=CrsCod WHERE CrsCod>'0' AND GrpCod<='0';
|
||||
UPDATE clipboard SET Cod=GrpCod WHERE GrpCod>'0';
|
||||
ALTER TABLE clipboard DROP COLUMN InsCod;
|
||||
ALTER TABLE clipboard DROP COLUMN CtrCod;
|
||||
|
@ -89,7 +100,7 @@ CREATE INDEX WorksUsrCod ON expanded_folders (WorksUsrCod);
|
|||
UPDATE expanded_folders SET Cod=InsCod WHERE InsCod>'0';
|
||||
UPDATE expanded_folders SET Cod=CtrCod WHERE CtrCod>'0';
|
||||
UPDATE expanded_folders SET Cod=DegCod WHERE DegCod>'0';
|
||||
UPDATE expanded_folders SET Cod=CrsCod WHERE CrsCod>'0';
|
||||
UPDATE expanded_folders SET Cod=CrsCod WHERE CrsCod>'0' AND GrpCod<='0';
|
||||
UPDATE expanded_folders SET Cod=GrpCod WHERE GrpCod>'0';
|
||||
ALTER TABLE expanded_folders DROP COLUMN InsCod;
|
||||
ALTER TABLE expanded_folders DROP COLUMN CtrCod;
|
||||
|
|
|
@ -2425,27 +2425,7 @@ static void Crs_EmptyCourseCompletely (long CrsCod)
|
|||
DB_QueryDELETE (Query,"can not remove users from a course");
|
||||
|
||||
/***** Remove information related to files in course *****/
|
||||
/* Remove clipboards related to the course */
|
||||
sprintf (Query,"DELETE FROM clipboard WHERE CrsCod='%ld'",
|
||||
CrsCod);
|
||||
DB_QueryDELETE (Query,"can not remove clipboards in a course");
|
||||
|
||||
/* Remove expanded folders in the course */
|
||||
Brw_RemoveExpandedFoldersInCrs (CrsCod);
|
||||
|
||||
/* Remove format of files of marks of the course */
|
||||
sprintf (Query,"DELETE FROM marks_properties"
|
||||
" USING files,marks_properties"
|
||||
" WHERE files.CrsCod='%ld'"
|
||||
" AND files.FilCod=marks_properties.FilCod",
|
||||
CrsCod);
|
||||
DB_QueryDELETE (Query,"can not remove the properties of marks associated to a course");
|
||||
|
||||
/* Remove files in the course from database */
|
||||
Brw_RemoveFilesFromDB (-1L,-1L,-1L,CrsCod,-1L,-1L);
|
||||
|
||||
/* Remove size of file zones in the course from database */
|
||||
Brw_RemoveSizeOfFileTreeFromDB (CrsCod,-1L,-1L);
|
||||
Brw_RemoveCrsFilesFromDB (CrsCod);
|
||||
|
||||
/***** Remove directories of the course *****/
|
||||
sprintf (PathRelCrs,"%s/%s/%ld",
|
||||
|
|
|
@ -1005,14 +1005,14 @@ mysql> DESCRIBE file_browser_size;
|
|||
*/
|
||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS file_browser_size ("
|
||||
"FileBrowser TINYINT NOT NULL,"
|
||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||
"GrpCod INT NOT NULL DEFAULT -1,"
|
||||
"UsrCod INT NOT NULL DEFAULT -1,"
|
||||
"Cod INT NOT NULL DEFAULT -1,"
|
||||
"ZoneUsrCod INT NOT NULL DEFAULT -1,"
|
||||
"NumLevels INT NOT NULL,"
|
||||
"NumFolders INT NOT NULL,"
|
||||
"NumFiles INT NOT NULL,"
|
||||
"TotalSize BIGINT NOT NULL,"
|
||||
"UNIQUE INDEX(FileBrowser,CrsCod,GrpCod,UsrCod),INDEX(CrsCod),INDEX(GrpCod),INDEX(UsrCod))");
|
||||
"UNIQUE INDEX(FileBrowser,Cod,ZoneUsrCod),"
|
||||
"INDEX(ZoneUsrCod))");
|
||||
|
||||
/***** Table file_view *****/
|
||||
/*
|
||||
|
|
|
@ -3122,6 +3122,7 @@ static void Deg_RemoveDegreeCompletely (long DegCod)
|
|||
MYSQL_ROW row;
|
||||
unsigned long NumRow,NumRows;
|
||||
long CrsCod;
|
||||
char PathDeg[PATH_MAX+1];
|
||||
|
||||
/***** Get courses of a degree from database *****/
|
||||
sprintf (Query,"SELECT CrsCod FROM courses"
|
||||
|
@ -3183,16 +3184,14 @@ static void Deg_RemoveDegreeCompletely (long DegCod)
|
|||
DB_QueryDELETE (Query,"can not remove threads in forums of a degree");
|
||||
|
||||
/***** Remove information related to files in degree *****/
|
||||
/* Remove clipboards related to the degree */
|
||||
sprintf (Query,"DELETE FROM clipboard WHERE DegCod='%ld'",
|
||||
DegCod);
|
||||
DB_QueryDELETE (Query,"can not remove clipboards in a degree");
|
||||
Brw_RemoveDegFilesFromDB (DegCod);
|
||||
|
||||
/* Remove last accesses to file browsers related with this degree */
|
||||
Brw_RemoveFileBrowserLast (Brw_FILE_BRW_ADMIN_DOCUMENTS_DEG,DegCod);
|
||||
|
||||
/* Remove files in the degree from database */
|
||||
Brw_RemoveFilesFromDB (-1L,-1L,DegCod,-1L,-1L,-1L);
|
||||
/***** Remove directories of the degree *****/
|
||||
sprintf (PathDeg,"%s/%s/%02u/%u",
|
||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_DEG,
|
||||
(unsigned) (DegCod % 100),
|
||||
(unsigned) DegCod);
|
||||
Brw_RemoveTree (PathDeg);
|
||||
|
||||
/***** Remove administrators of this degree *****/
|
||||
sprintf (Query,"DELETE FROM deg_admin WHERE DegCod='%ld'",
|
||||
|
|
|
@ -3219,11 +3219,8 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,struct Course *
|
|||
/***** Remove fields of this user in its course record *****/
|
||||
Rec_RemoveFieldsCrsRecordInCrs (UsrDat->UsrCod,Crs,QuietOrVerbose);
|
||||
|
||||
/***** Remove user's clipboard *****/
|
||||
Brw_RemoveUsrClipboardInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
|
||||
/***** Remove user's expanded folders in course *****/
|
||||
Brw_RemoveUsrExpandedFoldersInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
/***** Remove some information about files in course and groups *****/
|
||||
Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (UsrDat->UsrCod,Crs->CrsCod);
|
||||
|
||||
/***** Remove exams made by user in course *****/
|
||||
Tst_RemoveExamsMadeByUsrInCrs (UsrDat->UsrCod,Crs->CrsCod);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -142,10 +142,17 @@ bool Brw_UpdateFoldersAssigmentsIfExistForAllUsrs (const char *OldFolderName,con
|
|||
void Brw_RemoveFoldersAssignmentsIfExistForAllUsrs (const char *FolderName);
|
||||
void Brw_ShowFileBrowserOrWorks (void);
|
||||
void Brw_ShowAgainFileBrowserOrWorks (void);
|
||||
void Brw_RemoveSizeOfFileTreeFromDB (long CrsCod,long GrpCod,long UsrCod);
|
||||
void Brw_RemoveFilesFromDB (long InsCod,long CtrCod,long DegCod,long CrsCod,long GrpCod,long UsrCod);
|
||||
|
||||
void Brw_RemoveInsFilesFromDB (long InsCod);
|
||||
void Brw_RemoveCtrFilesFromDB (long CtrCod);
|
||||
void Brw_RemoveDegFilesFromDB (long DegCod);
|
||||
void Brw_RemoveCrsFilesFromDB (long CrsCod);
|
||||
void Brw_RemoveGrpFilesFromDB (long GrpCod);
|
||||
void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long CrsCod,long UsrCod);
|
||||
void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod);
|
||||
void Brw_RemoveUsrFilesFromDB (long UsrCod);
|
||||
|
||||
void Brw_CreateDirDownloadTmp (void);
|
||||
void Brw_RemoveFileBrowserLast (Brw_FileBrowser_t FileBrowser,long Cod);
|
||||
void Brw_AskEditWorksCrs (void);
|
||||
void Brw_AskRemFileFromTree (void);
|
||||
void Brw_RemFileFromTree (void);
|
||||
|
@ -183,15 +190,8 @@ void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
|||
long Brw_AddPathToDB (long PublisherUsrCod,Brw_FileType_t FileType,
|
||||
const char *Path,bool IsPublic,Brw_License_t License);
|
||||
|
||||
void Brw_RemoveExpandedFoldersInCrs (long CrsCod);
|
||||
void Brw_RemoveExpiredExpandedFolders (void);
|
||||
|
||||
void Brw_RemoveUsrClipboard (long UsrCod);
|
||||
void Brw_RemoveGrpClipboards (long GrpCod);
|
||||
void Brw_RemoveUsrClipboardInCrs (long UsrCod,long CrsCod);
|
||||
void Brw_RemoveUsrExpandedFolders (long UsrCod);
|
||||
void Brw_RemoveUsrExpandedFoldersInCrs (long UsrCod,long CrsCod);
|
||||
|
||||
void Brw_RemoveTree (const char *Path);
|
||||
void Brw_CalcSizeOfDir (char *Path);
|
||||
|
||||
|
|
|
@ -1364,6 +1364,7 @@ void Ins_RemoveInstitution (void)
|
|||
extern const char *Txt_Institution_X_removed;
|
||||
char Query[512];
|
||||
struct Institution Ins;
|
||||
char PathIns[PATH_MAX+1];
|
||||
|
||||
/***** Get institution code *****/
|
||||
if ((Ins.InsCod = Ins_GetParamOtherInsCod ()) < 0)
|
||||
|
@ -1379,16 +1380,14 @@ void Ins_RemoveInstitution (void)
|
|||
else // Institution has no users ==> remove it
|
||||
{
|
||||
/***** Remove information related to files in institution *****/
|
||||
/* Remove clipboards related to the institution */
|
||||
sprintf (Query,"DELETE FROM clipboard WHERE InsCod='%ld'",
|
||||
Ins.InsCod);
|
||||
DB_QueryDELETE (Query,"can not remove clipboards in an institution");
|
||||
Brw_RemoveInsFilesFromDB (Ins.InsCod);
|
||||
|
||||
/* Remove last accesses to file browsers related with this institution */
|
||||
Brw_RemoveFileBrowserLast (Brw_FILE_BRW_ADMIN_DOCUMENTS_INS,Ins.InsCod);
|
||||
|
||||
/* Remove files in the institution from database */
|
||||
Brw_RemoveFilesFromDB (Ins.InsCod,-1L,-1L,-1L,-1L,-1L);
|
||||
/***** Remove directories of the institution *****/
|
||||
sprintf (PathIns,"%s/%s/%02u/%u",
|
||||
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_INS,
|
||||
(unsigned) (Ins.InsCod % 100),
|
||||
(unsigned) Ins.InsCod);
|
||||
Brw_RemoveTree (PathIns);
|
||||
|
||||
/***** Remove institution *****/
|
||||
sprintf (Query,"DELETE FROM institutions WHERE InsCod='%ld'",
|
||||
|
|
|
@ -273,8 +273,6 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
|
|||
Gbl.FileBrowser.Priv.FullPathInTree);
|
||||
DB_QueryUPDATE (Query,"can not update properties of marks");
|
||||
|
||||
Lay_ShowAlert (Lay_INFO,Query);
|
||||
|
||||
/***** Write message of success *****/
|
||||
sprintf (Gbl.Message,Txt_The_number_of_rows_is_now_X,
|
||||
NumRows);
|
||||
|
|
|
@ -764,7 +764,8 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
"centres.ShortName,courses.ShortName"
|
||||
" FROM files,courses,degrees,centres,institutions,countries"
|
||||
" WHERE files.Public='Y' AND %s"
|
||||
" AND files.CrsCod=courses.CrsCod"
|
||||
" AND files.FileBrowser IN ('%u','%u')"
|
||||
" AND files.Cod=courses.CrsCod"
|
||||
" AND courses.DegCod=degrees.DegCod"
|
||||
" AND degrees.CtrCod=centres.CtrCod"
|
||||
" AND centres.InsCod=institutions.InsCod"
|
||||
|
@ -773,6 +774,8 @@ static unsigned Sch_SearchOpenDocumentsInDB (const char *RangeQuery)
|
|||
" HAVING PathFromRoot<>''"
|
||||
" ORDER BY degrees.ShortName,courses.ShortName,PathFromRoot",
|
||||
SearchQuery,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
RangeQuery);
|
||||
|
||||
/***** Query database and list documents found *****/
|
||||
|
@ -805,11 +808,13 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
It is necessary to speed up the second query *****/
|
||||
sprintf (Query,"CREATE TEMPORARY TABLE my_files (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.CrsCod"
|
||||
" WHERE crs_usr.UsrCod='%ld'"
|
||||
" AND crs_usr.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN ('%u','%u','%u')"
|
||||
" UNION"
|
||||
" SELECT files.FilCod FROM crs_grp_usr,files"
|
||||
" WHERE crs_grp_usr.UsrCod='%ld' AND crs_grp_usr.GrpCod=files.GrpCod"
|
||||
" WHERE crs_grp_usr.UsrCod='%ld'"
|
||||
" AND crs_grp_usr.GrpCod=files.Cod"
|
||||
" AND files.FileBrowser IN ('%u','%u','%u')",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
|
@ -829,9 +834,18 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"degrees.DegCod,degrees.ShortName,"
|
||||
"centres.ShortName,courses.ShortName"
|
||||
" FROM files,courses,degrees,centres,institutions,countries"
|
||||
" FROM files,crs_grp,crs_grp_types,courses,degrees,centres,institutions,countries"
|
||||
" WHERE files.FilCod IN (SELECT FilCod FROM my_files) AND %s"
|
||||
" AND files.CrsCod=courses.CrsCod"
|
||||
" AND "
|
||||
"("
|
||||
"(files.FileBrowser IN ('%u','%u','%u')"
|
||||
" AND files.Cod=courses.CrsCod)"
|
||||
" OR "
|
||||
"(files.FileBrowser IN ('%u','%u','%u')"
|
||||
" AND files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp.types.CrsCod=courses.CrsCod)"
|
||||
")"
|
||||
" AND courses.DegCod=degrees.DegCod"
|
||||
" AND degrees.CtrCod=centres.CtrCod"
|
||||
" AND centres.InsCod=institutions.InsCod"
|
||||
|
@ -840,6 +854,12 @@ static unsigned Sch_SearchDocumentsInMyCoursesInDB (const char *RangeQuery)
|
|||
" HAVING PathFromRoot<>''"
|
||||
" ORDER BY degrees.ShortName,courses.ShortName,PathFromRoot",
|
||||
SearchQuery,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_MARKS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_GRP,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_GRP,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_MARKS_GRP,
|
||||
RangeQuery);
|
||||
|
||||
/***** Query database and list documents found *****/
|
||||
|
@ -883,9 +903,18 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"degrees.DegCod,degrees.ShortName AS DegShortName,"
|
||||
"centres.ShortName,courses.ShortName AS CrsShortName"
|
||||
" FROM files,courses,degrees,centres,institutions,countries"
|
||||
" FROM files,crs_grp,crs_grp_types,courses,degrees,centres,institutions,countries"
|
||||
" WHERE files.PublisherUsrCod='%ld' AND %s"
|
||||
" AND files.CrsCod=courses.CrsCod"
|
||||
" AND "
|
||||
"("
|
||||
"(files.FileBrowser IN ('%u','%u','%u')"
|
||||
" AND files.Cod=courses.CrsCod)"
|
||||
" OR "
|
||||
"(files.FileBrowser IN ('%u','%u','%u')"
|
||||
" AND files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp.types.CrsCod=courses.CrsCod)"
|
||||
")"
|
||||
" AND courses.DegCod=degrees.DegCod"
|
||||
" AND degrees.CtrCod=centres.CtrCod"
|
||||
" AND centres.InsCod=institutions.InsCod"
|
||||
|
@ -900,17 +929,33 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
") AS my_files"
|
||||
" WHERE PathFromRoot<>''"
|
||||
" ORDER BY DegShortName,CrsShortName,PathFromRoot",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,SearchQuery,RangeQuery,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,SearchQuery,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_MARKS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_GRP,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_GRP,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_MARKS_GRP,
|
||||
RangeQuery,
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,(unsigned) Brw_FILE_BRW_BRIEFCASE_USR,SearchQuery);
|
||||
else
|
||||
sprintf (Query,"SELECT files.FilCod,"
|
||||
"SUBSTRING(files.Path,LOCATE('/',files.Path)) AS PathFromRoot,"
|
||||
"degrees.DegCod,degrees.ShortName,"
|
||||
"centres.ShortName,courses.ShortName"
|
||||
" FROM files,courses,degrees,centres,institutions,countries"
|
||||
" FROM files,crs_grp,crs_grp_types,courses,degrees,centres,institutions,countries"
|
||||
" WHERE files.PublisherUsrCod='%ld' AND %s"
|
||||
" AND files.CrsCod=courses.CrsCod"
|
||||
" AND courses.DegCod=degrees.DegCod"
|
||||
" AND "
|
||||
"("
|
||||
"(files.FileBrowser IN ('%u','%u','%u')"
|
||||
" AND files.Cod=courses.CrsCod)"
|
||||
" OR "
|
||||
"(files.FileBrowser IN ('%u','%u','%u')"
|
||||
" AND files.Cod=crs_grp.GrpCod"
|
||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod"
|
||||
" AND crs_grp.types.CrsCod=courses.CrsCod)"
|
||||
")"
|
||||
" AND courses.DegCod=degrees.DegCod"
|
||||
" AND degrees.CtrCod=centres.CtrCod"
|
||||
" AND centres.InsCod=institutions.InsCod"
|
||||
" AND institutions.CtyCod=countries.CtyCod"
|
||||
|
@ -918,6 +963,12 @@ static unsigned Sch_SearchMyDocumentsInDB (const char *RangeQuery)
|
|||
" HAVING PathFromRoot<>''"
|
||||
" ORDER BY degrees.ShortName,courses.ShortName,PathFromRoot",
|
||||
Gbl.Usrs.Me.UsrDat.UsrCod,SearchQuery,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_MARKS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_GRP,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_GRP,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_MARKS_GRP,
|
||||
RangeQuery);
|
||||
|
||||
/***** Query database and list documents found *****/
|
||||
|
|
|
@ -4994,10 +4994,13 @@ static void Sta_GetNumberOfOERsFromDB (Sco_Scope_t Scope,Brw_License_t License,u
|
|||
" WHERE centres.InsCod='%ld'"
|
||||
" AND centres.CtrCod=degrees.CtrCod"
|
||||
" AND degrees.DegCod=courses.DegCod"
|
||||
" AND courses.CrsCod=files.CrsCod"
|
||||
" AND courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN ('%u','%u')"
|
||||
" AND files.License='%u'"
|
||||
" GROUP BY files.Public",
|
||||
Gbl.CurrentIns.Ins.InsCod,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
(unsigned) License);
|
||||
break;
|
||||
case Sco_SCOPE_CENTRE:
|
||||
|
@ -5005,20 +5008,26 @@ static void Sta_GetNumberOfOERsFromDB (Sco_Scope_t Scope,Brw_License_t License,u
|
|||
" FROM degrees,courses,files"
|
||||
" WHERE degrees.CtrCod='%ld'"
|
||||
" AND degrees.DegCod=courses.DegCod"
|
||||
" AND courses.CrsCod=files.CrsCod"
|
||||
" AND courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN ('%u','%u')"
|
||||
" AND files.License='%u'"
|
||||
" GROUP BY files.Public",
|
||||
Gbl.CurrentCtr.Ctr.CtrCod,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
(unsigned) License);
|
||||
break;
|
||||
case Sco_SCOPE_DEGREE:
|
||||
sprintf (Query,"SELECT files.Public,COUNT(*)"
|
||||
" FROM courses,files"
|
||||
" WHERE courses.DegCod='%ld'"
|
||||
" AND courses.CrsCod=files.CrsCod"
|
||||
" AND courses.CrsCod=files.Cod"
|
||||
" AND files.FileBrowser IN ('%u','%u')"
|
||||
" AND files.License='%u'"
|
||||
" GROUP BY files.Public",
|
||||
Gbl.CurrentDeg.Deg.DegCod,
|
||||
(unsigned) Brw_FILE_BRW_ADMIN_DOCUMENTS_CRS,
|
||||
(unsigned) Brw_FILE_BRW_COMMON_CRS,
|
||||
(unsigned) License);
|
||||
break;
|
||||
case Sco_SCOPE_COURSE:
|
||||
|
|
Loading…
Reference in New Issue