mirror of https://github.com/acanas/swad-core.git
Version 21.2: Sep 14, 2021 Code refactoring related to file browsers.
This commit is contained in:
parent
b8b10a000f
commit
00dd46e1e4
|
@ -34,6 +34,7 @@
|
||||||
#include "swad_announcement_database.h"
|
#include "swad_announcement_database.h"
|
||||||
#include "swad_attendance_database.h"
|
#include "swad_attendance_database.h"
|
||||||
#include "swad_box.h"
|
#include "swad_box.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_calendar.h"
|
#include "swad_calendar.h"
|
||||||
#include "swad_connected_database.h"
|
#include "swad_connected_database.h"
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
@ -1007,7 +1008,7 @@ void Acc_CompletelyEliminateAccount (struct UsrData *UsrDat,
|
||||||
For_DB_RemoveUsrFromThrClipboard (UsrDat->UsrCod);
|
For_DB_RemoveUsrFromThrClipboard (UsrDat->UsrCod);
|
||||||
|
|
||||||
/***** Remove some files of the user's from database *****/
|
/***** Remove some files of the user's from database *****/
|
||||||
Brw_RemoveUsrFilesFromDB (UsrDat->UsrCod);
|
Brw_DB_RemoveUsrFiles (UsrDat->UsrCod);
|
||||||
|
|
||||||
/***** Remove the file tree of a user *****/
|
/***** Remove the file tree of a user *****/
|
||||||
Acc_RemoveUsrBriefcase (UsrDat);
|
Acc_RemoveUsrBriefcase (UsrDat);
|
||||||
|
|
1357
swad_browser.c
1357
swad_browser.c
File diff suppressed because it is too large
Load Diff
|
@ -185,16 +185,6 @@ void Brw_GetSelectedUsrsAndShowWorks (void);
|
||||||
void Brw_ShowFileBrowserOrWorks (void);
|
void Brw_ShowFileBrowserOrWorks (void);
|
||||||
void Brw_ShowAgainFileBrowserOrWorks (void);
|
void Brw_ShowAgainFileBrowserOrWorks (void);
|
||||||
|
|
||||||
void Brw_DB_RemoveInsFiles (long InsCod);
|
|
||||||
void Brw_DB_RemoveCtrFiles (long CtrCod);
|
|
||||||
void Brw_DB_RemoveDegFiles (long DegCod);
|
|
||||||
void Brw_DB_RemoveCrsFiles (long CrsCod);
|
|
||||||
void Brw_RemoveGrpFilesFromDB (long GrpCod);
|
|
||||||
void Brw_RemovePrjFilesFromDB (long PrjCod);
|
|
||||||
void Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (long UsrCod,long CrsCod);
|
|
||||||
void Brw_RemoveWrkFilesFromDB (long CrsCod,long UsrCod);
|
|
||||||
void Brw_RemoveUsrFilesFromDB (long UsrCod);
|
|
||||||
|
|
||||||
void Brw_PutHiddenParamFullTreeIfSelected (void *FullTree);
|
void Brw_PutHiddenParamFullTreeIfSelected (void *FullTree);
|
||||||
|
|
||||||
void Brw_CreateDirDownloadTmp (void);
|
void Brw_CreateDirDownloadTmp (void);
|
||||||
|
@ -232,7 +222,7 @@ unsigned Brw_DB_GetNumFileViewsUsr (long UsrCod);
|
||||||
unsigned Brw_DB_GetNumFilesUsr (long UsrCod);
|
unsigned Brw_DB_GetNumFilesUsr (long UsrCod);
|
||||||
unsigned Brw_DB_GetNumPublicFilesUsr (long UsrCod);
|
unsigned Brw_DB_GetNumPublicFilesUsr (long UsrCod);
|
||||||
|
|
||||||
long Brw_GetCodForFiles (void);
|
long Brw_GetZoneUsrCodForFileBrowser (void);
|
||||||
void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
void Brw_GetCrsGrpFromFileMetadata (Brw_FileBrowser_t FileBrowser,long Cod,
|
||||||
long *InsCod,
|
long *InsCod,
|
||||||
long *CtrCod,
|
long *CtrCod,
|
||||||
|
@ -246,6 +236,9 @@ long Brw_AddPathToDB (long PublisherUsrCod,Brw_FileType_t FileType,
|
||||||
|
|
||||||
bool Brw_CheckIfICanViewProjectFiles (long PrjCod);
|
bool Brw_CheckIfICanViewProjectFiles (long PrjCod);
|
||||||
|
|
||||||
|
long Brw_GetCodForFileBrowser (void);
|
||||||
|
long Brw_GetZoneUsrCodForFileBrowser (void);
|
||||||
|
|
||||||
void Brw_DB_RemoveExpiredExpandedFolders (void);
|
void Brw_DB_RemoveExpiredExpandedFolders (void);
|
||||||
|
|
||||||
void Brw_CalcSizeOfDir (char *Path);
|
void Brw_CalcSizeOfDir (char *Path);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -47,8 +47,31 @@
|
||||||
/***************************** Public prototypes *****************************/
|
/***************************** Public prototypes *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Brw_DB_GetSizeOfFileZone (MYSQL_RES **mysql_res,
|
void Brw_DB_StoreSizeOfFileZone (void);
|
||||||
Brw_FileBrowser_t FileBrowser);
|
|
||||||
|
void Brw_DB_UpdateDateMyLastAccFileBrowser (Brw_FileBrowser_t FileBrowser);
|
||||||
|
unsigned Brw_DB_GetDateMyLastAccFileBrowser (MYSQL_RES **mysql_res,
|
||||||
|
Brw_FileBrowser_t FileBrowser);
|
||||||
|
unsigned Brw_DB_GetGrpLastAccFileBrowser (MYSQL_RES **mysql_res,const char *FieldNameDB);
|
||||||
|
|
||||||
|
void Brw_DB_AddPathToClipboards (void);
|
||||||
|
void Brw_DB_UpdatePathInClipboard (void);
|
||||||
|
unsigned Brw_DB_GetMyClipboard (MYSQL_RES **mysql_res);
|
||||||
|
|
||||||
|
unsigned Brw_DB_GetFoldersAssignments (MYSQL_RES **mysql_res,long ZoneUsrCod);
|
||||||
|
|
||||||
|
void Brw_DB_GetSizeOfFileBrowser (MYSQL_RES **mysql_res,
|
||||||
|
Brw_FileBrowser_t FileBrowser);
|
||||||
unsigned Brw_DB_GetNumberOfOERs (MYSQL_RES **mysql_res,Brw_License_t License);
|
unsigned Brw_DB_GetNumberOfOERs (MYSQL_RES **mysql_res,Brw_License_t License);
|
||||||
|
|
||||||
|
void Brw_DB_RemoveInsFiles (long InsCod);
|
||||||
|
void Brw_DB_RemoveCtrFiles (long CtrCod);
|
||||||
|
void Brw_DB_RemoveDegFiles (long DegCod);
|
||||||
|
void Brw_DB_RemoveCrsFiles (long CrsCod);
|
||||||
|
void Brw_DB_RemoveGrpFiles (long GrpCod);
|
||||||
|
void Brw_DB_RemovePrjFiles (long PrjCod);
|
||||||
|
void Brw_DB_RemoveSomeInfoAboutCrsUsrFiles (long UsrCod,long CrsCod);
|
||||||
|
void Brw_DB_RemoveWrkFiles (long CrsCod,long UsrCod);
|
||||||
|
void Brw_DB_RemoveUsrFiles (long UsrCod);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_admin_database.h"
|
#include "swad_admin_database.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_center.h"
|
#include "swad_center.h"
|
||||||
#include "swad_center_config.h"
|
#include "swad_center_config.h"
|
||||||
#include "swad_center_database.h"
|
#include "swad_center_database.h"
|
||||||
|
|
|
@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
|
||||||
|
|
||||||
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 21.1.1 (2021-09-14)"
|
#define Log_PLATFORM_VERSION "SWAD 21.2 (2021-09-14)"
|
||||||
#define CSS_FILE "swad20.45.css"
|
#define CSS_FILE "swad20.45.css"
|
||||||
#define JS_FILE "swad20.69.1.js"
|
#define JS_FILE "swad20.69.1.js"
|
||||||
/*
|
/*
|
||||||
TODO: Rename CENTRE to CENTER in help wiki.
|
TODO: Rename CENTRE to CENTER in help wiki.
|
||||||
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
|
||||||
|
|
||||||
|
Version 21.2: Sep 14, 2021 Code refactoring related to file browsers. (314983 lines)
|
||||||
Version 21.1.1: Sep 14, 2021 Queries moved to module swad_enrolment_database. (315050 lines)
|
Version 21.1.1: Sep 14, 2021 Queries moved to module swad_enrolment_database. (315050 lines)
|
||||||
Version 21.1: Sep 13, 2021 New module swad_browser_database for database queries related to file browsers. (315050 lines)
|
Version 21.1: Sep 13, 2021 New module swad_browser_database for database queries related to file browsers. (315050 lines)
|
||||||
Version 21.0.2: Sep 13, 2021 Queries moved to module swad_notification. (314927 lines)
|
Version 21.0.2: Sep 13, 2021 Queries moved to module swad_notification. (314927 lines)
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_attendance.h"
|
#include "swad_attendance.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_call_for_exam_database.h"
|
#include "swad_call_for_exam_database.h"
|
||||||
#include "swad_course.h"
|
#include "swad_course.h"
|
||||||
#include "swad_course_config.h"
|
#include "swad_course_config.h"
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_admin_database.h"
|
#include "swad_admin_database.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_course_database.h"
|
#include "swad_course_database.h"
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
#include "swad_degree.h"
|
#include "swad_degree.h"
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "swad_announcement.h"
|
#include "swad_announcement.h"
|
||||||
#include "swad_attendance_database.h"
|
#include "swad_attendance_database.h"
|
||||||
#include "swad_box.h"
|
#include "swad_box.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
#include "swad_duplicate.h"
|
#include "swad_duplicate.h"
|
||||||
#include "swad_enrolment.h"
|
#include "swad_enrolment.h"
|
||||||
|
@ -3222,7 +3223,7 @@ static void Enr_EffectivelyRemUsrFromCrs (struct UsrData *UsrDat,
|
||||||
Rec_DB_RemoveFieldsCrsRecordInCrs (UsrDat->UsrCod,Crs);
|
Rec_DB_RemoveFieldsCrsRecordInCrs (UsrDat->UsrCod,Crs);
|
||||||
|
|
||||||
/***** Remove some information about files in course and groups *****/
|
/***** Remove some information about files in course and groups *****/
|
||||||
Brw_RemoveSomeInfoAboutCrsUsrFilesFromDB (UsrDat->UsrCod,Crs->CrsCod);
|
Brw_DB_RemoveSomeInfoAboutCrsUsrFiles (UsrDat->UsrCod,Crs->CrsCod);
|
||||||
|
|
||||||
/***** Set all the notifications for this user in this course as removed,
|
/***** Set all the notifications for this user in this course as removed,
|
||||||
except notifications about new messages *****/
|
except notifications about new messages *****/
|
||||||
|
|
|
@ -1375,7 +1375,7 @@ static void Fig_GetSizeOfFileZone (Brw_FileBrowser_t FileBrowser,
|
||||||
|
|
||||||
/***** Get the size of a file browser *****/
|
/***** Get the size of a file browser *****/
|
||||||
/* Query database */
|
/* Query database */
|
||||||
Brw_DB_GetSizeOfFileZone (&mysql_res,FileBrowser);
|
Brw_DB_GetSizeOfFileBrowser (&mysql_res,FileBrowser);
|
||||||
|
|
||||||
/* Get row */
|
/* Get row */
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_admin_database.h"
|
#include "swad_admin_database.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
#include "swad_department.h"
|
#include "swad_department.h"
|
||||||
#include "swad_enrolment_database.h"
|
#include "swad_enrolment_database.h"
|
||||||
|
|
|
@ -169,7 +169,7 @@ void Mrk_GetAndWriteNumRowsHeaderAndFooter (void)
|
||||||
static void Mrk_GetNumRowsHeaderAndFooter (struct MarksProperties *Marks)
|
static void Mrk_GetNumRowsHeaderAndFooter (struct MarksProperties *Marks)
|
||||||
{
|
{
|
||||||
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
|
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
|
||||||
long Cod = Brw_GetCodForFiles ();
|
long Cod = Brw_GetCodForFileBrowser ();
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ static void Mrk_ChangeNumRowsHeaderOrFooter (Brw_HeadOrFoot_t HeaderOrFooter)
|
||||||
if (sscanf (UnsignedStr,"%u",&NumRows) == 1)
|
if (sscanf (UnsignedStr,"%u",&NumRows) == 1)
|
||||||
{
|
{
|
||||||
/***** Update properties of marks in the database *****/
|
/***** Update properties of marks in the database *****/
|
||||||
Cod = Brw_GetCodForFiles ();
|
Cod = Brw_GetCodForFileBrowser ();
|
||||||
DB_QueryUPDATE ("can not update properties of marks",
|
DB_QueryUPDATE ("can not update properties of marks",
|
||||||
"UPDATE mrk_marks,"
|
"UPDATE mrk_marks,"
|
||||||
"brw_files"
|
"brw_files"
|
||||||
|
|
|
@ -1105,7 +1105,7 @@ void Ntf_MarkNotifChildrenOfFolderAsRemoved (const char *Path)
|
||||||
{
|
{
|
||||||
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
|
extern const Brw_FileBrowser_t Brw_FileBrowserForDB_files[Brw_NUM_TYPES_FILE_BROWSER];
|
||||||
Brw_FileBrowser_t FileBrowser = Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type];
|
Brw_FileBrowser_t FileBrowser = Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type];
|
||||||
long Cod = Brw_GetCodForFiles ();
|
long Cod = Brw_GetCodForFileBrowser ();
|
||||||
Ntf_NotifyEvent_t NotifyEvent;
|
Ntf_NotifyEvent_t NotifyEvent;
|
||||||
|
|
||||||
switch (FileBrowser)
|
switch (FileBrowser)
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include <string.h> // For string functions
|
#include <string.h> // For string functions
|
||||||
|
|
||||||
#include "swad_box.h"
|
#include "swad_box.h"
|
||||||
|
#include "swad_browser_database.h"
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
#include "swad_department.h"
|
#include "swad_department.h"
|
||||||
#include "swad_error.h"
|
#include "swad_error.h"
|
||||||
|
@ -3425,7 +3426,7 @@ void Prj_RemoveProject (void)
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
/***** Remove information related to files in project *****/
|
/***** Remove information related to files in project *****/
|
||||||
Brw_RemovePrjFilesFromDB (Prj.PrjCod);
|
Brw_DB_RemovePrjFiles (Prj.PrjCod);
|
||||||
|
|
||||||
/***** Remove directory of the project *****/
|
/***** Remove directory of the project *****/
|
||||||
snprintf (PathRelPrj,sizeof (PathRelPrj),"%s/%ld/%s/%02u/%ld",
|
snprintf (PathRelPrj,sizeof (PathRelPrj),"%s/%ld/%s/%02u/%ld",
|
||||||
|
|
|
@ -1045,7 +1045,7 @@ void Tml_Not_MarkNotesChildrenOfFolderAsUnavailable (const char *Path)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Tml_DB_MarkNotesChildrenOfFolderAsUnavailable (NoteType,
|
Tml_DB_MarkNotesChildrenOfFolderAsUnavailable (NoteType,
|
||||||
FileBrowser,Brw_GetCodForFiles (),
|
FileBrowser,Brw_GetCodForFileBrowser (),
|
||||||
Path);
|
Path);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue