Version 22.12.1: Sep 20, 2022 Changes in behaviour of program items.

This commit is contained in:
acanas 2022-09-20 08:46:45 +02:00
parent 9ef7ef738e
commit 55d7f216a8
14 changed files with 71 additions and 36 deletions

View File

@ -3327,7 +3327,8 @@ void Att_GetLinkToEvent (void)
/**************** Write attendance event in course program *******************/ /**************** 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]; extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]; char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
@ -3346,6 +3347,9 @@ void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo)
The_GetSuffix ()); The_GetSuffix ());
} }
/***** Icon depending on type ******/
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
/***** Write attendance event title *****/ /***** Write attendance event title *****/
HTM_Txt (Title); HTM_Txt (Title);

View File

@ -111,7 +111,8 @@ void Att_PrintUsrsAttendanceCrs (void);
//--------------------------- Program resources ------------------------------- //--------------------------- Program resources -------------------------------
void Att_GetLinkToEvent (void); 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); void Att_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize);
#endif #endif

View File

@ -5372,7 +5372,8 @@ void Brw_GetLinkToFile (void)
/******************** Write file name in course program **********************/ /******************** 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; extern const char *Txt_Download;
struct FileMetadata FileMetadata; struct FileMetadata FileMetadata;
@ -5381,23 +5382,30 @@ void Brw_WriteFileNameInCrsProgram (long FilCod,bool PutFormToDownload)
FileMetadata.FilCod = FilCod; FileMetadata.FilCod = FilCod;
Brw_GetFileMetadataByCod (&FileMetadata); Brw_GetFileMetadataByCod (&FileMetadata);
/***** Begin form to download file *****/ /***** Begin form to go to file data *****/
if (PutFormToDownload) if (PutFormToGo)
{ {
// TODO: Download directly or go to the file data? /* To download the file:
// TODO: File browser in marks file is always "admin", but student shouldn't have access to view all marks
Frm_BeginForm (Brw_ActDowFile[FileMetadata.FileBrowser]); 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, HTM_BUTTON_Submit_Begin (Txt_Download,
"class=\"LM BT_LINK PRG_RSC_%s\"", "class=\"LM BT_LINK PRG_RSC_%s\"",
The_GetSuffix ()); The_GetSuffix ());
} }
/***** Icon depending on type ******/
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
/***** Write filename *****/ /***** Write filename *****/
HTM_Txt (FileMetadata.FilFolLnk.Name); HTM_Txt (FileMetadata.FilFolLnk.Name);
/***** End form to download file *****/ /***** End form to download file *****/
if (PutFormToDownload) if (PutFormToGo)
{ {
HTM_BUTTON_End (); HTM_BUTTON_End ();

View File

@ -257,7 +257,8 @@ void Brw_SetFullPathInTree (void);
//--------------------------- Program resources ------------------------------- //--------------------------- Program resources -------------------------------
void Brw_GetLinkToFile (void); 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); void Brw_GetFileNameFromFilCod (long FilCod,char *FileName,size_t FileNameSize);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -1733,7 +1733,8 @@ void Cfe_GetLinkToCallForExam (void)
/******************* Write call for exam in course program *******************/ /******************* 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]; extern const char *Txt_Actions[Act_NUM_ACTIONS];
struct Cfe_CallsForExams CallsForExams; struct Cfe_CallsForExams CallsForExams;
@ -1764,6 +1765,9 @@ void Cfe_WriteCallForExamInCrsProgram (long ExaCod,bool PutFormToGo)
Frm_FreeAnchorStr (Anchor); Frm_FreeAnchorStr (Anchor);
} }
/***** Icon depending on type ******/
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
/***** Write Name of the course and date of exam *****/ /***** Write Name of the course and date of exam *****/
HTM_Txt (SessionAndDate); HTM_Txt (SessionAndDate);

View File

@ -128,7 +128,8 @@ void Cfe_GetSummaryAndContentCallForExam (char SummaryStr[Ntf_MAX_BYTES_SUMMARY
//--------------------------- Program resources ------------------------------- //--------------------------- Program resources -------------------------------
void Cfe_GetLinkToCallForExam (void); 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); void Cfe_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
#endif #endif

View File

@ -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.12 (2022-09-20)" #define Log_PLATFORM_VERSION "SWAD 22.12.1 (2022-09-20)"
#define CSS_FILE "swad22.7.css" #define CSS_FILE "swad22.7.css"
#define JS_FILE "swad21.100.js" #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) Version 22.12: Sep 20, 2022 Links to marks file in program. (330985 lines)
Copy the following icon to icon public directory: Copy the following icon to icon public directory:
sudo cp icon/list-alt.svg /var/www/html/swad/icon/ sudo cp icon/list-alt.svg /var/www/html/swad/icon/

View File

@ -1677,7 +1677,8 @@ void Exa_GetLinkToExam (void)
/*********************** Write exam in course program ************************/ /*********************** 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]; extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Gam_MAX_BYTES_TITLE + 1]; char Title[Gam_MAX_BYTES_TITLE + 1];
@ -1695,6 +1696,9 @@ void Exa_WriteExamInCrsProgram (long ExaCod,bool PutFormToGo)
The_GetSuffix ()); The_GetSuffix ());
} }
/***** Icon depending on type ******/
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
/***** Write Name of the course and date of exam *****/ /***** Write Name of the course and date of exam *****/
HTM_Txt (Title); HTM_Txt (Title);

View File

@ -89,7 +89,8 @@ void Exa_GetAndShowExamsStats (void);
//--------------------------- Program resources ------------------------------- //--------------------------- Program resources -------------------------------
void Exa_GetLinkToExam (void); 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); void Exa_GetTitleFromExaCod (long ExaCod,char *Title,size_t TitleSize);
#endif #endif

View File

@ -2387,7 +2387,8 @@ void Gam_GetLinkToGame (void)
/*********************** Write game in course program ************************/ /*********************** 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]; extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Gam_MAX_BYTES_TITLE + 1]; char Title[Gam_MAX_BYTES_TITLE + 1];
@ -2405,6 +2406,9 @@ void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo)
The_GetSuffix ()); The_GetSuffix ());
} }
/***** Icon depending on type ******/
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
/***** Write game title of exam *****/ /***** Write game title of exam *****/
HTM_Txt (Title); HTM_Txt (Title);

View File

@ -169,7 +169,8 @@ void Gam_GetAndShowGamesStats (void);
//--------------------------- Program resources ------------------------------- //--------------------------- Program resources -------------------------------
void Gam_GetLinkToGame (void); 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); void Gam_GetTitleFromGamCod (long GamCod,char *Title,size_t TitleSize);
#endif #endif

View File

@ -117,7 +117,8 @@ 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,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, static void PrgRsc_GetDataOfLinkFromClipboard (struct Prg_Link *Link,
MYSQL_RES **mysql_res); MYSQL_RES **mysql_res);
@ -444,10 +445,10 @@ static void PrgRsc_WriteRowViewResource (unsigned NumRsc,
The_GetSuffix (),The_GetColorRows1 (1)); The_GetSuffix (),The_GetColorRows1 (1));
HTM_Txt (Item->Resource.Title); HTM_Txt (Item->Resource.Title);
HTM_BR (); HTM_BR ();
Ico_PutIconOn (Prg_ResourceTypesIcons[Item->Resource.Link.Type],Ico_BLACK,
Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
PrgRsc_WriteLinkName (&Item->Resource.Link, 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 (); HTM_TD_End ();
/***** End row *****/ /***** End row *****/
@ -497,13 +498,11 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
/* Show clipboard to change resource link */ /* Show clipboard to change resource link */
PrgRsc_ShowClipboard (Item); PrgRsc_ShowClipboard (Item);
else else
{
/* Show current link */ /* 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, 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 (); HTM_TD_End ();
@ -989,13 +988,11 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
SubmitOnClick ? "" : SubmitOnClick ? "" :
" checked=\"checked\""); " checked=\"checked\"");
/***** Type *****/
Ico_PutIconOn (Prg_ResourceTypesIcons[Link->Type],Ico_BLACK,
Txt_RESOURCE_TYPES[Link->Type]);
/***** Name *****/ /***** Name *****/
PrgRsc_WriteLinkName (Link, 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_LABEL_End ();
HTM_LI_End (); HTM_LI_End ();
@ -1005,9 +1002,12 @@ 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,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_NONE ] = NULL,
[PrgRsc_ASSIGNMENT ] = NULL, [PrgRsc_ASSIGNMENT ] = NULL,
@ -1027,7 +1027,7 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutForm)
/***** Write link name *****/ /***** Write link name *****/
if (WriteLinkName[Link->Type]) if (WriteLinkName[Link->Type])
WriteLinkName[Link->Type] (Link->Cod,PutForm); WriteLinkName[Link->Type] (Link->Cod,PutFormToGo,Icon,IconTitle);
else else
Ale_ShowAlert (Ale_ERROR,"Not implemented!"); Ale_ShowAlert (Ale_ERROR,"Not implemented!");
} }

View File

@ -3489,7 +3489,8 @@ void Svy_GetLinkToSurvey (void)
/********************** Write survey in course program ***********************/ /********************** 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]; extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Svy_MAX_BYTES_SURVEY_TITLE + 1]; char Title[Svy_MAX_BYTES_SURVEY_TITLE + 1];
@ -3507,6 +3508,9 @@ void Svy_WriteSurveyInCrsProgram (long SvyCod,bool PutFormToGo)
The_GetSuffix ()); The_GetSuffix ());
} }
/***** Icon depending on type ******/
Ico_PutIconOn (Icon,Ico_BLACK,IconTitle);
/***** Write Name of the course and date of exam *****/ /***** Write Name of the course and date of exam *****/
HTM_Txt (Title); HTM_Txt (Title);

View File

@ -119,6 +119,7 @@ void Svy_GetAndShowSurveysStats (void);
//--------------------------- Program resources ------------------------------- //--------------------------- Program resources -------------------------------
void Svy_GetLinkToSurvey (void); 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); void Svy_GetTitleFromSvyCod (long SvyCod,char *Title,size_t TitleSize);
#endif #endif