From 08da6cdc9995fc331cc4d4d392429a1c8b557e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 8 Dec 2014 01:30:47 +0100 Subject: [PATCH] Version 14.34 --- swad_attendance.c | 159 ++++++++++++++++++++++++++++++++++------------ swad_changelog.h | 7 +- swad_group.c | 4 +- swad_text.c | 21 ++++++ 4 files changed, 146 insertions(+), 45 deletions(-) diff --git a/swad_attendance.c b/swad_attendance.c index 5b5e1bced..54787e96f 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -70,7 +70,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att); static void Att_GetParamAttOrderType (void); static void Att_PutFormToListStds (void); -static void Att_PutFormToPrintListStds (void); +static void Att_PutFormToPrintListStds (char *StrAttCodsSelected); static void Att_PutFormToCreateNewAttEvent (void); static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden); static void Att_GetListAttEvents (Att_OrderTime_t Order); @@ -96,7 +96,7 @@ static void Att_RegUsrInAttEventChangingComments (long AttCod,long UsrCod,bool P static void Att_RemoveUsrFromAttEvent (long AttCod,long UsrCod); static void Att_GetListSelectedUsrCods (unsigned NumStdsInList,long **LstSelectedUsrCods); -static void Att_GetListSelectedAttCods (void); +static void Att_GetListSelectedAttCods (char **StrAttCodsSelected); static void Att_ListEventsToSelect (void); static void Att_ListStdsAttendanceTable (unsigned NumStdsInList,long *LstSelectedUsrCods); static void Att_WriteTableHeadSeveralAttEvents (void); @@ -440,7 +440,7 @@ static void Att_PutFormToListStds (void) /**** Put a link (form) to list assistance of students to several events *****/ /*****************************************************************************/ -static void Att_PutFormToPrintListStds (void) +static void Att_PutFormToPrintListStds (char *StrAttCodsSelected) { extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Print_view; @@ -448,7 +448,10 @@ static void Att_PutFormToPrintListStds (void) /***** Link to print view *****/ fprintf (Gbl.F.Out,"
"); Act_FormStart (ActPrnLstAttStd); + Grp_PutParamsCodGrps (); Usr_PutHiddenParUsrCodAll (ActPrnLstAttStd,Gbl.Usrs.Select.All); + if (StrAttCodsSelected[0]) + Par_PutHiddenParamString ("AttCods",StrAttCodsSelected); Act_LinkFormSubmit (Txt_Print_view,The_ClassFormul[Gbl.Prefs.Theme]); Lay_PutSendIcon ("print",Txt_Print_view,Txt_Print_view); fprintf (Gbl.F.Out,"" @@ -2144,7 +2147,7 @@ static void Att_PutParamsCodGrps (long AttCod) { fprintf (Gbl.F.Out," 0) + /* Check if this group is selected */ + for (NumGrpSel = 0; + NumGrpSel < Gbl.CurrentCrs.Grps.LstGrpsSel.NumGrps && + !Gbl.AttEvents.Lst[NumAttEvent].Selected; + NumGrpSel++) + if (Gbl.CurrentCrs.Grps.LstGrpsSel.GrpCod[NumGrpSel] == GrpCodInThisEvent) + Gbl.AttEvents.Lst[NumAttEvent].Selected = true; + } + else // This event is not associated to groups + Gbl.AttEvents.Lst[NumAttEvent].Selected = true; + + /***** Free structure that stores the query result *****/ + DB_FreeMySQLResult (&mysql_res); + } + } + } } /*****************************************************************************/ @@ -2797,19 +2865,24 @@ static void Att_GetListSelectedAttCods (void) static void Att_ListEventsToSelect (void) { + extern const char *The_ClassFormul[The_NUM_THEMES]; extern const char *Txt_Events; extern const char *Txt_Event; extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; - extern const char *Txt_Present; - extern const char *Txt_Absent; - extern const char *Txt_Student_comment; - extern const char *Txt_Teachers_comment; + extern const char *Txt_Update_attendance; const char *BgColor; unsigned NumAttEvent; /***** Start frame *****/ if (Gbl.CurrentAct == ActSeeLstAttStd) + { + /***** Start form to update the attendance + depending on the events selected *****/ + Act_FormStart (ActSeeLstAttStd); + Usr_PutHiddenParUsrCodAll (ActSeeLstAttStd,Gbl.Usrs.Select.All); + Lay_StartRoundFrameTable10 (NULL,2,Txt_Events); + } else Lay_StartSquareFrameTable (NULL,NULL,NULL,2); @@ -2820,7 +2893,7 @@ static void Att_ListEventsToSelect (void) Txt_Event, Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]); - /***** List the events with students *****/ + /***** List the events *****/ for (NumAttEvent = 0, Gbl.RowEvenOdd = 0; NumAttEvent < Gbl.AttEvents.Num; NumAttEvent++) @@ -2834,12 +2907,13 @@ static void Att_ListEventsToSelect (void) /***** Write a row for this event *****/ fprintf (Gbl.F.Out,"" "" - "" + fprintf (Gbl.F.Out," />" + "" "%u:" "%02u/%02u/%04u %02u:%02u h %s" "%u" @@ -2861,15 +2935,20 @@ static void Att_ListEventsToSelect (void) /***** Put button to refresh *****/ fprintf (Gbl.F.Out,"" - ""); - // TODO: Form to update attendance - Lay_PutSendIcon ("recycle","Actualizar asistencia en los eventos seleccionados","Actualizar asistencia"); // Need translation!!! + ""); + Act_LinkFormSubmit ("Actualizar asistencia según los eventos seleccionados",The_ClassFormul[Gbl.Prefs.Theme]); + Lay_PutSendIcon ("recycle","Actualizar asistencia según los eventos seleccionados",Txt_Update_attendance); // Need translation!!! fprintf (Gbl.F.Out,"" ""); /***** End frame *****/ if (Gbl.CurrentAct == ActSeeLstAttStd) + { Lay_EndRoundFrameTable10 (); + + /***** End form *****/ + fprintf (Gbl.F.Out,""); + } else Lay_EndSquareFrameTable (); } @@ -2961,7 +3040,7 @@ static void Att_WriteTableHeadSeveralAttEvents (void) for (NumAttEvent = 0; NumAttEvent < Gbl.AttEvents.Num; NumAttEvent++) - if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList) + if (Gbl.AttEvents.Lst[NumAttEvent].Selected) { /***** Get data of this attendance event *****/ Att_GetDataOfAttEventByCodAndCheckCrs (&Gbl.AttEvents.Lst[NumAttEvent]); @@ -3038,7 +3117,7 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr for (NumAttEvent = 0, NumTimesPresent = 0; NumAttEvent < Gbl.AttEvents.Num; NumAttEvent++) - if (Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList) + if (Gbl.AttEvents.Lst[NumAttEvent].Selected) { /***** Check if this student is already registered in the current event *****/ // Here it is not necessary to get comments diff --git a/swad_changelog.h b/swad_changelog.h index 031ec3077..0dba0147a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -35,14 +35,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.33 (2014/12/07)" +#define Log_PLATFORM_VERSION "SWAD 14.34 (2014/12/08)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h | tail -1 /* - Version 13.33 :Dic 07, 2014 A teacher can select attendance events in list of attendances. (170595 lines) - Version 13.32.1 :Dic 06, 2014 Added new social network. (170518 lines) + Version 14.34 :Dic 08, 2014 Teachers can refresh list of attendances after selecting events. (170688 lines) + Version 14.33 :Dic 07, 2014 A teacher can select attendance events in list of attendances. (170595 lines) + Version 14.32.1 :Dic 06, 2014 Added new social network. (170518 lines) 1 change necessary in database: ALTER TABLE usr_webs CHANGE Web Web ENUM('www','delicious','edmodo','facebook','flickr','foursquare','github','googleplus','googlescholar','instagram','linkedin','paperli','pinterest','researchgate','scoopit','slideshare','storify','tumblr','twitter','wikipedia','youtube') NOT NULL; diff --git a/swad_group.c b/swad_group.c index ee1600f51..96eb7ab6d 100644 --- a/swad_group.c +++ b/swad_group.c @@ -273,7 +273,7 @@ static void Grp_ShowFormSeveralGrps (Act_Action_t NextAction) /***** Free list of groups types and groups in this course *****/ Grp_FreeListGrpTypesAndGrps (); - /***** Submit buton *****/ + /***** Submit button *****/ fprintf (Gbl.F.Out,"" "
", The_ClassFormul[Gbl.Prefs.Theme]); @@ -283,7 +283,7 @@ static void Grp_ShowFormSeveralGrps (Act_Action_t NextAction) ""); /***** End table *****/ - Lay_EndRoundFrameTable10 (); + Lay_EndRoundFrameTable10 (); /***** End form *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_text.c b/swad_text.c index c787f4039..7f205ab56 100644 --- a/swad_text.c +++ b/swad_text.c @@ -47213,6 +47213,27 @@ const char *Txt_Update = "Atualizar"; #endif +const char *Txt_Update_attendance = +#if L==0 + "Actualitzar assistència"; +#elif L==1 + "Update Anwesenheit"; +#elif L==2 + "Update attendance"; +#elif L==3 + "Actualizar asistencia"; +#elif L==4 + "Mise à jour présence"; +#elif L==5 + "Actualizar asistencia"; // Okoteve traducción +#elif L==6 + "Aggiornamento presenza"; +#elif L==7 + "Aktualizacja bytność"; +#elif L==8 + "Atualizar presença"; +#endif + const char *Txt_Update_connected_users = #if L==0 "Actualitzar usuaris connectats";