diff --git a/swad_assignment.c b/swad_assignment.c index 8725a5f3..dc1c06da 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -116,12 +116,12 @@ void Asg_SeeAssignments (void) static void Asg_ShowAllAssignments (void) { + extern const char *Txt_Assignments; extern const char *Txt_ASG_ATT_OR_SVY_HELP_ORDER[2]; extern const char *Txt_ASG_ATT_OR_SVY_ORDER[2]; extern const char *Txt_Assignment; extern const char *Txt_Upload_files_QUESTION; extern const char *Txt_Folder; - extern const char *Txt_No_assignments; tAsgsOrderType Order; struct Pagination Pagination; unsigned NumAsg; @@ -129,74 +129,77 @@ static void Asg_ShowAllAssignments (void) /***** Get list of assignments *****/ Asg_GetListAssignments (); + /***** Compute variables related to pagination *****/ + Pagination.NumItems = Gbl.Asgs.Num; + Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage; + Pag_CalculatePagination (&Pagination); + Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage; + + /***** Write links to pages *****/ + if (Pagination.MoreThanOnePage) + Pag_WriteLinksToPagesCentered (Pag_ASSIGNMENTS,0,&Pagination); + + /***** Start table *****/ + Lay_StartRoundFrameTable10 (NULL,2,Txt_Assignments); + /***** Select whether show only my groups or all groups *****/ if (Gbl.CurrentCrs.Grps.NumGrps) - Asg_PutFormToSelectWhichGroupsToShow (); - - if (Gbl.Asgs.Num) // There are assignments in current course { - /***** Compute variables related to pagination *****/ - Pagination.NumItems = Gbl.Asgs.Num; - Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage; - Pag_CalculatePagination (&Pagination); - Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage; - - /***** Write links to pages *****/ - if (Pagination.MoreThanOnePage) - Pag_WriteLinksToPagesCentered (Pag_ASSIGNMENTS,0,&Pagination); - - /***** Table head *****/ - Lay_StartRoundFrameTable10 (NULL,2,NULL); - fprintf (Gbl.F.Out,""); - for (Order = Asg_ORDER_BY_START_DATE; - Order <= Asg_ORDER_BY_END_DATE; - Order++) - { - fprintf (Gbl.F.Out,""); - Act_FormStart (ActSeeAsg); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); - Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL"); - if (Order == Gbl.Asgs.SelectedOrderType) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); - if (Order == Gbl.Asgs.SelectedOrderType) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); - } - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "" - "" - "%s" - "" - "", - Txt_Assignment, - Txt_Upload_files_QUESTION, - Txt_Folder); - - /***** Write all the assignments *****/ - for (NumAsg = Pagination.FirstItemVisible; - NumAsg <= Pagination.LastItemVisible; - NumAsg++) - Asg_ShowOneAssignment (Gbl.Asgs.LstAsgCods[NumAsg-1]); - - /***** Table end *****/ - Lay_EndRoundFrameTable10 (); - - /***** Write again links to pages *****/ - if (Pagination.MoreThanOnePage) - Pag_WriteLinksToPagesCentered (Pag_ASSIGNMENTS,0,&Pagination); + fprintf (Gbl.F.Out,"" + ""); + Asg_PutFormToSelectWhichGroupsToShow (); + fprintf (Gbl.F.Out,"" + ""); } - else // There are no assignments in current course - Lay_ShowAlert (Lay_INFO,Txt_No_assignments); + + /***** Table head *****/ + fprintf (Gbl.F.Out,""); + for (Order = Asg_ORDER_BY_START_DATE; + Order <= Asg_ORDER_BY_END_DATE; + Order++) + { + fprintf (Gbl.F.Out,""); + Act_FormStart (ActSeeAsg); + Grp_PutParamWhichGrps (); + Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); + Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); + Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL"); + if (Order == Gbl.Asgs.SelectedOrderType) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); + if (Order == Gbl.Asgs.SelectedOrderType) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" + "" + ""); + } + fprintf (Gbl.F.Out,"" + "%s" + "" + "" + "%s" + "" + "" + "%s" + "" + "", + Txt_Assignment, + Txt_Upload_files_QUESTION, + Txt_Folder); + + /***** Write all the assignments *****/ + for (NumAsg = Pagination.FirstItemVisible; + NumAsg <= Pagination.LastItemVisible; + NumAsg++) + Asg_ShowOneAssignment (Gbl.Asgs.LstAsgCods[NumAsg-1]); + + /***** Table end *****/ + Lay_EndRoundFrameTable10 (); + + /***** Write again links to pages *****/ + if (Pagination.MoreThanOnePage) + Pag_WriteLinksToPagesCentered (Pag_ASSIGNMENTS,0,&Pagination); /***** Free list of assignments *****/ Asg_FreeListAssignments (); @@ -208,13 +211,11 @@ static void Asg_ShowAllAssignments (void) static void Asg_PutFormToSelectWhichGroupsToShow (void) { - fprintf (Gbl.F.Out,"
"); Act_FormStart (ActSeeAsg); Asg_PutHiddenParamAsgOrderType (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Grp_ShowSelectorWhichGrps (); - fprintf (Gbl.F.Out,"" - "
"); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_attendance.c b/swad_attendance.c index a142541c..1683e2f2 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -147,11 +147,11 @@ void Att_SeeAttEvents (void) static void Att_ShowAllAttEvents (void) { + extern const char *Txt_Events; extern const char *Txt_ASG_ATT_OR_SVY_HELP_ORDER[2]; extern const char *Txt_ASG_ATT_OR_SVY_ORDER[2]; extern const char *Txt_Event; extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; - extern const char *Txt_No_events; Att_EventsOrderType_t Order; struct Pagination Pagination; unsigned NumAttEvent; @@ -159,70 +159,73 @@ static void Att_ShowAllAttEvents (void) /***** Get list of attendance events *****/ Att_GetListAttEvents (Att_NEWEST_FIRST); + /***** Compute variables related to pagination *****/ + Pagination.NumItems = Gbl.AttEvents.Num; + Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage; + Pag_CalculatePagination (&Pagination); + Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage; + + /***** Write links to pages *****/ + if (Pagination.MoreThanOnePage) + Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination); + + /***** Table start *****/ + Lay_StartRoundFrameTable10 (NULL,2,Txt_Events); + /***** Select whether show only my groups or all groups *****/ if (Gbl.CurrentCrs.Grps.NumGrps) - Att_PutFormToSelectWhichGroupsToShow (); - - if (Gbl.AttEvents.Num) // There are attendance events in current course { - /***** Compute variables related to pagination *****/ - Pagination.NumItems = Gbl.AttEvents.Num; - Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage; - Pag_CalculatePagination (&Pagination); - Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage; - - /***** Write links to pages *****/ - if (Pagination.MoreThanOnePage) - Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination); - - /***** Table head *****/ - Lay_StartRoundFrameTable10 (NULL,2,NULL); - fprintf (Gbl.F.Out,""); - for (Order = Att_ORDER_BY_START_DATE; - Order <= Att_ORDER_BY_END_DATE; - Order++) - { - fprintf (Gbl.F.Out,""); - Act_FormStart (ActSeeAtt); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); - Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL"); - if (Order == Gbl.AttEvents.SelectedOrderType) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); - if (Order == Gbl.AttEvents.SelectedOrderType) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"" - "" - ""); - } - fprintf (Gbl.F.Out,"" - "%s" - "" - "" - "%s" - "" - "", - Txt_Event, - Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]); - - /***** Write all the attendance events *****/ - for (NumAttEvent = Pagination.FirstItemVisible, Gbl.RowEvenOdd = 0; - NumAttEvent <= Pagination.LastItemVisible; - NumAttEvent++) - Att_ShowOneAttEvent (&Gbl.AttEvents.Lst[NumAttEvent-1],false); - - /***** Table end *****/ - Lay_EndRoundFrameTable10 (); - - /***** Write again links to pages *****/ - if (Pagination.MoreThanOnePage) - Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination); + fprintf (Gbl.F.Out,"" + ""); + Att_PutFormToSelectWhichGroupsToShow (); + fprintf (Gbl.F.Out,"" + ""); } - else // There are no attendance events in current course - Lay_ShowAlert (Lay_INFO,Txt_No_events); + + /***** Table head *****/ + fprintf (Gbl.F.Out,""); + for (Order = Att_ORDER_BY_START_DATE; + Order <= Att_ORDER_BY_END_DATE; + Order++) + { + fprintf (Gbl.F.Out,""); + Act_FormStart (ActSeeAtt); + Grp_PutParamWhichGrps (); + Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); + Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); + Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL"); + if (Order == Gbl.AttEvents.SelectedOrderType) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]); + if (Order == Gbl.AttEvents.SelectedOrderType) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,"" + "" + ""); + } + fprintf (Gbl.F.Out,"" + "%s" + "" + "" + "%s" + "" + "", + Txt_Event, + Txt_ROLES_PLURAL_Abc[Rol_ROLE_STUDENT][Usr_SEX_UNKNOWN]); + + /***** Write all the attendance events *****/ + for (NumAttEvent = Pagination.FirstItemVisible, Gbl.RowEvenOdd = 0; + NumAttEvent <= Pagination.LastItemVisible; + NumAttEvent++) + Att_ShowOneAttEvent (&Gbl.AttEvents.Lst[NumAttEvent-1],false); + + /***** Table end *****/ + Lay_EndRoundFrameTable10 (); + + /***** Write again links to pages *****/ + if (Pagination.MoreThanOnePage) + Pag_WriteLinksToPagesCentered (Pag_ATT_EVENTS,0,&Pagination); /***** Free list of attendance events *****/ Att_FreeListAttEvents (); @@ -234,13 +237,11 @@ static void Att_ShowAllAttEvents (void) static void Att_PutFormToSelectWhichGroupsToShow (void) { - fprintf (Gbl.F.Out,"
"); Act_FormStart (ActSeeAtt); Att_PutHiddenParamAttOrderType (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); Grp_ShowSelectorWhichGrps (); - fprintf (Gbl.F.Out,"" - "
"); + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index a294cf1b..fa8a0607 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -35,11 +35,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.51 (2015/01/01)" +#define Log_PLATFORM_VERSION "SWAD 14.51.1 (2015/01/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 | tail -1 /* + Version 14.51.1 :Jan 02, 2014 Changes in layout and titles of some options. (172963 lines) Version 14.51 :Jan 01, 2014 Users can select horizontal or vertical menu. (172958 lines) 1 change necessary in Makefile: Add swad_menu.o to list of object files diff --git a/swad_group.c b/swad_group.c index 4f19e1ac..d3d2174a 100644 --- a/swad_group.c +++ b/swad_group.c @@ -4186,7 +4186,7 @@ void Grp_ShowSelectorWhichGrps (void) Grp_WhichGroups_t WhichGrps; fprintf (Gbl.F.Out,"