Version 22.11: Sep 20, 2022 Links to attendance events in program.

This commit is contained in:
acanas 2022-09-20 00:06:38 +02:00
parent 60ba3add0f
commit 1d448bc687
10 changed files with 254 additions and 115 deletions

View File

@ -1417,6 +1417,7 @@ const struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
[ActHidAtt ] = {1069,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_HideAttEvent ,NULL}, [ActHidAtt ] = {1069,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_HideAttEvent ,NULL},
[ActUnhAtt ] = {1070,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_UnhideAttEvent ,NULL}, [ActUnhAtt ] = {1070,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_UnhideAttEvent ,NULL},
[ActSeeOneAtt ] = {1071,-1,TabUnk,ActSeeAtt ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_SeeOneAttEvent ,NULL}, [ActSeeOneAtt ] = {1071,-1,TabUnk,ActSeeAtt ,0x238,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_SeeOneAttEvent ,NULL},
[ActReqLnkAtt ] = {1938,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_GetLinkToEvent ,NULL},
[ActRecAttStd ] = {1072,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterStudentsInAttEvent ,NULL}, [ActRecAttStd ] = {1072,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterStudentsInAttEvent ,NULL},
[ActRecAttMe ] = {1076,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterMeAsStdInAttEvent ,NULL}, [ActRecAttMe ] = {1076,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RegisterMeAsStdInAttEvent ,NULL},
@ -3785,6 +3786,7 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un
ActReqLnkGam, // #1935 ActReqLnkGam, // #1935
ActReqLnkExa, // #1936 ActReqLnkExa, // #1936
ActReqLnkSvy, // #1937 ActReqLnkSvy, // #1937
ActReqLnkAtt, // #1938
}; };
/*****************************************************************************/ /*****************************************************************************/

View File

@ -65,7 +65,7 @@ typedef enum
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_MAX_ACTION_COD 1937 #define Act_MAX_ACTION_COD 1938
#define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13 #define Act_MAX_OPTIONS_IN_MENU_PER_TAB 13
@ -1359,122 +1359,123 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to
#define ActHidAtt (ActRemOldBrf + 74) #define ActHidAtt (ActRemOldBrf + 74)
#define ActUnhAtt (ActRemOldBrf + 75) #define ActUnhAtt (ActRemOldBrf + 75)
#define ActSeeOneAtt (ActRemOldBrf + 76) #define ActSeeOneAtt (ActRemOldBrf + 76)
#define ActRecAttStd (ActRemOldBrf + 77) #define ActReqLnkAtt (ActRemOldBrf + 77)
#define ActRecAttMe (ActRemOldBrf + 78) #define ActRecAttStd (ActRemOldBrf + 78)
#define ActRecAttMe (ActRemOldBrf + 79)
#define ActSignUp (ActRemOldBrf + 79) #define ActSignUp (ActRemOldBrf + 80)
#define ActUpdSignUpReq (ActRemOldBrf + 80) #define ActUpdSignUpReq (ActRemOldBrf + 81)
#define ActReqRejSignUp (ActRemOldBrf + 81) #define ActReqRejSignUp (ActRemOldBrf + 82)
#define ActRejSignUp (ActRemOldBrf + 82) #define ActRejSignUp (ActRemOldBrf + 83)
#define ActReqMdfOneOth (ActRemOldBrf + 83) #define ActReqMdfOneOth (ActRemOldBrf + 84)
#define ActReqMdfOneStd (ActRemOldBrf + 84) #define ActReqMdfOneStd (ActRemOldBrf + 85)
#define ActReqMdfOneTch (ActRemOldBrf + 85) #define ActReqMdfOneTch (ActRemOldBrf + 86)
#define ActReqMdfOth (ActRemOldBrf + 86) #define ActReqMdfOth (ActRemOldBrf + 87)
#define ActReqMdfStd (ActRemOldBrf + 87) #define ActReqMdfStd (ActRemOldBrf + 88)
#define ActReqMdfNET (ActRemOldBrf + 88) #define ActReqMdfNET (ActRemOldBrf + 89)
#define ActReqMdfTch (ActRemOldBrf + 89) #define ActReqMdfTch (ActRemOldBrf + 90)
#define ActReqOthPho (ActRemOldBrf + 90) #define ActReqOthPho (ActRemOldBrf + 91)
#define ActReqStdPho (ActRemOldBrf + 91) #define ActReqStdPho (ActRemOldBrf + 92)
#define ActReqTchPho (ActRemOldBrf + 92) #define ActReqTchPho (ActRemOldBrf + 93)
#define ActDetOthPho (ActRemOldBrf + 93) #define ActDetOthPho (ActRemOldBrf + 94)
#define ActDetStdPho (ActRemOldBrf + 94) #define ActDetStdPho (ActRemOldBrf + 95)
#define ActDetTchPho (ActRemOldBrf + 95) #define ActDetTchPho (ActRemOldBrf + 96)
#define ActUpdOthPho (ActRemOldBrf + 96) #define ActUpdOthPho (ActRemOldBrf + 97)
#define ActUpdStdPho (ActRemOldBrf + 97) #define ActUpdStdPho (ActRemOldBrf + 98)
#define ActUpdTchPho (ActRemOldBrf + 98) #define ActUpdTchPho (ActRemOldBrf + 99)
#define ActReqRemOthPho (ActRemOldBrf + 99) #define ActReqRemOthPho (ActRemOldBrf + 100)
#define ActReqRemStdPho (ActRemOldBrf + 100) #define ActReqRemStdPho (ActRemOldBrf + 101)
#define ActReqRemTchPho (ActRemOldBrf + 101) #define ActReqRemTchPho (ActRemOldBrf + 102)
#define ActRemOthPho (ActRemOldBrf + 102) #define ActRemOthPho (ActRemOldBrf + 103)
#define ActRemStdPho (ActRemOldBrf + 103) #define ActRemStdPho (ActRemOldBrf + 104)
#define ActRemTchPho (ActRemOldBrf + 104) #define ActRemTchPho (ActRemOldBrf + 105)
#define ActCreOth (ActRemOldBrf + 105) #define ActCreOth (ActRemOldBrf + 106)
#define ActCreStd (ActRemOldBrf + 106) #define ActCreStd (ActRemOldBrf + 107)
#define ActCreNET (ActRemOldBrf + 107) #define ActCreNET (ActRemOldBrf + 108)
#define ActCreTch (ActRemOldBrf + 108) #define ActCreTch (ActRemOldBrf + 109)
#define ActUpdOth (ActRemOldBrf + 109) #define ActUpdOth (ActRemOldBrf + 110)
#define ActUpdStd (ActRemOldBrf + 110) #define ActUpdStd (ActRemOldBrf + 111)
#define ActUpdNET (ActRemOldBrf + 111) #define ActUpdNET (ActRemOldBrf + 112)
#define ActUpdTch (ActRemOldBrf + 112) #define ActUpdTch (ActRemOldBrf + 113)
#define ActReqAccEnrStd (ActRemOldBrf + 113) #define ActReqAccEnrStd (ActRemOldBrf + 114)
#define ActReqAccEnrNET (ActRemOldBrf + 114) #define ActReqAccEnrNET (ActRemOldBrf + 115)
#define ActReqAccEnrTch (ActRemOldBrf + 115) #define ActReqAccEnrTch (ActRemOldBrf + 116)
#define ActAccEnrStd (ActRemOldBrf + 116) #define ActAccEnrStd (ActRemOldBrf + 117)
#define ActAccEnrNET (ActRemOldBrf + 117) #define ActAccEnrNET (ActRemOldBrf + 118)
#define ActAccEnrTch (ActRemOldBrf + 118) #define ActAccEnrTch (ActRemOldBrf + 119)
#define ActRemMe_Std (ActRemOldBrf + 119) #define ActRemMe_Std (ActRemOldBrf + 120)
#define ActRemMe_NET (ActRemOldBrf + 120) #define ActRemMe_NET (ActRemOldBrf + 121)
#define ActRemMe_Tch (ActRemOldBrf + 121) #define ActRemMe_Tch (ActRemOldBrf + 122)
#define ActNewAdmIns (ActRemOldBrf + 122) #define ActNewAdmIns (ActRemOldBrf + 123)
#define ActRemAdmIns (ActRemOldBrf + 123) #define ActRemAdmIns (ActRemOldBrf + 124)
#define ActNewAdmCtr (ActRemOldBrf + 124) #define ActNewAdmCtr (ActRemOldBrf + 125)
#define ActRemAdmCtr (ActRemOldBrf + 125) #define ActRemAdmCtr (ActRemOldBrf + 126)
#define ActNewAdmDeg (ActRemOldBrf + 126) #define ActNewAdmDeg (ActRemOldBrf + 127)
#define ActRemAdmDeg (ActRemOldBrf + 127) #define ActRemAdmDeg (ActRemOldBrf + 128)
#define ActRcvFrmEnrSevStd (ActRemOldBrf + 128) #define ActRcvFrmEnrSevStd (ActRemOldBrf + 129)
#define ActRcvFrmEnrSevNET (ActRemOldBrf + 129) #define ActRcvFrmEnrSevNET (ActRemOldBrf + 130)
#define ActRcvFrmEnrSevTch (ActRemOldBrf + 130) #define ActRcvFrmEnrSevTch (ActRemOldBrf + 131)
#define ActCnfID_Oth (ActRemOldBrf + 131) #define ActCnfID_Oth (ActRemOldBrf + 132)
#define ActCnfID_Std (ActRemOldBrf + 132) #define ActCnfID_Std (ActRemOldBrf + 133)
#define ActCnfID_Tch (ActRemOldBrf + 133) #define ActCnfID_Tch (ActRemOldBrf + 134)
#define ActFrmAccOth (ActRemOldBrf + 134) #define ActFrmAccOth (ActRemOldBrf + 135)
#define ActFrmAccStd (ActRemOldBrf + 135) #define ActFrmAccStd (ActRemOldBrf + 136)
#define ActFrmAccTch (ActRemOldBrf + 136) #define ActFrmAccTch (ActRemOldBrf + 137)
#define ActRemOldNicOth (ActRemOldBrf + 137) #define ActRemOldNicOth (ActRemOldBrf + 138)
#define ActRemOldNicStd (ActRemOldBrf + 138) #define ActRemOldNicStd (ActRemOldBrf + 139)
#define ActRemOldNicTch (ActRemOldBrf + 139) #define ActRemOldNicTch (ActRemOldBrf + 140)
#define ActChgNicOth (ActRemOldBrf + 140) #define ActChgNicOth (ActRemOldBrf + 141)
#define ActChgNicStd (ActRemOldBrf + 141) #define ActChgNicStd (ActRemOldBrf + 142)
#define ActChgNicTch (ActRemOldBrf + 142) #define ActChgNicTch (ActRemOldBrf + 143)
#define ActRemID_Oth (ActRemOldBrf + 143) #define ActRemID_Oth (ActRemOldBrf + 144)
#define ActRemID_Std (ActRemOldBrf + 144) #define ActRemID_Std (ActRemOldBrf + 145)
#define ActRemID_Tch (ActRemOldBrf + 145) #define ActRemID_Tch (ActRemOldBrf + 146)
#define ActNewID_Oth (ActRemOldBrf + 146) #define ActNewID_Oth (ActRemOldBrf + 147)
#define ActNewID_Std (ActRemOldBrf + 147) #define ActNewID_Std (ActRemOldBrf + 148)
#define ActNewID_Tch (ActRemOldBrf + 148) #define ActNewID_Tch (ActRemOldBrf + 149)
#define ActChgPwdOth (ActRemOldBrf + 149) #define ActChgPwdOth (ActRemOldBrf + 150)
#define ActChgPwdStd (ActRemOldBrf + 150) #define ActChgPwdStd (ActRemOldBrf + 151)
#define ActChgPwdTch (ActRemOldBrf + 151) #define ActChgPwdTch (ActRemOldBrf + 152)
#define ActRemMaiOth (ActRemOldBrf + 152) #define ActRemMaiOth (ActRemOldBrf + 153)
#define ActRemMaiStd (ActRemOldBrf + 153) #define ActRemMaiStd (ActRemOldBrf + 154)
#define ActRemMaiTch (ActRemOldBrf + 154) #define ActRemMaiTch (ActRemOldBrf + 155)
#define ActNewMaiOth (ActRemOldBrf + 155) #define ActNewMaiOth (ActRemOldBrf + 156)
#define ActNewMaiStd (ActRemOldBrf + 156) #define ActNewMaiStd (ActRemOldBrf + 157)
#define ActNewMaiTch (ActRemOldBrf + 157) #define ActNewMaiTch (ActRemOldBrf + 158)
#define ActRemStdCrs (ActRemOldBrf + 158) #define ActRemStdCrs (ActRemOldBrf + 159)
#define ActRemNETCrs (ActRemOldBrf + 159) #define ActRemNETCrs (ActRemOldBrf + 160)
#define ActRemTchCrs (ActRemOldBrf + 160) #define ActRemTchCrs (ActRemOldBrf + 161)
#define ActRemUsrGbl (ActRemOldBrf + 161) #define ActRemUsrGbl (ActRemOldBrf + 162)
#define ActReqRemAllStdCrs (ActRemOldBrf + 162) #define ActReqRemAllStdCrs (ActRemOldBrf + 163)
#define ActRemAllStdCrs (ActRemOldBrf + 163) #define ActRemAllStdCrs (ActRemOldBrf + 164)
#define ActReqRemOldUsr (ActRemOldBrf + 164) #define ActReqRemOldUsr (ActRemOldBrf + 165)
#define ActRemOldUsr (ActRemOldBrf + 165) #define ActRemOldUsr (ActRemOldBrf + 166)
#define ActLstDupUsr (ActRemOldBrf + 166) #define ActLstDupUsr (ActRemOldBrf + 167)
#define ActLstSimUsr (ActRemOldBrf + 167) #define ActLstSimUsr (ActRemOldBrf + 168)
#define ActRemDupUsr (ActRemOldBrf + 168) #define ActRemDupUsr (ActRemOldBrf + 169)
#define ActReqFolSevStd (ActRemOldBrf + 169) #define ActReqFolSevStd (ActRemOldBrf + 170)
#define ActReqFolSevTch (ActRemOldBrf + 170) #define ActReqFolSevTch (ActRemOldBrf + 171)
#define ActReqUnfSevStd (ActRemOldBrf + 171) #define ActReqUnfSevStd (ActRemOldBrf + 172)
#define ActReqUnfSevTch (ActRemOldBrf + 172) #define ActReqUnfSevTch (ActRemOldBrf + 173)
#define ActFolSevStd (ActRemOldBrf + 173) #define ActFolSevStd (ActRemOldBrf + 174)
#define ActFolSevTch (ActRemOldBrf + 174) #define ActFolSevTch (ActRemOldBrf + 175)
#define ActUnfSevStd (ActRemOldBrf + 175) #define ActUnfSevStd (ActRemOldBrf + 176)
#define ActUnfSevTch (ActRemOldBrf + 176) #define ActUnfSevTch (ActRemOldBrf + 177)
/*****************************************************************************/ /*****************************************************************************/
/******************************* Messages tab ********************************/ /******************************* Messages tab ********************************/

View File

@ -49,6 +49,7 @@
#include "swad_pagination.h" #include "swad_pagination.h"
#include "swad_parameter.h" #include "swad_parameter.h"
#include "swad_photo.h" #include "swad_photo.h"
#include "swad_program_database.h"
#include "swad_QR.h" #include "swad_QR.h"
#include "swad_setting.h" #include "swad_setting.h"
@ -116,6 +117,7 @@ static void Att_CreateGroups (long AttCod);
static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Event); static void Att_GetAndWriteNamesOfGrpsAssociatedToAttEvent (struct Att_Event *Event);
static void Att_ShowEvent (struct Att_Events *Events); static void Att_ShowEvent (struct Att_Events *Events);
static void Att_PutIconsOneAtt (void *Events);
static void Att_ListAttOnlyMeAsStudent (struct Att_Event *Event); static void Att_ListAttOnlyMeAsStudent (struct Att_Event *Event);
static void Att_ListAttStudents (struct Att_Events *Events, static void Att_ListAttStudents (struct Att_Events *Events,
@ -1482,7 +1484,7 @@ static void Att_ShowEvent (struct Att_Events *Events)
/***** Begin box and table *****/ /***** Begin box and table *****/
Box_BoxTableBegin (NULL,Txt_Event, Box_BoxTableBegin (NULL,Txt_Event,
NULL,NULL, Att_PutIconsOneAtt,Events,
Hlp_USERS_Attendance,Box_NOT_CLOSABLE,2); Hlp_USERS_Attendance,Box_NOT_CLOSABLE,2);
/***** Show attendance event *****/ /***** Show attendance event *****/
@ -1508,6 +1510,18 @@ static void Att_ShowEvent (struct Att_Events *Events)
} }
} }
/*****************************************************************************/
/*************** Put contextual icons in an attendance event *****************/
/*****************************************************************************/
static void Att_PutIconsOneAtt (void *Events)
{
/***** Put icon to get resource link *****/
if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) // Only if I am superuser // TODO: Include teachers
Ico_PutContextualIconToGetLink (ActReqLnkAtt,NULL,
Att_PutParams,Events);
}
/*****************************************************************************/ /*****************************************************************************/
/*********************** List me as student in one event *********************/ /*********************** List me as student in one event *********************/
/*****************************************************************************/ /*****************************************************************************/
@ -3280,3 +3294,79 @@ static void Att_ListAttEventsForAStd (const struct Att_Events *Events,
The_ChangeRowColor (); The_ChangeRowColor ();
} }
/*****************************************************************************/
/************************ Get link to attendance event ***********************/
/*****************************************************************************/
void Att_GetLinkToEvent (void)
{
extern const char *Txt_Link_to_resource_X_copied_into_clipboard;
long AttCod;
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
/***** Get attendance event code *****/
if ((AttCod = Att_GetParamAttCod ()) < 0)
Err_WrongEventExit ();
/***** Get attendance event title *****/
Att_DB_GetAttEventTitle (AttCod,Title);
/***** Copy link to attendance event into resource clipboard *****/
Prg_DB_CopyToClipboard (PrgRsc_ATTENDANCE_EVENT,AttCod);
/***** Write sucess message *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_Link_to_resource_X_copied_into_clipboard,
Title);
/***** Show attendance events again *****/
Att_SeeAttEvents ();
}
/*****************************************************************************/
/**************** Write attendance event in course program *******************/
/*****************************************************************************/
void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo)
{
extern const char *Txt_Actions[Act_NUM_ACTIONS];
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
/***** Get game title *****/
Att_DB_GetAttEventTitle (AttCod,Title);
/***** Begin form to go to game *****/
if (PutFormToGo)
{
Frm_BeginForm (ActSeeOneAtt);
Att_PutParamAttCod (AttCod);
HTM_BUTTON_Submit_Begin (Txt_Actions[ActSeeOneAtt],
"class=\"LM BT_LINK PRG_RSC_%s\"",
The_GetSuffix ());
}
/***** Write attendance event title *****/
HTM_Txt (Title);
/***** End form to download file *****/
if (PutFormToGo)
{
/* End form */
HTM_BUTTON_End ();
Frm_EndForm ();
}
}
/*****************************************************************************/
/*************** Get attendance event title from game code *******************/
/*****************************************************************************/
void Att_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize)
{
char TitleFromDB[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1];
/***** Get attendance event title *****/
Att_DB_GetAttEventTitle (AttCod,TitleFromDB);
Str_Copy (Title,TitleFromDB,TitleSize);
}

View File

@ -109,4 +109,9 @@ void Att_PrintMyAttendanceCrs (void);
void Att_ListUsrsAttendanceCrs (void); void Att_ListUsrsAttendanceCrs (void);
void Att_PrintUsrsAttendanceCrs (void); void Att_PrintUsrsAttendanceCrs (void);
//--------------------------- Program resources -------------------------------
void Att_GetLinkToEvent (void);
void Att_WriteAttEventInCrsProgram (long AttCod,bool PutFormToGo);
void Att_GetTitleFromAttCod (long AttCod,char *Title,size_t TitleSize);
#endif #endif

View File

@ -186,18 +186,34 @@ unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod)
AttCod); AttCod);
} }
/*****************************************************************************/
/***************** Get attendance event title from database ******************/
/*****************************************************************************/
void Att_DB_GetAttEventTitle (long AttCod,
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1])
{
DB_QuerySELECTString (Title,Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE,
"can not get attendance event title",
"SELECT Title" // row[0]
" FROM att_events"
" WHERE AttCod=%ld"
" AND CrsCod=%ld", // Extra check
AttCod,
Gbl.Hierarchy.Crs.CrsCod);
}
/*****************************************************************************/ /*****************************************************************************/
/***************** Get attendance event text from database *******************/ /***************** Get attendance event text from database *******************/
/*****************************************************************************/ /*****************************************************************************/
void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]) void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1])
{ {
/***** Get text of attendance event from database *****/
DB_QuerySELECTString (Description,Cns_MAX_BYTES_TEXT,"can not get attendance event text", DB_QuerySELECTString (Description,Cns_MAX_BYTES_TEXT,"can not get attendance event text",
"SELECT Txt" "SELECT Txt" // row[0]
" FROM att_events" " FROM att_events"
" WHERE AttCod=%ld" " WHERE AttCod=%ld"
" AND CrsCod=%ld", " AND CrsCod=%ld", // Extra check
AttCod, AttCod,
Gbl.Hierarchy.Crs.CrsCod); Gbl.Hierarchy.Crs.CrsCod);
} }

View File

@ -45,6 +45,8 @@ unsigned Att_DB_GetListAttEventsAllGrps (MYSQL_RES **mysql_res,
Att_OrderNewestOldest_t OrderNewestOldest); Att_OrderNewestOldest_t OrderNewestOldest);
unsigned Att_DB_GetDataOfAllAttEvents (MYSQL_RES **mysql_res,long CrsCod); unsigned Att_DB_GetDataOfAllAttEvents (MYSQL_RES **mysql_res,long CrsCod);
unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod); unsigned Att_DB_GetDataOfAttEventByCod (MYSQL_RES **mysql_res,long AttCod);
void Att_DB_GetAttEventTitle (long AttCod,
char Title[Att_MAX_BYTES_ATTENDANCE_EVENT_TITLE + 1]);
void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]); void Att_DB_GetAttEventDescription (long AttCod,char Description[Cns_MAX_BYTES_TEXT + 1]);
bool Att_DB_CheckIfSimilarAttEventExists (const char *Field,const char *Value,long AttCod); bool Att_DB_CheckIfSimilarAttEventExists (const char *Field,const char *Value,long AttCod);

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.10.1 (2022-09-19)" #define Log_PLATFORM_VERSION "SWAD 22.11 (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.11: Sep 20, 2022 Links to attendance events in program. (330907 lines)
Version 22.10.1: Sep 19, 2022 Code refactoring in program. (330789 lines) Version 22.10.1: Sep 19, 2022 Code refactoring in program. (330789 lines)
Version 22.10: Sep 19, 2022 Links to surveys in program. (330822 lines) Version 22.10: Sep 19, 2022 Links to surveys in program. (330822 lines)
Version 22.9.1: Sep 19, 2022 Text for icons in program. (330725 lines) Version 22.9.1: Sep 19, 2022 Text for icons in program. (330725 lines)

View File

@ -2405,7 +2405,7 @@ void Gam_WriteGameInCrsProgram (long GamCod,bool PutFormToGo)
The_GetSuffix ()); The_GetSuffix ());
} }
/***** Write Name of the course and date of exam *****/ /***** Write game title of exam *****/
HTM_Txt (Title); HTM_Txt (Title);
/***** End form to download file *****/ /***** End form to download file *****/

View File

@ -27,6 +27,7 @@
#include <string.h> // For string functions #include <string.h> // For string functions
#include "swad_attendance.h"
#include "swad_browser.h" #include "swad_browser.h"
#include "swad_call_for_exam.h" #include "swad_call_for_exam.h"
#include "swad_error.h" #include "swad_error.h"
@ -461,7 +462,7 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
struct Prg_Item *Item, struct Prg_Item *Item,
bool EditLink) bool EditLink)
{ {
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES]; extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
/***** Begin row *****/ /***** Begin row *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -499,7 +500,7 @@ static void PrgRsc_WriteRowEditResource (unsigned NumRsc,unsigned NumResources,
{ {
/* Show current link */ /* Show current 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]); Txt_RESOURCE_TYPES[Item->Resource.Link.Type]);
PrgRsc_WriteLinkName (&Item->Resource.Link, PrgRsc_WriteLinkName (&Item->Resource.Link,
true); // Put form true); // Put form
} }
@ -518,8 +519,6 @@ static void PrgRsc_WriteRowNewResource (unsigned NumResources,
struct Prg_Item *Item, struct Prg_Item *Item,
bool EditLink) bool EditLink)
{ {
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
/***** Begin row *****/ /***** Begin row *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -978,6 +977,7 @@ 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)
{ {
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES]; extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
extern const char *Txt_RESOURCE_TYPES[PrgRsc_NUM_TYPES];
HTM_LI_Begin ("class=\"DAT_%s\"",The_GetSuffix ()); HTM_LI_Begin ("class=\"DAT_%s\"",The_GetSuffix ());
HTM_LABEL_Begin (NULL); HTM_LABEL_Begin (NULL);
@ -991,7 +991,7 @@ static void PrgRsc_WriteRowClipboard (bool SubmitOnClick,const struct Prg_Link *
/***** Type *****/ /***** Type *****/
Ico_PutIconOn (Prg_ResourceTypesLogos[Link->Type],Ico_BLACK, Ico_PutIconOn (Prg_ResourceTypesLogos[Link->Type],Ico_BLACK,
Prg_ResourceTypesDB[Link->Type]); Txt_RESOURCE_TYPES[Link->Type]);
/***** Name *****/ /***** Name *****/
PrgRsc_WriteLinkName (Link, PrgRsc_WriteLinkName (Link,
@ -1017,7 +1017,7 @@ static void PrgRsc_WriteLinkName (const struct Prg_Link *Link,bool PutForm)
[PrgRsc_SURVEY ] = Svy_WriteSurveyInCrsProgram, [PrgRsc_SURVEY ] = Svy_WriteSurveyInCrsProgram,
[PrgRsc_DOCUMENT ] = Brw_WriteFileNameInCrsProgram, [PrgRsc_DOCUMENT ] = Brw_WriteFileNameInCrsProgram,
[PrgRsc_MARKS ] = NULL, [PrgRsc_MARKS ] = NULL,
[PrgRsc_ATTENDANCE_EVENT] = NULL, [PrgRsc_ATTENDANCE_EVENT] = Att_WriteAttEventInCrsProgram,
[PrgRsc_FORUM_THREAD ] = NULL, [PrgRsc_FORUM_THREAD ] = NULL,
}; };
@ -1048,7 +1048,7 @@ static void PrgRsc_GetResourceTitleFromLink (struct Prg_Item *Item)
[PrgRsc_SURVEY ] = Svy_GetTitleFromSvyCod, [PrgRsc_SURVEY ] = Svy_GetTitleFromSvyCod,
[PrgRsc_DOCUMENT ] = Brw_GetFileNameFromFilCod, [PrgRsc_DOCUMENT ] = Brw_GetFileNameFromFilCod,
[PrgRsc_MARKS ] = NULL, [PrgRsc_MARKS ] = NULL,
[PrgRsc_ATTENDANCE_EVENT] = NULL, [PrgRsc_ATTENDANCE_EVENT] = Att_GetTitleFromAttCod,
[PrgRsc_FORUM_THREAD ] = NULL, [PrgRsc_FORUM_THREAD ] = NULL,
}; };
@ -1074,7 +1074,6 @@ static void PrgRsc_GetResourceTitleFromLink (struct Prg_Item *Item)
void PrgRsc_ChangeLink (void) void PrgRsc_ChangeLink (void)
{ {
extern const char *Prg_ResourceTypesDB[PrgRsc_NUM_TYPES];
struct Prg_Item Item; struct Prg_Item Item;
char TypeCod[3 + 1 + Cns_MAX_DECIMAL_DIGITS_LONG + 1]; char TypeCod[3 + 1 + Cns_MAX_DECIMAL_DIGITS_LONG + 1];
char TypeStr[3 + 1]; char TypeStr[3 + 1];

View File

@ -25866,6 +25866,29 @@ const char *Txt_Actions[Act_NUM_ACTIONS] =
"List students who attended to an event" // Precisa de tradução "List students who attended to an event" // Precisa de tradução
#elif L==10 // tr #elif L==10 // tr
"List students who attended to an event" // Çeviri lazim! "List students who attended to an event" // Çeviri lazim!
#endif
,
[ActReqLnkAtt] =
#if L==1 // ca
"Copy link to attendance event" // Necessita traducció
#elif L==2 // de
"Copy link to attendance event" // Need Übersetzung
#elif L==3 // en
"Copy link to attendance event"
#elif L==4 // es
"Copiar enlace a evento de asistencia"
#elif L==5 // fr
"Copy link to attendance event" // Besoin de traduction
#elif L==6 // gn
"Copiar enlace a evento de asistencia" // Okoteve traducción
#elif L==7 // it
"Copy link to attendance event" // Bisogno di traduzione
#elif L==8 // pl
"Copy link to attendance event" // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Copy link to attendance event" // Precisa de tradução
#elif L==10 // tr
"Copy link to attendance event" // Çeviri lazim!
#endif #endif
, ,
[ActRecAttStd] = [ActRecAttStd] =