diff --git a/swad_agenda.c b/swad_agenda.c index fb974f83..ce43887b 100644 --- a/swad_agenda.c +++ b/swad_agenda.c @@ -1572,8 +1572,8 @@ void Agd_RequestCreatOrEditEvent (void) char Txt[Cns_MAX_BYTES_TEXT + 1]; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_TO_000000, - Dat_HMS_TO_235959 + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Reset agenda context *****/ diff --git a/swad_assignment.c b/swad_assignment.c index d6db6f2f..695ad564 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -1172,10 +1172,15 @@ void Asg_RequestCreatOrEditAsg (void) struct Asg_Assignment Asg; bool ItsANewAssignment; char Txt[Cns_MAX_BYTES_TEXT + 1]; - static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = + static const Dat_SetHMS SetHMSDontSet[Dat_NUM_START_END_TIME] = { - Dat_HMS_TO_000000, - Dat_HMS_TO_235959 + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET + }; + static const Dat_SetHMS SetHMSAllDay[Dat_NUM_START_END_TIME] = + { + [Dat_START_TIME] = Dat_HMS_TO_000000, + [Dat_END_TIME ] = Dat_HMS_TO_235959 }; /***** Reset assignments *****/ @@ -1255,7 +1260,8 @@ void Asg_RequestCreatOrEditAsg (void) /***** Assignment start and end dates *****/ Dat_PutFormStartEndClientLocalDateTimes (Asg.TimeUTC, Dat_FORM_SECONDS_ON, - SetHMS); + Gbl.Action.Act == ActFrmNewAsg ? SetHMSAllDay : + SetHMSDontSet); /***** Send work? *****/ HTM_TR_Begin (NULL); diff --git a/swad_attendance.c b/swad_attendance.c index 507db70c..e6ffb7c1 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -145,6 +145,7 @@ static void Att_RegUsrInAttEventChangingComments (long AttCod,long UsrCod,bool P const char *CommentStd,const char *CommentTch); static void Att_RemoveUsrFromAttEvent (long AttCod,long UsrCod); +static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView); static void Att_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView); static void Att_GetUsrsAndListOrPrintAttendanceCrs (Att_TypeOfView_t TypeOfView); static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView); @@ -1094,8 +1095,8 @@ void Att_RequestCreatOrEditAttEvent (void) char Description[Cns_MAX_BYTES_TEXT + 1]; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_DO_NOT_SET, - Dat_HMS_DO_NOT_SET + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Get parameters *****/ @@ -2717,7 +2718,14 @@ void Att_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod) /********** Request listing attendance of users to several events ************/ /*****************************************************************************/ -void Att_ReqListUsrsAttendanceCrs (void *TypeOfView) +void Att_ReqListUsrsAttendanceCrs (void) + { + Att_TypeOfView_t TypeOfView = Att_VIEW_SEL_USR; + + Att_ReqListOrPrintUsrsAttendanceCrs (&TypeOfView); + } + +static void Att_ReqListOrPrintUsrsAttendanceCrs (void *TypeOfView) { extern const char *Hlp_USERS_Attendance_attendance_list; extern const char *Txt_Attendance_list; @@ -2868,7 +2876,7 @@ static void Att_GetUsrsAndListOrPrintAttendanceCrs (Att_TypeOfView_t TypeOfView) { Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected, Att_ListOrPrintUsrsAttendanceCrs,&TypeOfView, - Att_ReqListUsrsAttendanceCrs,&TypeOfView); + Att_ReqListOrPrintUsrsAttendanceCrs,&TypeOfView); } static void Att_ListOrPrintUsrsAttendanceCrs (void *TypeOfView) diff --git a/swad_attendance.h b/swad_attendance.h index 7ac2df76..c4c679f1 100644 --- a/swad_attendance.h +++ b/swad_attendance.h @@ -123,7 +123,7 @@ void Att_RegisterStudentsInAttEvent (void); void Att_RegUsrInAttEventNotChangingComments (long AttCod,long UsrCod); void Att_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod); -void Att_ReqListUsrsAttendanceCrs (void *TypeOfView); +void Att_ReqListUsrsAttendanceCrs (void); void Att_ListMyAttendanceCrs (void); void Att_PrintMyAttendanceCrs (void); void Att_ListUsrsAttendanceCrs (void); diff --git a/swad_changelog.h b/swad_changelog.h index bfde1461..a3fae060 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.180.3 (2020-04-13)" +#define Log_PLATFORM_VERSION "SWAD 19.180.4 (2020-04-13)" #define CSS_FILE "swad19.146.css" #define JS_FILE "swad19.172.1.js" /* @@ -548,6 +548,9 @@ 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.180.4: Apr 13, 2020 Fixed bug in attendance. + Fixed bug in lists of users. + Fixed bug in dates (assignments, agenda). (285622 lines) Version 19.180.3: Apr 13, 2020 Fixed bug in course info. (285614 lines) Version 19.180.2: Apr 13, 2020 Fixed bugs in syllabus. (285613 lines) Version 19.180.1: Apr 12, 2020 Changes in stats of clicks. (285599 lines) diff --git a/swad_date.c b/swad_date.c index 1996ed71..e72c14a6 100644 --- a/swad_date.c +++ b/swad_date.c @@ -708,9 +708,12 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id, /***** Script to set selectors to local date and time from UTC time *****/ HTM_SCRIPT_Begin (NULL,NULL); - HTM_TxtF ("setLocalDateTimeFormFromUTC('%s',%ld);\n" - "adjustDateForm('%s');", - Id,(long) TimeUTC,Id); + HTM_TxtF ("setLocalDateTimeFormFromUTC('%s',%ld);\n" // Set date-time form from UTC time + "adjustDateForm('%s');\n" // Adjust date-time form + "setUTCFromLocalDateTimeForm('%s');\n", // Adjust UTC time from date-time form + Id,(long) TimeUTC, + Id, + Id); switch (SetHMS) { case Dat_HMS_TO_000000: diff --git a/swad_file_browser.c b/swad_file_browser.c index 70dcd7e7..5fa9b6f2 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3115,15 +3115,14 @@ static void Brw_AskEditWorksCrsInternal (__attribute__((unused)) void *Args) extern const char *Txt_Assignments_and_other_works; extern const char *Txt_View_homework; - if (Args) - /***** List users to select some of them *****/ - Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, - ActAdmAsgWrkCrs, - NULL,NULL, - Txt_Assignments_and_other_works, - Hlp_FILES_Homework_for_teachers, - Txt_View_homework, - false); // Do not put form with date range + /***** List users to select some of them *****/ + Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected, + ActAdmAsgWrkCrs, + NULL,NULL, + Txt_Assignments_and_other_works, + Hlp_FILES_Homework_for_teachers, + Txt_View_homework, + false); // Do not put form with date range } /*****************************************************************************/ diff --git a/swad_program.c b/swad_program.c index 23da9d5d..6963e618 100644 --- a/swad_program.c +++ b/swad_program.c @@ -1812,8 +1812,8 @@ static void Prg_ShowFormToCreateItem (long ParentItmCod) struct ProgramItem Item; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_TO_000000, - Dat_HMS_TO_235959 + [Dat_START_TIME] = Dat_HMS_TO_000000, + [Dat_END_TIME ] = Dat_HMS_TO_235959 }; /***** Get data of the parent program item from database *****/ @@ -1861,8 +1861,8 @@ static void Prg_ShowFormToChangeItem (long ItmCod) char Txt[Cns_MAX_BYTES_TEXT + 1]; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_DO_NOT_SET, - Dat_HMS_DO_NOT_SET + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Get data of the program item from database *****/ diff --git a/swad_survey.c b/swad_survey.c index 97aa29c7..7806f04a 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -1880,8 +1880,8 @@ void Svy_RequestCreatOrEditSvy (void) char Txt[Cns_MAX_BYTES_TEXT + 1]; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_TO_000000, - Dat_HMS_TO_235959 + [Dat_START_TIME] = Dat_HMS_TO_000000, + [Dat_END_TIME ] = Dat_HMS_TO_235959 }; /***** Reset surveys *****/ diff --git a/swad_test.c b/swad_test.c index 59258b24..f9d01d55 100644 --- a/swad_test.c +++ b/swad_test.c @@ -1230,8 +1230,8 @@ static void Tst_ShowFormRequestEditTests (struct Tst_Test *Test) MYSQL_RES *mysql_res; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_DO_NOT_SET, - Dat_HMS_DO_NOT_SET + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Contextual menu *****/ @@ -1315,8 +1315,8 @@ static void Tst_ShowFormRequestSelectTestsForGame (struct Gam_Games *Games, MYSQL_RES *mysql_res; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_DO_NOT_SET, - Dat_HMS_DO_NOT_SET + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Begin box *****/ diff --git a/swad_test_exam.c b/swad_test_exam.c index f1925c27..a8661d4d 100644 --- a/swad_test_exam.c +++ b/swad_test_exam.c @@ -1484,8 +1484,8 @@ void TstExa_SelDatesToSeeMyExams (void) extern const char *Txt_View_test_results; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_DO_NOT_SET, - Dat_HMS_DO_NOT_SET + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Begin form *****/ diff --git a/swad_user.c b/swad_user.c index ff150a24..9a634992 100644 --- a/swad_user.c +++ b/swad_user.c @@ -5680,14 +5680,11 @@ static void Usr_PutButtonToConfirmIWantToSeeBigList (unsigned NumUsrs, static void Usr_PutParamsConfirmIWantToSeeBigList (void *Args) { - if (Args) - { - Grp_PutParamsCodGrps (); - Usr_PutParamsPrefsAboutUsrList (); - if (Usr_FuncParamsBigList) - Usr_FuncParamsBigList (Args); - Par_PutHiddenParamChar ("ShowBigList",'Y'); - } + Grp_PutParamsCodGrps (); + Usr_PutParamsPrefsAboutUsrList (); + if (Usr_FuncParamsBigList) + Usr_FuncParamsBigList (Args); + Par_PutHiddenParamChar ("ShowBigList",'Y'); } /*****************************************************************************/ @@ -6329,8 +6326,8 @@ void Usr_PutFormToSelectUsrsToGoToAct (struct SelectedUsrs *SelectedUsrs, unsigned NumTotalUsrs; static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] = { - Dat_HMS_DO_NOT_SET, - Dat_HMS_DO_NOT_SET + [Dat_START_TIME] = Dat_HMS_DO_NOT_SET, + [Dat_END_TIME ] = Dat_HMS_DO_NOT_SET }; /***** Begin box *****/ @@ -8789,26 +8786,23 @@ static void Usr_PutIconsListGsts (__attribute__((unused)) void *Args) static void Usr_PutIconsListStds (__attribute__((unused)) void *Args) { - if (Args) + switch (Gbl.Usrs.Me.ListType) { - switch (Gbl.Usrs.Me.ListType) - { - case Usr_LIST_AS_CLASS_PHOTO: - if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs) - /***** Put icon to print students *****/ - Usr_PutIconToPrintStds (); - break; - case Usr_LIST_AS_LISTING: - /***** Put icon to show all data of students *****/ - Usr_PutIconToShowStdsAllData (); - break; - default: - break; - } - - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_USERS); + case Usr_LIST_AS_CLASS_PHOTO: + if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs) + /***** Put icon to print students *****/ + Usr_PutIconToPrintStds (); + break; + case Usr_LIST_AS_LISTING: + /***** Put icon to show all data of students *****/ + Usr_PutIconToShowStdsAllData (); + break; + default: + break; } + + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_USERS); } /*****************************************************************************/ @@ -8817,26 +8811,23 @@ static void Usr_PutIconsListStds (__attribute__((unused)) void *Args) static void Usr_PutIconsListTchs (__attribute__((unused)) void *Args) { - if (Args) + switch (Gbl.Usrs.Me.ListType) { - switch (Gbl.Usrs.Me.ListType) - { - case Usr_LIST_AS_CLASS_PHOTO: - if (Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs) - /***** Put icon to print teachers *****/ - Usr_PutIconToPrintTchs (); - break; - case Usr_LIST_AS_LISTING: - /***** Put icon to show all data of teachers *****/ - Usr_PutIconToShowTchsAllData (); - break; - default: - break; - } - - /***** Put icon to show a figure *****/ - Fig_PutIconToShowFigure (Fig_USERS); + case Usr_LIST_AS_CLASS_PHOTO: + if (Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs) + /***** Put icon to print teachers *****/ + Usr_PutIconToPrintTchs (); + break; + case Usr_LIST_AS_LISTING: + /***** Put icon to show all data of teachers *****/ + Usr_PutIconToShowTchsAllData (); + break; + default: + break; } + + /***** Put icon to show a figure *****/ + Fig_PutIconToShowFigure (Fig_USERS); } /*****************************************************************************/