diff --git a/swad_changelog.h b/swad_changelog.h index 3a6470a99..dd7ef0c5a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -217,20 +217,21 @@ // TODO: Change numbers of notifications in program and database to match order in tabs -// TODO: Add plus icons in boxes "Types of group" and "Groups" when editing groups. +// TODO: Print view of an assignment (suggested by Sandra Daniela Tazzioli Barroso). /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.195.1 (2017-04-29)" +#define Log_PLATFORM_VERSION "SWAD 16.195.2 (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.1: Apr 29, 2017 Code refactoring in edition of groups. (? lines) + Version 16.195.2: Apr 29, 2017 Add plus icons in boxes "Types of group" and "Groups" when editing groups. (218512 lines) + Version 16.195.1: Apr 29, 2017 Code refactoring in edition of groups. (218474 lines) Version 16.195: Apr 29, 2017 Changes in edition of groups. (218470 lines) Version 16.194.22:Apr 29, 2017 Changes in edition of groups. (218433 lines) Version 16.194.21:Apr 29, 2017 Changes in edition of groups. (218435 lines) diff --git a/swad_group.c b/swad_group.c index a28a34f2e..153046ed3 100644 --- a/swad_group.c +++ b/swad_group.c @@ -40,8 +40,10 @@ /*************************** Internal constants ******************************/ /*****************************************************************************/ -#define Grp_SECTION_GROUP_TYPES "grp_types" -#define Grp_SECTION_GROUPS "grps" +#define Grp_SECTION_GROUP_TYPES "grp_types" +#define Grp_SECTION_NEW_GROUP_TYPE "new_grp_type" +#define Grp_SECTION_GROUPS "grps" +#define Grp_SECTION_NEW_GROUP "new_grp" /*****************************************************************************/ /***************************** Internal types ********************************/ @@ -73,6 +75,9 @@ static void Grp_DestructorListGrpAlreadySelec (struct ListGrpsAlreadySelec **Alr static void Grp_RemoveUsrFromGroup (long UsrCod,long GrpCod); static void Grp_AddUsrToGroup (struct UsrData *UsrDat,long GrpCod); static void Grp_ListGroupTypesForEdition (void); +static void Grp_PutIconsEditingGroupTypes (void); +static void Grp_PutIconToViewGroups (void); +static void Grp_PutIconToCreateNewGroupType (void); static void Grp_WriteHeadingGroupTypes (void); static void Grp_ListGroupsForEdition (void); static void Grp_WriteHeadingGroups (void); @@ -178,7 +183,7 @@ void Grp_ReqEditGroups (void) static void Grp_ReqEditGroupsInternal0 (void) { /***** Start groups types section *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
",Grp_SECTION_GROUP_TYPES); } static void Grp_ReqEditGroupsInternal1 (Lay_AlertType_t AlertType,const char *Message) @@ -198,7 +203,7 @@ static void Grp_ReqEditGroupsInternal1 (Lay_AlertType_t AlertType,const char *Me fprintf (Gbl.F.Out,"
"); /***** Start groups section *****/ - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
",Grp_SECTION_GROUPS); } static void Grp_ReqEditGroupsInternal2 (Lay_AlertType_t AlertType,const char *Message) @@ -1136,7 +1141,9 @@ static void Grp_ListGroupTypesForEdition (void) char Id[32]; /***** Write heading *****/ - Lay_StartRoundFrameTable (NULL,Txt_Types_of_group,NULL,Hlp_USERS_Groups,2); + Lay_StartRoundFrameTable (NULL,Txt_Types_of_group, + Grp_PutIconsEditingGroupTypes, + Hlp_USERS_Groups,2); Grp_WriteHeadingGroupTypes (); /***** List group types with forms for edition *****/ @@ -1255,6 +1262,41 @@ static void Grp_ListGroupTypesForEdition (void) Lay_EndRoundFrameTable (); } +/*****************************************************************************/ +/************ Put contextual icons in edition of types of group **************/ +/*****************************************************************************/ + +static void Grp_PutIconsEditingGroupTypes (void) + { + /***** Put icon to view groups *****/ + Grp_PutIconToViewGroups (); + + /***** Put icon to create a new type of group *****/ + Grp_PutIconToCreateNewGroupType (); + } + +static void Grp_PutIconToViewGroups (void) + { + extern const char *Txt_View; + + /***** Put form to create a new type of group *****/ + Lay_PutContextualLink (ActReqSelGrp,NULL,NULL, + "eye-on64x64.png", + Txt_View,NULL, + NULL); + } + +static void Grp_PutIconToCreateNewGroupType (void) + { + extern const char *Txt_New_type_of_group; + + /***** Put form to create a new type of group *****/ + Lay_PutContextualLink (ActReqEdiGrp,Grp_SECTION_NEW_GROUP_TYPE,NULL, + "plus64x64.png", + Txt_New_type_of_group,NULL, + NULL); + } + /*****************************************************************************/ /*********************** Write heading of group types ************************/ /*****************************************************************************/ @@ -2111,6 +2153,7 @@ static void Grp_PutFormToCreateGroupType (void) extern const char *Txt_Create_type_of_group; /***** Start form *****/ + fprintf (Gbl.F.Out,"
",Grp_SECTION_NEW_GROUP_TYPE); Act_FormStartAnchor (ActNewGrpTyp,Grp_SECTION_GROUP_TYPES); /***** Start of frame *****/ @@ -2207,6 +2250,7 @@ static void Grp_PutFormToCreateGroupType (void) /***** End form *****/ Act_FormEnd (); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/