diff --git a/swad_changelog.h b/swad_changelog.h index 8bf783337..bdc896117 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -233,14 +233,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.227.2 (2017-05-30)" +#define Log_PLATFORM_VERSION "SWAD 16.228 (2017-05-30)" #define CSS_FILE "swad16.226.css" #define JS_FILE "swad16.206.3.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.227.3: May 30, 2017 Behaviour of registering non-editing teachers in groups similar to registering students. (? lines) + Version 16.228: May 30, 2017 Non-editing teachers can not change their selection of groups. + Removed alert with origin of copy when pasting. (220722 lines) Version 16.227.2: May 30, 2017 Button to upload photo integrated in alert. (220694 lines) Version 16.227.1: May 30, 2017 Button to check email integrated in alert. (220693 lines) Version 16.227: May 30, 2017 Changes in selector or roles in record cards. (220694 lines) diff --git a/swad_file_browser.c b/swad_file_browser.c index 319d0810e..54612ef8c 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -7438,9 +7438,6 @@ void Brw_PasteIntoFileBrowser (void) break; } - /***** Write the origin of the copy *****/ - Brw_WriteCurrentClipboard (); - /***** Copy files recursively *****/ Brw_PasteClipboard (); diff --git a/swad_group.c b/swad_group.c index 714222a9b..387a3e419 100644 --- a/swad_group.c +++ b/swad_group.c @@ -90,7 +90,8 @@ static void Grp_WriteHeadingGroups (void); static void Grp_PutIconToEditGroups (void); static void Grp_ShowWarningToStdsToChangeGrps (void); -static unsigned Grp_ListGrpsForChange (struct GroupType *GrpTyp); +static bool Grp_ListGrpsForChange (struct GroupType *GrpTyp, + unsigned *NumGrpsThisTypeIBelong); static void Grp_ListGrpsToAddOrRemUsrs (struct GroupType *GrpTyp,long UsrCod); static void Grp_ListGrpsForMultipleSelection (struct GroupType *GrpTyp); static void Grp_WriteGrpHead (struct GroupType *GrpTyp); @@ -1651,11 +1652,13 @@ void Grp_ShowLstGrpsToChgMyGrps (void) extern const char *Txt_No_groups_have_been_created_in_the_course_X; extern const char *Txt_Create_group; unsigned NumGrpTyp; + unsigned NumGrpsThisTypeIBelong; unsigned NumGrpsIBelong = 0; bool PutFormToChangeGrps = !Gbl.Form.Inside; // Not inside another form (record card) bool ICanEdit = !Gbl.Form.Inside && (Gbl.Usrs.Me.LoggedRole == Rol_TCH || Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM); + bool ICanChangeMySelection = false; if (Gbl.CurrentCrs.Grps.NumGrps) // This course has groups { @@ -1686,14 +1689,19 @@ void Grp_ShowLstGrpsToChgMyGrps (void) NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num; NumGrpTyp++) if (Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps) // If there are groups of this type - NumGrpsIBelong += Grp_ListGrpsForChange (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp]); + { + ICanChangeMySelection |= Grp_ListGrpsForChange (&Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp], + &NumGrpsThisTypeIBelong); + NumGrpsIBelong += NumGrpsThisTypeIBelong; + } Lay_EndTable (); /***** End form *****/ if (PutFormToChangeGrps) { - Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups : - Txt_Enrol_in_groups); + if (ICanChangeMySelection) + Lay_PutConfirmButton (NumGrpsIBelong ? Txt_Change_my_groups : + Txt_Enrol_in_groups); Act_FormEnd (); } } @@ -1774,15 +1782,16 @@ static void Grp_ShowWarningToStdsToChangeGrps (void) /*****************************************************************************/ /*************** List the groups of a type to register in ********************/ /*****************************************************************************/ -// Returns the number of groups of this type I belong to +// Returns true if I can change my selection -static unsigned Grp_ListGrpsForChange (struct GroupType *GrpTyp) +static bool Grp_ListGrpsForChange (struct GroupType *GrpTyp, + unsigned *NumGrpsThisTypeIBelong) { struct ListCodGrps LstGrpsIBelong; unsigned NumGrpThisType; struct Group *Grp; bool IBelongToThisGroup; - unsigned NumGrpsIBelong; + bool ICanChangeMySelection = false; /***** Write heading *****/ Grp_WriteGrpHead (GrpTyp); @@ -1790,7 +1799,7 @@ static unsigned Grp_ListGrpsForChange (struct GroupType *GrpTyp) /***** Query in the database the group of this type that I belong to *****/ Grp_GetLstCodGrpsUsrBelongs (Gbl.CurrentCrs.Crs.CrsCod,GrpTyp->GrpTypCod, Gbl.Usrs.Me.UsrDat.UsrCod,&LstGrpsIBelong); - NumGrpsIBelong = LstGrpsIBelong.NumGrps; + *NumGrpsThisTypeIBelong = LstGrpsIBelong.NumGrps; /***** List the groups *****/ for (NumGrpThisType = 0; @@ -1800,20 +1809,18 @@ static unsigned Grp_ListGrpsForChange (struct GroupType *GrpTyp) Grp = &(GrpTyp->LstGrps[NumGrpThisType]); IBelongToThisGroup = Grp_CheckIfGrpIsInList (Grp->GrpCod,&LstGrpsIBelong); - /* Put icon to select the group */ + /* Put radio item or checkbox to select the group */ fprintf (Gbl.F.Out,"