From ca39e3aa526abc645fe4766602606d7931dfe415 Mon Sep 17 00:00:00 2001 From: acanas Date: Wed, 8 Apr 2020 18:18:46 +0200 Subject: [PATCH] Version19.169.3 --- swad_attendance.c | 11 ++-- swad_centre.c | 2 +- swad_changelog.h | 3 +- swad_country.c | 2 +- swad_degree.c | 54 ++++++++--------- swad_degree_config.c | 25 ++++---- swad_degree_type.c | 21 +++---- swad_department.c | 11 ++-- swad_exam.c | 82 ++++++++++++------------- swad_file_browser.c | 57 +++++++++--------- swad_follow.c | 33 +++++----- swad_global.h | 24 +------- swad_group.c | 124 ++++++++++++++++++-------------------- swad_holiday.c | 21 +++---- swad_indicator.c | 16 ++--- swad_info.c | 24 ++++---- swad_info.h | 2 +- swad_institution.c | 54 ++++++++--------- swad_institution.h | 2 +- swad_institution_config.c | 25 ++++---- swad_match.c | 4 +- swad_place.c | 2 +- swad_statistic.h | 26 ++++++++ swad_syllabus.c | 2 +- swad_user.c | 2 +- 25 files changed, 295 insertions(+), 334 deletions(-) diff --git a/swad_attendance.c b/swad_attendance.c index cd2b20ea..90fdc9cc 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -2740,7 +2740,7 @@ void Att_ReqListUsrsAttendanceCrs (void *TypeOfView) extern const char *Txt_View_attendance; struct Att_Events Events; - switch (*(Att_TypeOfView_t *) TypeOfView) + switch (*((Att_TypeOfView_t *) TypeOfView)) { case Att_VIEW_SEL_USR: case Att_PRNT_SEL_USR: @@ -2896,7 +2896,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) long *LstSelectedUsrCods; unsigned NumAttEvent; - switch (*(Att_TypeOfView_t *) TypeOfView) + switch (*((Att_TypeOfView_t *) TypeOfView)) { case Att_VIEW_SEL_USR: case Att_PRNT_SEL_USR: @@ -2934,7 +2934,7 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) Att_GetListSelectedAttCods (&Events); /***** Begin box *****/ - switch (*(Att_TypeOfView_t *) TypeOfView) + switch (*((Att_TypeOfView_t *) TypeOfView)) { case Att_VIEW_SEL_USR: Box_BoxBegin (NULL,Txt_Attendance_list, @@ -2951,13 +2951,14 @@ static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) } /***** List events to select *****/ - Att_ListEventsToSelect (&Events,*(Att_TypeOfView_t *) TypeOfView); + Att_ListEventsToSelect (&Events,*((Att_TypeOfView_t *) TypeOfView)); /***** Get my preference about photos in users' list for current course *****/ Usr_GetMyPrefAboutListWithPhotosFromDB (); /***** Show table with attendances for every student in list *****/ - Att_ListUsrsAttendanceTable (&Events,*(Att_TypeOfView_t *) TypeOfView,NumUsrsInList,LstSelectedUsrCods); + Att_ListUsrsAttendanceTable (&Events,*((Att_TypeOfView_t *) TypeOfView), + NumUsrsInList,LstSelectedUsrCods); /***** Show details or put button to show details *****/ if (Events.ShowDetails) diff --git a/swad_centre.c b/swad_centre.c index b27e4e29..7d57a0c2 100644 --- a/swad_centre.c +++ b/swad_centre.c @@ -1581,7 +1581,7 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void) static void Ctr_PutParamGoToCtr (void *CtrCod) { if (CtrCod) - Ctr_PutParamCtrCod (*(long *) CtrCod); + Ctr_PutParamCtrCod (*((long *) CtrCod)); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index a02ae61b..07312dd7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - * En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 19.169.2 (2020-04-08)" +#define Log_PLATFORM_VERSION "SWAD 19.169.3 (2020-04-08)" #define CSS_FILE "swad19.146.css" #define JS_FILE "swad19.153.js" /* @@ -548,6 +548,7 @@ Funci // TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores // TODO: Integrar pull requests con traducciones del alemán del usuario eruedin en GitHub + Version 19.169.3: Apr 08, 2020 Mark some parameters as unused (functions from D to I). (284929 lines) Version 19.169.2: Apr 08, 2020 Mark some parameters as unused (functions from A to C). (284969 lines) Version 19.169.1: Apr 08, 2020 Mark some parameters as unused. (284999 lines) Version 19.169: Apr 08, 2020 Code refactoring in games and matches. (285024 lines) diff --git a/swad_country.c b/swad_country.c index c0db40f2..ca0af9b9 100644 --- a/swad_country.c +++ b/swad_country.c @@ -1588,7 +1588,7 @@ static void Cty_PutParamGoToCty (void *CtyCod) { if (CtyCod) /***** Put parameter *****/ - Cty_PutParamCtyCod (*(long *) CtyCod); + Cty_PutParamCtyCod (*((long *) CtyCod)); } /*****************************************************************************/ diff --git a/swad_degree.c b/swad_degree.c index ef3fe69f..f6d63aca 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -79,12 +79,12 @@ static void Deg_CreateDegree (unsigned Status); static void Deg_ListDegrees (void); static bool Deg_CheckIfICanCreateDegrees (void); -static void Deg_PutIconsListingDegrees (void *Args); +static void Deg_PutIconsListingDegrees (__attribute__((unused)) void *Args); static void Deg_PutIconToEditDegrees (void); static void Deg_ListOneDegreeForSeeing (struct Degree *Deg,unsigned NumDeg); static void Deg_EditDegreesInternal (void); -static void Deg_PutIconsEditingDegrees (void *Args); +static void Deg_PutIconsEditingDegrees (__attribute__((unused)) void *Args); static void Deg_RecFormRequestOrCreateDeg (unsigned Status); static void Deg_PutParamOtherDegCod (long DegCod); @@ -94,7 +94,7 @@ static void Deg_GetDataOfDegreeFromRow (struct Degree *Deg,MYSQL_ROW row); static void Deg_UpdateDegNameDB (long DegCod,const char *FieldName,const char *NewDegName); static void Deg_ShowAlertAndButtonToGoToDeg (void); -static void Deg_PutParamGoToDeg (void *Args); +static void Deg_PutParamGoToDeg (void *DegCod); static void Deg_EditingDegreeConstructor (void); static void Deg_EditingDegreeDestructor (void); @@ -767,7 +767,7 @@ static void Deg_ListDegrees (void) /***** Begin box *****/ Box_BoxBegin (NULL,Str_BuildStringStr (Txt_Degrees_of_CENTRE_X, Gbl.Hierarchy.Ctr.ShrtName), - Deg_PutIconsListingDegrees,&Gbl, + Deg_PutIconsListingDegrees,NULL, Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE); Str_FreeString (); @@ -815,20 +815,17 @@ static bool Deg_CheckIfICanCreateDegrees (void) /***************** Put contextual icons in list of degrees *******************/ /*****************************************************************************/ -static void Deg_PutIconsListingDegrees (void *Args) +static void Deg_PutIconsListingDegrees (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to edit degrees *****/ - if (Deg_CheckIfICanCreateDegrees ()) - Deg_PutIconToEditDegrees (); + /***** Put icon to edit degrees *****/ + if (Deg_CheckIfICanCreateDegrees ()) + Deg_PutIconToEditDegrees (); - /***** Put icon to view degree types *****/ - DT_PutIconToViewDegreeTypes (); + /***** Put icon to view degree types *****/ + DT_PutIconToViewDegreeTypes (); - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_HIERARCHY); - } + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_HIERARCHY); } /*****************************************************************************/ @@ -953,7 +950,7 @@ static void Deg_EditDegreesInternal (void) /***** Begin box *****/ Box_BoxBegin (NULL,Str_BuildStringStr (Txt_Degrees_of_CENTRE_X, Gbl.Hierarchy.Ctr.ShrtName), - Deg_PutIconsEditingDegrees,&Gbl, + Deg_PutIconsEditingDegrees,NULL, Hlp_CENTRE_Degrees,Box_NOT_CLOSABLE); Str_FreeString (); @@ -990,19 +987,16 @@ static void Deg_EditDegreesInternal (void) /**************** Put contextual icons in edition of degrees *****************/ /*****************************************************************************/ -static void Deg_PutIconsEditingDegrees (void *Args) +static void Deg_PutIconsEditingDegrees (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to view degrees *****/ - Deg_PutIconToViewDegrees (); + /***** Put icon to view degrees *****/ + Deg_PutIconToViewDegrees (); - /***** Put icon to view types of degree *****/ - DT_PutIconToViewDegreeTypes (); + /***** Put icon to view types of degree *****/ + DT_PutIconToViewDegreeTypes (); - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_HIERARCHY); - } + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_HIERARCHY); } /*****************************************************************************/ @@ -1809,7 +1803,7 @@ static void Deg_ShowAlertAndButtonToGoToDeg (void) { /***** Alert with button to go to degree *****/ Ale_ShowLastAlertAndButton (ActSeeCrs,NULL,NULL, - Deg_PutParamGoToDeg,&Gbl, + Deg_PutParamGoToDeg,&Deg_EditingDeg->DegCod, Btn_CONFIRM_BUTTON, Hie_BuildGoToMsg (Deg_EditingDeg->ShrtName)); Hie_FreeGoToMsg (); @@ -1819,10 +1813,10 @@ static void Deg_ShowAlertAndButtonToGoToDeg (void) Ale_ShowAlerts (NULL); } -static void Deg_PutParamGoToDeg (void *Args) +static void Deg_PutParamGoToDeg (void *DegCod) { - if (Args) - Deg_PutParamDegCod (Deg_EditingDeg->DegCod); + if (DegCod) + Deg_PutParamDegCod (*((long *) DegCod)); } /*****************************************************************************/ diff --git a/swad_degree_config.c b/swad_degree_config.c index 47ab2a3a..82aabd88 100644 --- a/swad_degree_config.c +++ b/swad_degree_config.c @@ -59,7 +59,7 @@ extern struct Globals Gbl; /*****************************************************************************/ static void DegCfg_Configuration (bool PrintView); -static void DegCfg_PutIconsToPrintAndUpload (void *Args); +static void DegCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args); static void DegCfg_Title (bool PutLink); static void DegCfg_Centre (bool PrintView,bool PutForm); static void DegCfg_FullName (bool PutForm); @@ -122,7 +122,7 @@ static void DegCfg_Configuration (bool PrintView) NULL,Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,NULL, - DegCfg_PutIconsToPrintAndUpload,&Gbl, + DegCfg_PutIconsToPrintAndUpload,NULL, Hlp_DEGREE_Information,Box_NOT_CLOSABLE); /***** Title *****/ @@ -176,20 +176,17 @@ static void DegCfg_Configuration (bool PrintView) /************ Put contextual icons in configuration of a degree **************/ /*****************************************************************************/ -static void DegCfg_PutIconsToPrintAndUpload (void *Args) +static void DegCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Link to print info about degree *****/ - Ico_PutContextualIconToPrint (ActPrnDegInf, - NULL,NULL); + /***** Link to print info about degree *****/ + Ico_PutContextualIconToPrint (ActPrnDegInf, + NULL,NULL); - if (Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM) - // Only degree admins, centre admins, institution admins and system admins - // have permission to upload logo of the degree - /***** Link to upload logo of degree *****/ - Lgo_PutIconToChangeLogo (Hie_DEG); - } + if (Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM) + // Only degree admins, centre admins, institution admins and system admins + // have permission to upload logo of the degree + /***** Link to upload logo of degree *****/ + Lgo_PutIconToChangeLogo (Hie_DEG); } /*****************************************************************************/ diff --git a/swad_degree_type.c b/swad_degree_type.c index 94c047f4..f2ec984c 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -75,7 +75,7 @@ static void DT_ListDegreeTypes (Act_Action_t NextAction, DT_Order_t SelectedOrder); static void DT_EditDegreeTypesInternal (void); -static void DT_PutIconsEditingDegreeTypes (void *Args); +static void DT_PutIconsEditingDegreeTypes (__attribute__((unused)) void *Args); static void DT_ListDegreeTypesForSeeing (void); static void DT_PutIconsListingDegTypes (__attribute__((unused)) void *Args); @@ -265,7 +265,7 @@ static void DT_EditDegreeTypesInternal (void) /***** Begin box *****/ Box_BoxBegin (NULL,Txt_Types_of_degree, - DT_PutIconsEditingDegreeTypes,&Gbl, + DT_PutIconsEditingDegreeTypes,NULL, Hlp_CENTRE_DegreeTypes_edit,Box_NOT_CLOSABLE); /***** Put a form to create a new degree type *****/ @@ -286,19 +286,16 @@ static void DT_EditDegreeTypesInternal (void) /************ Put contextual icons when editing degree types *****************/ /*****************************************************************************/ -static void DT_PutIconsEditingDegreeTypes (void *Args) +static void DT_PutIconsEditingDegreeTypes (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to view degree types *****/ - DT_PutIconToViewDegreeTypes (); + /***** Put icon to view degree types *****/ + DT_PutIconToViewDegreeTypes (); - /***** Put icon to view degrees *****/ - Deg_PutIconToViewDegrees (); + /***** Put icon to view degrees *****/ + Deg_PutIconToViewDegrees (); - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_DEGREE_TYPES); - } + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_DEGREE_TYPES); } /*****************************************************************************/ diff --git a/swad_department.c b/swad_department.c index 0bcc2a7f..da1561cc 100644 --- a/swad_department.c +++ b/swad_department.c @@ -67,7 +67,7 @@ static struct Department *Dpt_EditingDpt = NULL; // Static variable to keep the /*****************************************************************************/ static void Dpt_GetParamDptOrder (void); -static void Dpt_PutIconToEditDpts (void *Args); +static void Dpt_PutIconToEditDpts (__attribute__((unused)) void *Args); static void Dpt_EditDepartmentsInternal (void); static void Dpt_ListDepartmentsForEdition (void); static void Dpt_PutParamDptCod (long DptCod); @@ -114,7 +114,7 @@ void Dpt_SeeDepts (void) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) Box_BoxTableBegin (NULL,Str_BuildStringStr (Txt_Departments_of_INSTITUTION_X, Gbl.Hierarchy.Ins.FullName), - Dpt_PutIconToEditDpts,&Gbl, + Dpt_PutIconToEditDpts,NULL, Hlp_INSTITUTION_Departments,Box_NOT_CLOSABLE,2); else Box_BoxTableBegin (NULL,Str_BuildStringStr (Txt_Departments_of_INSTITUTION_X, @@ -230,11 +230,10 @@ static void Dpt_GetParamDptOrder (void) /************************ Put icon to edit departments ***********************/ /*****************************************************************************/ -static void Dpt_PutIconToEditDpts (void *Args) +static void Dpt_PutIconToEditDpts (__attribute__((unused)) void *Args) { - if (Args) - Ico_PutContextualIconToEdit (ActEdiDpt,NULL, - NULL,NULL); + Ico_PutContextualIconToEdit (ActEdiDpt,NULL, + NULL,NULL); } /*****************************************************************************/ diff --git a/swad_exam.c b/swad_exam.c index 016ee245..e803c3fd 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -77,7 +77,7 @@ static long Exa_GetParamsExamAnnouncement (void); static void Exa_AllocMemExamAnnouncement (void); static void Exa_UpdateNumUsrsNotifiedByEMailAboutExamAnnouncement (long ExaCod,unsigned NumUsrsToBeNotifiedByEMail); static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewExamAnnouncement); -static void Exa_PutIconToCreateNewExamAnnouncement (void *Args); +static void Exa_PutIconToCreateNewExamAnnouncement (__attribute__((unused)) void *Args); static void Exa_PutButtonToCreateNewExamAnnouncement (void); static long Exa_AddExamAnnouncementToDB (void); @@ -86,8 +86,8 @@ static void Exa_GetDataExamAnnouncementFromDB (long ExaCod); static void Exa_ShowExamAnnouncement (long ExaCod, Exa_TypeViewExamAnnouncement_t TypeViewExamAnnouncement, bool HighLight); -static void Exa_PutIconsExamAnnouncement (void *Args); -static void Exa_PutParamExaCodToEdit (void *Args); +static void Exa_PutIconsExamAnnouncement (__attribute__((unused)) void *Args); +static void Exa_PutParamExaCodToEdit (void *ExaCod); static long Exa_GetParamExaCod (void); static void Exa_GetNotifContentExamAnnouncement (char **ContentStr); @@ -395,7 +395,7 @@ void Exa_ReqRemoveExamAnnouncement (void) /* End alert */ Ale_ShowAlertAndButton2 (ActRemExaAnn,NULL,NULL, - Exa_PutParamExaCodToEdit,NULL, + Exa_PutParamExaCodToEdit,&Gbl.ExamAnns.ExaCod, Btn_REMOVE_BUTTON,Txt_Remove); } @@ -577,7 +577,7 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx /***** Begin box *****/ if (ICanEdit) Box_BoxBegin (NULL,Txt_Announcements_of_exams, - Exa_PutIconToCreateNewExamAnnouncement,&Gbl, + Exa_PutIconToCreateNewExamAnnouncement,NULL, Hlp_ASSESSMENT_Announcements,Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,Txt_Announcements_of_exams, @@ -638,14 +638,13 @@ static void Exa_ListExamAnnouncements (Exa_TypeViewExamAnnouncement_t TypeViewEx /***************** Put icon to create a new exam announcement ****************/ /*****************************************************************************/ -static void Exa_PutIconToCreateNewExamAnnouncement (void *Args) +static void Exa_PutIconToCreateNewExamAnnouncement (__attribute__((unused)) void *Args) { extern const char *Txt_New_announcement_OF_EXAM; - if (Args) - Ico_PutContextualIconToAdd (ActEdiExaAnn,NULL, - NULL,NULL, - Txt_New_announcement_OF_EXAM); + Ico_PutContextualIconToAdd (ActEdiExaAnn,NULL, + NULL,NULL, + Txt_New_announcement_OF_EXAM); } /*****************************************************************************/ @@ -1010,7 +1009,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod, /* Start highlighted box */ Box_BoxShadowBegin (Width,NULL, - FunctionToDrawContextualIcons,&Gbl, + FunctionToDrawContextualIcons,NULL, HelpLink); } else // Don't highlight @@ -1493,51 +1492,48 @@ static void Exa_ShowExamAnnouncement (long ExaCod, /********* Put icons to remove / edit / print an exam announcement ***********/ /*****************************************************************************/ -static void Exa_PutIconsExamAnnouncement (void *Args) +static void Exa_PutIconsExamAnnouncement (__attribute__((unused)) void *Args) { - if (Args) + if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) { - if (Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) + /***** Link to remove this exam announcement *****/ + Ico_PutContextualIconToRemove (ActReqRemExaAnn, + Exa_PutParamExaCodToEdit,&Gbl.ExamAnns.ExaCod); + + /***** Put form to hide/show exam announement *****/ + switch (Gbl.ExamAnns.ExaDat.Status) { - /***** Link to remove this exam announcement *****/ - Ico_PutContextualIconToRemove (ActReqRemExaAnn, - Exa_PutParamExaCodToEdit,NULL); - - /***** Put form to hide/show exam announement *****/ - switch (Gbl.ExamAnns.ExaDat.Status) - { - case Exa_VISIBLE_EXAM_ANNOUNCEMENT: - Ico_PutContextualIconToHide (ActHidExaAnn,Gbl.ExamAnns.Anchor, - Exa_PutParamExaCodToEdit,NULL); - break; - case Exa_HIDDEN_EXAM_ANNOUNCEMENT: - Ico_PutContextualIconToUnhide (ActShoExaAnn,Gbl.ExamAnns.Anchor, - Exa_PutParamExaCodToEdit,NULL); - break; - case Exa_DELETED_EXAM_ANNOUNCEMENT: // Not applicable here - break; - } - - /***** Link to edit this exam announcement *****/ - Ico_PutContextualIconToEdit (ActEdiExaAnn,NULL, - Exa_PutParamExaCodToEdit,NULL); + case Exa_VISIBLE_EXAM_ANNOUNCEMENT: + Ico_PutContextualIconToHide (ActHidExaAnn,Gbl.ExamAnns.Anchor, + Exa_PutParamExaCodToEdit,&Gbl.ExamAnns.ExaCod); + break; + case Exa_HIDDEN_EXAM_ANNOUNCEMENT: + Ico_PutContextualIconToUnhide (ActShoExaAnn,Gbl.ExamAnns.Anchor, + Exa_PutParamExaCodToEdit,&Gbl.ExamAnns.ExaCod); + break; + case Exa_DELETED_EXAM_ANNOUNCEMENT: // Not applicable here + break; } - /***** Link to print view *****/ - Ico_PutContextualIconToPrint (ActPrnExaAnn, - Exa_PutParamExaCodToEdit,NULL); + /***** Link to edit this exam announcement *****/ + Ico_PutContextualIconToEdit (ActEdiExaAnn,NULL, + Exa_PutParamExaCodToEdit,&Gbl.ExamAnns.ExaCod); } + + /***** Link to print view *****/ + Ico_PutContextualIconToPrint (ActPrnExaAnn, + Exa_PutParamExaCodToEdit,&Gbl.ExamAnns.ExaCod); } /*****************************************************************************/ /*************** Param with the code of an exam announcement *****************/ /*****************************************************************************/ -static void Exa_PutParamExaCodToEdit (void *Args) +static void Exa_PutParamExaCodToEdit (void *ExaCod) { - if (Args) - Exa_PutHiddenParamExaCod (Gbl.ExamAnns.ExaCod); + if (ExaCod) + Exa_PutHiddenParamExaCod (*((long *) ExaCod)); } void Exa_PutHiddenParamExaCod (long ExaCod) diff --git a/swad_file_browser.c b/swad_file_browser.c index 218e9550..4a7c20ff 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -1285,7 +1285,7 @@ static void Brw_GetSelectedGroupData (struct GroupData *GrpDat,bool AbortOnError static void Brw_ShowDataOwnerAsgWrk (struct UsrData *UsrDat); static void Brw_ShowFileBrowserOrWorksInternal (__attribute__((unused)) void *Args); static void Brw_ShowFileBrowser (void); -static void Brw_PutIconsFileBrowser (void *Args); +static void Brw_PutIconsFileBrowser (__attribute__((unused)) void *Args); static void Brw_PutIconShowFigure (__attribute__((unused)) void *Args); static void Brw_PutButtonToShowEdit (void); static void Brw_WriteTopBeforeShowingFileBrowser (void); @@ -3696,7 +3696,7 @@ static void Brw_ShowFileBrowser (void) Gbl.FileBrowser.Id); HTM_SECTION_Begin (FileBrowserSectionId); Box_BoxBegin ("100%",Brw_TitleOfFileBrowser[Gbl.FileBrowser.Type], - Brw_PutIconsFileBrowser,&Gbl, + Brw_PutIconsFileBrowser,NULL, Brw_HelpOfFileBrowser[Gbl.FileBrowser.Type],Box_NOT_CLOSABLE); /***** Subtitle *****/ @@ -3734,37 +3734,34 @@ static void Brw_ShowFileBrowser (void) /******************* Put contextual icons in file browser ********************/ /*****************************************************************************/ -static void Brw_PutIconsFileBrowser (void *Args) +static void Brw_PutIconsFileBrowser (__attribute__((unused)) void *Args) { - if (Args) + /***** Put icon to view / edit file browser *****/ + switch (Gbl.FileBrowser.IconViewEdit) { - /***** Put icon to view / edit file browser *****/ - switch (Gbl.FileBrowser.IconViewEdit) - { - case Brw_ICON_NONE: - break; - case Brw_ICON_VIEW: - Ico_PutContextualIconToView (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type], - Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree); - break; - case Brw_ICON_EDIT: - Ico_PutContextualIconToEdit (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type],NULL, - Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree); - break; - } + case Brw_ICON_NONE: + break; + case Brw_ICON_VIEW: + Ico_PutContextualIconToView (Brw_ActFromAdmToSee[Gbl.FileBrowser.Type], + Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree); + break; + case Brw_ICON_EDIT: + Ico_PutContextualIconToEdit (Brw_ActFromSeeToAdm[Gbl.FileBrowser.Type],NULL, + Brw_PutHiddenParamFullTreeIfSelected,&Gbl.FileBrowser.FullTree); + break; + } - /***** Put icon to show a figure *****/ - switch (Gbl.FileBrowser.Type) - { - case Brw_ADMI_WRK_CRS: - case Brw_ADMI_ASG_CRS: - case Brw_ADMI_DOC_PRJ: - case Brw_ADMI_ASS_PRJ: - break; - default: - Brw_PutIconShowFigure (NULL); - break; - } + /***** Put icon to show a figure *****/ + switch (Gbl.FileBrowser.Type) + { + case Brw_ADMI_WRK_CRS: + case Brw_ADMI_ASG_CRS: + case Brw_ADMI_DOC_PRJ: + case Brw_ADMI_ASS_PRJ: + break; + default: + Brw_PutIconShowFigure (NULL); + break; } } diff --git a/swad_follow.c b/swad_follow.c index 2ae5e6c1..6aa816ed 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -79,7 +79,7 @@ static unsigned long Fol_GetUsrsToFollow (unsigned long MaxUsrsToShow, Fol_WhichUsersSuggestToFollowThem_t WhichUsersSuggestToFollowThem, MYSQL_RES **mysql_res); -static void Fol_PutIconsWhoToFollow (void *Args); +static void Fol_PutIconsWhoToFollow (__attribute__((unused)) void *Args); static void Fol_PutIconToUpdateWhoToFollow (void); static void Fol_ShowNumberOfFollowingOrFollowers (const struct UsrData *UsrDat, @@ -98,7 +98,7 @@ static void Fol_PutIconToUnfollow (struct UsrData *UsrDat); static void Fol_RequestFollowUsrs (Act_Action_t NextAction); static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction); -static void Fol_PutHiddenParSelectedUsrsCods (void *Args); +static void Fol_PutHiddenParSelectedUsrsCods (void *SelectedUsrs); static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed, unsigned *NumNotFollowed); @@ -149,7 +149,7 @@ void Fol_SuggestUsrsToFollowMainZone (void) { /***** Begin box and table *****/ Box_BoxTableBegin ("560px",Txt_Who_to_follow, - Fol_PutIconsWhoToFollow,&Gbl, + Fol_PutIconsWhoToFollow,NULL, Hlp_START_Profiles_who_to_follow,Box_NOT_CLOSABLE,2); /***** Initialize structure with user's data *****/ @@ -419,16 +419,13 @@ static unsigned long Fol_GetUsrsToFollow (unsigned long MaxUsrsToShow, /****************** Put contextual icons in "who to follow" ******************/ /*****************************************************************************/ -static void Fol_PutIconsWhoToFollow (void *Args) +static void Fol_PutIconsWhoToFollow (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to update who to follow *****/ - Fol_PutIconToUpdateWhoToFollow (); + /***** Put icon to update who to follow *****/ + Fol_PutIconToUpdateWhoToFollow (); - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_FOLLOW); - } + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_FOLLOW); } /*****************************************************************************/ @@ -1083,12 +1080,12 @@ static void Fol_RequestFollowUsrs (Act_Action_t NextAction) { if (NumNotFollowed == 1) Ale_ShowAlertAndButton (NextAction,NULL,NULL, - Fol_PutHiddenParSelectedUsrsCods,&Gbl, + Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected, Btn_CREATE_BUTTON,Txt_Follow, Ale_QUESTION,Txt_Do_you_want_to_follow_the_selected_user_whom_you_do_not_follow_yet); else Ale_ShowAlertAndButton (NextAction,NULL,NULL, - Fol_PutHiddenParSelectedUsrsCods,&Gbl, + Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected, Btn_CREATE_BUTTON,Txt_Follow, Ale_QUESTION,Txt_Do_you_want_to_follow_the_X_selected_users_whom_you_do_not_follow_yet, NumNotFollowed); @@ -1127,12 +1124,12 @@ static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction) { if (NumFollowed == 1) Ale_ShowAlertAndButton (NextAction,NULL,NULL, - Fol_PutHiddenParSelectedUsrsCods,&Gbl, + Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected, Btn_CREATE_BUTTON,Txt_Unfollow, Ale_QUESTION,Txt_Do_you_want_to_stop_following_the_selected_user_whom_you_follow); else Ale_ShowAlertAndButton (NextAction,NULL,NULL, - Fol_PutHiddenParSelectedUsrsCods,&Gbl, + Fol_PutHiddenParSelectedUsrsCods,&Gbl.Usrs.Selected, Btn_CREATE_BUTTON,Txt_Unfollow, Ale_QUESTION,Txt_Do_you_want_to_stop_following_the_X_selected_users_whom_you_follow, NumFollowed); @@ -1142,10 +1139,10 @@ static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction) Usr_FreeListsSelectedEncryptedUsrsCods (&Gbl.Usrs.Selected); } -static void Fol_PutHiddenParSelectedUsrsCods (void *Args) +static void Fol_PutHiddenParSelectedUsrsCods (void *SelectedUsrs) { - if (Args) - Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected); + if (SelectedUsrs) + Usr_PutHiddenParSelectedUsrsCods ((struct SelectedUsrs *) SelectedUsrs); } /*****************************************************************************/ diff --git a/swad_global.h b/swad_global.h index 3ec690f9..8b33c395 100644 --- a/swad_global.h +++ b/swad_global.h @@ -611,29 +611,7 @@ struct Globals Dat_StartEndTime_t SelectedOrder; unsigned CurrentPage; } Svys; - struct - { - Sta_ClicksGroupedBy_t ClicksGroupedBy; - Sta_Role_t Role; - Sta_CountType_t CountType; - Act_Action_t NumAction; - unsigned long FirstRow; - unsigned long LastRow; - unsigned RowsPerPage; - long DegTypCod; - long DptCod; - char StrIndicatorsSelected[Ind_MAX_SIZE_INDICATORS_SELECTED + 1]; - bool IndicatorsSelected[1 + Ind_NUM_INDICATORS]; - struct - { - Pho_AvgPhotoTypeOfAverage_t TypeOfAverage; - Pho_HowComputePhotoSize_t HowComputePhotoSize; - Pho_HowOrderDegrees_t HowOrderDegrees; - int MaxStds; - int MaxStdsWithPhoto; - double MaxPercent; - } DegPhotos; - } Stat; + struct Sta_Stats Stat; /* Cache */ struct diff --git a/swad_group.c b/swad_group.c index 5c2857a2..b91a41ed 100644 --- a/swad_group.c +++ b/swad_group.c @@ -97,7 +97,7 @@ static void Grp_ReqEditGroupsInternal2 (Ale_AlertType_t AlertTypeGroups, static void Grp_EditGroupTypes (void); static void Grp_EditGroups (void); -static void Grp_PutIconsEditingGroups (void *Args); +static void Grp_PutIconsEditingGroups (__attribute__((unused)) void *Args); static void Grp_PutIconToCreateNewGroup (void); static void Grp_PutCheckboxAllGrps (Grp_WhichGroups_t GroupsSelectableByStdsOrNETs); @@ -111,14 +111,14 @@ static void Grp_RemoveUsrFromGroup (long UsrCod,long GrpCod); static void Grp_AddUsrToGroup (struct UsrData *UsrDat,long GrpCod); static void Grp_ListGroupTypesForEdition (void); -static void Grp_PutIconsEditingGroupTypes (void *Args); +static void Grp_PutIconsEditingGroupTypes (__attribute__((unused)) void *Args); static void Grp_PutIconToViewGroups (void); static void Grp_PutIconToCreateNewGroupType (void); static void Grp_WriteHeadingGroupTypes (void); static void Grp_ListGroupsForEdition (void); static void Grp_WriteHeadingGroups (void); -static void Grp_PutIconToEditGroups (void *Args); +static void Grp_PutIconToEditGroups (__attribute__((unused)) void *Args); static void Grp_ShowWarningToStdsToChangeGrps (void); static bool Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp, @@ -146,9 +146,9 @@ static void Grp_CreateGroupType (void); static void Grp_CreateGroup (void); static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps); -static void Grp_PutParamRemGrpTyp (void *Args); +static void Grp_PutParamRemGrpTyp (void *GrpTypCod); static void Grp_AskConfirmRemGrp (void); -static void Grp_PutParamRemGrp (void *Args); +static void Grp_PutParamRemGrp (void *GrpCod); static void Grp_RemoveGroupTypeCompletely (void); static void Grp_RemoveGroupCompletely (void); @@ -287,7 +287,7 @@ static void Grp_EditGroupTypes (void) /***** Begin box *****/ Box_BoxBegin (NULL,Txt_Types_of_group, - Grp_PutIconsEditingGroupTypes,&Gbl, + Grp_PutIconsEditingGroupTypes,NULL, Hlp_USERS_Groups,Box_NOT_CLOSABLE); /***** Put a form to create a new group type *****/ @@ -316,7 +316,7 @@ static void Grp_EditGroups (void) /***** Begin box *****/ Box_BoxBegin (NULL,Txt_Groups, - Grp_PutIconsEditingGroups,&Gbl, + Grp_PutIconsEditingGroups,NULL, Hlp_USERS_Groups,Box_NOT_CLOSABLE); /***** Put a form to create a new group *****/ @@ -337,16 +337,13 @@ static void Grp_EditGroups (void) /**************** Put contextual icons in edition of groups ******************/ /*****************************************************************************/ -static void Grp_PutIconsEditingGroups (void *Args) +static void Grp_PutIconsEditingGroups (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to view groups *****/ - Grp_PutIconToViewGroups (); + /***** Put icon to view groups *****/ + Grp_PutIconToViewGroups (); - /***** Put icon to create a new group *****/ - Grp_PutIconToCreateNewGroup (); - } + /***** Put icon to create a new group *****/ + Grp_PutIconToCreateNewGroup (); } static void Grp_PutIconToCreateNewGroup (void) @@ -383,7 +380,7 @@ void Grp_ShowFormToSelectSeveralGroups (void (*FuncParams) (void *Args),void *Ar Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); if (ICanEdit) Box_BoxBegin (NULL,Txt_Groups, - Grp_PutIconToEditGroups,&Gbl, + Grp_PutIconToEditGroups,NULL, Hlp_USERS_Groups,Box_CLOSABLE); else Box_BoxBegin (NULL,Txt_Groups, @@ -1413,16 +1410,13 @@ static void Grp_ListGroupTypesForEdition (void) /************ Put contextual icons in edition of types of group **************/ /*****************************************************************************/ -static void Grp_PutIconsEditingGroupTypes (void *Args) +static void Grp_PutIconsEditingGroupTypes (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to view groups *****/ - Grp_PutIconToViewGroups (); + /***** Put icon to view groups *****/ + Grp_PutIconToViewGroups (); - /***** Put icon to create a new type of group *****/ - Grp_PutIconToCreateNewGroupType (); - } + /***** Put icon to create a new type of group *****/ + Grp_PutIconToCreateNewGroupType (); } static void Grp_PutIconToViewGroups (void) @@ -1792,7 +1786,7 @@ void Grp_ShowLstGrpsToChgMyGrps (void) /***** Begin box *****/ if (ICanEdit) Box_BoxBegin (NULL,Txt_My_groups, - Grp_PutIconToEditGroups,&Gbl, + Grp_PutIconToEditGroups,NULL, Hlp_USERS_Groups,Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,Txt_My_groups, @@ -1853,11 +1847,10 @@ void Grp_ShowLstGrpsToChgMyGrps (void) /*************************** Put icon to edit groups *************************/ /*****************************************************************************/ -static void Grp_PutIconToEditGroups (void *Args) +static void Grp_PutIconToEditGroups (__attribute__((unused)) void *Args) { - if (Args) - Ico_PutContextualIconToEdit (ActReqEdiGrp,NULL, - NULL,NULL); + Ico_PutContextualIconToEdit (ActReqEdiGrp,NULL, + NULL,NULL); } /*****************************************************************************/ @@ -3958,13 +3951,13 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps) /***** Show question and button to remove type of group *****/ if (NumGrps == 1) Ale_ShowAlertAndButton (ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL, - Grp_PutParamRemGrpTyp,&Gbl, + Grp_PutParamRemGrpTyp,&Gbl.Crs.Grps.GrpTyp.GrpTypCod, Btn_REMOVE_BUTTON,Txt_Remove_type_of_group, Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_type_of_group_X_1_group_, Gbl.Crs.Grps.GrpTyp.GrpTypName); else Ale_ShowAlertAndButton (ActRemGrpTyp,Grp_GROUP_TYPES_SECTION_ID,NULL, - Grp_PutParamRemGrpTyp,&Gbl, + Grp_PutParamRemGrpTyp,&Gbl.Crs.Grps.GrpTyp.GrpTypCod, Btn_REMOVE_BUTTON,Txt_Remove_type_of_group, Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_type_of_group_X_Y_groups_, Gbl.Crs.Grps.GrpTyp.GrpTypName,NumGrps); @@ -3978,10 +3971,10 @@ static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps) /**************** Put parameter to remove a type of group ********************/ /*****************************************************************************/ -static void Grp_PutParamRemGrpTyp (void *Args) +static void Grp_PutParamRemGrpTyp (void *GrpTypCod) { - if (Args) - Grp_PutParamGrpTypCod (Gbl.Crs.Grps.GrpTyp.GrpTypCod); + if (GrpTypCod) + Grp_PutParamGrpTypCod (*((long *) GrpTypCod)); } /*****************************************************************************/ @@ -4011,19 +4004,19 @@ static void Grp_AskConfirmRemGrp (void) /***** Show question and button to remove group *****/ if (NumStds == 0) Ale_ShowAlertAndButton (ActRemGrp,Grp_GROUPS_SECTION_ID,NULL, - Grp_PutParamRemGrp,&Gbl, + Grp_PutParamRemGrp,&Gbl.Crs.Grps.GrpCod, Btn_REMOVE_BUTTON,Txt_Remove_group, Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_group_X, GrpDat.GrpName); else if (NumStds == 1) Ale_ShowAlertAndButton (ActRemGrp,Grp_GROUPS_SECTION_ID,NULL, - Grp_PutParamRemGrp,&Gbl, + Grp_PutParamRemGrp,&Gbl.Crs.Grps.GrpCod, Btn_REMOVE_BUTTON,Txt_Remove_group, Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_group_X_1_student_, GrpDat.GrpName); else Ale_ShowAlertAndButton (ActRemGrp,Grp_GROUPS_SECTION_ID,NULL, - Grp_PutParamRemGrp,&Gbl, + Grp_PutParamRemGrp,&Gbl.Crs.Grps.GrpCod, Btn_REMOVE_BUTTON,Txt_Remove_group, Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_, GrpDat.GrpName,NumStds); @@ -4036,10 +4029,10 @@ static void Grp_AskConfirmRemGrp (void) /*********************** Put parameter to remove a group *********************/ /*****************************************************************************/ -static void Grp_PutParamRemGrp (void *Args) +static void Grp_PutParamRemGrp (void *GrpCod) { - if (Args) - Grp_PutParamGrpCod (Gbl.Crs.Grps.GrpCod); + if (GrpCod) + Grp_PutParamGrpCod (*((long *) GrpCod)); } /*****************************************************************************/ @@ -4959,9 +4952,9 @@ void Grp_PutParamAllGroups (void) void Grp_PutParamWhichGroups (void *WhichGrps) { if (WhichGrps) - if (*(Grp_WhichGroups_t *) WhichGrps != Grp_WHICH_GROUPS_DEFAULT) + if (*((Grp_WhichGroups_t *) WhichGrps) != Grp_WHICH_GROUPS_DEFAULT) Par_PutHiddenParamUnsigned (NULL,"WhichGrps", - (unsigned) *(Grp_WhichGroups_t *) WhichGrps); + (unsigned) *((Grp_WhichGroups_t *) WhichGrps)); } void Grp_PutParamWhichGrpsOnlyMyGrps (void) @@ -4984,33 +4977,30 @@ void Grp_ShowFormToSelWhichGrps (Act_Action_t Action, extern const char *Txt_GROUP_WHICH_GROUPS[2]; Grp_WhichGroups_t WhichGrps; - if (Args) + /***** Start setting selector *****/ + Set_StartOneSettingSelector (); + + /***** Put icons to select which groups *****/ + for (WhichGrps = Grp_MY_GROUPS; + WhichGrps <= Grp_ALL_GROUPS; + WhichGrps++) { - /***** Start setting selector *****/ - Set_StartOneSettingSelector (); - - /***** Put icons to select which groups *****/ - for (WhichGrps = Grp_MY_GROUPS; - WhichGrps <= Grp_ALL_GROUPS; - WhichGrps++) - { - HTM_DIV_Begin ("class=\"%s\"", - WhichGrps == Gbl.Crs.Grps.WhichGrps ? "PREF_ON" : - "PREF_OFF"); - Frm_StartForm (Action); - Par_PutHiddenParamUnsigned (NULL,"WhichGrps",(unsigned) WhichGrps); - if (FuncParams) // Extra parameters depending on the action - FuncParams (Args); - Ico_PutSettingIconLink (WhichGrps == Grp_MY_GROUPS ? "mysitemap.png" : - "sitemap.svg", - Txt_GROUP_WHICH_GROUPS[WhichGrps]); - Frm_EndForm (); - HTM_DIV_End (); - } - - /***** End setting selector *****/ - Set_EndOneSettingSelector (); + HTM_DIV_Begin ("class=\"%s\"", + WhichGrps == Gbl.Crs.Grps.WhichGrps ? "PREF_ON" : + "PREF_OFF"); + Frm_StartForm (Action); + Par_PutHiddenParamUnsigned (NULL,"WhichGrps",(unsigned) WhichGrps); + if (FuncParams) // Extra parameters depending on the action + FuncParams (Args); + Ico_PutSettingIconLink (WhichGrps == Grp_MY_GROUPS ? "mysitemap.png" : + "sitemap.svg", + Txt_GROUP_WHICH_GROUPS[WhichGrps]); + Frm_EndForm (); + HTM_DIV_End (); } + + /***** End setting selector *****/ + Set_EndOneSettingSelector (); } /*****************************************************************************/ diff --git a/swad_holiday.c b/swad_holiday.c index e076b489..44310218 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -64,7 +64,7 @@ static struct Holiday *Hld_EditingHld = NULL; // Static variable to keep the hol /*****************************************************************************/ static void Hld_GetParamHldOrder (void); -static void Hld_PutIconsSeeHolidays (void *Args); +static void Hld_PutIconsSeeHolidays (__attribute__((unused)) void *Args); static void Hld_EditHolidaysInternal (void); @@ -111,7 +111,7 @@ void Hld_SeeHolidays (void) /***** Table head *****/ Box_BoxBegin (NULL,Txt_Holidays, - Hld_PutIconsSeeHolidays,&Gbl, + Hld_PutIconsSeeHolidays,NULL, Hlp_INSTITUTION_Holidays,Box_NOT_CLOSABLE); if (Gbl.Hlds.Num) { @@ -221,18 +221,15 @@ static void Hld_GetParamHldOrder (void) /******************** Put contextual icons in calendar ***********************/ /*****************************************************************************/ -static void Hld_PutIconsSeeHolidays (void *Args) +static void Hld_PutIconsSeeHolidays (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Edit holidays calendar *****/ - if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) - Ico_PutContextualIconToEdit (ActEdiHld,NULL, - NULL,NULL); + /***** Edit holidays calendar *****/ + if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) + Ico_PutContextualIconToEdit (ActEdiHld,NULL, + NULL,NULL); - /***** View calendar *****/ - Cal_PutIconToSeeCalendar (NULL); - } + /***** View calendar *****/ + Cal_PutIconToSeeCalendar (NULL); } /*****************************************************************************/ diff --git a/swad_indicator.c b/swad_indicator.c index a0785126..3f6a2f26 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -68,7 +68,7 @@ static void Ind_GetParamNumIndicators (void); static unsigned Ind_GetTableOfCourses (MYSQL_RES **mysql_res); static bool Ind_GetIfShowBigList (unsigned NumCrss); static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss); -static void Ind_PutParamsConfirmIWantToSeeBigList (void *Args); +static void Ind_PutParamsConfirmIWantToSeeBigList (void *Stats); static void Ind_GetNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 + Ind_NUM_INDICATORS], unsigned NumCrss,MYSQL_RES *mysql_res); @@ -566,21 +566,21 @@ static void Ind_PutButtonToConfirmIWantToSeeBigList (unsigned NumCrss) /***** Show alert and button to confirm that I want to see the big list *****/ Ale_ShowAlertAndButton (Gbl.Action.Act,NULL,NULL, - Ind_PutParamsConfirmIWantToSeeBigList,&Gbl, + Ind_PutParamsConfirmIWantToSeeBigList,&Gbl.Stat, Btn_CONFIRM_BUTTON,Txt_Show_anyway, Ale_WARNING,Txt_The_list_of_X_courses_is_too_large_to_be_displayed, NumCrss); } -static void Ind_PutParamsConfirmIWantToSeeBigList (void *Args) +static void Ind_PutParamsConfirmIWantToSeeBigList (void *Stats) { - if (Args) + if (Stats) { Sco_PutParamScope ("ScopeInd",Gbl.Scope.Current); - Par_PutHiddenParamLong (NULL,"OthDegTypCod",Gbl.Stat.DegTypCod); - Par_PutHiddenParamLong (NULL,Dpt_PARAM_DPT_COD_NAME,Gbl.Stat.DptCod); - if (Gbl.Stat.StrIndicatorsSelected[0]) - Par_PutHiddenParamString (NULL,"Indicators",Gbl.Stat.StrIndicatorsSelected); + Par_PutHiddenParamLong (NULL,"OthDegTypCod",((struct Sta_Stats *) Stats)->DegTypCod); + Par_PutHiddenParamLong (NULL,Dpt_PARAM_DPT_COD_NAME,((struct Sta_Stats *) Stats)->DptCod); + if (((struct Sta_Stats *) Stats)->StrIndicatorsSelected[0]) + Par_PutHiddenParamString (NULL,"Indicators",((struct Sta_Stats *) Stats)->StrIndicatorsSelected); Par_PutHiddenParamChar ("ShowBigList",'Y'); } } diff --git a/swad_info.c b/swad_info.c index 6e0c4ac0..bcd26050 100644 --- a/swad_info.c +++ b/swad_info.c @@ -269,7 +269,7 @@ extern const char *Hlp_ASSESSMENT_System_edit; /*****************************************************************************/ static void Inf_PutButtonToEditInfo (void); -static void Inf_PutIconToViewInfo (void *Args); +static void Inf_PutIconToViewInfo (void *Type); static void Inf_PutCheckboxForceStdsToReadInfo (bool MustBeRead,bool Disabled); static void Inf_PutCheckboxConfirmIHaveReadInfo (void); static bool Inf_CheckIfIHaveReadInfo (void); @@ -414,7 +414,7 @@ void Inf_ShowInfo (void) { if (ICanEdit) Box_BoxBegin ("100%",Txt_INFO_TITLE[Gbl.Crs.Info.Type], - Inf_PutIconToEditInfo,&Gbl, + Inf_PutIconToEditInfo,&Gbl.Crs.Info.Type, Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE); else Box_BoxBegin ("100%",Txt_INFO_TITLE[Gbl.Crs.Info.Type], @@ -444,17 +444,17 @@ static void Inf_PutButtonToEditInfo (void) /************************ Put icon to edit course info ***********************/ /*****************************************************************************/ -static void Inf_PutIconToViewInfo (void *Args) +static void Inf_PutIconToViewInfo (void *Type) { - if (Args) - Ico_PutContextualIconToView (Inf_ActionsSeeInfo[Gbl.Crs.Info.Type], + if (Type) + Ico_PutContextualIconToView (Inf_ActionsSeeInfo[*((Inf_InfoType_t *) Type)], NULL,NULL); } -void Inf_PutIconToEditInfo (void *Args) +void Inf_PutIconToEditInfo (void *Type) { - if (Args) - Ico_PutContextualIconToEdit (Inf_ActionsEditInfo[Gbl.Crs.Info.Type],NULL, + if (Type) + Ico_PutContextualIconToEdit (Inf_ActionsEditInfo[*((Inf_InfoType_t *) Type)],NULL, NULL,NULL); } @@ -942,7 +942,7 @@ static void Inf_ShowPage (const char *URL) /***** Begin box *****/ if (ICanEdit) Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], - Inf_PutIconToEditInfo,&Gbl, + Inf_PutIconToEditInfo,&Gbl.Crs.Info.Type, Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], @@ -1030,7 +1030,7 @@ void Inf_FormsToSelSendInfo (void) /***** Form to choice between alternatives *****/ /* Begin box and table */ Box_BoxTableBegin (NULL,Txt_Source_of_information, - Inf_PutIconToViewInfo,&Gbl, + Inf_PutIconToViewInfo,&Gbl.Crs.Info.Type, HelpEdit[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE,4); /* Options */ @@ -1691,7 +1691,7 @@ static bool Inf_CheckAndShowPlainTxt (void) /***** Begin box *****/ if (ICanEdit) Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], - Inf_PutIconToEditInfo,&Gbl, + Inf_PutIconToEditInfo,&Gbl.Crs.Info.Type, Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], @@ -1779,7 +1779,7 @@ static bool Inf_CheckAndShowRichTxt (void) /***** Begin box *****/ if (ICanEdit) Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], - Inf_PutIconToEditInfo,&Gbl, + Inf_PutIconToEditInfo,&Gbl.Crs.Info.Type, Help[Gbl.Crs.Info.Type],Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], diff --git a/swad_info.h b/swad_info.h index 74a2c6f8..dcc560b2 100644 --- a/swad_info.h +++ b/swad_info.h @@ -68,7 +68,7 @@ typedef enum /*****************************************************************************/ void Inf_ShowInfo (void); -void Inf_PutIconToEditInfo (void *Args); +void Inf_PutIconToEditInfo (void *Type); void Inf_WriteMsgYouMustReadInfo (void); void Inf_ChangeForceReadInfo (void); void Inf_ChangeIHaveReadInfo (void); diff --git a/swad_institution.c b/swad_institution.c index 3b700347..15630b44 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -63,14 +63,14 @@ static struct Instit *Ins_EditingIns = NULL; // Static variable to keep the inst static void Ins_ListInstitutions (void); static bool Ins_CheckIfICanCreateInstitutions (void); -static void Ins_PutIconsListingInstitutions (void *Args); +static void Ins_PutIconsListingInstitutions (__attribute__((unused)) void *Args); static void Ins_PutIconToEditInstitutions (void); static void Ins_ListOneInstitutionForSeeing (struct Instit *Ins,unsigned NumIns); static void Ins_PutHeadInstitutionsForSeeing (bool OrderSelectable); static void Ins_GetParamInsOrder (void); static void Ins_EditInstitutionsInternal (void); -static void Ins_PutIconsEditingInstitutions (void *Args); +static void Ins_PutIconsEditingInstitutions (__attribute__((unused)) void *Args); static void Ins_PutIconToViewInstitutions (void); static void Ins_GetDataOfInstitFromRow (struct Instit *Ins,MYSQL_ROW row); @@ -89,7 +89,7 @@ static long Ins_GetParamOtherInsCod (void); static void Ins_UpdateInsNameDB (long InsCod,const char *FieldName,const char *NewInsName); static void Ins_ShowAlertAndButtonToGoToIns (void); -static void Ins_PutParamGoToIns (void *Args); +static void Ins_PutParamGoToIns (void *InsCod); static void Ins_PutFormToCreateInstitution (void); static void Ins_PutHeadInstitutionsForEdition (void); @@ -302,7 +302,7 @@ static void Ins_ListInstitutions (void) /***** Begin box *****/ Box_BoxBegin (NULL,Str_BuildStringStr (Txt_Institutions_of_COUNTRY_X, Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]), - Ins_PutIconsListingInstitutions,&Gbl, + Ins_PutIconsListingInstitutions,NULL, Hlp_COUNTRY_Institutions,Box_NOT_CLOSABLE); Str_FreeString (); @@ -349,17 +349,14 @@ static bool Ins_CheckIfICanCreateInstitutions (void) /*************** Put contextual icons in list of institutions ****************/ /*****************************************************************************/ -static void Ins_PutIconsListingInstitutions (void *Args) +static void Ins_PutIconsListingInstitutions (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to edit institutions *****/ - if (Ins_CheckIfICanCreateInstitutions ()) - Ins_PutIconToEditInstitutions (); + /***** Put icon to edit institutions *****/ + if (Ins_CheckIfICanCreateInstitutions ()) + Ins_PutIconToEditInstitutions (); - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_INSTITS); - } + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_INSTITS); } /*****************************************************************************/ @@ -564,7 +561,7 @@ static void Ins_EditInstitutionsInternal (void) /***** Begin box *****/ Box_BoxBegin (NULL,Str_BuildStringStr (Txt_Institutions_of_COUNTRY_X, Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]), - Ins_PutIconsEditingInstitutions,&Gbl, + Ins_PutIconsEditingInstitutions,NULL, Hlp_COUNTRY_Institutions,Box_NOT_CLOSABLE); Str_FreeString (); @@ -586,16 +583,13 @@ static void Ins_EditInstitutionsInternal (void) /************ Put contextual icons in edition of institutions ****************/ /*****************************************************************************/ -static void Ins_PutIconsEditingInstitutions (void *Args) +static void Ins_PutIconsEditingInstitutions (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Put icon to view institutions *****/ - Ins_PutIconToViewInstitutions (); + /***** Put icon to view institutions *****/ + Ins_PutIconToViewInstitutions (); - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_INSTITS); - } + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_INSTITS); } /*****************************************************************************/ @@ -1298,10 +1292,10 @@ static Ins_Status_t Ins_GetStatusBitsFromStatusTxt (Ins_StatusTxt_t StatusTxt) /************* Write parameter with code of current institution **************/ /*****************************************************************************/ -void Ins_PutParamCurrentInsCod (void *Args) +void Ins_PutParamCurrentInsCod (void *InsCod) { - if (Args) - Ins_PutParamInsCod (Gbl.Hierarchy.Ins.InsCod); + if (InsCod) + Ins_PutParamInsCod (*((long *) InsCod)); } /*****************************************************************************/ @@ -1678,7 +1672,7 @@ static void Ins_ShowAlertAndButtonToGoToIns (void) { /***** Alert with button to go to institution *****/ Ale_ShowLastAlertAndButton (ActSeeCtr,NULL,NULL, - Ins_PutParamGoToIns,&Gbl, + Ins_PutParamGoToIns,&Ins_EditingIns->InsCod, Btn_CONFIRM_BUTTON, Hie_BuildGoToMsg (Ins_EditingIns->ShrtName)); Hie_FreeGoToMsg (); @@ -1688,11 +1682,11 @@ static void Ins_ShowAlertAndButtonToGoToIns (void) Ale_ShowAlerts (NULL); } -static void Ins_PutParamGoToIns (void *Args) +static void Ins_PutParamGoToIns (void *InsCod) { - if (Args) + if (InsCod) /***** Put parameter *****/ - Ins_PutParamInsCod (Ins_EditingIns->InsCod); + Ins_PutParamInsCod (*((long *) InsCod)); } /*****************************************************************************/ @@ -2128,7 +2122,7 @@ static void Ins_FormToGoToMap (struct Instit *Ins) { Ins_EditingIns = Ins; // Used to pass parameter with the code of the institution Lay_PutContextualLinkOnlyIcon (ActSeeInsInf,NULL, - Ins_PutParamGoToIns,&Gbl, + Ins_PutParamGoToIns,&Ins_EditingIns->InsCod, "map-marker-alt.svg", Txt_Map); } diff --git a/swad_institution.h b/swad_institution.h index 0c75f2c8..75345235 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -110,7 +110,7 @@ void Ins_FlushCacheFullNameAndCtyOfInstitution (void); void Ins_FreeListInstitutions (void); void Ins_WriteSelectorOfInstitution (void); -void Ins_PutParamCurrentInsCod (void *Args); +void Ins_PutParamCurrentInsCod (void *InsCod); void Ins_PutParamInsCod (long InsCod); long Ins_GetAndCheckParamOtherInsCod (long MinCodAllowed); void Ins_RemoveInstitution (void); diff --git a/swad_institution_config.c b/swad_institution_config.c index e6589132..f801f7c5 100644 --- a/swad_institution_config.c +++ b/swad_institution_config.c @@ -63,7 +63,7 @@ extern struct Globals Gbl; /*****************************************************************************/ static void InsCfg_Configuration (bool PrintView); -static void InsCfg_PutIconsToPrintAndUpload (void *Args); +static void InsCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args); static void InsCfg_Title (bool PutLink); static void InsCfg_GetCoordAndZoom (struct Coordinates *Coord,unsigned *Zoom); static void InsCfg_Map (void); @@ -132,7 +132,7 @@ static void InsCfg_Configuration (bool PrintView) NULL,Box_NOT_CLOSABLE); else Box_BoxBegin (NULL,NULL, - InsCfg_PutIconsToPrintAndUpload,&Gbl, + InsCfg_PutIconsToPrintAndUpload,NULL, Hlp_INSTITUTION_Information,Box_NOT_CLOSABLE); @@ -211,21 +211,18 @@ static void InsCfg_Configuration (bool PrintView) /********* Put contextual icons in configuration of an institution ***********/ /*****************************************************************************/ -static void InsCfg_PutIconsToPrintAndUpload (void *Args) +static void InsCfg_PutIconsToPrintAndUpload (__attribute__((unused)) void *Args) { - if (Args) - { - /***** Icon to print info about institution *****/ - Ico_PutContextualIconToPrint (ActPrnInsInf, - NULL,NULL); + /***** Icon to print info about institution *****/ + Ico_PutContextualIconToPrint (ActPrnInsInf, + NULL,NULL); - if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) - /***** Icon to upload logo of institution *****/ - Lgo_PutIconToChangeLogo (Hie_INS); + if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) + /***** Icon to upload logo of institution *****/ + Lgo_PutIconToChangeLogo (Hie_INS); - /***** Put icon to view places *****/ - Plc_PutIconToViewPlaces (); - } + /***** Put icon to view places *****/ + Plc_PutIconToViewPlaces (); } /*****************************************************************************/ diff --git a/swad_match.c b/swad_match.c index e24bf44d..d6e758ae 100644 --- a/swad_match.c +++ b/swad_match.c @@ -1229,8 +1229,8 @@ static void Mch_PutParamsPlay (void *MchCod) { if (MchCod) { - if (*(long *) MchCod > 0) - Mch_PutParamMchCod (*(long *) MchCod); + if (*((long *) MchCod) > 0) + Mch_PutParamMchCod (*((long *) MchCod)); } } diff --git a/swad_place.c b/swad_place.c index 535d392d..6d078912 100644 --- a/swad_place.c +++ b/swad_place.c @@ -330,7 +330,7 @@ void Plc_PutIconToViewPlaces (void) extern const char *Txt_Places; Lay_PutContextualLinkOnlyIcon (ActSeePlc,NULL, - Ins_PutParamCurrentInsCod,&Gbl, + Ins_PutParamCurrentInsCod,&Gbl.Hierarchy.Ins.InsCod, "map-marker-alt.svg", Txt_Places); } diff --git a/swad_statistic.h b/swad_statistic.h index c4010c5d..8283e74c 100644 --- a/swad_statistic.h +++ b/swad_statistic.h @@ -27,6 +27,8 @@ /********************************* Headers ***********************************/ /*****************************************************************************/ +#include "swad_indicator.h" +#include "swad_photo.h" #include "swad_user.h" /*****************************************************************************/ @@ -126,6 +128,30 @@ struct Sta_Hits double Total; }; +struct Sta_Stats + { + Sta_ClicksGroupedBy_t ClicksGroupedBy; + Sta_Role_t Role; + Sta_CountType_t CountType; + Act_Action_t NumAction; + unsigned long FirstRow; + unsigned long LastRow; + unsigned RowsPerPage; + long DegTypCod; + long DptCod; + char StrIndicatorsSelected[Ind_MAX_SIZE_INDICATORS_SELECTED + 1]; + bool IndicatorsSelected[1 + Ind_NUM_INDICATORS]; + struct + { + Pho_AvgPhotoTypeOfAverage_t TypeOfAverage; + Pho_HowComputePhotoSize_t HowComputePhotoSize; + Pho_HowOrderDegrees_t HowOrderDegrees; + int MaxStds; + int MaxStdsWithPhoto; + double MaxPercent; + } DegPhotos; + }; + /*****************************************************************************/ /***************************** Public prototypes *****************************/ /*****************************************************************************/ diff --git a/swad_syllabus.c b/swad_syllabus.c index 8e982798..f8c9cfab 100644 --- a/swad_syllabus.c +++ b/swad_syllabus.c @@ -512,7 +512,7 @@ static void Syl_ShowSyllabus (bool PutIconToEdit) /***** Begin box and table *****/ if (PutIconToEdit) Box_BoxTableBegin (NULL,Txt_INFO_TITLE[Gbl.Crs.Info.Type], - Inf_PutIconToEditInfo,&Gbl, + Inf_PutIconToEditInfo,&Gbl.Crs.Info.Type, Gbl.Syllabus.EditionIsActive ? Hlp_COURSE_Syllabus_edit : Hlp_COURSE_Syllabus, Box_NOT_CLOSABLE,0); diff --git a/swad_user.c b/swad_user.c index 3449fb74..4270626f 100644 --- a/swad_user.c +++ b/swad_user.c @@ -9328,7 +9328,7 @@ unsigned Usr_GetTotalNumberOfUsersInPlatform (void) /******* Get total number of users of one or several roles in courses ********/ /*****************************************************************************/ -#define Usr_MAX_BYTES_SUBQUERY_ROLES (Rol_NUM_ROLES*(10+1)-1) +#define Usr_MAX_BYTES_SUBQUERY_ROLES (Rol_NUM_ROLES * (10 + 1) - 1) unsigned Usr_GetNumUsrsInCrss (Hie_Level_t Scope,long Cod,unsigned Roles) {