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,""); Grp_WriteHeadingGroupTypes (); /***** List group types with forms for edition *****/ @@ -1263,7 +1303,8 @@ static void Grp_ListGroupTypesForEdition (void) Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps); } - Lay_EndRoundFrameTable (); + /***** End table *****/ + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -1345,8 +1386,6 @@ static void Grp_WriteHeadingGroupTypes (void) static void Grp_ListGroupsForEdition (void) { - extern const char *Hlp_USERS_Groups; - extern const char *Txt_Groups; extern const char *Txt_Group_X_open_click_to_close_it; extern const char *Txt_Group_X_closed_click_to_open_it; extern const char *Txt_File_zones_of_the_group_X_enabled_click_to_disable_them; @@ -1359,8 +1398,7 @@ static void Grp_ListGroupsForEdition (void) struct Group *Grp; /***** Write heading *****/ - Lay_StartRoundFrameTable (NULL,Txt_Groups,Grp_PutIconsEditingGroups, - Hlp_USERS_Groups,2); + fprintf (Gbl.F.Out,""); Grp_WriteHeadingGroups (); /***** List the groups *****/ @@ -1480,31 +1518,7 @@ static void Grp_ListGroupsForEdition (void) } /***** End table *****/ - Lay_EndRoundFrameTable (); - } - -/*****************************************************************************/ -/**************** 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); + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -2171,7 +2185,6 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight) static void Grp_PutFormToCreateGroupType (void) { - extern const char *Hlp_USERS_Groups; extern const char *Txt_New_type_of_group; extern const char *Txt_It_is_optional_to_choose_a_group; extern const char *Txt_It_is_mandatory_to_choose_a_group; @@ -2187,16 +2200,14 @@ static void Grp_PutFormToCreateGroupType (void) /***** Start of frame *****/ Lay_StartRoundFrameTable (NULL,Txt_New_type_of_group, - NULL,Hlp_USERS_Groups,2); + NULL,NULL,2); /***** Write heading *****/ Grp_WriteHeadingGroupTypes (); - /***** Put disabled icon to remove group type *****/ + /***** Column to remove group type, disabled here *****/ fprintf (Gbl.F.Out,"" - ""); - Lay_PutIconRemovalNotAllowed (); - fprintf (Gbl.F.Out,""); + ""); /***** Name of group type *****/ fprintf (Gbl.F.Out,"" @@ -2271,8 +2282,10 @@ static void Grp_PutFormToCreateGroupType (void) ""); /***** Number of groups of this type *****/ - fprintf (Gbl.F.Out,"" - ""); + fprintf (Gbl.F.Out,"" + "0" // It's a new group type ==> 0 groups + "" + ""); /***** Send button and end frame *****/ Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Create_type_of_group); @@ -2305,11 +2318,9 @@ static void Grp_PutFormToCreateGroup (void) /***** Write heading *****/ Grp_WriteHeadingGroups (); - /***** Put disabled icons to remove group, open group and archive zone *****/ + /***** Put disabled icons to open group and archive zone *****/ fprintf (Gbl.F.Out,"" - ""); - Lay_PutIconRemovalNotAllowed (); - fprintf (Gbl.F.Out,"" + "" "" "\"%s\""); /***** Current number of students in this group *****/ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" + "0" // It's a new group ==> 0 students + "" ""); /***** Send button and end frame *****/ @@ -3675,7 +3688,7 @@ static void Grp_RemoveGroupCompletely (void) Grp_GetDataOfGroupByCod (&GrpDat); /***** Remove file zones of this group *****/ - Brw_RemoveGrpZonesVerbose (&GrpDat); + Brw_RemoveGrpZones (Gbl.CurrentCrs.Crs.CrsCod,GrpDat.GrpCod); /***** Remove this group from all the assignments *****/ Asg_RemoveGroup (GrpDat.GrpCod); diff --git a/swad_text.c b/swad_text.c index 9399d878..a2123765 100644 --- a/swad_text.c +++ b/swad_text.c @@ -12401,27 +12401,6 @@ const char *Txt_File_zones_of_the_group_X_disabled_click_to_enable_them = // War "File zones of the group %s disabled, click to enable them"; // Necessita de tradução #endif -const char *Txt_File_zones_of_the_group_X_Y_removed = // Warning: it is very important to include two %s in the following sentences -#if L==1 - "Zonas de archivos del grupo %s %s eliminadas."; // Necessita traduccio -#elif L==2 - "Dateienbereiche der Gruppe %s %s entfernt."; -#elif L==3 - "File areas of the group %s %s removed."; -#elif L==4 - "Zonas de archivos del grupo %s %s eliminadas."; -#elif L==5 - "File zones of the group %s %s removed."; // Besoin de traduction -#elif L==6 - "Zonas de archivos del grupo %s %s eliminadas."; // Okoteve traducción -#elif L==7 - "Aree file del gruppo %s %s rimosse."; -#elif L==8 - "Plik obszarach grupy %s %s usuniety."; -#elif L==9 - "File zones of the group %s %s removed."; // Necessita de tradução -#endif - const char *Txt_Files = #if L==1 "Fitxers";