mirror of https://github.com/acanas/swad-core.git
Version 22.12.1: Sep 20, 2022 Changes in behaviour of program items.
This commit is contained in:
parent
9ef7ef738e
commit
55d7f216a8
|
@ -3327,7 +3327,8 @@ void Att_GetLinkToEvent (void)
|
|||
/**************** Write attendance event in course program *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo)
|
||||
void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
|
||||
|
@ -3346,6 +3347,9 @@ void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo)
|
|||
The_GetSuffix ());
|
||||
}
|
||||
|
||||
/***** Icon depending on type ******/
|
||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||
|
||||
/***** Write attendance event title *****/
|
||||
HTM_Txt (Title);
|
||||
|
||||
|
|
|
@ -111,7 +111,8 @@ void Att_PrintUsrsAttendanceCrs (void);
|
|||
|
||||
//--------------------------- Program resources -------------------------------
|
||||
void Att_GetLinkToEvent (void);
|
||||
void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo);
|
||||
void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
void Att_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5372,7 +5372,8 @@ void Brw_GetLinkToFile (void)
|
|||
/******************** Write file name in course program **********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload)
|
||||
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
extern const char *Txt_Download;
|
||||
struct FileMetadata FileMetadata;
|
||||
|
@ -5381,23 +5382,30 @@ void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload)
|
|||
FileMetadata.FilCod = FilCod;
|
||||
Brw_GetFileMetadataByCod (&FileMetadata);
|
||||
|
||||
/***** Begin form to download file *****/
|
||||
if (PutFormToDownload)
|
||||
/***** Begin form to go to file data *****/
|
||||
if (PutFormToGo)
|
||||
{
|
||||
// TODO: Download directly or go to the file data?
|
||||
// TODO: File browser in marks file is always "admin", but student shouldn't have access to view all marks
|
||||
/* To download the file:
|
||||
Frm_BeginForm (Brw_ActDowFile[FileMetadata.FileBrowser]);
|
||||
Brw_PutImplicitParamsFileBrowser (&FileMetadata.FilFolLnk);
|
||||
Brw_PutImplicitParamsFileBrowser (&FileMetadata.FilFolLnk); */
|
||||
Frm_BeginForm (Brw_ActReqDatFile[FileMetadata.FileBrowser]);
|
||||
Brw_PutParamsFileBrowser (NULL, // Not used
|
||||
NULL, // Not used
|
||||
Brw_IS_UNKNOWN, // Not used
|
||||
FileMetadata.FilCod);
|
||||
HTM_BUTTON_Submit_Begin (Txt_Download,
|
||||
"class=\"LM BT_LINK PRG_RSC_%s\"",
|
||||
The_GetSuffix ());
|
||||
}
|
||||
|
||||
/***** Icon depending on type ******/
|
||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||
|
||||
/***** Write filename *****/
|
||||
HTM_Txt (FileMetadata.FilFolLnk.Name);
|
||||
|
||||
/***** End form to download file *****/
|
||||
if (PutFormToDownload)
|
||||
if (PutFormToGo)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
|
||||
|
|
|
@ -257,7 +257,8 @@ void Brw_SetFullPathInTree (void);
|
|||
|
||||
//--------------------------- Program resources -------------------------------
|
||||
void Brw_GetLinkToFile (void);
|
||||
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload);
|
||||
void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
void Brw_GetFileNameFromFilCod (long FilCod,char *FileName,size_t FileNameSize);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -1733,7 +1733,8 @@ void Cfe_GetLinkToCallForExam (void)
|
|||
/******************* Write call for exam in course program *******************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
||||
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
struct Cfe_CallsForExams CallsForExams;
|
||||
|
@ -1764,6 +1765,9 @@ void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
|||
Frm_FreeAnchorStr (Anchor);
|
||||
}
|
||||
|
||||
/***** Icon depending on type ******/
|
||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||
|
||||
/***** Write Name of the course and date of exam *****/
|
||||
HTM_Txt (SessionAndDate);
|
||||
|
||||
|
|
|
@ -128,7 +128,8 @@ void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY
|
|||
|
||||
//--------------------------- Program resources -------------------------------
|
||||
void Cfe_GetLinkToCallForExam (void);
|
||||
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo);
|
||||
void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
void Cfe_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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.12 (2022-09-20)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 22.12.1 (2022-09-20)"
|
||||
#define CSS_FILE "swad22.7.css"
|
||||
#define JS_FILE "swad21.100.js"
|
||||
/*
|
||||
Version 22.12.1: Sep 20, 2022 Changes in behaviour of program items. (331015 lines)
|
||||
Version 22.12: Sep 20, 2022 Links to marks file in program. (330985 lines)
|
||||
Copy the following icon to icon public directory:
|
||||
sudo cp icon/list-alt.svg /var/www/html/swad/icon/
|
||||
|
|
|
@ -1677,7 +1677,8 @@ void Exa_GetLinkToExam (void)
|
|||
/*********************** Write exam in course program ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Exa_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
||||
void Exa_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
char Title[Gam_MAX_BYTES_TITLE + 1];
|
||||
|
@ -1695,6 +1696,9 @@ void Exa_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo)
|
|||
The_GetSuffix ());
|
||||
}
|
||||
|
||||
/***** Icon depending on type ******/
|
||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||
|
||||
/***** Write Name of the course and date of exam *****/
|
||||
HTM_Txt (Title);
|
||||
|
||||
|
|
|
@ -89,7 +89,8 @@ void Exa_GetAndShowExamsStats (void);
|
|||
|
||||
//--------------------------- Program resources -------------------------------
|
||||
void Exa_GetLinkToExam (void);
|
||||
void Exa_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo);
|
||||
void Exa_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
void Exa_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2387,7 +2387,8 @@ void Gam_GetLinkToGame (void)
|
|||
/*********************** Write game in course program ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo)
|
||||
void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
char Title[Gam_MAX_BYTES_TITLE + 1];
|
||||
|
@ -2405,6 +2406,9 @@ void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo)
|
|||
The_GetSuffix ());
|
||||
}
|
||||
|
||||
/***** Icon depending on type ******/
|
||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||
|
||||
/***** Write game title of exam *****/
|
||||
HTM_Txt (Title);
|
||||
|
||||
|
|
|
@ -169,7 +169,8 @@ void Gam_GetAndShowGamesStats (void);
|
|||
|
||||
//--------------------------- Program resources -------------------------------
|
||||
void Gam_GetLinkToGame (void);
|
||||
void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo);
|
||||
void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
void Gam_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -117,7 +117,8 @@ 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,bool PutForm);
|
||||
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link,
|
||||
MYSQL_RES **mysql_res);
|
||||
|
||||
|
@ -444,10 +445,10 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
|
|||
The_GetSuffix (),The_GetColorRows1 (1));
|
||||
HTM_Txt (Item->Resource.Title);
|
||||
HTM_BR ();
|
||||
Ico_PutIconOn (Prg_ResourceTypesIcons[Item->Resource.Link.Type],Ico_BLACK,
|
||||
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
||||
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
||||
true); // Put form
|
||||
true, // Put form
|
||||
Prg_ResourceTypesIcons[Item->Resource.Link.Type],
|
||||
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
||||
HTM_TD_End ();
|
||||
|
||||
/***** End row *****/
|
||||
|
@ -497,13 +498,11 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
|
|||
/* Show clipboard to change resource link */
|
||||
PrgRsc_ShowClipboard (Item);
|
||||
else
|
||||
{
|
||||
/* Show current link */
|
||||
Ico_PutIconOn (Prg_ResourceTypesIcons[Item->Resource.Link.Type],Ico_BLACK,
|
||||
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
||||
PrgRsc_WriteLinkName (&Item->Resource.Link,
|
||||
true); // Put form
|
||||
}
|
||||
true, // Put form
|
||||
Prg_ResourceTypesIcons[Item->Resource.Link.Type],
|
||||
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
|
||||
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -989,13 +988,11 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
|
|||
SubmitOnClick ? "" :
|
||||
" checked=\"checked\"");
|
||||
|
||||
/***** Type *****/
|
||||
Ico_PutIconOn (Prg_ResourceTypesIcons[Link->Type],Ico_BLACK,
|
||||
Txt_RESOURCE_TYPES[Link->Type]);
|
||||
|
||||
/***** Name *****/
|
||||
PrgRsc_WriteLinkName (Link,
|
||||
false); // Don't put form
|
||||
false, // Don't put form
|
||||
Prg_ResourceTypesIcons[Link->Type],
|
||||
Txt_RESOURCE_TYPES[Link->Type]);
|
||||
|
||||
HTM_LABEL_End ();
|
||||
HTM_LI_End ();
|
||||
|
@ -1005,9 +1002,12 @@ 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,bool PutForm)
|
||||
static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
static void (*WriteLinkName[PrgRsc_NUM_TYPES]) (long Cod,bool PutFormToGo) =
|
||||
static void (*WriteLinkName[PrgRsc_NUM_TYPES]) (long Cod,bool PutFormToGo,
|
||||
const char *Icon,
|
||||
const char *IconTitle) =
|
||||
{
|
||||
[PrgRsc_NONE ] = NULL,
|
||||
[PrgRsc_ASSIGNMENT ] = NULL,
|
||||
|
@ -1027,7 +1027,7 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutForm)
|
|||
|
||||
/***** Write link name *****/
|
||||
if (WriteLinkName[Link->Type])
|
||||
WriteLinkName[Link->Type] (Link->Cod,PutForm);
|
||||
WriteLinkName[Link->Type] (Link->Cod,PutFormToGo,Icon,IconTitle);
|
||||
else
|
||||
Ale_ShowAlert (Ale_ERROR,"Not implemented!");
|
||||
}
|
||||
|
|
|
@ -3489,7 +3489,8 @@ void Svy_GetLinkToSurvey (void)
|
|||
/********************** Write survey in course program ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Svy_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo)
|
||||
void Svy_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle)
|
||||
{
|
||||
extern const char *Txt_Actions[Act_NUM_ACTIONS];
|
||||
char Title[Svy_MAX_BYTES_SURVEY_TITLE + 1];
|
||||
|
@ -3507,6 +3508,9 @@ void Svy_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo)
|
|||
The_GetSuffix ());
|
||||
}
|
||||
|
||||
/***** Icon depending on type ******/
|
||||
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
|
||||
|
||||
/***** Write Name of the course and date of exam *****/
|
||||
HTM_Txt (Title);
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ void Svy_GetAndShowSurveysStats (void);
|
|||
|
||||
//--------------------------- Program resources -------------------------------
|
||||
void Svy_GetLinkToSurvey (void);
|
||||
void Svy_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo);
|
||||
void Svy_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo,
|
||||
const char *Icon,const char *IconTitle);
|
||||
void Svy_GetTitleFromSvyCod (long SvyCod,char *Title,size_t TitleSize);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue