diff --git a/swad_changelog.h b/swad_changelog.h index c3fb006b..6f01de88 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -432,8 +432,6 @@ Lo de mutear anuncios, en principio prefiero hacer una opci // TODO: Intentar aumentar la velocidad de carga del timeline (comprobar ralentización al mostrar la titulación de cada usuario) -// TODO: "Se podría poner un botón para seguir a todos los relacionados contigo en las asignaturas, en lugar de tener que agregarlos uno a uno" Suggested by José María girao Miras. - /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ @@ -453,14 +451,15 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.73 (2019-03-12)" +#define Log_PLATFORM_VERSION "SWAD 18.73.1 (2019-03-12)" #define CSS_FILE "swad18.68.3.css" #define JS_FILE "swad18.64.js" /* -Arreglar BUG: RMS no debería poder seleccionar todos los grupos al redactar mensajes -Arreglar BUG: A RMS le sale ACV al listar profesores, pero no al redactar mensajes +Arreglar BUG: RMS no debería poder seleccionar todos los grupos al redactar mensajes !!!!!!!!!!! +Arreglar BUG: A RMS le sale ACV al listar profesores, pero no al redactar mensajes !!!!!!!!!!! - Version 18.73: Mar 12, 2019 New actions to follow/unfollow several users. (239658 lines) + Version 18.73.1: Mar 12, 2019 Code refactoring in list of options when listing several users. (239569 lines) + Version 18.73: Mar 12, 2019 New actions to follow/unfollow several users. Suggested by José María Guirao Miras. (239658 lines) 14 changes necessary in database: UPDATE actions SET Txt='Ver fichas profesores' WHERE ActCod='22' AND Language='es'; UPDATE actions SET Txt='Ver fichas estudiantes' WHERE ActCod='89' AND Language='es'; @@ -481,11 +480,6 @@ INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1763','es','N','Deja Version 18.72.1: Mar 11, 2019 Show attendance list from list of users. (239075 lines) Version 18.72: Mar 11, 2019 Show homework from list of students and teachers. (239043 lines) Version 18.71: Mar 11, 2019 Listing of users now allow to do several actions. Not finished. (238920 lines) - 3 changes necessary in database: -UPDATE actions SET Txt='Realizar acción con varios profesores' WHERE ActCod='22' AND Language='es'; -UPDATE actions SET Txt='Realizar acción con varios estudiantes' WHERE ActCod='89' AND Language='es'; -UPDATE actions SET Txt='Realizar acción con varios invitados' WHERE ActCod='1187' AND Language='es'; - Version 18.70: Mar 10, 2019 Code refactoring in one user administration. (238819 lines) Version 18.69.2: Mar 10, 2019 Changes related to alerts. (238842 lines) Version 18.69.1: Mar 09, 2019 Changes in forms to register/remove users. (238805 lines) diff --git a/swad_global.c b/swad_global.c index a0d3dec5..2b2eb232 100644 --- a/swad_global.c +++ b/swad_global.c @@ -196,7 +196,7 @@ void Gbl_InitializeGlobals (void) Gbl.Action.Tab = TabUnk; Gbl.Usrs.Selected.Filled = false; // Lists of encrypted codes of users selected from form are not filled - Gbl.Usrs.Selected.Action = Usr_LIST_USRS_UNKNOWN_ACTION; + Gbl.Usrs.Selected.Option = Usr_OPTION_UNKNOWN; for (Role = (Rol_Role_t) 0; Role < Rol_NUM_ROLES; Role++) diff --git a/swad_global.h b/swad_global.h index 34f04a33..b6d2c373 100644 --- a/swad_global.h +++ b/swad_global.h @@ -397,7 +397,7 @@ struct Globals { char *List[Rol_NUM_ROLES]; // Lists of encrypted codes of users selected from a form bool Filled; // If lists are already filled/readed - Usr_ListUsrsAction_t Action; // What action I want to do with these selected users + Usr_ListUsrsOption_t Option; // What option I have selected to do with these selected users } Selected; char *ListOtherRecipients; // List of ID or nicks of users written explicitely on a form struct diff --git a/swad_text.c b/swad_text.c index 8d34ef7a..442230be 100644 --- a/swad_text.c +++ b/swad_text.c @@ -54999,11 +54999,11 @@ const char *Txt_You_have_stopped_following_X_users = // Warning: it is very impo #elif L==3 // en "You have stopped following %u users."; #elif L==4 // es - "Ha seguido a %u usuarios."; + "Ha dejado de seguir a %u usuarios."; #elif L==5 // fr "Vous avez cessé de suivre %u utilisateurs."; #elif L==6 // gn - "Ha seguido a %u usuarios."; // Okoteve traducción + "Ha dejado de seguir a %u usuarios."; // Okoteve traducción #elif L==7 // it "Hai smesso di seguire %u utenti."; #elif L==8 // pl diff --git a/swad_user.c b/swad_user.c index 1f725b8e..5d62082a 100644 --- a/swad_user.c +++ b/swad_user.c @@ -237,15 +237,9 @@ static void Usr_PutLinkToSeeAdmins (void); static void Usr_PutLinkToSeeGuests (void); static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole); -static void Usr_PutActionShowRecords (void); -static void Usr_PutActionShowHomework (void); -static void Usr_PutActionShowAttendance (void); -static void Usr_PutActionNewMessage (void); -static void Usr_PutActionFollowUsers (void); -static void Usr_PutActionUnfollowUsers (void); -static void Usr_StartListUsrsAction (Usr_ListUsrsAction_t ListUsrsAction); -static void Usr_EndListUsrsAction (void); -static Usr_ListUsrsAction_t Usr_ListUsrsAction (Usr_ListUsrsAction_t DefaultAction); +static void Usr_ShowOneListUsrsOption (Usr_ListUsrsOption_t ListUsrsAction, + const char *Label); +static Usr_ListUsrsOption_t Usr_GetListUsrsOption (Usr_ListUsrsOption_t DefaultAction); static void Usr_PutIconsListGsts (void); static void Usr_PutIconsListStds (void); @@ -8023,215 +8017,112 @@ void Usr_SeeTeachers (void) static bool Usr_PutActionsSeveralUsrs (Rol_Role_t UsrsRole) { extern const char *The_ClassFormInBox[The_NUM_THEMES]; - bool ICanViewRecords; - bool ICanViewHomework; - bool ICanViewAttendance; - bool ICanSendMessage; - bool ICanFollow; - bool ICanUnfollow; - bool OptionsShown = false; + extern const char *Txt_Show_records; + extern const char *Txt_View_homework; + extern const char *Txt_Show_attendance; + extern const char *Txt_Send_message; + extern const char *Txt_Follow; + extern const char *Txt_Unfollow; + const char *Label[Usr_LIST_USRS_NUM_OPTIONS] = + { + NULL, // Usr_OPTION_UNKNOWN + Txt_Show_records, // Usr_OPTION_RECORDS + Txt_View_homework, // Usr_OPTION_HOMEWORK + Txt_Show_attendance, // Usr_OPTION_ATTENDANCE + Txt_Send_message, // Usr_OPTION_MESSAGE + Txt_Follow, // Usr_OPTION_FOLLOW + Txt_Unfollow, // Usr_OPTION_UNFOLLOW + }; + bool ICanChooseOption[Usr_LIST_USRS_NUM_OPTIONS]; + Usr_ListUsrsOption_t Opt; + bool OptionsShown; - /***** Get the action to do *****/ - Gbl.Usrs.Selected.Action = Usr_ListUsrsAction (Usr_LIST_USRS_DEFAULT_ACTION); + /***** Get the selected option from form *****/ + Gbl.Usrs.Selected.Option = Usr_GetListUsrsOption (Usr_LIST_USRS_DEFAULT_OPTION); + /***** Check which options I can choose *****/ + /* Set default (I can not choose options) */ + for (Opt = (Usr_ListUsrsOption_t) 1; // Skip unknown option + Opt <= (Usr_ListUsrsOption_t) (Usr_LIST_USRS_NUM_OPTIONS - 1); + Opt++) + ICanChooseOption[Opt] = false; + + /* Activate some options depending on users' role, on my role, etc. */ switch (UsrsRole) { case Rol_GST: - ICanViewRecords = (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); - - ICanViewHomework = - ICanViewAttendance = - ICanSendMessage = - ICanFollow = - ICanUnfollow = false; + ICanChooseOption[Usr_OPTION_RECORDS] = (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); break; case Rol_STD: - ICanViewRecords = - ICanSendMessage = - ICanFollow = (Gbl.Scope.Current == Sco_SCOPE_CRS && - (Gbl.Usrs.Me.IBelongToCurrentCrs || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)); + ICanChooseOption[Usr_OPTION_RECORDS] = + ICanChooseOption[Usr_OPTION_MESSAGE] = + ICanChooseOption[Usr_OPTION_FOLLOW] = (Gbl.Scope.Current == Sco_SCOPE_CRS && + (Gbl.Usrs.Me.IBelongToCurrentCrs || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)); - ICanViewHomework = - ICanViewAttendance = (Gbl.Usrs.Me.Role.Logged == Rol_NET || - Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); - ICanUnfollow = true; + ICanChooseOption[Usr_OPTION_HOMEWORK] = + ICanChooseOption[Usr_OPTION_ATTENDANCE] = (Gbl.Usrs.Me.Role.Logged == Rol_NET || + Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + ICanChooseOption[Usr_OPTION_UNFOLLOW] = true; break; case Rol_TCH: - ICanViewRecords = - ICanSendMessage = - ICanFollow = (Gbl.Scope.Current == Sco_SCOPE_CRS); + ICanChooseOption[Usr_OPTION_RECORDS] = + ICanChooseOption[Usr_OPTION_MESSAGE] = + ICanChooseOption[Usr_OPTION_FOLLOW] = (Gbl.Scope.Current == Sco_SCOPE_CRS); - ICanViewHomework = (Gbl.Usrs.Me.Role.Logged == Rol_NET || - Gbl.Usrs.Me.Role.Logged == Rol_TCH || - Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); - - ICanViewAttendance = false; - ICanUnfollow = true; + ICanChooseOption[Usr_OPTION_HOMEWORK] = (Gbl.Usrs.Me.Role.Logged == Rol_NET || + Gbl.Usrs.Me.Role.Logged == Rol_TCH || + Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM); + ICanChooseOption[Usr_OPTION_UNFOLLOW] = true; break; default: - ICanViewRecords = - ICanViewHomework = - ICanViewAttendance = - ICanSendMessage = - ICanFollow = - ICanUnfollow = false; - break; + return false; } - /***** Start list of options *****/ + /***** Write list of options *****/ + /* Start list of options */ fprintf (Gbl.F.Out,"