diff --git a/swad_attendance.c b/swad_attendance.c index c090d106a..f7bb929c4 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -1935,7 +1935,7 @@ static void Att_ListAttStudents (struct AttendanceEvent *Att) Hlp_USERS_Attendance,Box_NOT_CLOSABLE); /***** Form to select groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActSeeOneAtt); + Grp_ShowFormToSelectSeveralGroups (ActSeeOneAtt,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); @@ -2672,7 +2672,7 @@ void Usr_ReqListStdsAttendanceCrs (void) Hlp_USERS_Attendance_attendance_list,Box_NOT_CLOSABLE); /***** Form to select groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActReqLstStdAtt); + Grp_ShowFormToSelectSeveralGroups (ActReqLstStdAtt,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); diff --git a/swad_changelog.h b/swad_changelog.h index ebf7e8c4f..89aaa80df 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -236,13 +236,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.247 (2017-06-20)" +#define Log_PLATFORM_VERSION "SWAD 16.247.1 (2017-06-23)" #define CSS_FILE "swad16.235.1.css" #define JS_FILE "swad16.206.3.js" // 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 sql/swad*.sql | tail -1 /* + Version 16.247.1: Jun 23, 2017 Non-editing teachers can select all groups when writing a message. (222068 lines) Version 16.247: Jun 20, 2017 Fixed bug when removing a user from a course. Code refactoring related with caches. (222063 lines) Version 16.246: Jun 20, 2017 Fixed bugs and code refactoring in groups. (221975 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 198f618d1..e1ee90d88 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3124,7 +3124,7 @@ void Brw_AskEditWorksCrs (void) Hlp_FILES_Homework_for_teachers,Box_NOT_CLOSABLE); /***** Show form to select the groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActReqAsgWrkCrs); + Grp_ShowFormToSelectSeveralGroups (ActReqAsgWrkCrs,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); diff --git a/swad_group.c b/swad_group.c index ef9692e5d..d2fa1ef77 100644 --- a/swad_group.c +++ b/swad_group.c @@ -90,7 +90,7 @@ static void Grp_EditGroups (void); static void Grp_PutIconsEditingGroups (void); static void Grp_PutIconToCreateNewGroup (void); -static void Grp_PutCheckboxAllGrps (void); +static void Grp_PutCheckboxAllGrps (bool AllGroupsSelectable); static void Grp_ConstructorListGrpAlreadySelec (struct ListGrpsAlreadySelec **AlreadyExistsGroupOfType); static void Grp_DestructorListGrpAlreadySelec (struct ListGrpsAlreadySelec **AlreadyExistsGroupOfType); @@ -111,7 +111,8 @@ static void Grp_ShowWarningToStdsToChangeGrps (void); static bool Grp_ListGrpsForChangeMySelection (struct GroupType *GrpTyp, unsigned *NumGrpsThisTypeIBelong); static void Grp_ListGrpsToAddOrRemUsrs (struct GroupType *GrpTyp,long UsrCod); -static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp); +static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp, + bool AllGroupsSelectable); static void Grp_WriteGrpHead (struct GroupType *GrpTyp); static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight); static void Grp_PutFormToCreateGroupType (void); @@ -346,7 +347,7 @@ static void Grp_PutIconToCreateNewGroup (void) /*************** Show form to select one or several groups *******************/ /*****************************************************************************/ -void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction) +void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction,bool AllGroupsSelectable) { extern const char *Hlp_USERS_Groups; extern const char *The_ClassFormBold[The_NUM_THEMES]; @@ -376,7 +377,7 @@ void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction) Usr_PutExtraParamsUsrList (NextAction); /***** Select all groups *****/ - Grp_PutCheckboxAllGrps (); + Grp_PutCheckboxAllGrps (AllGroupsSelectable); /***** Get list of groups types and groups in this course *****/ Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS); @@ -387,7 +388,8 @@ void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction) NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num; NumGrpTyp++) if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) - Grp_ListGrpsForMultipleSelection (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp]); + Grp_ListGrpsForMultipleSelection (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp], + AllGroupsSelectable); Tbl_EndTable (); /***** Free list of groups types and groups in this course *****/ @@ -415,7 +417,7 @@ void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction) /******************* Put checkbox to select all groups ***********************/ /*****************************************************************************/ -static void Grp_PutCheckboxAllGrps (void) +static void Grp_PutCheckboxAllGrps (bool AllGroupsSelectable) { extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_All_groups; @@ -424,7 +426,7 @@ static void Grp_PutCheckboxAllGrps (void) switch (Gbl.Usrs.Me.Role.Logged) { case Rol_NET: - ICanSelUnselGroup = false; + ICanSelUnselGroup = AllGroupsSelectable; break; case Rol_STD: case Rol_TCH: @@ -2128,7 +2130,8 @@ static void Grp_ListGrpsToAddOrRemUsrs (struct GroupType *GrpTyp,long UsrCod) /******* Write a list of groups as checkbox form for unique selection ********/ /*****************************************************************************/ -static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp) +static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp, + bool AllGroupsSelectable) { extern const char *Txt_users_with_no_group; unsigned NumGrpThisType; @@ -2164,7 +2167,8 @@ static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp) switch (Gbl.Usrs.Me.Role.Logged) { case Rol_NET: - ICanSelUnselGroup = IBelongToThisGroup; + ICanSelUnselGroup = AllGroupsSelectable || + IBelongToThisGroup; break; case Rol_STD: case Rol_TCH: diff --git a/swad_group.h b/swad_group.h index 12bc3ab82..a9965150c 100644 --- a/swad_group.h +++ b/swad_group.h @@ -135,7 +135,7 @@ typedef enum void Grp_WriteNamesOfSelectedGrps (void); void Grp_ReqEditGroups (void); -void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction); +void Grp_ShowFormToSelectSeveralGroups (Act_Action_t NextAction,bool AllGroupsSelectable); void Grp_PutParamsCodGrps (void); void Grp_GetParCodsSeveralGrpsToShowUsrs (void); void Grp_GetParCodsSeveralGrps (void); diff --git a/swad_mail.c b/swad_mail.c index a9a5e4fcd..37641ea30 100644 --- a/swad_mail.c +++ b/swad_mail.c @@ -892,7 +892,7 @@ void Mai_ListEmails (void) Hlp_MESSAGES_Email,Box_NOT_CLOSABLE); /***** Form to select groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActMaiStd); + Grp_ShowFormToSelectSeveralGroups (ActMaiStd,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); diff --git a/swad_message.c b/swad_message.c index bc2779d9e..f92b47209 100644 --- a/swad_message.c +++ b/swad_message.c @@ -238,7 +238,7 @@ static void Msg_PutFormMsgUsrs (char Content[Cns_MAX_BYTES_LONG_TEXT + 1]) if (GetUsrsInCrs) { /***** Form to select groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActReqMsgUsr); + Grp_ShowFormToSelectSeveralGroups (ActReqMsgUsr,true); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); diff --git a/swad_statistic.c b/swad_statistic.c index e68c7223a..d77f8c874 100644 --- a/swad_statistic.c +++ b/swad_statistic.c @@ -480,7 +480,7 @@ void Sta_AskShowCrsHits (void) Hlp_STATS_Visits_visits_to_course,Box_NOT_CLOSABLE); /***** Show form to select the groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActReqAccCrs); + Grp_ShowFormToSelectSeveralGroups (ActReqAccCrs,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); diff --git a/swad_test.c b/swad_test.c index 020967f10..6ee7affb0 100644 --- a/swad_test.c +++ b/swad_test.c @@ -6986,7 +6986,7 @@ void Tst_SelUsrsToSeeUsrsTestResults (void) Hlp_ASSESSMENT_Tests_test_results,Box_NOT_CLOSABLE); /***** Show form to select the groups *****/ - Grp_ShowFormToSelectSeveralGroups (ActReqSeeUsrTstRes); + Grp_ShowFormToSelectSeveralGroups (ActReqSeeUsrTstRes,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); diff --git a/swad_user.c b/swad_user.c index a2d9bc084..222f08823 100644 --- a/swad_user.c +++ b/swad_user.c @@ -7403,7 +7403,7 @@ void Usr_SeeStudents (void) /***** Form to select groups *****/ if (Gbl.Scope.Current == Sco_SCOPE_CRS) - Grp_ShowFormToSelectSeveralGroups (ActLstStd); + Grp_ShowFormToSelectSeveralGroups (ActLstStd,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID); @@ -7578,7 +7578,7 @@ void Usr_SeeTeachers (void) /***** Form to select groups *****/ if (Gbl.Scope.Current == Sco_SCOPE_CRS) - Grp_ShowFormToSelectSeveralGroups (ActLstTch); + Grp_ShowFormToSelectSeveralGroups (ActLstTch,false); /***** Start section with user list *****/ Lay_StartSection (Usr_USER_LIST_SECTION_ID);