From 8615d161e078978b4748291c58636e0939598456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 11 Apr 2019 23:15:40 +0200 Subject: [PATCH] Version18.112 --- swad_action.c | 18 +-- swad_action.h | 6 +- swad_attendance.c | 298 +++++++++++++++++--------------------------- swad_attendance.h | 4 +- swad_changelog.h | 3 +- swad_file_browser.c | 2 + swad_follow.c | 4 +- swad_mail.c | 2 + swad_project.c | 9 +- swad_record.c | 2 +- swad_text.c | 46 ++++++- swad_user.c | 25 ++-- swad_user.h | 1 + 13 files changed, 201 insertions(+), 219 deletions(-) diff --git a/swad_action.c b/swad_action.c index 1b90d009..6a9e26d2 100644 --- a/swad_action.c +++ b/swad_action.c @@ -1175,11 +1175,11 @@ Users: 983. ActReqEnrSevNET Request the enrolment/removing of several non-editing teachers to / from current course 984. ActReqEnrSevTch Request the enrolment/removing of several teachers to / from current course - 985. ActReqLstStdAtt Request listing of attendance of several students to several events + 985. ActReqLstUsrAtt Request listing of attendance of several students to several events 986. ActSeeLstMyAtt List my attendance as student to several events 987. ActPrnLstMyAtt Print my attendance as student to several events - 988. ActSeeLstStdAtt List attendance of several students to several events - 989. ActPrnLstStdAtt Print attendance of several students to several events + 988. ActSeeLstUsrAtt List attendance of several students to several events + 989. ActPrnLstUsrAtt Print attendance of several students to several events 990. ActFrmNewAtt Form to create a new attendance event 991. ActEdiOneAtt Edit one attendance event 992. ActNewAtt Create new attendance event @@ -2731,11 +2731,11 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] = /* ActReqEnrSevNET */{1642,-1,TabUnk,ActLstTch ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_ReqAdminNonEditingTchs ,NULL}, /* ActReqEnrSevTch */{1427,-1,TabUnk,ActLstTch ,0x3C0,0x3C0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Enr_ReqAdminTchs ,NULL}, - /* ActReqLstStdAtt */{1073,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_ReqListStdsAttendanceCrs ,NULL}, + /* ActReqLstUsrAtt */{1073,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_ReqListStdsAttendanceCrs ,NULL}, /* ActSeeLstMyAtt */{1473,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_ListMyAttendanceCrs ,NULL}, /* ActPrnLstMyAtt */{1474,-1,TabUnk,ActSeeAtt ,0x008, 0, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Usr_PrintMyAttendanceCrs ,NULL}, - /* ActSeeLstStdAtt */{1074,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_ListStdsAttendanceCrs ,NULL}, - /* ActPrnLstStdAtt */{1075,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Usr_PrintStdsAttendanceCrs ,NULL}, + /* ActSeeLstUsrAtt */{1074,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Usr_ListUsrsAttendanceCrs ,NULL}, + /* ActPrnLstUsrAtt */{1075,-1,TabUnk,ActSeeAtt ,0x230,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_NEW_TAB,NULL ,Usr_PrintUsrsAttendanceCrs ,NULL}, /* ActFrmNewAtt */{1063,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RequestCreatOrEditAttEvent ,NULL}, /* ActEdiOneAtt */{1064,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RequestCreatOrEditAttEvent ,NULL}, /* ActNewAtt */{1065,-1,TabUnk,ActSeeAtt ,0x220,0x200, 0, 0, 0, 0, 0,Act_CONT_NORM,Act_BRW_1ST_TAB,NULL ,Att_RecFormAttEvent ,NULL}, @@ -4249,9 +4249,9 @@ Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD] = // Do not reuse un ActShoAtt, // #1070 ActSeeOneAtt, // #1071 ActRecAttStd, // #1072 - ActReqLstStdAtt, // #1073 - ActSeeLstStdAtt, // #1074 - ActPrnLstStdAtt, // #1075 + ActReqLstUsrAtt, // #1073 + ActSeeLstUsrAtt, // #1074 + ActPrnLstUsrAtt, // #1075 ActRecAttMe, // #1076 ActLogInLan, // #1077 ActSeeDocCrs, // #1078 diff --git a/swad_action.h b/swad_action.h index 0de63489..10dfa0cd 100644 --- a/swad_action.h +++ b/swad_action.h @@ -1194,11 +1194,11 @@ typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to #define ActReqEnrSevNET (ActRemOldBrf + 61) #define ActReqEnrSevTch (ActRemOldBrf + 62) -#define ActReqLstStdAtt (ActRemOldBrf + 63) +#define ActReqLstUsrAtt (ActRemOldBrf + 63) #define ActSeeLstMyAtt (ActRemOldBrf + 64) #define ActPrnLstMyAtt (ActRemOldBrf + 65) -#define ActSeeLstStdAtt (ActRemOldBrf + 66) -#define ActPrnLstStdAtt (ActRemOldBrf + 67) +#define ActSeeLstUsrAtt (ActRemOldBrf + 66) +#define ActPrnLstUsrAtt (ActRemOldBrf + 67) #define ActFrmNewAtt (ActRemOldBrf + 68) #define ActEdiOneAtt (ActRemOldBrf + 69) #define ActNewAtt (ActRemOldBrf + 70) diff --git a/swad_attendance.c b/swad_attendance.c index 2d7c9764..784fcc6b 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -108,7 +108,7 @@ static void Att_RemoveAttEventFromCurrentCrs (long AttCod); static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att); static void Att_ListAttStudents (struct AttendanceEvent *Att); -static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, +static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, struct UsrData *UsrDat, struct AttendanceEvent *Att); static void Att_PutLinkAttEvent (struct AttendanceEvent *AttEvent, @@ -116,7 +116,7 @@ static void Att_PutLinkAttEvent (struct AttendanceEvent *AttEvent, const char *LinkStyle); static void Att_PutParamsCodGrps (long AttCod); static void Att_GetNumStdsTotalWhoAreInAttEvent (struct AttendanceEvent *Att); -static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumStdsInList); +static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumUsrsInList); static bool Att_CheckIfUsrIsInTableAttUsr (long AttCod,long UsrCod,bool *Present); static bool Att_CheckIfUsrIsPresentInAttEvent (long AttCod,long UsrCod); static bool Att_CheckIfUsrIsPresentInAttEventAndGetComments (long AttCod,long UsrCod, @@ -127,9 +127,9 @@ static void Att_RegUsrInAttEventChangingComments (long AttCod,long UsrCod,bool P static void Att_RemoveUsrFromAttEvent (long AttCod,long UsrCod); static void Usr_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView); -static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView); +static void Usr_ListOrPrintUsrsAttendanceCrs (Att_TypeOfView_t TypeOfView); -static void Att_GetListSelectedUsrCods (unsigned NumStdsInList,long **LstSelectedUsrCods); +static void Att_GetListSelectedUsrCods (unsigned NumUsrsInList,long **LstSelectedUsrCods); static void Att_GetListSelectedAttCods (char **StrAttCodsSelected); static void Att_PutIconsMyAttList (void); @@ -141,15 +141,15 @@ static void Att_PutButtonToShowDetails (void); static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView); static void Att_PutIconToEditAttEvents (void); static void Att_PutIconToViewAttEvents (void); -static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, - unsigned NumStdsInList, +static void Att_ListUsrsAttendanceTable (Att_TypeOfView_t TypeOfView, + unsigned NumUsrsInList, long *LstSelectedUsrCods); static void Att_WriteTableHeadSeveralAttEvents (void); -static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat); +static void Att_WriteRowUsrSeveralAttEvents (unsigned NumUsr,struct UsrData *UsrDat); static void Att_PutCheckOrCross (bool Present); -static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList, +static void Att_ListStdsWithAttEventsDetails (unsigned NumUsrsInList, long *LstSelectedUsrCods); -static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat); +static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat); /*****************************************************************************/ /********************** List all the attendance events ***********************/ @@ -544,7 +544,7 @@ static void Att_PutFormToListStdsAttendance (void) { extern const char *Txt_Attendance_list; - Lay_PutContextualLinkIconText (ActReqLstStdAtt,NULL, + Lay_PutContextualLinkIconText (ActReqLstUsrAtt,NULL, Att_PutFormToListStdsParams, "list-ol.svg", Txt_Attendance_list); @@ -1910,7 +1910,7 @@ static void Att_ListAttOnlyMeAsStudent (struct AttendanceEvent *Att) Txt_Teachers_comment); /* List of students (only me) */ - Att_WriteRowStdToCallTheRoll (1,&Gbl.Usrs.Me.UsrDat,Att); + Att_WriteRowUsrToCallTheRoll (1,&Gbl.Usrs.Me.UsrDat,Att); /* End table */ Tbl_EndTable (); @@ -1939,7 +1939,7 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) extern const char *Txt_Teachers_comment; extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_Save_changes; - unsigned NumStd; + unsigned NumUsr; struct UsrData UsrDat; /***** Get groups to show ******/ @@ -1997,17 +1997,17 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) Txt_Teachers_comment); /* List of students */ - for (NumStd = 0, Gbl.RowEvenOdd = 0; - NumStd < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; - NumStd++) + for (NumUsr = 0, Gbl.RowEvenOdd = 0; + NumUsr < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; + NumUsr++) { /* Copy user's basic data from list */ - Usr_CopyBasicUsrDataFromList (&UsrDat,&Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd]); + Usr_CopyBasicUsrDataFromList (&UsrDat,&Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr]); /* Get list of user's IDs */ ID_GetListIDsFromUsrCod (&UsrDat); - Att_WriteRowStdToCallTheRoll (NumStd + 1,&UsrDat,Att); + Att_WriteRowUsrToCallTheRoll (NumUsr + 1,&UsrDat,Att); } /* End table */ @@ -2040,10 +2040,10 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) } /*****************************************************************************/ -/************ Write a row of a table with the data of a student **************/ +/************** Write a row of a table with the data of a user ***************/ /*****************************************************************************/ -static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, +static void Att_WriteRowUsrToCallTheRoll (unsigned NumUsr, struct UsrData *UsrDat, struct AttendanceEvent *Att) { @@ -2093,7 +2093,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, fprintf (Gbl.F.Out,"" "" "" ""); @@ -2102,7 +2102,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, fprintf (Gbl.F.Out,"" "EncryptedUsrCod); if (Present) // This student has attended to the event? fprintf (Gbl.F.Out," checked=\"checked\""); @@ -2118,7 +2118,7 @@ static void Att_WriteRowStdToCallTheRoll (unsigned NumStd, UsrDat->Accepted ? "DAT_N" : "DAT", Gbl.RowEvenOdd, - NumStd); + NumUsr); /***** Show student's photo *****/ if (Gbl.Usrs.Listing.WithPhotos) @@ -2320,7 +2320,7 @@ void Att_RegisterStudentsInAttEvent (void) extern const char *Txt_Presents; extern const char *Txt_Absents; struct AttendanceEvent Att; - unsigned NumStd; + unsigned NumUsr; const char *Ptr; bool Present; unsigned NumStdsPresent; @@ -2345,10 +2345,10 @@ void Att_RegisterStudentsInAttEvent (void) if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs) // If there are students in the groups selected... { /***** 2. Mark all students in the groups selected setting Remove=true *****/ - for (NumStd = 0; - NumStd < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; - NumStd++) - Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].Remove = true; + for (NumUsr = 0; + NumUsr < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; + NumUsr++) + Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].Remove = true; /***** 3. Get list of students marked as present by me: Gbl.Usrs.Selected.List[Rol_STD] *****/ Usr_GetListsSelectedUsrsCods (); @@ -2367,12 +2367,12 @@ void Att_RegisterStudentsInAttEvent (void) Usr_GetUsrCodFromEncryptedUsrCod (&UsrData); if (UsrData.UsrCod > 0) // Student exists in database /***** Mark student to not be removed *****/ - for (NumStd = 0; - NumStd < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; - NumStd++) - if (Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].UsrCod == UsrData.UsrCod) + for (NumUsr = 0; + NumUsr < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; + NumUsr++) + if (Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod == UsrData.UsrCod) { - Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].Remove = false; + Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].Remove = false; break; // Found! Exit loop } } @@ -2386,28 +2386,28 @@ void Att_RegisterStudentsInAttEvent (void) // 5. Delete from att_usr all the students marked as Remove=true // 6. Replace (insert without duplicated) into att_usr all the students marked as Remove=false - for (NumStd = 0, NumStdsAbsent = NumStdsPresent = 0; - NumStd < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; - NumStd++) + for (NumUsr = 0, NumStdsAbsent = NumStdsPresent = 0; + NumUsr < Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs; + NumUsr++) { /***** Get comments for this student *****/ - Att_CheckIfUsrIsPresentInAttEventAndGetComments (Att.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].UsrCod,CommentStd,CommentTch); + Att_CheckIfUsrIsPresentInAttEventAndGetComments (Att.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod,CommentStd,CommentTch); snprintf (CommentParamName,sizeof (CommentParamName), "CommentTch%ld", - Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].UsrCod); + Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod); Par_GetParToHTML (CommentParamName,CommentTch,Cns_MAX_BYTES_TEXT); - Present = !Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].Remove; + Present = !Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].Remove; if (Present || CommentStd[0] || CommentTch[0]) /***** Register student *****/ - Att_RegUsrInAttEventChangingComments (Att.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].UsrCod, + Att_RegUsrInAttEventChangingComments (Att.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod, Present,CommentStd,CommentTch); else /***** Remove student *****/ - Att_RemoveUsrFromAttEvent (Att.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumStd].UsrCod); + Att_RemoveUsrFromAttEvent (Att.AttCod,Gbl.Usrs.LstUsrs[Rol_STD].Lst[NumUsr].UsrCod); if (Present) NumStdsPresent++; @@ -2455,38 +2455,38 @@ static void Att_GetNumStdsTotalWhoAreInAttEvent (struct AttendanceEvent *Att) /******* Get number of students from a list who attended to an event *********/ /*****************************************************************************/ -static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumStdsInList) +static unsigned Att_GetNumStdsFromAListWhoAreInAttEvent (long AttCod,long LstSelectedUsrCods[],unsigned NumUsrsInList) { char *SubQueryAllUsrs = NULL; char SubQueryOneUsr[1 + 1 + 10 + 1]; - unsigned NumStd; + unsigned NumUsr; unsigned NumStdsInAttEvent = 0; size_t MaxLength; - if (NumStdsInList) + if (NumUsrsInList) { /***** Allocate space for subquery *****/ - MaxLength = 256 + NumStdsInList * (1 + 1 + 10); + MaxLength = 256 + NumUsrsInList * (1 + 1 + 10); if ((SubQueryAllUsrs = (char *) malloc (MaxLength + 1)) == NULL) Lay_NotEnoughMemoryExit (); SubQueryAllUsrs[0] = '\0'; /***** Count number of students registered in an event in database *****/ - for (NumStd = 0; - NumStd < NumStdsInList; - NumStd++) - if (NumStd) + for (NumUsr = 0; + NumUsr < NumUsrsInList; + NumUsr++) + if (NumUsr) { snprintf (SubQueryOneUsr,sizeof (SubQueryOneUsr), ",%ld", - LstSelectedUsrCods[NumStd]); + LstSelectedUsrCods[NumUsr]); Str_Concat (SubQueryAllUsrs,SubQueryOneUsr, MaxLength); } else snprintf (SubQueryAllUsrs,sizeof (SubQueryOneUsr), "%ld", - LstSelectedUsrCods[NumStd]); + LstSelectedUsrCods[NumUsr]); NumStdsInAttEvent = (unsigned) DB_QueryCOUNT ("can not get number of students" @@ -2676,93 +2676,23 @@ void Att_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod) } /*****************************************************************************/ -/********* Request listing attendance of students to several events **********/ +/********** Request listing attendance of users to several events ************/ /*****************************************************************************/ void Usr_ReqListStdsAttendanceCrs (void) { extern const char *Hlp_USERS_Attendance_attendance_list; - extern const char *Txt_Attendance; - extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; + extern const char *Txt_Attendance_list; extern const char *Txt_View_attendance; /***** Get list of attendance events *****/ Att_GetListAttEvents (Att_OLDEST_FIRST); - /***** Get and update type of list, - number of columns in class photo - and preference about view photos *****/ - Usr_GetAndUpdatePrefsAboutUsrList (); - - /***** Get groups to show ******/ - Grp_GetParCodsSeveralGrpsToShowUsrs (); - - /***** Get and order lists of users from current course *****/ - Usr_GetListUsrs (Hie_CRS,Rol_STD); - - /***** Start box *****/ - Box_StartBox (NULL,Txt_Attendance,Att_PutIconsStdsAttList, - Hlp_USERS_Attendance_attendance_list,Box_NOT_CLOSABLE); - - /***** Start box *****/ - Box_StartBox (NULL,Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],NULL, - NULL,Box_NOT_CLOSABLE); - - /***** Form to select groups *****/ - Grp_ShowFormToSelectSeveralGroups (Att_PutParamSelectedAttCod, - Grp_ONLY_MY_GROUPS); - - /***** Start section with user list *****/ - Lay_StartSection (Usr_USER_LIST_SECTION_ID); - - if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs) - { - if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs,NULL,NULL)) - { - /***** Get list of selected users *****/ - Usr_GetListsSelectedUsrsCods (); - - /***** Draw a class photo with students of the course *****/ - /* Form to select type of list used for select several users */ - Usr_ShowFormsToSelectUsrListType (NULL); - - /* Start form */ - Frm_StartForm (ActSeeLstStdAtt); - Grp_PutParamsCodGrps (); - - /* Write list of students to select some of them */ - Tbl_StartTableCenter (0); - Usr_ListUsersToSelect (Rol_STD); - Tbl_EndTable (); - - /* Send button */ - Btn_PutConfirmButton (Txt_View_attendance); - - /* End form */ - Frm_EndForm (); - - /***** Free memory used by list of selected users' codes *****/ - Usr_FreeListsSelectedUsrsCods (); - } - } - else // Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs == 0 - /***** Show warning indicating no students found *****/ - Usr_ShowWarningNoUsersFound (Rol_STD); - - /***** End section with user list *****/ - Lay_EndSection (); - - /***** End box *****/ - Box_EndBox (); - - /***** End box *****/ - Box_EndBox (); - - /***** Free memory for students list *****/ - Usr_FreeUsrsList (Rol_STD); - - /***** Free memory for list of selected groups *****/ - Grp_FreeListCodSelectedGrps (); + /***** List users to select some of them *****/ + Usr_PutFormToSelectUsrsToGoToAct (ActSeeLstUsrAtt,NULL, + Txt_Attendance_list, + Hlp_USERS_Attendance_attendance_list, + Txt_View_attendance); /***** Free list of attendance events *****/ Att_FreeListAttEvents (); @@ -2823,7 +2753,7 @@ static void Usr_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView) Usr_GetMyPrefAboutListWithPhotosFromDB (); /***** Show table with attendances for every student in list *****/ - Att_ListStdsAttendanceTable (TypeOfView,1,&Gbl.Usrs.Me.UsrDat.UsrCod); + Att_ListUsrsAttendanceTable (TypeOfView,1,&Gbl.Usrs.Me.UsrDat.UsrCod); /***** Show details or put button to show details *****/ if (Gbl.AttEvents.ShowDetails) @@ -2843,25 +2773,25 @@ static void Usr_ListOrPrintMyAttendanceCrs (Att_TypeOfView_t TypeOfView) } /*****************************************************************************/ -/************* List attendance of students to several events *****************/ +/*************** List attendance of users to several events ******************/ /*****************************************************************************/ -void Usr_ListStdsAttendanceCrs (void) +void Usr_ListUsrsAttendanceCrs (void) { - Usr_ListOrPrintStdsAttendanceCrs (Att_NORMAL_VIEW_STUDENTS); + Usr_ListOrPrintUsrsAttendanceCrs (Att_NORMAL_VIEW_STUDENTS); } -void Usr_PrintStdsAttendanceCrs (void) +void Usr_PrintUsrsAttendanceCrs (void) { - Usr_ListOrPrintStdsAttendanceCrs (Att_PRINT_VIEW); + Usr_ListOrPrintUsrsAttendanceCrs (Att_PRINT_VIEW); } -static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView) +static void Usr_ListOrPrintUsrsAttendanceCrs (Att_TypeOfView_t TypeOfView) { extern const char *Hlp_USERS_Attendance_attendance_list; - extern const char *Txt_Attendance; + extern const char *Txt_Attendance_list; extern const char *Txt_You_must_select_one_ore_more_users; - unsigned NumStdsInList; + unsigned NumUsrsInList; long *LstSelectedUsrCods; unsigned NumAttEvent; @@ -2872,7 +2802,7 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView) Usr_GetListsSelectedUsrsCods (); /* Check the number of students to list */ - if ((NumStdsInList = Usr_CountNumUsrsInListOfSelectedUsrs ())) + if ((NumUsrsInList = Usr_CountNumUsrsInListOfSelectedUsrs ())) { /***** Get boolean parameter that indicates if details must be shown *****/ Gbl.AttEvents.ShowDetails = Par_GetParToBool ("ShowDetails"); @@ -2881,7 +2811,7 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView) Grp_GetParCodsSeveralGrpsToShowUsrs (); /***** Get list of students selected to show their attendances *****/ - Att_GetListSelectedUsrCods (NumStdsInList,&LstSelectedUsrCods); + Att_GetListSelectedUsrCods (NumUsrsInList,&LstSelectedUsrCods); /***** Get number of students in each event *****/ for (NumAttEvent = 0; @@ -2889,13 +2819,13 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView) NumAttEvent++) /* Get number of students in this event */ Gbl.AttEvents.Lst[NumAttEvent].NumStdsFromList = Att_GetNumStdsFromAListWhoAreInAttEvent (Gbl.AttEvents.Lst[NumAttEvent].AttCod, - LstSelectedUsrCods,NumStdsInList); + LstSelectedUsrCods,NumUsrsInList); /***** Get list of attendance events selected *****/ Att_GetListSelectedAttCods (&Gbl.AttEvents.StrAttCodsSelected); /***** Start box *****/ - Box_StartBox (NULL,Txt_Attendance, + Box_StartBox (NULL,Txt_Attendance_list, TypeOfView == Att_NORMAL_VIEW_STUDENTS ? Att_PutIconsStdsAttList : NULL, TypeOfView == Att_NORMAL_VIEW_STUDENTS ? Hlp_USERS_Attendance_attendance_list : @@ -2909,11 +2839,11 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView) Usr_GetMyPrefAboutListWithPhotosFromDB (); /***** Show table with attendances for every student in list *****/ - Att_ListStdsAttendanceTable (TypeOfView,NumStdsInList,LstSelectedUsrCods); + Att_ListUsrsAttendanceTable (TypeOfView,NumUsrsInList,LstSelectedUsrCods); /***** Show details or put button to show details *****/ if (Gbl.AttEvents.ShowDetails) - Att_ListStdsWithAttEventsDetails (NumStdsInList,LstSelectedUsrCods); + Att_ListStdsWithAttEventsDetails (NumUsrsInList,LstSelectedUsrCods); /***** End box *****/ Box_EndBox (); @@ -2944,28 +2874,28 @@ static void Usr_ListOrPrintStdsAttendanceCrs (Att_TypeOfView_t TypeOfView) /********** Get list of students selected to show their attendances **********/ /*****************************************************************************/ -static void Att_GetListSelectedUsrCods (unsigned NumStdsInList,long **LstSelectedUsrCods) +static void Att_GetListSelectedUsrCods (unsigned NumUsrsInList,long **LstSelectedUsrCods) { - unsigned NumStd; + unsigned NumUsr; const char *Ptr; struct UsrData UsrDat; /***** Create list of user codes *****/ - if ((*LstSelectedUsrCods = (long *) calloc ((size_t) NumStdsInList,sizeof (long))) == NULL) + if ((*LstSelectedUsrCods = (long *) calloc ((size_t) NumUsrsInList,sizeof (long))) == NULL) Lay_NotEnoughMemoryExit (); /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); /***** Loop over the list Gbl.Usrs.Selected.List[Rol_UNK] getting users' codes *****/ - for (NumStd = 0, Ptr = Gbl.Usrs.Selected.List[Rol_UNK]; - NumStd < NumStdsInList && *Ptr; - NumStd++) + for (NumUsr = 0, Ptr = Gbl.Usrs.Selected.List[Rol_UNK]; + NumUsr < NumUsrsInList && *Ptr; + NumUsr++) { Par_GetNextStrUntilSeparParamMult (&Ptr,UsrDat.EncryptedUsrCod, Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64); Usr_GetUsrCodFromEncryptedUsrCod (&UsrDat); - (*LstSelectedUsrCods)[NumStd] = UsrDat.UsrCod; + (*LstSelectedUsrCods)[NumUsr] = UsrDat.UsrCod; } /***** Free memory used for user's data *****/ @@ -3110,7 +3040,7 @@ static void Att_PutFormToPrintMyListParams (void) static void Att_PutIconsStdsAttList (void) { /***** Put icon to print assistance of students to several events *****/ - Ico_PutContextualIconToPrint (ActPrnLstStdAtt,Att_PutParamsToPrintStdsList); + Ico_PutContextualIconToPrint (ActPrnLstUsrAtt,Att_PutParamsToPrintStdsList); /***** Put icon to print my QR code *****/ QR_PutLinkToPrintQRCode (ActPrnUsrQR,Usr_PutParamMyUsrCodEncrypted); @@ -3121,7 +3051,7 @@ static void Att_PutParamsToPrintStdsList (void) if (Gbl.AttEvents.ShowDetails) Par_PutHiddenParamChar ("ShowDetails",'Y'); Grp_PutParamsCodGrps (); - Usr_PutHiddenParUsrCodAll (ActPrnLstStdAtt,Gbl.Usrs.Selected.List[Rol_UNK]); + Usr_PutHiddenParUsrCodAll (ActPrnLstUsrAtt,Gbl.Usrs.Selected.List[Rol_UNK]); if (Gbl.AttEvents.StrAttCodsSelected) if (Gbl.AttEvents.StrAttCodsSelected[0]) Par_PutHiddenParamString ("AttCods",Gbl.AttEvents.StrAttCodsSelected); @@ -3291,16 +3221,16 @@ static void Att_PutIconToViewAttEvents (void) } /*****************************************************************************/ -/*********** Show table with attendances for every student in list ***********/ +/************ Show table with attendances for every user in list *************/ /*****************************************************************************/ -static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, - unsigned NumStdsInList, +static void Att_ListUsrsAttendanceTable (Att_TypeOfView_t TypeOfView, + unsigned NumUsrsInList, long *LstSelectedUsrCods) { - extern const char *Txt_Number_of_students; + extern const char *Txt_Number_of_users; struct UsrData UsrDat; - unsigned NumStd; + unsigned NumUsr; unsigned NumAttEvent; unsigned Total; bool PutButtonShowDetails = (TypeOfView != Att_PRINT_VIEW && @@ -3318,22 +3248,22 @@ static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, /***** Heading row *****/ Att_WriteTableHeadSeveralAttEvents (); - /***** List the students *****/ - for (NumStd = 0, Gbl.RowEvenOdd = 0; - NumStd < NumStdsInList; - NumStd++) + /***** List the users *****/ + for (NumUsr = 0, Gbl.RowEvenOdd = 0; + NumUsr < NumUsrsInList; + NumUsr++) { - UsrDat.UsrCod = LstSelectedUsrCods[NumStd]; + UsrDat.UsrCod = LstSelectedUsrCods[NumUsr]; if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS)) // Get from the database the data of the student if (Usr_CheckIfICanViewAtt (&UsrDat)) { UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&UsrDat); - Att_WriteRowStdSeveralAttEvents (NumStd,&UsrDat); + Att_WriteRowUsrSeveralAttEvents (NumUsr,&UsrDat); } } - /***** Last row with the total of students present in each event *****/ - if (NumStdsInList > 1) + /***** Last row with the total of users present in each event *****/ + if (NumUsrsInList > 1) { fprintf (Gbl.F.Out,"" "" @@ -3341,7 +3271,7 @@ static void Att_ListStdsAttendanceTable (Att_TypeOfView_t TypeOfView, "", Gbl.Usrs.Listing.WithPhotos ? 4 : 3, - Txt_Number_of_students); + Txt_Number_of_users); for (NumAttEvent = 0, Total = 0; NumAttEvent < Gbl.AttEvents.Num; NumAttEvent++) @@ -3391,7 +3321,7 @@ static void Att_WriteTableHeadSeveralAttEvents (void) "", Gbl.Usrs.Listing.WithPhotos ? 4 : 3, - Txt_ROLES_SINGUL_Abc[Rol_STD][Usr_SEX_UNKNOWN]); + Txt_ROLES_SINGUL_Abc[Rol_USR][Usr_SEX_UNKNOWN]); for (NumAttEvent = 0; NumAttEvent < Gbl.AttEvents.Num; @@ -3422,10 +3352,10 @@ static void Att_WriteTableHeadSeveralAttEvents (void) } /*****************************************************************************/ -/************ Write a row of a table with the data of a student **************/ +/************** Write a row of a table with the data of a user ***************/ /*****************************************************************************/ -static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *UsrDat) +static void Att_WriteRowUsrSeveralAttEvents (unsigned NumUsr,struct UsrData *UsrDat) { char PhotoURL[PATH_MAX + 1]; bool ShowPhoto; @@ -3433,7 +3363,7 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr bool Present; unsigned NumTimesPresent; - /***** Write number of student in the list *****/ + /***** Write number of user in the list *****/ fprintf (Gbl.F.Out,"" "" "%u" @@ -3441,9 +3371,9 @@ static void Att_WriteRowStdSeveralAttEvents (unsigned NumStd,struct UsrData *Usr UsrDat->Accepted ? "DAT_N" : "DAT", Gbl.RowEvenOdd, - NumStd + 1); + NumUsr + 1); - /***** Show student's photo *****/ + /***** Show user's photo *****/ if (Gbl.Usrs.Listing.WithPhotos) { fprintf (Gbl.F.Out,""); - /***** Write student's name *****/ + /***** Write user's name *****/ fprintf (Gbl.F.Out,"" "%s", UsrDat->Accepted ? "DAT_SMALL_N" : @@ -3535,12 +3465,12 @@ static void Att_PutCheckOrCross (bool Present) /**************** List the students with details and comments ****************/ /*****************************************************************************/ -static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList, +static void Att_ListStdsWithAttEventsDetails (unsigned NumUsrsInList, long *LstSelectedUsrCods) { extern const char *Txt_Details; struct UsrData UsrDat; - unsigned NumStd; + unsigned NumUsr; /***** Initialize structure with user's data *****/ Usr_UsrDataConstructor (&UsrDat); @@ -3553,16 +3483,16 @@ static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList, NULL,Box_NOT_CLOSABLE,2); /***** List students with attendance details *****/ - for (NumStd = 0, Gbl.RowEvenOdd = 0; - NumStd < NumStdsInList; - NumStd++) + for (NumUsr = 0, Gbl.RowEvenOdd = 0; + NumUsr < NumUsrsInList; + NumUsr++) { - UsrDat.UsrCod = LstSelectedUsrCods[NumStd]; + UsrDat.UsrCod = LstSelectedUsrCods[NumUsr]; if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,Usr_DONT_GET_PREFS)) // Get from the database the data of the student if (Usr_CheckIfICanViewAtt (&UsrDat)) { UsrDat.Accepted = Usr_CheckIfUsrHasAcceptedInCurrentCrs (&UsrDat); - Att_ListAttEventsForAStd (NumStd,&UsrDat); + Att_ListAttEventsForAStd (NumUsr,&UsrDat); } } @@ -3580,7 +3510,7 @@ static void Att_ListStdsWithAttEventsDetails (unsigned NumStdsInList, /*************** Write list of attendance events for a student ***************/ /*****************************************************************************/ -static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) +static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat) { extern const char *Txt_Today; extern const char *Txt_Student_comment; @@ -3596,7 +3526,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) char CommentTch[Cns_MAX_BYTES_TEXT + 1]; /***** Write number of student in the list *****/ - NumStd++; + NumUsr++; fprintf (Gbl.F.Out,"" "" "%u:" @@ -3604,7 +3534,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) UsrDat->Accepted ? "DAT_N" : "DAT", Gbl.RowEvenOdd, - NumStd); + NumUsr); /***** Show student's photo *****/ fprintf (Gbl.F.Out,"", @@ -3682,9 +3612,9 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat) "" "", Gbl.RowEvenOdd, - NumStd,UniqueId, + NumUsr,UniqueId, Gbl.AttEvents.Lst[NumAttEvent].Title, - NumStd,UniqueId, + NumUsr,UniqueId, Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME], (unsigned) Gbl.Prefs.DateFormat,Txt_Today); diff --git a/swad_attendance.h b/swad_attendance.h index a57cf634..3ed01b77 100644 --- a/swad_attendance.h +++ b/swad_attendance.h @@ -120,7 +120,7 @@ void Att_RemoveUsrsAbsentWithoutCommentsFromAttEvent (long AttCod); void Usr_ReqListStdsAttendanceCrs (void); void Usr_ListMyAttendanceCrs (void); void Usr_PrintMyAttendanceCrs (void); -void Usr_ListStdsAttendanceCrs (void); -void Usr_PrintStdsAttendanceCrs (void); +void Usr_ListUsrsAttendanceCrs (void); +void Usr_PrintUsrsAttendanceCrs (void); #endif diff --git a/swad_changelog.h b/swad_changelog.h index 4cac1513..f533014a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -456,10 +456,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.111 (2019-04-11)" +#define Log_PLATFORM_VERSION "SWAD 18.112 (2019-04-11)" #define CSS_FILE "swad18.92.css" #define JS_FILE "swad18.92.js" /* + Version 18.112: Apr 11, 2019 Code refactoring related to attendance. (242538 lines) Version 18.111: Apr 11, 2019 New option to select users to compose an email to them. (242541 lines) 1 change necessary in database: INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1772','es','N','Seleccionar usuarios para envío correo'); diff --git a/swad_file_browser.c b/swad_file_browser.c index 783cfbd7..1fca59db 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3051,6 +3051,7 @@ static bool Brw_CheckIfQuotaExceded (void) void Brw_AskEditWorksCrs (void) { extern const char *Hlp_FILES_Homework_for_teachers; + extern const char *Txt_Assignments_and_other_works; extern const char *Txt_View_homework; /***** Get parameters related to file browser *****/ @@ -3058,6 +3059,7 @@ void Brw_AskEditWorksCrs (void) /***** List users to select some of them *****/ Usr_PutFormToSelectUsrsToGoToAct (ActAdmAsgWrkCrs,NULL, + Txt_Assignments_and_other_works, Hlp_FILES_Homework_for_teachers, Txt_View_homework); } diff --git a/swad_follow.c b/swad_follow.c index ab9a7361..cbe289cc 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -1184,7 +1184,7 @@ static void Fol_RequestUnfollowUsrs (Act_Action_t NextAction,void (*FuncParams) static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed, unsigned *NumNotFollowed) { - extern const char *Txt_Select_users_X_Followed_Y_Not_followed_Z; + extern const char *Txt_Selected_users_X_Followed_Y_Not_followed_Z; struct UsrData UsrDat; const char *Ptr; bool IFollowUsr; @@ -1221,7 +1221,7 @@ static void Fol_GetFollowedFromSelectedUsrs (unsigned *NumFollowed, /***** Show alert ****/ *NumNotFollowed = NumUsrs - *NumFollowed; - Ale_ShowAlert (Ale_INFO,Txt_Select_users_X_Followed_Y_Not_followed_Z, + Ale_ShowAlert (Ale_INFO,Txt_Selected_users_X_Followed_Y_Not_followed_Z, NumUsrs,*NumFollowed,*NumNotFollowed); } diff --git a/swad_mail.c b/swad_mail.c index 1bfb8357..87511d0a 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -883,10 +883,12 @@ static void Mai_CreateMailDomain (struct Mail *Mai) void Mai_ReqUsrsToListEmails (void) { extern const char *Hlp_MESSAGES_Email; + extern const char *Txt_Email; extern const char *Txt_View_email_addresses; /***** List users to select some of them *****/ Usr_PutFormToSelectUsrsToGoToAct (ActMaiUsr,NULL, + Txt_Email, Hlp_MESSAGES_Email, Txt_View_email_addresses); } diff --git a/swad_project.c b/swad_project.c index 2b52a4f9..c6ab664a 100644 --- a/swad_project.c +++ b/swad_project.c @@ -1555,7 +1555,7 @@ static void Prj_ShowOneProjectMembersWithARole (const struct Project *Prj, extern const char *Txt_PROJECT_ROLES_SINGUL_Abc[Prj_NUM_ROLES_IN_PROJECT]; extern const char *Txt_PROJECT_ROLES_PLURAL_Abc[Prj_NUM_ROLES_IN_PROJECT]; extern const char *Txt_Remove; - extern const char *Txt_Add_USER; + extern const char *Txt_Add_USERS; extern const char *Txt_PROJECT_ROLES_PLURAL_abc[Prj_NUM_ROLES_IN_PROJECT]; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -1700,7 +1700,7 @@ static void Prj_ShowOneProjectMembersWithARole (const struct Project *Prj, ""); Gbl.Prjs.PrjCod = Prj->PrjCod; // Used to pass project code as a parameter snprintf (Gbl.Title,sizeof (Gbl.Title), - Txt_Add_USER, + Txt_Add_USERS, Txt_PROJECT_ROLES_PLURAL_abc[RoleInProject]); Ico_PutContextualIconToAdd (ActionReqAddUsr[RoleInProject],NULL, Prj_PutCurrentParams, @@ -1886,7 +1886,7 @@ void Prj_ReqAddEvls (void) static void Prj_ReqAddUsrs (Prj_RoleInProject_t RoleInProject) { extern const char *Hlp_ASSESSMENT_Projects_add_user; - extern const char *Txt_Add_USER; + extern const char *Txt_Add_USERS; extern const char *Txt_PROJECT_ROLES_PLURAL_abc[Prj_NUM_ROLES_IN_PROJECT]; static Act_Action_t ActionAddUsr[Prj_NUM_ROLES_IN_PROJECT] = { @@ -1903,9 +1903,10 @@ static void Prj_ReqAddUsrs (Prj_RoleInProject_t RoleInProject) /***** Put form to select users *****/ snprintf (TxtButton,sizeof (TxtButton), - Txt_Add_USER, + Txt_Add_USERS, Txt_PROJECT_ROLES_PLURAL_abc[RoleInProject]); Usr_PutFormToSelectUsrsToGoToAct (ActionAddUsr[RoleInProject],Prj_PutCurrentParams, + TxtButton, Hlp_ASSESSMENT_Projects_add_user, TxtButton); diff --git a/swad_record.c b/swad_record.c index ed0bc8e5..55379dc1 100644 --- a/swad_record.c +++ b/swad_record.c @@ -2587,7 +2587,7 @@ static void Rec_PutIconsCommands (void) "calendar-check.svg", Txt_View_attendance); else // Not me - Lay_PutContextualLinkOnlyIcon (ActSeeLstStdAtt,NULL, + Lay_PutContextualLinkOnlyIcon (ActSeeLstUsrAtt,NULL, Rec_PutParamsStudent, "calendar-check.svg", Txt_View_attendance); diff --git a/swad_text.c b/swad_text.c index 490b8974..1679b4fa 100644 --- a/swad_text.c +++ b/swad_text.c @@ -1820,7 +1820,7 @@ const char *Txt_Add_this_ID = "Adicionar este nº identif."; #endif -const char *Txt_Add_USER = // Warning: it is very important to include %s in the following sentences +const char *Txt_Add_USERS = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "Afegir %s"; #elif L==2 // de @@ -27592,6 +27592,27 @@ const char *Txt_Number_BR_of_test_BR_questions = "Nº de
questões
de test"; #endif +const char *Txt_Number_of_users = +#if L==1 // ca + "Nombre d'usuaris"; +#elif L==2 // de + "Anzahl der Benutzer"; +#elif L==3 // en + "Number of users"; +#elif L==4 // es + "Nº de usuarios"; +#elif L==5 // fr + "Nombre d'utilisateurs"; +#elif L==6 // gn + "Nº de usuarios"; // Okoteve traducción +#elif L==7 // it + "Numero di utenti"; +#elif L==8 // pl + "Liczba uzytkowników"; +#elif L==9 // pt + "Nº de utilizadores"; +#endif + const char *Txt_Numeric_BR_code_BR_ISO_3166_1 = #if L==1 // ca "Cód.
numérico
ISO 3166-1"; // Necessita traduccio @@ -37904,7 +37925,28 @@ const char *Txt_Select_the_groups_in_from_which_you_want_to_register_remove_user " ou serão removidos da disciplina e de todos os grupos."; #endif -const char *Txt_Select_users_X_Followed_Y_Not_followed_Z = // Warning: it is very important to include three %u in the following sentences +const char *Txt_Select_users = +#if L==1 // ca + "Seleccioneu usuaris"; +#elif L==2 // de + "Wählen Sie Benutzer aus"; +#elif L==3 // en + "Select users"; +#elif L==4 // es + "Seleccione usuarios"; +#elif L==5 // fr + "Sélectionnez des utilisateurs"; +#elif L==6 // gn + "Seleccione usuarios"; // Okoteve traducción +#elif L==7 // it + "Seleziona utenti"; +#elif L==8 // pl + "Wybierz użytkowników"; +#elif L==9 // pt + "Selecione usuários"; +#endif + +const char *Txt_Selected_users_X_Followed_Y_Not_followed_Z = // Warning: it is very important to include three %u in the following sentences #if L==1 // ca "Usuaris seleccionats: %u
" "• Seguits: %u
" diff --git a/swad_user.c b/swad_user.c index 4b9fb10f..a9cb5c1f 100644 --- a/swad_user.c +++ b/swad_user.c @@ -1377,24 +1377,20 @@ bool Usr_CheckIfICanViewAtt (const struct UsrData *UsrDat) if (Gbl.Hierarchy.Crs.CrsCod <= 0) return false; - /***** 4. Fast check: Is he/she a student in the current course? *****/ - if (UsrDat->Roles.InCurrentCrs.Role != Rol_STD) - return false; - - /***** 5. Fast check: Am I a system admin? *****/ + /***** 4. Fast check: Am I a system admin? *****/ if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) return true; - /***** 6. Fast check: Do I belong to the current course? *****/ + /***** 5. Fast check: Do I belong to the current course? *****/ if (!Gbl.Usrs.Me.IBelongToCurrentCrs) return false; - /***** 7. Fast check: It's me? *****/ + /***** 6. Fast check: It's me? *****/ ItsMe = Usr_ItsMe (UsrDat->UsrCod); if (ItsMe) return true; - /***** 8. Fast / slow check depending on roles *****/ + /***** 7. Fast / slow check depending on roles *****/ switch (Gbl.Usrs.Me.Role.Logged) { case Rol_NET: @@ -6101,12 +6097,16 @@ static void Usr_FormToSelectUsrListType (void (*FuncParams) (void), /*****************************************************************************/ void Usr_PutFormToSelectUsrsToGoToAct (Act_Action_t NextAction,void (*FuncParams) (), + const char *Title, const char *HelpLink, const char *TxtButton) { - extern const char *Txt_Users; + extern const char *Txt_Select_users; unsigned NumTotalUsrs; + /***** Start box *****/ + Box_StartBox (NULL,Title,NULL,HelpLink,Box_NOT_CLOSABLE); + /***** Get and update type of list, number of columns in class photo and preference about view photos *****/ @@ -6127,7 +6127,7 @@ void Usr_PutFormToSelectUsrsToGoToAct (Act_Action_t NextAction,void (*FuncParams Gbl.Usrs.LstUsrs[Rol_TCH].NumUsrs; /***** Draw class photos to select users *****/ - Box_StartBox (NULL,Txt_Users,NULL,HelpLink,Box_NOT_CLOSABLE); + Box_StartBox (NULL,Txt_Select_users,NULL,HelpLink,Box_NOT_CLOSABLE); /***** Show form to select the groups *****/ Grp_ShowFormToSelectSeveralGroups (FuncParams, @@ -6188,6 +6188,9 @@ void Usr_PutFormToSelectUsrsToGoToAct (Act_Action_t NextAction,void (*FuncParams /***** Free memory for list of selected groups *****/ Grp_FreeListCodSelectedGrps (); + + /***** End box *****/ + Box_EndBox (); } void Usr_GetSelectedUsrsAndGoToAct (void (*FuncWhenUsrsSelected) (), @@ -8419,7 +8422,7 @@ void Usr_DoActionOnSeveralUsrs1 (void) switch (Gbl.Action.Act) { case ActDoActOnSevStd: - Gbl.Action.Act = ActSeeLstStdAtt; + Gbl.Action.Act = ActSeeLstUsrAtt; break; default: break; diff --git a/swad_user.h b/swad_user.h index 959f25fb..5a4769fa 100644 --- a/swad_user.h +++ b/swad_user.h @@ -426,6 +426,7 @@ void Usr_SetUsrDatMainFieldNames (void); void Usr_WriteHeaderFieldsUsrDat (bool PutCheckBoxToSelectUsr); void Usr_PutFormToSelectUsrsToGoToAct (Act_Action_t NextAction,void (*FuncParams) (), + const char *Title, const char *HelpLink, const char *TxtButton); void Usr_GetSelectedUsrsAndGoToAct (void (*FuncWhenUsrsSelected) (),