mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-15 21:24:07 +02:00
Version 22.5: Sep 16, 2022 Link to download document in program.
This commit is contained in:
parent
c8297efb77
commit
adb3e3179a
|
@ -1778,8 +1778,14 @@ a:hover img.CENTER_PHOTO_SHOW
|
||||||
.PRG_RSC_PURPLE,
|
.PRG_RSC_PURPLE,
|
||||||
.PRG_RSC_BLUE,
|
.PRG_RSC_BLUE,
|
||||||
.PRG_RSC_YELLOW,
|
.PRG_RSC_YELLOW,
|
||||||
.PRG_RSC_PINK {color:#202020; font-size:12pt;}
|
.PRG_RSC_PINK {color:#202020; font-size:13pt;}
|
||||||
.PRG_RSC_DARK {color:#e0e0e0; font-size:12pt;}
|
.PRG_RSC_DARK {color:#e0e0e0; font-size:13pt;}
|
||||||
|
|
||||||
|
.PRG_RSC_INPUT
|
||||||
|
{
|
||||||
|
box-sizing:border-box;
|
||||||
|
width:360px;
|
||||||
|
}
|
||||||
|
|
||||||
/************************* Program resource clipboard ************************/
|
/************************* Program resource clipboard ************************/
|
||||||
.PRG_CLIPBOARD
|
.PRG_CLIPBOARD
|
|
@ -5318,6 +5318,39 @@ static void Brw_WriteFileName (unsigned Level,bool IsPublic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************** Get summary and content of a file **********************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload)
|
||||||
|
{
|
||||||
|
extern const char *Txt_Download;
|
||||||
|
struct FileMetadata FileMetadata;
|
||||||
|
|
||||||
|
/***** Get file metadata *****/
|
||||||
|
FileMetadata.FilCod = FilCod;
|
||||||
|
Brw_GetFileMetadataByCod (&FileMetadata);
|
||||||
|
|
||||||
|
/***** Begin form to download file *****/
|
||||||
|
if (PutFormToDownload)
|
||||||
|
{
|
||||||
|
Frm_BeginForm (Brw_ActDowFile[Brw_SHOW_DOC_CRS]);
|
||||||
|
Brw_PutImplicitParamsFileBrowser (&FileMetadata.FilFolLnk);
|
||||||
|
HTM_BUTTON_Submit_Begin (Txt_Download,"class=\"LM BT_LINK PRG_RSC_%s\"",The_GetSuffix ());
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Write filename *****/
|
||||||
|
HTM_Txt (FileMetadata.FilFolLnk.Name);
|
||||||
|
|
||||||
|
/***** End form to download file *****/
|
||||||
|
if (PutFormToDownload)
|
||||||
|
{
|
||||||
|
HTM_BUTTON_End ();
|
||||||
|
|
||||||
|
Frm_EndForm ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Which filename must be shown? ***********************/
|
/*********************** Which filename must be shown? ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -9113,22 +9146,22 @@ void Brw_GetFileMetadataByCod (struct FileMetadata *FileMetadata)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Get summary and content of a file **********************/
|
/******************** Get summary and content of a file **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
void Brw_GetFileNameFromFilCod (long FilCod,char FileName[NAME_MAX + 1])
|
void Brw_GetFileNameFromFilCod (long FilCod,char FileName[NAME_MAX + 1])
|
||||||
{
|
{
|
||||||
struct FileMetadata FileMetadata;
|
struct FileMetadata FileMetadata;
|
||||||
|
|
||||||
/***** Return nothing on error *****/
|
***** Return nothing on error *****
|
||||||
FileName[0] = '\0'; // Return nothing on error
|
FileName[0] = '\0'; // Return nothing on error
|
||||||
|
|
||||||
/***** Get file metadata *****/
|
***** Get file metadata *****
|
||||||
FileMetadata.FilCod = FilCod;
|
FileMetadata.FilCod = FilCod;
|
||||||
Brw_GetFileMetadataByCod (&FileMetadata);
|
Brw_GetFileMetadataByCod (&FileMetadata);
|
||||||
|
|
||||||
/***** Copy file name into summary string *****/
|
***** Copy file name into summary string *****
|
||||||
Str_Copy (FileName,FileMetadata.FilFolLnk.Name,NAME_MAX);
|
Str_Copy (FileName,FileMetadata.FilFolLnk.Name,NAME_MAX);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Get file type, size and date *************************/
|
/********************** Get file type, size and date *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -233,7 +233,7 @@ void Brw_GetLinkToDownloadFile (const char *PathInTree,const char *FileName,char
|
||||||
void Brw_ChgFileMetadata (void);
|
void Brw_ChgFileMetadata (void);
|
||||||
void Brw_GetFileMetadataByPath (struct FileMetadata *FileMetadata);
|
void Brw_GetFileMetadataByPath (struct FileMetadata *FileMetadata);
|
||||||
void Brw_GetFileMetadataByCod (struct FileMetadata *FileMetadata);
|
void Brw_GetFileMetadataByCod (struct FileMetadata *FileMetadata);
|
||||||
void Brw_GetFileNameFromFilCod (long FilCod,char FileName[NAME_MAX + 1]);
|
// void Brw_GetFileNameFromFilCod (long FilCod,char FileName[NAME_MAX + 1]);
|
||||||
bool Brw_GetFileTypeSizeAndDate (struct FileMetadata *FileMetadata);
|
bool Brw_GetFileTypeSizeAndDate (struct FileMetadata *FileMetadata);
|
||||||
void Brw_GetAndUpdateFileViews (struct FileMetadata *FileMetadata);
|
void Brw_GetAndUpdateFileViews (struct FileMetadata *FileMetadata);
|
||||||
void Brw_UpdateMyFileViews (long FilCod);
|
void Brw_UpdateMyFileViews (long FilCod);
|
||||||
|
@ -257,6 +257,8 @@ void Brw_CalcSizeOfDir (char *Path);
|
||||||
|
|
||||||
void Brw_SetFullPathInTree (void);
|
void Brw_SetFullPathInTree (void);
|
||||||
|
|
||||||
|
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload);
|
||||||
|
|
||||||
void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
||||||
const char *FileName);
|
const char *FileName);
|
||||||
|
|
||||||
|
|
|
@ -606,10 +606,11 @@ TODO: Fix bug: error al enviar un mensaje a dos recipientes, error on duplicate
|
||||||
|
|
||||||
TODO: Attach pdf files in multimedia.
|
TODO: Attach pdf files in multimedia.
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 22.4.2 (2022-09-16)"
|
#define Log_PLATFORM_VERSION "SWAD 22.5 (2022-09-16)"
|
||||||
#define CSS_FILE "swad22.3.css"
|
#define CSS_FILE "swad22.5.css"
|
||||||
#define JS_FILE "swad21.100.js"
|
#define JS_FILE "swad21.100.js"
|
||||||
/*
|
/*
|
||||||
|
Version 22.5: Sep 16, 2022 Link to download document in program. (330018 lines)
|
||||||
Version 22.4.2: Sep 16, 2022 Changes in edition of program items. (329982 lines)
|
Version 22.4.2: Sep 16, 2022 Changes in edition of program items. (329982 lines)
|
||||||
Version 22.4.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
Version 22.4.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
||||||
Copy the following icon to icon public directory:
|
Copy the following icon to icon public directory:
|
||||||
|
|
|
@ -113,7 +113,7 @@ static bool PrgRsc_ExchangeResources (const struct Prg_ResourceHierarchy *Rsc1,
|
||||||
|
|
||||||
static void PrgRsc_ShowClipboard (struct Prg_Item *Item);
|
static void PrgRsc_ShowClipboard (struct Prg_Item *Item);
|
||||||
static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *Link);
|
static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *Link);
|
||||||
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link);
|
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutForm);
|
||||||
static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link,
|
static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link,
|
||||||
MYSQL_RES **mysql_res);
|
MYSQL_RES **mysql_res);
|
||||||
|
|
||||||
|
@ -439,7 +439,8 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
||||||
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
||||||
PrgRsc_WriteLinkName (&Item->Resource.Link);
|
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
||||||
|
true); // Put form
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
/***** End row *****/
|
/***** End row *****/
|
||||||
|
@ -479,7 +480,7 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
||||||
Prg_PutParamRscCod (&Item->Resource.Hierarchy.RscCod);
|
Prg_PutParamRscCod (&Item->Resource.Hierarchy.RscCod);
|
||||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,Item->Resource.Title,
|
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,Item->Resource.Title,
|
||||||
HTM_SUBMIT_ON_CHANGE,
|
HTM_SUBMIT_ON_CHANGE,
|
||||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
"class=\"PRG_RSC_INPUT INPUT_%s\"",
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
|
@ -495,7 +496,8 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
||||||
/* Link */
|
/* Link */
|
||||||
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
||||||
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
||||||
PrgRsc_WriteLinkName (&Item->Resource.Link);
|
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
||||||
|
true); // Put form
|
||||||
}
|
}
|
||||||
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
@ -538,7 +540,7 @@ static void PrgRsc_WriteRowNewResource (Prg_ListingType_t ListingType,
|
||||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,"",
|
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,"",
|
||||||
HTM_SUBMIT_ON_CHANGE,
|
HTM_SUBMIT_ON_CHANGE,
|
||||||
"placeholder=\"%s\""
|
"placeholder=\"%s\""
|
||||||
" class=\"INPUT_FULL_NAME INPUT_%s\"",
|
" class=\"PRG_RSC_INPUT INPUT_%s\"",
|
||||||
"Nuevo recurso", // TODO: Need translation!!!!!!!!!!!!!!!!!!!
|
"Nuevo recurso", // TODO: Need translation!!!!!!!!!!!!!!!!!!!
|
||||||
The_GetSuffix ());
|
The_GetSuffix ());
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
@ -987,7 +989,8 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
|
||||||
Prg_ResourceTypesDB[Link->Type]);
|
Prg_ResourceTypesDB[Link->Type]);
|
||||||
|
|
||||||
/***** Name *****/
|
/***** Name *****/
|
||||||
PrgRsc_WriteLinkName (Link);
|
PrgRsc_WriteLinkName (Link,
|
||||||
|
false); // Don't put form
|
||||||
|
|
||||||
HTM_LABEL_End ();
|
HTM_LABEL_End ();
|
||||||
HTM_LI_End ();
|
HTM_LI_End ();
|
||||||
|
@ -997,10 +1000,8 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
|
||||||
/************* Write link name (filename, assignment title...) ***************/
|
/************* Write link name (filename, assignment title...) ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link)
|
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutForm)
|
||||||
{
|
{
|
||||||
char FileName[NAME_MAX + 1];
|
|
||||||
|
|
||||||
/***** Trivial check: code should be > 0 *****/
|
/***** Trivial check: code should be > 0 *****/
|
||||||
if (Link->Cod <= 0)
|
if (Link->Cod <= 0)
|
||||||
return;
|
return;
|
||||||
|
@ -1018,8 +1019,7 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link)
|
||||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||||
break;
|
break;
|
||||||
case PrgRsc_DOCUMENT:
|
case PrgRsc_DOCUMENT:
|
||||||
Brw_GetFileNameFromFilCod (Link->Cod,FileName);
|
Brw_WriteFileNameInCrsProgram (Link->Cod,PutForm);
|
||||||
HTM_Txt (FileName);
|
|
||||||
break;
|
break;
|
||||||
case PrgRsc_MARKS:
|
case PrgRsc_MARKS:
|
||||||
case PrgRsc_ATTENDANCE_EVENT:
|
case PrgRsc_ATTENDANCE_EVENT:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user