diff --git a/swad_assignment.c b/swad_assignment.c index 732b6997..bfbaa9c8 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -1129,7 +1129,7 @@ void Asg_RequestCreatOrEditAsg (void) "%s:" "" "" - "" + "" "" "", Txt_Title, @@ -1249,7 +1249,7 @@ static void Asg_ShowLstGrpsToEditAssignment (long AsgCod) "" "", Txt_Groups); - Lay_StartRoundFrameTable10 (NULL,0,NULL); + Lay_StartRoundFrameTable10 ("100%",0,NULL); /***** First row: checkbox to select the whole course *****/ fprintf (Gbl.F.Out,"" @@ -1722,14 +1722,24 @@ static bool Asg_CheckIfICanDoThisAssignment (long AsgCod) { char Query[512]; - /***** Get if I can do an assignment from database *****/ - sprintf (Query,"SELECT COUNT(*) FROM assignments" - " WHERE AsgCod='%ld'" - " AND (AsgCod NOT IN (SELECT AsgCod FROM asg_grp) OR" - " AsgCod IN (SELECT asg_grp.AsgCod FROM asg_grp,crs_grp_usr" - " WHERE crs_grp_usr.UsrCod='%ld' AND asg_grp.GrpCod=crs_grp_usr.GrpCod))", - AsgCod,Gbl.Usrs.Me.UsrDat.UsrCod); - return (DB_QueryCOUNT (Query,"can not check if I can do an assignment") != 0); + if (Gbl.Usrs.Me.LoggedRole == Rol_ROLE_STUDENT) + { + /***** Get if I can do an assignment from database *****/ + sprintf (Query,"SELECT COUNT(*) FROM assignments" + " WHERE AsgCod='%ld'" + " AND (" + "AsgCod NOT IN (SELECT AsgCod FROM asg_grp)" + " OR " + "AsgCod IN" + " (SELECT asg_grp.AsgCod FROM asg_grp,crs_grp_usr" + " WHERE crs_grp_usr.UsrCod='%ld'" + " AND asg_grp.GrpCod=crs_grp_usr.GrpCod)" + ")", + AsgCod,Gbl.Usrs.Me.UsrDat.UsrCod); + return (DB_QueryCOUNT (Query,"can not check if I can do an assignment") != 0); + } + else + return false; } /*****************************************************************************/ diff --git a/swad_attendance.c b/swad_attendance.c index 55d08703..ba19c6e9 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -496,25 +496,17 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) extern const char *Txt_Hide; extern const char *Txt_Edit; + fprintf (Gbl.F.Out,"
"); + /***** Put form to remove attendance event *****/ - fprintf (Gbl.F.Out,"" - "" - ""); + Act_PutIconLink ("delon",Txt_Remove); /***** Put form to hide/show attendance event *****/ - fprintf (Gbl.F.Out,""); + Act_PutIconLink ("visible_on",Txt_Hide); /***** Put form to edit attendance event *****/ - fprintf (Gbl.F.Out,"" - "" - "
"); Act_FormStart (ActReqRemAtt); Att_PutParamAttCod (AttCod); Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - fprintf (Gbl.F.Out,"", - Gbl.Prefs.IconsURL, - Txt_Remove, - Txt_Remove); - Act_FormEnd (); - fprintf (Gbl.F.Out,""); Act_FormStart (Hidden ? ActShoAtt : ActHidAtt); Att_PutParamAttCod (AttCod); @@ -522,36 +514,19 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); if (Hidden) - fprintf (Gbl.F.Out,"", - Gbl.Prefs.IconsURL, - Txt_Show, - Txt_Show); + Act_PutIconLink ("hidden_on",Txt_Show); else - fprintf (Gbl.F.Out,"", - Gbl.Prefs.IconsURL, - Txt_Hide, - Txt_Hide); - Act_FormEnd (); - fprintf (Gbl.F.Out,""); Act_FormStart (ActEdiOneAtt); Att_PutParamAttCod (AttCod); Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - fprintf (Gbl.F.Out,"", - Gbl.Prefs.IconsURL, - Txt_Edit, - Txt_Edit); - Act_FormEnd (); - fprintf (Gbl.F.Out,"
"); + Act_PutIconLink ("edit",Txt_Edit); + + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -1121,7 +1096,7 @@ void Att_RequestCreatOrEditAttEvent (void) "%s:" "" "" - "" + "" "" "", Txt_Title, @@ -1249,7 +1224,7 @@ static void Att_ShowLstGrpsToEditAttEvent (long AttCod) "" "", Txt_Groups); - Lay_StartRoundFrameTable10 (NULL,0,NULL); + Lay_StartRoundFrameTable10 ("100%",0,NULL); /***** First row: checkbox to select the whole course *****/ fprintf (Gbl.F.Out,"" diff --git a/swad_changelog.h b/swad_changelog.h index 23e4b899..c4fe2434 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -103,11 +103,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.107.2 (2015/04/02)" +#define Log_PLATFORM_VERSION "SWAD 14.107.3 (2015/04/02)" // 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 14.107.3: Apr 02, 2015 Changes in icons in attendance events. + Fixed bug in assignments. (183702 lines) Version 14.107.2: Apr 02, 2015 Changes in icons in surveys. (183717 lines) Version 14.107.1: Apr 02, 2015 Changes in icons in assignments. (183748 lines) Version 14.107: Apr 02, 2015 Refactoring contextual menus. (183776 lines) diff --git a/swad_survey.c b/swad_survey.c index 5ef0c60e..29607dc0 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -1592,7 +1592,7 @@ void Svy_RequestCreatOrEditSvy (void) "%s:" "" "" - "" + "" "" "", Txt_Title,