From 96d71b5ce3d2f9bec3e9368ec253657408cbbbb4 Mon Sep 17 00:00:00 2001 From: acanas Date: Fri, 21 Apr 2023 09:02:00 +0200 Subject: [PATCH] Version 22.101.12:Apr 21, 2023 Code refactoring in attendance and match results. --- swad_attendance.c | 47 +++++++++++++++++---------------------------- swad_changelog.h | 3 ++- swad_match_result.c | 29 +++++++++++----------------- swad_user.c | 2 +- 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/swad_attendance.c b/swad_attendance.c index c13ef2314..4237aa26d 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -131,7 +131,7 @@ static bool Att_CheckIfUsrIsPresentInEventAndGetComments (long AttCod,long UsrCo char CommentStd[Cns_MAX_BYTES_TEXT + 1], char CommentTch[Cns_MAX_BYTES_TEXT + 1]); -static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView); +static void Att_ReqListOrPrintUsrsAttendanceCrs (__attribute__((unused)) void *Args); static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView); static void Att_GetUsrsAndListOrPrintAttendanceCrs (Att_TypeOfView_t TypeOfView); static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView); @@ -2176,44 +2176,33 @@ static bool Att_CheckIfUsrIsPresentInEventAndGetComments (long AttCod,long UsrCo void Att_ReqListUsrsAttendanceCrs (void) { - Att_TypeOfView_t TypeOfView = Att_VIEW_SEL_USR; - - Att_ReqListOrPrintUsrsAttendanceCrs (&TypeOfView); + Att_ReqListOrPrintUsrsAttendanceCrs (NULL); } -static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView) +static void Att_ReqListOrPrintUsrsAttendanceCrs (__attribute__((unused)) void *Args) { extern const char *Hlp_USERS_Attendance_attendance_list; extern const char *Txt_Attendance_list; extern const char *Txt_View_attendance; struct Att_Events Events; - switch (*((Att_TypeOfView_t *) TypeOfView)) - { - case Att_VIEW_SEL_USR: - case Att_PRNT_SEL_USR: - /***** Reset attendance events *****/ - Att_ResetEvents (&Events); + /***** Reset attendance events *****/ + Att_ResetEvents (&Events); - /***** Get list of attendance events *****/ - Att_GetListEvents (&Events,Att_OLDEST_FIRST); + /***** Get list of attendance events *****/ + Att_GetListEvents (&Events,Att_OLDEST_FIRST); - /***** List users to select some of them *****/ - Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, - ActSeeLstUsrAtt, - NULL,NULL, - Txt_Attendance_list, - Hlp_USERS_Attendance_attendance_list, - Txt_View_attendance, - false); // Do not put form with date range + /***** List users to select some of them *****/ + Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, + ActSeeLstUsrAtt, + NULL,NULL, + Txt_Attendance_list, + Hlp_USERS_Attendance_attendance_list, + Txt_View_attendance, + false); // Do not put form with date range - /***** Free list of attendance events *****/ - Att_FreeListEvents (&Events); - break; - default: - Err_WrongTypeExit (); - break; - } + /***** Free list of attendance events *****/ + Att_FreeListEvents (&Events); } /*****************************************************************************/ @@ -2332,7 +2321,7 @@ static void Att_GetUsrsAndListOrPrintAttendanceCrs (Att_TypeOfView_t TypeOfView) { Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected, Att_ListOrPrintUsrsAttendanceCrs,&TypeOfView, - Att_ReqListOrPrintUsrsAttendanceCrs,&TypeOfView); + Att_ReqListOrPrintUsrsAttendanceCrs,NULL); } static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) diff --git a/swad_changelog.h b/swad_changelog.h index 70bd7fe4a..5b74a3402 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -629,10 +629,11 @@ TODO: Emilce Barrera Mesa: Podr TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. */ -#define Log_PLATFORM_VERSION "SWAD 22.101.11 (2023-04-21)" +#define Log_PLATFORM_VERSION "SWAD 22.101.12 (2023-04-21)" #define CSS_FILE "swad22.95.css" #define JS_FILE "swad22.49.js" /* + Version 22.101.12:Apr 21, 2023 Code refactoring in attendance and match results. (337275 lines) Version 22.101.11:Apr 21, 2023 Changes in edition of centers and places. (337289 lines) Version 22.101.10:Apr 21, 2023 Changes in course information. (337302 lines) Version 22.101.9: Apr 21, 2023 Changes in edition of countries, links, banners, institutions, centers, places, degrees, degree types, buildings, rooms and courses. (337313 lines) diff --git a/swad_match_result.c b/swad_match_result.c index 25eb2655e..907001a3c 100644 --- a/swad_match_result.c +++ b/swad_match_result.c @@ -71,7 +71,7 @@ struct MchRes_ICanView /***************************** Private prototypes ****************************/ /*****************************************************************************/ -static void MchRes_PutFormToSelUsrsToViewMchResults (void *Games); +static void MchRes_PutFormToSelUsrsToViewMchResults (__attribute__((unused)) void *Args); static void MchRes_ListMyMchResultsInCrs (struct Gam_Games *Games); static void MchRes_ListMyMchResultsInGam (struct Gam_Games *Games); @@ -255,7 +255,7 @@ void MchRes_ShowAllMchResultsInCrs (void) /***** Get users and show their matches results *****/ Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected, MchRes_ShowAllMchResultsInSelectedGames,&Games, - MchRes_PutFormToSelUsrsToViewMchResults,&Games); + MchRes_PutFormToSelUsrsToViewMchResults,NULL); } /*****************************************************************************/ @@ -320,29 +320,22 @@ static void MchRes_ListAllMchResultsInSelectedGames (struct Gam_Games *Games) void MchRes_SelUsrsToViewMchResults (void) { - struct Gam_Games Games; - - /***** Reset games context *****/ - Gam_ResetGames (&Games); - - /***** Put form to select users *****/ - MchRes_PutFormToSelUsrsToViewMchResults (&Games); + MchRes_PutFormToSelUsrsToViewMchResults (NULL); } -static void MchRes_PutFormToSelUsrsToViewMchResults (void *Games) +static void MchRes_PutFormToSelUsrsToViewMchResults (__attribute__((unused)) void *Args) { extern const char *Hlp_ASSESSMENT_Games_results; extern const char *Txt_Results; extern const char *Txt_View_results; - if (Games) // Not used - Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, - ActSeeUsrMchResCrs, - NULL,NULL, - Txt_Results, - Hlp_ASSESSMENT_Games_results, - Txt_View_results, - false); // Do not put form with date range + Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, + ActSeeUsrMchResCrs, + NULL,NULL, + Txt_Results, + Hlp_ASSESSMENT_Games_results, + Txt_View_results, + false); // Do not put form with date range } /*****************************************************************************/ diff --git a/swad_user.c b/swad_user.c index 0d4812618..22aeeeb4f 100644 --- a/swad_user.c +++ b/swad_user.c @@ -3707,7 +3707,7 @@ void Usr_PutFormToSelectUsrsToGoToAct (struct Usr_SelectedUsrs *SelectedUsrs, /***** Draw class photos to select users *****/ Box_BoxBegin (NULL,Txt_Select_users, NULL,NULL, - HelpLink,Box_NOT_CLOSABLE); + NULL,Box_NOT_CLOSABLE); /***** Show form to select the groups *****/ Grp_ShowFormToSelectSeveralGroups (FuncPars,Args,