diff --git a/swad_assignment.c b/swad_assignment.c index 91146348..2f39533d 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -63,7 +63,7 @@ extern struct Globals Gbl; /*****************************************************************************/ static void Asg_ShowAllAssignments (void); -static void Asg_PutHeadForSeeing (void); +static void Asg_PutHeadForSeeing (bool PrintView); static bool Asg_CheckIfICanCreateAssignments (void); static void Asg_PutIconsListAssignments (void); static void Asg_PutIconToCreateNewAsg (void); @@ -146,7 +146,7 @@ static void Asg_ShowAllAssignments (void) { /***** Table head *****/ Lay_StartTableWideMargin (2); - Asg_PutHeadForSeeing (); + Asg_PutHeadForSeeing (false); // Not print view /***** Write all the assignments *****/ for (NumAsg = Pagination.FirstItemVisible; @@ -182,7 +182,7 @@ static void Asg_ShowAllAssignments (void) /***************** Write header with fields of an assignment *****************/ /*****************************************************************************/ -static void Asg_PutHeadForSeeing (void) +static void Asg_PutHeadForSeeing (bool PrintView) { extern const char *Txt_START_END_TIME_HELP[Dat_NUM_START_END_TIME]; extern const char *Txt_START_END_TIME[Dat_NUM_START_END_TIME]; @@ -198,18 +198,26 @@ static void Asg_PutHeadForSeeing (void) Order++) { fprintf (Gbl.F.Out,""); - Act_FormStart (ActSeeAsg); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Pag_ASSIGNMENTS,Gbl.Asgs.CurrentPage); - Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); - Act_LinkFormSubmit (Txt_START_END_TIME_HELP[Order],"TIT_TBL",NULL); - if (Order == Gbl.Asgs.SelectedOrder) - fprintf (Gbl.F.Out,""); + + if (!PrintView) + { + Act_FormStart (ActSeeAsg); + Grp_PutParamWhichGrps (); + Pag_PutHiddenParamPagNum (Pag_ASSIGNMENTS,Gbl.Asgs.CurrentPage); + Par_PutHiddenParamUnsigned ("Order",(unsigned) Order); + Act_LinkFormSubmit (Txt_START_END_TIME_HELP[Order],"TIT_TBL",NULL); + if (Order == Gbl.Asgs.SelectedOrder) + fprintf (Gbl.F.Out,""); + } fprintf (Gbl.F.Out,"%s",Txt_START_END_TIME[Order]); - if (Order == Gbl.Asgs.SelectedOrder) - fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,""); - Act_FormEnd (); + if (!PrintView) + { + if (Order == Gbl.Asgs.SelectedOrder) + fprintf (Gbl.F.Out,""); + fprintf (Gbl.F.Out,""); + Act_FormEnd (); + } + fprintf (Gbl.F.Out,""); } fprintf (Gbl.F.Out,"" @@ -319,7 +327,7 @@ void Asg_PrintOneAssignment (void) /***** Table head *****/ Lay_StartTableWideMargin (2); - Asg_PutHeadForSeeing (); + Asg_PutHeadForSeeing (true); // Print view /***** Write assignment *****/ Asg_ShowOneAssignment (AsgCod, @@ -350,62 +358,76 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) /***** Write first row of data of this assignment *****/ /* Forms to remove/edit this assignment */ fprintf (Gbl.F.Out,"" - "", - Gbl.RowEvenOdd); - if (!PrintView) + ""); + else + { + fprintf (Gbl.F.Out," COLOR%u\">",Gbl.RowEvenOdd); Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden); + } fprintf (Gbl.F.Out,""); /* Start date/time */ UniqueId++; - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" "" "", + UniqueId, + Asg.TimeUTC[Dat_START_TIME],Txt_Today); + + /* End date/time */ + UniqueId++; + fprintf (Gbl.F.Out,"" + "DATE_RED")); + if (!PrintView) + fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); + fprintf (Gbl.F.Out,"\">" "" "", - UniqueId, - Asg.Hidden ? (Asg.Open ? "DATE_GREEN_LIGHT" : - "DATE_RED_LIGHT") : - (Asg.Open ? "DATE_GREEN" : - "DATE_RED"), - Gbl.RowEvenOdd, - UniqueId,Asg.TimeUTC[Dat_END_TIME],Txt_Today); + UniqueId, + Asg.TimeUTC[Dat_END_TIME],Txt_Today); /* Assignment title */ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" "
%s
", - Gbl.RowEvenOdd, Asg.Hidden ? "ASG_TITLE_LIGHT" : "ASG_TITLE", Asg.Title); fprintf (Gbl.F.Out,""); /* Send work? */ - fprintf (Gbl.F.Out,"" + fprintf (Gbl.F.Out,"" "\"%s\"" "
%s" "", - (Asg.SendWork == Asg_SEND_WORK) ? "DAT_N" : - "DAT", - Gbl.RowEvenOdd, Gbl.Prefs.IconsURL, (Asg.SendWork == Asg_SEND_WORK) ? "file_on" : "file_off", @@ -415,8 +437,10 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) Txt_No); /* Assignment folder */ - fprintf (Gbl.F.Out,"", - Gbl.RowEvenOdd); + fprintf (Gbl.F.Out,""); if (Asg.SendWork == Asg_SEND_WORK) Asg_WriteAssignmentFolder (&Asg,PrintView); fprintf (Gbl.F.Out,"" @@ -424,8 +448,10 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) /***** Write second row of data of this assignment *****/ fprintf (Gbl.F.Out,"" - "", - Gbl.RowEvenOdd); + ""); /* Author of the assignment */ Asg_WriteAsgAuthor (&Asg); @@ -437,8 +463,10 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, Txt,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML Str_InsertLinks (Txt,Cns_MAX_BYTES_TEXT,60); // Insert links - fprintf (Gbl.F.Out,"", - Gbl.RowEvenOdd); + fprintf (Gbl.F.Out,""); if (Gbl.CurrentCrs.Grps.NumGrps) Asg_GetAndWriteNamesOfGrpsAssociatedToAsg (&Asg); diff --git a/swad_changelog.h b/swad_changelog.h index b4cb9db3..b737cf44 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -220,13 +220,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.201.4 (2017-05-02)" +#define Log_PLATFORM_VERSION "SWAD 16.201.5 (2017-05-02)" #define CSS_FILE "swad16.201.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.201.5: May 02, 2017 Changes in layout of assignment print view. (218270 lines) Version 16.201.4: May 02, 2017 Icon to view course info when editing source of information. (218243 lines) Version 16.201.3: May 02, 2017 Code refactoring in forums. (218237 lines) Version 16.201.2: May 02, 2017 Code refactoring in messages. (218242 lines)