mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-12 11:44:13 +02:00
Version20.8
This commit is contained in:
parent
598311b0bb
commit
9778f7c09b
|
@ -2374,7 +2374,8 @@ table.CELLS_PAD_10 > tbody > tr > td {padding:10px;}
|
||||||
.LST_EDIT_REC_HID {width:250px; color:#89BE87; font-weight:bold; font-size:11pt; height:20px; padding:0; margin:-1px; border-width:1px; border-style:solid; border-color:#ECE9D8;}
|
.LST_EDIT_REC_HID {width:250px; color:#89BE87; font-weight:bold; font-size:11pt; height:20px; padding:0; margin:-1px; border-width:1px; border-style:solid; border-color:#ECE9D8;}
|
||||||
.LST_EDIT_ROWS {width:30px; color:#202020; font-weight:bold; font-size:11pt; height:20px; padding:0; margin:-1px; border-width:1px; border-style:solid; border-color:#ECE9D8;}
|
.LST_EDIT_ROWS {width:30px; color:#202020; font-weight:bold; font-size:11pt; height:20px; padding:0; margin:-1px; border-width:1px; border-style:solid; border-color:#ECE9D8;}
|
||||||
|
|
||||||
.LICENSE {max-width:260px;}
|
.PUBLIC_FILE {max-width:400px;}
|
||||||
|
.LICENSE {max-width:400px;}
|
||||||
|
|
||||||
/************** Paragraph (margin on top and bottom of a div) ****************/
|
/************** Paragraph (margin on top and bottom of a div) ****************/
|
||||||
.PAR
|
.PAR
|
|
@ -555,8 +555,8 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 20.7.4 (2020-12-01)"
|
#define Log_PLATFORM_VERSION "SWAD 20.8 (2020-12-15)"
|
||||||
#define CSS_FILE "swad20.1.1.css"
|
#define CSS_FILE "swad20.8.css"
|
||||||
#define JS_FILE "swad20.6.2.js"
|
#define JS_FILE "swad20.6.2.js"
|
||||||
/*
|
/*
|
||||||
TODO: Juan Miguel Boyero Corral: Este verano ha habido varias personas que han solicitado incluir la funcionalidad del apartado de Actividades en SWADroid. Si lo ves viable podríamos estudiarlo.
|
TODO: Juan Miguel Boyero Corral: Este verano ha habido varias personas que han solicitado incluir la funcionalidad del apartado de Actividades en SWADroid. Si lo ves viable podríamos estudiarlo.
|
||||||
|
@ -602,6 +602,7 @@ Juan Miguel.
|
||||||
TODO: Fix bug: un profesor editor no puede ver las carpetas de TFG (proyectos) de otros. Debería poder.
|
TODO: Fix bug: un profesor editor no puede ver las carpetas de TFG (proyectos) de otros. Debería poder.
|
||||||
TODO: DNI de un estudiante sale erróneamente como ******* en lugar de mostrarse al ver los accesos de un estudiante a la asignatura.
|
TODO: DNI de un estudiante sale erróneamente como ******* en lugar de mostrarse al ver los accesos de un estudiante a la asignatura.
|
||||||
|
|
||||||
|
Version 20.8: Dec 15, 2020 Fixed bug in file browser. Reported by Javier Fernández Baldomero. (304711 lines)
|
||||||
Version 20.7.4: Dec 01, 2020 Fixed bug in pagination of forums of a thread. Reported by Javier Fernández Baldomero. (304705 lines)
|
Version 20.7.4: Dec 01, 2020 Fixed bug in pagination of forums of a thread. Reported by Javier Fernández Baldomero. (304705 lines)
|
||||||
Version 20.7.3: Nov 26, 2020 Fixed bugs in pagination when editing assignments. (304706 lines)
|
Version 20.7.3: Nov 26, 2020 Fixed bugs in pagination when editing assignments. (304706 lines)
|
||||||
Version 20.7.2: Nov 25, 2020 Changes in edition of matches. (304690 lines)
|
Version 20.7.2: Nov 25, 2020 Changes in edition of matches. (304690 lines)
|
||||||
|
|
|
@ -1418,7 +1418,7 @@ static bool Brw_GetIfFolderHasPublicFiles (const char Path[PATH_MAX + 1]);
|
||||||
|
|
||||||
static void Brw_ChangeFileOrFolderHiddenInDB (const char Path[PATH_MAX + 1],bool IsHidden);
|
static void Brw_ChangeFileOrFolderHiddenInDB (const char Path[PATH_MAX + 1],bool IsHidden);
|
||||||
|
|
||||||
static void Brw_ChangeFilePublicInDB (long PublisherUsrCod,const char *Path,
|
static void Brw_ChangeFilePublicInDB (struct FileMetadata *FileMetadata,
|
||||||
bool IsPublic,Brw_License_t License);
|
bool IsPublic,Brw_License_t License);
|
||||||
|
|
||||||
static long Brw_GetZoneUsrCodForFiles (void);
|
static long Brw_GetZoneUsrCodForFiles (void);
|
||||||
|
@ -9548,7 +9548,10 @@ void Brw_ShowFileMetadata (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
Frm_StartForm (Brw_ActRecDatFile[Gbl.FileBrowser.Type]);
|
Frm_StartForm (Brw_ActRecDatFile[Gbl.FileBrowser.Type]);
|
||||||
Brw_PutImplicitParamsFileBrowser (&Gbl.FileBrowser.FilFolLnk);
|
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||||
|
NULL, // Not used
|
||||||
|
Brw_IS_UNKNOWN, // Not used
|
||||||
|
FileMetadata.FilCod);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
|
@ -9649,7 +9652,7 @@ void Brw_ShowFileMetadata (void)
|
||||||
if (ICanChangePublic) // I can change file to public
|
if (ICanChangePublic) // I can change file to public
|
||||||
{
|
{
|
||||||
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,
|
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,
|
||||||
"id=\"PublicFile\" name=\"PublicFile\"");
|
"id=\"PublicFile\" name=\"PublicFile\" class=\"PUBLIC_FILE\"");
|
||||||
HTM_OPTION (HTM_Type_STRING,"N",
|
HTM_OPTION (HTM_Type_STRING,"N",
|
||||||
!FileMetadata.IsPublic,false,
|
!FileMetadata.IsPublic,false,
|
||||||
"%s",Txt_Private_available_to_certain_users_identified);
|
"%s",Txt_Private_available_to_certain_users_identified);
|
||||||
|
@ -10205,6 +10208,7 @@ void Brw_ChgFileMetadata (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_properties_of_file_X_have_been_saved;
|
extern const char *Txt_The_properties_of_file_X_have_been_saved;
|
||||||
struct FileMetadata FileMetadata;
|
struct FileMetadata FileMetadata;
|
||||||
|
bool Found;
|
||||||
bool IAmTheOwner;
|
bool IAmTheOwner;
|
||||||
bool PublicFileBeforeEdition;
|
bool PublicFileBeforeEdition;
|
||||||
bool PublicFileAfterEdition;
|
bool PublicFileAfterEdition;
|
||||||
|
@ -10214,106 +10218,103 @@ void Brw_ChgFileMetadata (void)
|
||||||
/***** Get parameters related to file browser *****/
|
/***** Get parameters related to file browser *****/
|
||||||
Brw_GetParAndInitFileBrowser ();
|
Brw_GetParAndInitFileBrowser ();
|
||||||
|
|
||||||
/***** Get file metadata from database *****/
|
/***** Get file metadata *****/
|
||||||
Brw_GetFileMetadataByPath (&FileMetadata);
|
FileMetadata.FilCod = Brw_GetParamFilCod ();
|
||||||
Brw_GetFileTypeSizeAndDate (&FileMetadata);
|
Brw_GetFileMetadataByCod (&FileMetadata);
|
||||||
|
Found = Brw_GetFileTypeSizeAndDate (&FileMetadata);
|
||||||
|
|
||||||
/***** Check if I can change file metadata *****/
|
if (Found)
|
||||||
IAmTheOwner = Brw_CheckIfIAmOwnerOfFile (FileMetadata.PublisherUsrCod);
|
|
||||||
if (Brw_CheckIfICanEditFileMetadata (IAmTheOwner))
|
|
||||||
{
|
{
|
||||||
/* Check if the file was public before the edition */
|
/***** Check if I can change file metadata *****/
|
||||||
PublicFileBeforeEdition = FileMetadata.IsPublic;
|
IAmTheOwner = Brw_CheckIfIAmOwnerOfFile (FileMetadata.PublisherUsrCod);
|
||||||
|
if (Brw_CheckIfICanEditFileMetadata (IAmTheOwner))
|
||||||
|
{
|
||||||
|
/* Check if the file was public before the edition */
|
||||||
|
PublicFileBeforeEdition = FileMetadata.IsPublic;
|
||||||
|
|
||||||
/***** Get the new file privacy and license from form *****/
|
/***** Get the new file privacy and license from form *****/
|
||||||
switch (Gbl.FileBrowser.Type)
|
|
||||||
{
|
|
||||||
case Brw_ADMI_DOC_INS:
|
|
||||||
case Brw_ADMI_SHR_INS:
|
|
||||||
case Brw_ADMI_DOC_CTR:
|
|
||||||
case Brw_ADMI_SHR_CTR:
|
|
||||||
case Brw_ADMI_DOC_DEG:
|
|
||||||
case Brw_ADMI_SHR_DEG:
|
|
||||||
case Brw_ADMI_DOC_CRS:
|
|
||||||
case Brw_ADMI_SHR_CRS:
|
|
||||||
PublicFileAfterEdition = Brw_GetParamPublicFile ();
|
|
||||||
License = Brw_GetParLicense ();
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_DOC_GRP:
|
|
||||||
case Brw_ADMI_TCH_CRS:
|
|
||||||
case Brw_ADMI_TCH_GRP:
|
|
||||||
case Brw_ADMI_SHR_GRP:
|
|
||||||
case Brw_ADMI_ASG_USR:
|
|
||||||
case Brw_ADMI_ASG_CRS:
|
|
||||||
case Brw_ADMI_WRK_USR:
|
|
||||||
case Brw_ADMI_WRK_CRS:
|
|
||||||
case Brw_ADMI_DOC_PRJ:
|
|
||||||
case Brw_ADMI_ASS_PRJ:
|
|
||||||
case Brw_ADMI_BRF_USR:
|
|
||||||
PublicFileAfterEdition = false; // Files in these zones can not be public
|
|
||||||
License = Brw_GetParLicense ();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
PublicFileAfterEdition = false; // Files in other zones can not be public
|
|
||||||
License = Brw_LICENSE_DEFAULT;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Change file metadata *****/
|
|
||||||
if (FileMetadata.FilCod > 0) // Entry exists in database
|
|
||||||
Brw_ChangeFilePublicInDB (Gbl.Usrs.Me.UsrDat.UsrCod,
|
|
||||||
Gbl.FileBrowser.FilFolLnk.Full,
|
|
||||||
PublicFileAfterEdition,License);
|
|
||||||
else // No entry in database
|
|
||||||
FileMetadata.FilCod = Brw_AddPathToDB (Gbl.Usrs.Me.UsrDat.UsrCod,FileMetadata.FilFolLnk.Type,
|
|
||||||
Gbl.FileBrowser.FilFolLnk.Full,
|
|
||||||
PublicFileAfterEdition,License);
|
|
||||||
|
|
||||||
/***** Remove the affected clipboards *****/
|
|
||||||
Brw_RemoveAffectedClipboards (Gbl.FileBrowser.Type,
|
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
|
||||||
Gbl.Usrs.Other.UsrDat.UsrCod);
|
|
||||||
|
|
||||||
/***** Insert file into public social activity *****/
|
|
||||||
if (!PublicFileBeforeEdition &&
|
|
||||||
PublicFileAfterEdition) // Only if file has changed from private to public
|
|
||||||
switch (Gbl.FileBrowser.Type)
|
switch (Gbl.FileBrowser.Type)
|
||||||
{
|
{
|
||||||
case Brw_ADMI_DOC_INS:
|
case Brw_ADMI_DOC_INS:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_SHR_INS:
|
case Brw_ADMI_SHR_INS:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_DOC_CTR:
|
case Brw_ADMI_DOC_CTR:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_SHR_CTR:
|
case Brw_ADMI_SHR_CTR:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_DOC_DEG:
|
case Brw_ADMI_DOC_DEG:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_SHR_DEG:
|
case Brw_ADMI_SHR_DEG:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_DOC_CRS:
|
case Brw_ADMI_DOC_CRS:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
|
||||||
break;
|
|
||||||
case Brw_ADMI_SHR_CRS:
|
case Brw_ADMI_SHR_CRS:
|
||||||
TL_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
PublicFileAfterEdition = Brw_GetParamPublicFile ();
|
||||||
|
License = Brw_GetParLicense ();
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_DOC_GRP:
|
||||||
|
case Brw_ADMI_TCH_CRS:
|
||||||
|
case Brw_ADMI_TCH_GRP:
|
||||||
|
case Brw_ADMI_SHR_GRP:
|
||||||
|
case Brw_ADMI_ASG_USR:
|
||||||
|
case Brw_ADMI_ASG_CRS:
|
||||||
|
case Brw_ADMI_WRK_USR:
|
||||||
|
case Brw_ADMI_WRK_CRS:
|
||||||
|
case Brw_ADMI_DOC_PRJ:
|
||||||
|
case Brw_ADMI_ASS_PRJ:
|
||||||
|
case Brw_ADMI_BRF_USR:
|
||||||
|
PublicFileAfterEdition = false; // Files in these zones can not be public
|
||||||
|
License = Brw_GetParLicense ();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
PublicFileAfterEdition = false; // Files in other zones can not be public
|
||||||
|
License = Brw_LICENSE_DEFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Write sucess message *****/
|
/***** Change file metadata *****/
|
||||||
Ale_ShowAlert (Ale_SUCCESS,Txt_The_properties_of_file_X_have_been_saved,
|
Brw_ChangeFilePublicInDB (&FileMetadata,PublicFileAfterEdition,License);
|
||||||
Gbl.FileBrowser.FilFolLnk.Name);
|
|
||||||
|
/***** Remove the affected clipboards *****/
|
||||||
|
Brw_RemoveAffectedClipboards (Gbl.FileBrowser.Type,
|
||||||
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
|
Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||||
|
|
||||||
|
/***** Insert file into public social activity *****/
|
||||||
|
if (!PublicFileBeforeEdition &&
|
||||||
|
PublicFileAfterEdition) // Only if file has changed from private to public
|
||||||
|
switch (Gbl.FileBrowser.Type)
|
||||||
|
{
|
||||||
|
case Brw_ADMI_DOC_INS:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_INS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_SHR_INS:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_INS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_DOC_CTR:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_CTR_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_SHR_CTR:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_CTR_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_DOC_DEG:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_DEG_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_SHR_DEG:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_DEG_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_DOC_CRS:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_CRS_DOC_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
case Brw_ADMI_SHR_CRS:
|
||||||
|
TL_StoreAndPublishNote (TL_NOTE_CRS_SHA_PUB_FILE,FileMetadata.FilCod,&SocPub);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Write sucess message *****/
|
||||||
|
Ale_ShowAlert (Ale_SUCCESS,Txt_The_properties_of_file_X_have_been_saved,
|
||||||
|
Gbl.FileBrowser.FilFolLnk.Name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/***** Write error message and exit *****/
|
||||||
|
Lay_NoPermissionExit ();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
/***** Write error message and exit *****/
|
|
||||||
Lay_NoPermissionExit ();
|
|
||||||
|
|
||||||
/***** Show again the file browser *****/
|
/***** Show again the file browser *****/
|
||||||
Brw_ShowAgainFileBrowserOrWorks ();
|
Brw_ShowAgainFileBrowserOrWorks ();
|
||||||
|
@ -10979,24 +10980,28 @@ static void Brw_ChangeFileOrFolderHiddenInDB (const char Path[PATH_MAX + 1],bool
|
||||||
/******* Change publisher, public and license of file in the database ********/
|
/******* Change publisher, public and license of file in the database ********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Brw_ChangeFilePublicInDB (long PublisherUsrCod,const char *Path,
|
static void Brw_ChangeFilePublicInDB (struct FileMetadata *FileMetadata,
|
||||||
bool IsPublic,Brw_License_t License)
|
bool IsPublic,Brw_License_t License)
|
||||||
{
|
{
|
||||||
long Cod = Brw_GetCodForFiles ();
|
long Cod = Brw_GetCodForFiles ();
|
||||||
long ZoneUsrCod = Brw_GetZoneUsrCodForFiles ();
|
long ZoneUsrCod = Brw_GetZoneUsrCodForFiles ();
|
||||||
|
|
||||||
|
/***** Trivial check *****/
|
||||||
|
if (FileMetadata->FilCod <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
/***** Change publisher, public and license of file in database *****/
|
/***** Change publisher, public and license of file in database *****/
|
||||||
DB_QueryUPDATE ("can not change metadata of a file in database",
|
DB_QueryUPDATE ("can not change metadata of a file in database",
|
||||||
"UPDATE files SET PublisherUsrCod=%ld,Public='%c',License=%u"
|
"UPDATE files SET Public='%c',License=%u"
|
||||||
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
" WHERE FileBrowser=%u AND Cod=%ld AND ZoneUsrCod=%ld"
|
||||||
" AND Path='%s'",
|
" AND FilCod=%ld AND Path='%s'",
|
||||||
PublisherUsrCod,
|
|
||||||
IsPublic ? 'Y' :
|
IsPublic ? 'Y' :
|
||||||
'N',
|
'N',
|
||||||
(unsigned) License,
|
(unsigned) License,
|
||||||
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
(unsigned) Brw_FileBrowserForDB_files[Gbl.FileBrowser.Type],
|
||||||
Cod,ZoneUsrCod,
|
Cod,ZoneUsrCod,
|
||||||
Path);
|
FileMetadata->FilCod,
|
||||||
|
FileMetadata->FilFolLnk.Full);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user