diff --git a/swad_changelog.h b/swad_changelog.h index 282e1a2a..bfac0029 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -223,13 +223,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.195.3 (2017-04-29)" +#define Log_PLATFORM_VERSION "SWAD 16.195.4 (2017-04-29)" #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.195.4: Apr 29, 2017 Changes in layout of edition of groups. (218513 lines) Version 16.195.3: Apr 29, 2017 Add plus icon in box "Groups" when editing groups. (218537 lines) Version 16.195.2: Apr 29, 2017 Add plus icon in box "Types of group" when editing groups. (218512 lines) Version 16.195.1: Apr 29, 2017 Code refactoring in edition of groups. (218474 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index acb1f0e6..37645d25 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -11030,7 +11030,8 @@ void Brw_RemoveZonesOfGroupsOfType (long GrpTypCod) { MYSQL_RES *mysql_res; MYSQL_ROW row; - unsigned long NumRow,NumRows; + unsigned long NumRow; + unsigned long NumRows; struct GroupData GrpDat; /***** Query database *****/ @@ -11050,30 +11051,13 @@ void Brw_RemoveZonesOfGroupsOfType (long GrpTypCod) Grp_GetDataOfGroupByCod (&GrpDat); /* Remove file zones of this group */ - Brw_RemoveGrpZonesVerbose (&GrpDat); + Brw_RemoveGrpZones (Gbl.CurrentCrs.Crs.CrsCod,GrpDat.GrpCod); } /***** Free structure that stores the query result *****/ DB_FreeMySQLResult (&mysql_res); } -/*****************************************************************************/ -/************** Remove file zones of a group and show message ****************/ -/*****************************************************************************/ - -void Brw_RemoveGrpZonesVerbose (struct GroupData *GrpDat) - { - extern const char *Txt_File_zones_of_the_group_X_Y_removed; - - /***** Remove group zones and clipboards *****/ - Brw_RemoveGrpZones (Gbl.CurrentCrs.Crs.CrsCod,GrpDat->GrpCod); - - /***** Print message *****/ - sprintf (Gbl.Message,Txt_File_zones_of_the_group_X_Y_removed, - GrpDat->GrpTypName,GrpDat->GrpName); - Lay_ShowAlert (Lay_SUCCESS,Gbl.Message); - } - /*****************************************************************************/ /*********************** Remove file zones of a group ************************/ /*****************************************************************************/ diff --git a/swad_file_browser.h b/swad_file_browser.h index 38b72d14..fc085c56 100644 --- a/swad_file_browser.h +++ b/swad_file_browser.h @@ -246,7 +246,6 @@ void Brw_PutParamsFileBrowser (Act_Action_t NextAction, Brw_FileType_t FileType,long FilCod); void Brw_RemoveZonesOfGroupsOfType (long GrpTypCod); -void Brw_RemoveGrpZonesVerbose (struct GroupData *GrpDat); void Brw_RemoveGrpZones (long CrsCod,long GrpCod); void Brw_RemoveUsrWorksInCrs (struct UsrData *UsrDat,struct Course *Crs,Cns_QuietOrVerbose_t QuietOrVerbose); diff --git a/swad_group.c b/swad_group.c index cfd5b9c9..11d2fd30 100644 --- a/swad_group.c +++ b/swad_group.c @@ -69,6 +69,8 @@ static void Grp_ReqEditGroupsInternal2 (Lay_AlertType_t AlertType,const char *Me static void Grp_EditGroupTypes (void); static void Grp_EditGroups (void); +static void Grp_PutIconsEditingGroups (void); +static void Grp_PutIconToCreateNewGroup (void); static void Grp_ConstructorListGrpAlreadySelec (struct ListGrpsAlreadySelec **AlreadyExistsGroupOfType); static void Grp_DestructorListGrpAlreadySelec (struct ListGrpsAlreadySelec **AlreadyExistsGroupOfType); @@ -82,8 +84,6 @@ static void Grp_PutIconToCreateNewGroupType (void); static void Grp_WriteHeadingGroupTypes (void); static void Grp_ListGroupsForEdition (void); -static void Grp_PutIconsEditingGroups (void); -static void Grp_PutIconToCreateNewGroup (void); static void Grp_WriteHeadingGroups (void); static void Grp_PutIconToEditGroups (void); @@ -234,8 +234,15 @@ static void Grp_ReqEditGroupsInternal2 (Lay_AlertType_t AlertType,const char *Me static void Grp_EditGroupTypes (void) { + extern const char *Hlp_USERS_Groups; + extern const char *Txt_Types_of_group; extern const char *Txt_There_are_no_types_of_group_in_the_course_X; + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_Types_of_group, + Grp_PutIconsEditingGroupTypes, + Hlp_USERS_Groups); + /***** Forms to edit current group types *****/ if (Gbl.CurrentCrs.Grps.GrpTypes.Num) // Group types found... Grp_ListGroupTypesForEdition (); @@ -248,6 +255,9 @@ static void Grp_EditGroupTypes (void) /***** Put a form to create a new group type *****/ Grp_PutFormToCreateGroupType (); + + /***** End frame *****/ + Lay_EndRoundFrame (); } /*****************************************************************************/ @@ -256,8 +266,14 @@ static void Grp_EditGroupTypes (void) static void Grp_EditGroups (void) { + extern const char *Hlp_USERS_Groups; + extern const char *Txt_Groups; extern const char *Txt_No_groups_have_been_created_in_the_course_X; + /***** Start frame *****/ + Lay_StartRoundFrame (NULL,Txt_Groups,Grp_PutIconsEditingGroups, + Hlp_USERS_Groups); + /***** Forms to edit current groups *****/ if (Gbl.CurrentCrs.Grps.GrpTypes.NumGrpsTotal) // If there are groups... Grp_ListGroupsForEdition (); @@ -270,6 +286,33 @@ static void Grp_EditGroups (void) /***** Put a form to create a new group *****/ Grp_PutFormToCreateGroup (); + + /***** End frame *****/ + Lay_EndRoundFrame (); + } + +/*****************************************************************************/ +/**************** Put contextual icons in edition of groups ******************/ +/*****************************************************************************/ + +static void Grp_PutIconsEditingGroups (void) + { + /***** Put icon to view groups *****/ + Grp_PutIconToViewGroups (); + + /***** Put icon to create a new group *****/ + Grp_PutIconToCreateNewGroup (); + } + +static void Grp_PutIconToCreateNewGroup (void) + { + extern const char *Txt_New_group; + + /***** Put form to create a new group *****/ + Lay_PutContextualLink (ActReqEdiGrp,Grp_SECTION_NEW_GROUP,NULL, + "plus64x64.png", + Txt_New_group,NULL, + NULL); } /*****************************************************************************/ @@ -1132,8 +1175,7 @@ static void Grp_AddUsrToGroup (struct UsrData *UsrDat,long GrpCod) static void Grp_ListGroupTypesForEdition (void) { - extern const char *Hlp_USERS_Groups; - extern const char *Txt_Types_of_group; + extern const char *Txt_It_is_optional_to_choose_a_group; extern const char *Txt_It_is_mandatory_to_choose_a_group; extern const char *Txt_A_student_can_belong_to_several_groups; @@ -1145,9 +1187,7 @@ static void Grp_ListGroupTypesForEdition (void) char Id[32]; /***** Write heading *****/ - Lay_StartRoundFrameTable (NULL,Txt_Types_of_group, - Grp_PutIconsEditingGroupTypes, - Hlp_USERS_Groups,2); + fprintf (Gbl.F.Out,"