Version 16.68.5

This commit is contained in:
Antonio Cañas Vargas 2016-11-22 13:26:34 +01:00
parent 9c490f279c
commit faa0c5c44f
4 changed files with 27 additions and 33 deletions

View File

@ -172,13 +172,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.68.4 (2016-11-22)" #define Log_PLATFORM_VERSION "SWAD 16.68.5 (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.5: Nov 22, 2016 Code refactoring and change in layout of file browser and contextual links. (207443 lines)
Version 16.68.4: Nov 22, 2016 Code refactoring in file browser. (207447 lines) 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)

View File

@ -1450,7 +1450,6 @@ 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);
@ -3131,8 +3130,9 @@ static void Brw_ShowFileBrowsersAsgWrkCrs (void)
/***** 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...
{ {
/***** Put link to download / create zip file *****/ /***** Create the zip file and put a link to download it *****/
Brw_PutLinkZIPAsgWrk (); if (Gbl.FileBrowser.ZIP.CreateZIP)
ZIP_CreateZIPAsgWrk ();
/***** Write top before showing file browser *****/ /***** Write top before showing file browser *****/
Brw_WriteTopBeforeShowingFileBrowser (); Brw_WriteTopBeforeShowingFileBrowser ();
@ -3189,23 +3189,6 @@ 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 ****************/
/*****************************************************************************/ /*****************************************************************************/
@ -3726,10 +3709,22 @@ static void Brw_WriteTopBeforeShowingFileBrowser (void)
/* Put checkbox to show the full tree */ /* Put checkbox to show the full tree */
Brw_PutCheckboxFullTree (); Brw_PutCheckboxFullTree ();
/* Put link to remove old files */ switch (Gbl.FileBrowser.Type)
if (Gbl.FileBrowser.Type == Brw_ADMI_BRIEF_USR && {
Gbl.Action.Act != ActReqRemOldBrf) case Brw_ADMI_ASSIG_CRS:
Brw_PutLinkToAskRemOldFiles (); case Brw_ADMI_WORKS_CRS:
/* Put link to create a zip file with all the works of the selected users */
if (!Gbl.FileBrowser.ZIP.CreateZIP)
ZIP_PutLinkToCreateZIPAsgWrk ();
break;
case Brw_ADMI_BRIEF_USR:
/* Put link to remove old files */
if (Gbl.Action.Act != ActReqRemOldBrf)
Brw_PutLinkToAskRemOldFiles ();
break;
default:
break;
}
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");

View File

@ -102,7 +102,7 @@ extern struct Globals Gbl;
/***************************** Internal prototypes ***************************/ /***************************** Internal prototypes ***************************/
/*****************************************************************************/ /*****************************************************************************/
static void ZIP_PutButtonToCreateZIPAsgWrkParams (void); static void ZIP_PutLinkToCreateZIPAsgWrkParams (void);
static void ZIP_CreateTmpDirForCompression (void); static void ZIP_CreateTmpDirForCompression (void);
static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat); static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat);
@ -113,22 +113,20 @@ static void ZIP_ShowLinkToDownloadZIP (const char *FileName,const char *URL,
off_t FileSize,unsigned long long UncompressedSize); off_t FileSize,unsigned long long UncompressedSize);
/*****************************************************************************/ /*****************************************************************************/
/********* Put button to create ZIP file of assignments and works ************/ /*********** Put link to create ZIP file of assignments and works ************/
/*****************************************************************************/ /*****************************************************************************/
void ZIP_PutButtonToCreateZIPAsgWrk (void) void ZIP_PutLinkToCreateZIPAsgWrk (void)
{ {
extern const char *Txt_Create_ZIP_file; extern const char *Txt_Create_ZIP_file;
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_MENU\">"); Lay_PutContextualLink (ActAdmAsgWrkCrs,ZIP_PutLinkToCreateZIPAsgWrkParams,
Lay_PutContextualLink (ActAdmAsgWrkCrs,ZIP_PutButtonToCreateZIPAsgWrkParams,
"download64x64.png", "download64x64.png",
Txt_Create_ZIP_file,Txt_Create_ZIP_file, Txt_Create_ZIP_file,Txt_Create_ZIP_file,
NULL); NULL);
fprintf (Gbl.F.Out,"</div>");
} }
static void ZIP_PutButtonToCreateZIPAsgWrkParams (void) static void ZIP_PutLinkToCreateZIPAsgWrkParams (void)
{ {
Usr_PutHiddenParUsrCodAll (ActAdmAsgWrkCrs,Gbl.Usrs.Select.All); Usr_PutHiddenParUsrCodAll (ActAdmAsgWrkCrs,Gbl.Usrs.Select.All);
if (Gbl.FileBrowser.FullTree) if (Gbl.FileBrowser.FullTree)

View File

@ -43,7 +43,7 @@
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
void ZIP_PutButtonToCreateZIPAsgWrk (void); void ZIP_PutLinkToCreateZIPAsgWrk (void);
bool ZIP_GetCreateZIPFromForm (void); bool ZIP_GetCreateZIPFromForm (void);
void ZIP_CreateZIPAsgWrk (void); void ZIP_CreateZIPAsgWrk (void);