mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-31 22:05:23 +02:00
Version 16.68.4
This commit is contained in:
parent
43a0c1267a
commit
9c490f279c
|
@ -172,13 +172,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.68.3 (2016-11-22)"
|
#define Log_PLATFORM_VERSION "SWAD 16.68.4 (2016-11-22)"
|
||||||
#define CSS_FILE "swad16.68.css"
|
#define CSS_FILE "swad16.68.css"
|
||||||
#define JS_FILE "swad16.46.1.js"
|
#define JS_FILE "swad16.46.1.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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 sql/swad*.sql | tail -1
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 16.68.4: Nov 22, 2016 Code refactoring in file browser. (207447 lines)
|
||||||
Version 16.68.3: Nov 22, 2016 Change in layout of contextual links in file browsers. (207436 lines)
|
Version 16.68.3: Nov 22, 2016 Change in layout of contextual links in file browsers. (207436 lines)
|
||||||
Version 16.68.2: Nov 22, 2016 Code refactoring related to file browser and contextual checkbox. (207438 lines)
|
Version 16.68.2: Nov 22, 2016 Code refactoring related to file browser and contextual checkbox. (207438 lines)
|
||||||
Version 16.68.1: Nov 22, 2016 Code refactoring related to notifications and contextual checkbox. (207438 lines)
|
Version 16.68.1: Nov 22, 2016 Code refactoring related to notifications and contextual checkbox. (207438 lines)
|
||||||
|
|
|
@ -1450,6 +1450,7 @@ static bool Brw_CheckIfQuotaExceded (void);
|
||||||
|
|
||||||
static void Brw_ShowFileBrowserNormal (void);
|
static void Brw_ShowFileBrowserNormal (void);
|
||||||
static void Brw_ShowFileBrowsersAsgWrkCrs (void);
|
static void Brw_ShowFileBrowsersAsgWrkCrs (void);
|
||||||
|
static void Brw_PutLinkZIPAsgWrk (void);
|
||||||
static void Brw_ShowFileBrowsersAsgWrkUsr (void);
|
static void Brw_ShowFileBrowsersAsgWrkUsr (void);
|
||||||
|
|
||||||
static void Brw_FormToChangeCrsGrpZone (void);
|
static void Brw_FormToChangeCrsGrpZone (void);
|
||||||
|
@ -3126,50 +3127,12 @@ static void Brw_ShowFileBrowsersAsgWrkCrs (void)
|
||||||
extern const char *Txt_Assignments_and_other_works;
|
extern const char *Txt_Assignments_and_other_works;
|
||||||
extern const char *Txt_You_must_select_one_ore_more_users;
|
extern const char *Txt_You_must_select_one_ore_more_users;
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
struct UsrData UsrDat;
|
|
||||||
|
|
||||||
/***** Check the number of users whose works will be shown *****/
|
/***** Check the number of users whose works will be shown *****/
|
||||||
if (Usr_CountNumUsrsInListOfSelectedUsrs ()) // If some users are selected...
|
if (Usr_CountNumUsrsInListOfSelectedUsrs ()) // If some users are selected...
|
||||||
{
|
{
|
||||||
if (Gbl.FileBrowser.ZIP.CreateZIP)
|
/***** Put link to download / create zip file *****/
|
||||||
{
|
Brw_PutLinkZIPAsgWrk ();
|
||||||
/***** Create zip file
|
|
||||||
with the assignments and works
|
|
||||||
of the selected users *****/
|
|
||||||
/* Create temporary directory
|
|
||||||
for the compression of assignments and works */
|
|
||||||
ZIP_CreateTmpDirForCompression ();
|
|
||||||
|
|
||||||
/* Initialize structure with user's data */
|
|
||||||
Usr_UsrDataConstructor (&UsrDat);
|
|
||||||
|
|
||||||
/* Create temporary directory for each selected user
|
|
||||||
inside the directory used for compression */
|
|
||||||
Ptr = Gbl.Usrs.Select.All;
|
|
||||||
while (*Ptr)
|
|
||||||
{
|
|
||||||
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EncryptedUsrCod,
|
|
||||||
Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64);
|
|
||||||
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
|
||||||
|
|
||||||
|
|
||||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get user's data from database
|
|
||||||
if (Usr_CheckIfUsrBelongsToCrs (UsrDat.UsrCod,
|
|
||||||
Gbl.CurrentCrs.Crs.CrsCod,
|
|
||||||
false))
|
|
||||||
ZIP_CreateDirCompressionUsr (&UsrDat);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Free memory used for user's data */
|
|
||||||
Usr_UsrDataDestructor (&UsrDat);
|
|
||||||
|
|
||||||
/* Create the zip file and put a link to download it */
|
|
||||||
ZIP_CreateZIPAsgWrk ();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/***** Button to create a zip file
|
|
||||||
with all the works of the selected users *****/
|
|
||||||
ZIP_PutButtonToCreateZIPAsgWrk ();
|
|
||||||
|
|
||||||
/***** Write top before showing file browser *****/
|
/***** Write top before showing file browser *****/
|
||||||
Brw_WriteTopBeforeShowingFileBrowser ();
|
Brw_WriteTopBeforeShowingFileBrowser ();
|
||||||
|
@ -3226,6 +3189,23 @@ static void Brw_ShowFileBrowsersAsgWrkCrs (void)
|
||||||
Usr_FreeListsSelectedUsrsCods ();
|
Usr_FreeListsSelectedUsrsCods ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******** Put link to download / create zip file in assigments / works *******/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Brw_PutLinkZIPAsgWrk (void)
|
||||||
|
{
|
||||||
|
if (Gbl.FileBrowser.ZIP.CreateZIP)
|
||||||
|
{
|
||||||
|
/* Create the zip file and put a link to download it */
|
||||||
|
ZIP_CreateZIPAsgWrk ();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/***** Button to create a zip file
|
||||||
|
with all the works of the selected users *****/
|
||||||
|
ZIP_PutButtonToCreateZIPAsgWrk ();
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************ Show file browsers with works files of one user ****************/
|
/************ Show file browsers with works files of one user ****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
39
swad_zip.c
39
swad_zip.c
|
@ -104,6 +104,9 @@ extern struct Globals Gbl;
|
||||||
|
|
||||||
static void ZIP_PutButtonToCreateZIPAsgWrkParams (void);
|
static void ZIP_PutButtonToCreateZIPAsgWrkParams (void);
|
||||||
|
|
||||||
|
static void ZIP_CreateTmpDirForCompression (void);
|
||||||
|
static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat);
|
||||||
|
|
||||||
static void ZIP_CompressFolderIntoZIP (void);
|
static void ZIP_CompressFolderIntoZIP (void);
|
||||||
static unsigned long long ZIP_CloneDir (const char *Path,const char *PathClone,const char *PathInTree);
|
static unsigned long long ZIP_CloneDir (const char *Path,const char *PathClone,const char *PathInTree);
|
||||||
static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL,
|
static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL,
|
||||||
|
@ -153,6 +156,8 @@ bool ZIP_GetCreateZIPFromForm (void)
|
||||||
void ZIP_CreateZIPAsgWrk (void)
|
void ZIP_CreateZIPAsgWrk (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_works_ZIP_FILE_NAME;
|
extern const char *Txt_works_ZIP_FILE_NAME;
|
||||||
|
struct UsrData UsrDat;
|
||||||
|
const char *Ptr;
|
||||||
char StrZip[100+PATH_MAX*2+1];
|
char StrZip[100+PATH_MAX*2+1];
|
||||||
char Path[PATH_MAX+1];
|
char Path[PATH_MAX+1];
|
||||||
int Result;
|
int Result;
|
||||||
|
@ -162,6 +167,36 @@ void ZIP_CreateZIPAsgWrk (void)
|
||||||
char URLWithSpaces[PATH_MAX+1];
|
char URLWithSpaces[PATH_MAX+1];
|
||||||
char URL[PATH_MAX+1];
|
char URL[PATH_MAX+1];
|
||||||
|
|
||||||
|
/***** Create zip file
|
||||||
|
with the assignments and works
|
||||||
|
of the selected users *****/
|
||||||
|
/* Create temporary directory
|
||||||
|
for the compression of assignments and works */
|
||||||
|
ZIP_CreateTmpDirForCompression ();
|
||||||
|
|
||||||
|
/* Initialize structure with user's data */
|
||||||
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
|
||||||
|
/* Create temporary directory for each selected user
|
||||||
|
inside the directory used for compression */
|
||||||
|
Ptr = Gbl.Usrs.Select.All;
|
||||||
|
while (*Ptr)
|
||||||
|
{
|
||||||
|
Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EncryptedUsrCod,
|
||||||
|
Cry_LENGTH_ENCRYPTED_STR_SHA256_BASE64);
|
||||||
|
Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat);
|
||||||
|
|
||||||
|
|
||||||
|
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get user's data from database
|
||||||
|
if (Usr_CheckIfUsrBelongsToCrs (UsrDat.UsrCod,
|
||||||
|
Gbl.CurrentCrs.Crs.CrsCod,
|
||||||
|
false))
|
||||||
|
ZIP_CreateDirCompressionUsr (&UsrDat);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Free memory used for user's data */
|
||||||
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
/***** Create a temporary public directory
|
/***** Create a temporary public directory
|
||||||
used to download the zip file *****/
|
used to download the zip file *****/
|
||||||
Brw_CreateDirDownloadTmp ();
|
Brw_CreateDirDownloadTmp ();
|
||||||
|
@ -220,7 +255,7 @@ void ZIP_CreateZIPAsgWrk (void)
|
||||||
/********* Create temporary directory to put the works to compress ***********/
|
/********* Create temporary directory to put the works to compress ***********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ZIP_CreateTmpDirForCompression (void)
|
static void ZIP_CreateTmpDirForCompression (void)
|
||||||
{
|
{
|
||||||
char PathZipPriv[PATH_MAX+1];
|
char PathZipPriv[PATH_MAX+1];
|
||||||
char PathDirTmp[PATH_MAX+1];
|
char PathDirTmp[PATH_MAX+1];
|
||||||
|
@ -247,7 +282,7 @@ void ZIP_CreateTmpDirForCompression (void)
|
||||||
/**************** in the temporary directory of compression ******************/
|
/**************** in the temporary directory of compression ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat)
|
static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat)
|
||||||
{
|
{
|
||||||
char FullNameAndUsrID[(Usr_MAX_BYTES_NAME+1)*3+
|
char FullNameAndUsrID[(Usr_MAX_BYTES_NAME+1)*3+
|
||||||
ID_MAX_LENGTH_USR_ID+1+
|
ID_MAX_LENGTH_USR_ID+1+
|
||||||
|
|
|
@ -46,8 +46,6 @@
|
||||||
void ZIP_PutButtonToCreateZIPAsgWrk (void);
|
void ZIP_PutButtonToCreateZIPAsgWrk (void);
|
||||||
bool ZIP_GetCreateZIPFromForm (void);
|
bool ZIP_GetCreateZIPFromForm (void);
|
||||||
void ZIP_CreateZIPAsgWrk (void);
|
void ZIP_CreateZIPAsgWrk (void);
|
||||||
void ZIP_CreateTmpDirForCompression (void);
|
|
||||||
void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat);
|
|
||||||
|
|
||||||
void ZIP_PutButtonToDownloadZIPOfAFolder (const char *PathInTree,const char *FileName);
|
void ZIP_PutButtonToDownloadZIPOfAFolder (const char *PathInTree,const char *FileName);
|
||||||
void ZIP_CompressFileTree (void);
|
void ZIP_CompressFileTree (void);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user