mirror of https://github.com/acanas/swad-core.git
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_BLUE,
|
||||
.PRG_RSC_YELLOW,
|
||||
.PRG_RSC_PINK {color:#202020; font-size:12pt;}
|
||||
.PRG_RSC_DARK {color:#e0e0e0; font-size:12pt;}
|
||||
.PRG_RSC_PINK {color:#202020; font-size:13pt;}
|
||||
.PRG_RSC_DARK {color:#e0e0e0; font-size:13pt;}
|
||||
|
||||
.PRG_RSC_INPUT
|
||||
{
|
||||
box-sizing:border-box;
|
||||
width:360px;
|
||||
}
|
||||
|
||||
/************************* Program resource 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? ***********************/
|
||||
/*****************************************************************************/
|
||||
|
@ -9113,22 +9146,22 @@ void Brw_GetFileMetadataByCod (struct FileMetadata *FileMetadata)
|
|||
/*****************************************************************************/
|
||||
/******************** Get summary and content of a file **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
void Brw_GetFileNameFromFilCod (long FilCod,char FileName[NAME_MAX + 1])
|
||||
{
|
||||
struct FileMetadata FileMetadata;
|
||||
|
||||
/***** Return nothing on error *****/
|
||||
***** Return nothing on error *****
|
||||
FileName[0] = '\0'; // Return nothing on error
|
||||
|
||||
/***** Get file metadata *****/
|
||||
***** Get file metadata *****
|
||||
FileMetadata.FilCod = FilCod;
|
||||
Brw_GetFileMetadataByCod (&FileMetadata);
|
||||
|
||||
/***** Copy file name into summary string *****/
|
||||
***** Copy file name into summary string *****
|
||||
Str_Copy (FileName,FileMetadata.FilFolLnk.Name,NAME_MAX);
|
||||
}
|
||||
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/********************** Get file type, size and date *************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -9944,7 +9977,7 @@ void Brw_ListDocsFound (MYSQL_RES **mysql_res,unsigned NumDocs,
|
|||
HTM_TR_End ();
|
||||
|
||||
/***** List documents found *****/
|
||||
for (NumDoc = 1;
|
||||
for (NumDoc = 1;
|
||||
NumDoc <= NumDocs;
|
||||
NumDoc++)
|
||||
{
|
||||
|
|
|
@ -233,7 +233,7 @@ void Brw_GetLinkToDownloadFile (const char *PathInTree,const char *FileName,char
|
|||
void Brw_ChgFileMetadata (void);
|
||||
void Brw_GetFileMetadataByPath (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);
|
||||
void Brw_GetAndUpdateFileViews (struct FileMetadata *FileMetadata);
|
||||
void Brw_UpdateMyFileViews (long FilCod);
|
||||
|
@ -257,6 +257,8 @@ void Brw_CalcSizeOfDir (char *Path);
|
|||
|
||||
void Brw_SetFullPathInTree (void);
|
||||
|
||||
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload);
|
||||
|
||||
void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
||||
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.
|
||||
*/
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.4.2 (2022-09-16)"
|
||||
#define CSS_FILE "swad22.3.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.5 (2022-09-16)"
|
||||
#define CSS_FILE "swad22.5.css"
|
||||
#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.1: Sep 15, 2022 Changes in edition of program items. (329955 lines)
|
||||
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_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,
|
||||
MYSQL_RES **mysql_res);
|
||||
|
||||
|
@ -439,7 +439,8 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
|||
HTM_BR ();
|
||||
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
||||
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
||||
PrgRsc_WriteLinkName (&Item->Resource.Link);
|
||||
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
||||
true); // Put form
|
||||
HTM_TD_End ();
|
||||
|
||||
/***** End row *****/
|
||||
|
@ -479,7 +480,7 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
|||
Prg_PutParamRscCod (&Item->Resource.Hierarchy.RscCod);
|
||||
HTM_INPUT_TEXT ("Title",PrgRsc_MAX_CHARS_PROGRAM_RESOURCE_TITLE,Item->Resource.Title,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
"class=\"PRG_RSC_INPUT INPUT_%s\"",
|
||||
The_GetSuffix ());
|
||||
Frm_EndForm ();
|
||||
|
||||
|
@ -495,7 +496,8 @@ static void PrgRsc_WriteRowEditResource (Prg_ListingType_t ListingType,
|
|||
/* Link */
|
||||
Ico_PutIconOn (Prg_ResourceTypesLogos[Item->Resource.Link.Type],Ico_BLACK,
|
||||
Prg_ResourceTypesDB[Item->Resource.Link.Type]);
|
||||
PrgRsc_WriteLinkName (&Item->Resource.Link);
|
||||
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
||||
true); // Put form
|
||||
}
|
||||
|
||||
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_SUBMIT_ON_CHANGE,
|
||||
"placeholder=\"%s\""
|
||||
" class=\"INPUT_FULL_NAME INPUT_%s\"",
|
||||
" class=\"PRG_RSC_INPUT INPUT_%s\"",
|
||||
"Nuevo recurso", // TODO: Need translation!!!!!!!!!!!!!!!!!!!
|
||||
The_GetSuffix ());
|
||||
Frm_EndForm ();
|
||||
|
@ -987,7 +989,8 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
|
|||
Prg_ResourceTypesDB[Link->Type]);
|
||||
|
||||
/***** Name *****/
|
||||
PrgRsc_WriteLinkName (Link);
|
||||
PrgRsc_WriteLinkName (Link,
|
||||
false); // Don't put form
|
||||
|
||||
HTM_LABEL_End ();
|
||||
HTM_LI_End ();
|
||||
|
@ -997,10 +1000,8 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
|
|||
/************* 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 *****/
|
||||
if (Link->Cod <= 0)
|
||||
return;
|
||||
|
@ -1018,8 +1019,7 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link)
|
|||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||
break;
|
||||
case PrgRsc_DOCUMENT:
|
||||
Brw_GetFileNameFromFilCod (Link->Cod,FileName);
|
||||
HTM_Txt (FileName);
|
||||
Brw_WriteFileNameInCrsProgram (Link->Cod,PutForm);
|
||||
break;
|
||||
case PrgRsc_MARKS:
|
||||
case PrgRsc_ATTENDANCE_EVENT:
|
||||
|
|
Loading…
Reference in New Issue