diff --git a/swad_changelog.h b/swad_changelog.h
index 4b5354704..9b10f4d6f 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -221,13 +221,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 16.194.13 (2017-04-28)"
+#define Log_PLATFORM_VERSION "SWAD 16.194.14 (2017-04-28)"
#define CSS_FILE "swad16.193.4.css"
#define JS_FILE "swad16.181.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.194.14:Apr 28, 2017 Changed dialog to remove a group. (218368 lines)
Version 16.194.13:Apr 28, 2017 Changed dialog to remove a social note. (218417 lines)
Version 16.194.12:Apr 28, 2017 Changed dialog to remove a social comment. (218398 lines)
Version 16.194.11:Apr 28, 2017 Changed dialog to remove a notice. (218379 lines)
diff --git a/swad_global.h b/swad_global.h
index 7425ca1da..980c99f84 100644
--- a/swad_global.h
+++ b/swad_global.h
@@ -459,7 +459,7 @@ struct Globals
unsigned NumGrps;
struct GroupTypes GrpTypes;
struct GroupType GrpTyp;
- long GrpCod;
+ long GrpCod; // Group to be edited, removed...
char GrpName[Grp_MAX_BYTES_GROUP_NAME + 1];
unsigned MaxStudents;
bool Open;
diff --git a/swad_group.c b/swad_group.c
index efc3bda76..f29b584ee 100644
--- a/swad_group.c
+++ b/swad_group.c
@@ -94,10 +94,13 @@ static bool Grp_CheckIfGroupTypeNameExists (const char *GrpTypName,long GrpTypCo
static bool Grp_CheckIfGroupNameExists (long GrpTypCod,const char *GrpName,long GrpCod);
static void Grp_CreateGroupType (void);
static void Grp_CreateGroup (void);
+
static void Grp_AskConfirmRemGrpTypWithGrps (unsigned NumGrps);
static void Grp_AskConfirmRemGrp (void);
+static void Grp_PutParamRemGrp (void);
static void Grp_RemoveGroupTypeCompletely (void);
static void Grp_RemoveGroupCompletely (void);
+
static void Grp_WriteMaxStdsGrp (unsigned MaxStudents);
static long Grp_GetParamGrpTypCod (void);
static long Grp_GetParamGrpCod (void);
@@ -3388,12 +3391,15 @@ static void Grp_AskConfirmRemGrp (void)
struct GroupData GrpDat;
unsigned NumStds;
- /***** Get name and type of the group from database *****/
+ /***** Get name of the group from database *****/
GrpDat.GrpCod = Gbl.CurrentCrs.Grps.GrpCod;
Grp_GetDataOfGroupByCod (&GrpDat);
+
+ /***** Count number of students in group *****/
NumStds = Grp_CountNumStdsInGrp (Gbl.CurrentCrs.Grps.GrpCod);
- /***** Write message to ask confirmation of removing *****/
+ /***** Show question and button to remove group *****/
+ /* Start alert */
if (NumStds == 0)
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_group_X,
GrpDat.GrpName);
@@ -3403,19 +3409,27 @@ static void Grp_AskConfirmRemGrp (void)
else
sprintf (Gbl.Message,Txt_Do_you_really_want_to_remove_the_group_X_Y_students_,
GrpDat.GrpName,NumStds);
- Lay_ShowAlert (Lay_WARNING,Gbl.Message);
+ Lay_ShowAlertAndButton1 (Lay_QUESTION,Gbl.Message);
- /***** Put button to confirm the removing *****/
- fprintf (Gbl.F.Out,"
");
- Act_FormStart (ActRemGrp);
- Grp_PutParamGrpCod (GrpDat.GrpCod);
- Lay_PutRemoveButton (Txt_Remove_group);
- Act_FormEnd ();
- fprintf (Gbl.F.Out,"
");
+ /* End alert */
+ Lay_ShowAlertAndButton2 (ActRemGrp,NULL,Grp_PutParamRemGrp,
+ Lay_REMOVE_BUTTON,Txt_Remove_group);
+
+ /***** Show the form again *****/
+ Grp_ReqEditGroups ();
}
/*****************************************************************************/
-/****************************** Remove a group type **************************/
+/*********************** Put parameter to remove a group *********************/
+/*****************************************************************************/
+
+static void Grp_PutParamRemGrp (void)
+ {
+ Grp_PutParamGrpCod (Gbl.CurrentCrs.Grps.GrpCod);
+ }
+
+/*****************************************************************************/
+/**************************** Remove a group type ****************************/
/*****************************************************************************/
void Grp_RemoveGroupType (void)
diff --git a/swad_text.c b/swad_text.c
index 8fbcc3491..9399d8784 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -9180,66 +9180,6 @@ const char *Txt_Do_you_really_want_to_remove_the_following_post =
"Você realmente deseja remover o seguinte post?";
#endif
-const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_the_centre_X = // Warning: it is very important to include %s in the following sentences
-#if L==1
- "¿Realmente desea eliminar el siguiente usuario"
- " como administrador/a del centro %s?"; // Necessita traduccio
-#elif L==2
- "Do you really want to remove the following user"
- " as an administrator of the centre %s?"; // Need Übersetzung
-#elif L==3
- "Do you really want to remove the following user"
- " as an administrator of the centre %s?";
-#elif L==4
- "¿Realmente desea eliminar el siguiente usuario"
- " como administrador/a del centro %s?";
-#elif L==5
- "Do you really want to remove the following user"
- " as an administrator of the centre %s?"; // Besoin de traduction
-#elif L==6
- "¿Realmente desea eliminar el siguiente usuario"
- " como administrador/a del centro %s?"; // Okoteve traducción
-#elif L==7
- "Vuoi realmente rimuovere il seguente utente"
- " come amministratore del centro %s?";
-#elif L==8
- "Czy na pewno chcesz usunac nastepujace użytkownika"
- " jako administratora centrum %s?";
-#elif L==9
- "Do you really want to remove the following user"
- " as an administrator of the centre %s?"; // Necessita de tradução
-#endif
-
-const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_the_degree_X = // Warning: it is very important to include %s in the following sentences
-#if L==1
- "¿Realmente desea eliminar el siguiente usuario"
- " como administrador/a de la titulación %s?"; // Necessita traduccio
-#elif L==2
- "Do you really want to remove the following user"
- " as an administrator of the degree %s?"; // Need Übersetzung
-#elif L==3
- "Do you really want to remove the following user"
- " as an administrator of the degree %s?";
-#elif L==4
- "¿Realmente desea eliminar el siguiente usuario"
- " como administrador/a de la titulación %s?";
-#elif L==5
- "Do you really want to remove the following user"
- " as an administrator of the degree %s?"; // Besoin de traduction
-#elif L==6
- "¿Realmente desea eliminar el siguiente usuario"
- " como administrador/a de la titulación %s?"; // Okoteve traducción
-#elif L==7
- "Vuoi realmente rimuovere il seguente utente"
- " come amministratore della laurea %s?";
-#elif L==8
- "Czy na pewno chcesz usunac nastepujace użytkownika"
- " jako administratora stopnia %s?";
-#elif L==9
- "Do you really want to remove the following user"
- " as an administrator of the degree %s?"; // Necessita de tradução
-#endif
-
const char *Txt_Do_you_really_want_to_remove_the_following_user_as_an_administrator_of_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"¿Realmente desea eliminar el siguiente usuario"