From 5fbb40778d41765d055e0eed4bcc5169867ee79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 20 Apr 2019 22:06:18 +0200 Subject: [PATCH] Version18.116.6 --- swad_assignment.c | 46 +++++++++++++++++++++++----------------------- swad_changelog.h | 3 ++- swad_project.c | 13 ++++++------- swad_text.c | 42 ------------------------------------------ 4 files changed, 31 insertions(+), 73 deletions(-) diff --git a/swad_assignment.c b/swad_assignment.c index cbca5ac7..10055107 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -79,7 +79,8 @@ static void Asg_WriteAsgAuthor (struct Assignment *Asg); static void Asg_WriteAssignmentFolder (struct Assignment *Asg,bool PrintView); static void Asg_GetParamAsgOrder (void); -static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden); +static void Asg_PutFormsToRemEditOneAsg (const struct Assignment *Asg, + const char *Anchor); static void Asg_PutParams (void); static void Asg_GetDataOfAssignment (struct Assignment *Asg, MYSQL_RES **mysql_res, @@ -340,6 +341,7 @@ void Asg_PrintOneAssignment (void) static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) { extern const char *Txt_Today; + char *Anchor = NULL; static unsigned UniqueId = 0; struct Assignment Asg; char Txt[Cns_MAX_BYTES_TEXT + 1]; @@ -348,6 +350,9 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) Asg.AsgCod = AsgCod; Asg_GetDataOfAssignmentByCod (&Asg); + /***** Set anchor string *****/ + Frm_SetAnchorStr (Asg.AsgCod,&Anchor); + /***** Write first row of data of this assignment *****/ /* Forms to remove/edit this assignment */ fprintf (Gbl.F.Out,"" @@ -357,7 +362,7 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) else { fprintf (Gbl.F.Out," COLOR%u\">",Gbl.RowEvenOdd); - Asg_PutFormsToRemEditOneAsg (Asg.AsgCod,Asg.Hidden); + Asg_PutFormsToRemEditOneAsg (&Asg,Anchor); } fprintf (Gbl.F.Out,""); @@ -400,14 +405,15 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) (unsigned) Gbl.Prefs.DateFormat,Txt_Today); /* Assignment title */ - fprintf (Gbl.F.Out,"" - "
%s
", - Asg.Hidden ? "ASG_TITLE_LIGHT" : - "ASG_TITLE", - Asg.Title); + fprintf (Gbl.F.Out,"\">"); + Lay_StartArticle (Anchor); + fprintf (Gbl.F.Out,"%s",Asg.Title); + Lay_EndArticle (); fprintf (Gbl.F.Out,""); /* Assignment folder */ @@ -452,6 +458,9 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView) "DAT", Txt); + /***** Free anchor string *****/ + Frm_FreeAnchorStr (Anchor); + Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; /***** Mark possible notification as seen *****/ @@ -533,9 +542,10 @@ void Asg_PutHiddenParamAsgOrder (void) /***************** Put a link (form) to edit one assignment ******************/ /*****************************************************************************/ -static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) +static void Asg_PutFormsToRemEditOneAsg (const struct Assignment *Asg, + const char *Anchor) { - Gbl.Asgs.AsgCodToEdit = AsgCod; // Used as parameter in contextual links + Gbl.Asgs.AsgCodToEdit = Asg->AsgCod; // Used as parameter in contextual links switch (Gbl.Usrs.Me.Role.Logged) { @@ -545,10 +555,10 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) Ico_PutContextualIconToRemove (ActReqRemAsg,Asg_PutParams); /***** Put form to hide/show assignment *****/ - if (Hidden) - Ico_PutContextualIconToUnhide (ActShoAsg,NULL,Asg_PutParams); + if (Asg->Hidden) + Ico_PutContextualIconToUnhide (ActShoAsg,Anchor,Asg_PutParams); else - Ico_PutContextualIconToHide (ActHidAsg,NULL,Asg_PutParams); + Ico_PutContextualIconToHide (ActHidAsg,Anchor,Asg_PutParams); /***** Put form to edit assignment *****/ Ico_PutContextualIconToEdit (ActEdiOneAsg,Asg_PutParams); @@ -995,7 +1005,6 @@ void Asg_RemoveAssignment (void) void Asg_HideAssignment (void) { - extern const char *Txt_Assignment_X_is_now_hidden; struct Assignment Asg; /***** Get assignment code *****/ @@ -1011,10 +1020,6 @@ void Asg_HideAssignment (void) " WHERE AsgCod=%ld AND CrsCod=%ld", Asg.AsgCod,Gbl.Hierarchy.Crs.CrsCod); - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_is_now_hidden, - Asg.Title); - /***** Show assignments again *****/ Asg_SeeAssignments (); } @@ -1025,7 +1030,6 @@ void Asg_HideAssignment (void) void Asg_ShowAssignment (void) { - extern const char *Txt_Assignment_X_is_now_visible; struct Assignment Asg; /***** Get assignment code *****/ @@ -1041,10 +1045,6 @@ void Asg_ShowAssignment (void) " WHERE AsgCod=%ld AND CrsCod=%ld", Asg.AsgCod,Gbl.Hierarchy.Crs.CrsCod); - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_Assignment_X_is_now_visible, - Asg.Title); - /***** Show assignments again *****/ Asg_SeeAssignments (); } diff --git a/swad_changelog.h b/swad_changelog.h index 2b9c88f5..0d98e48d 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -448,10 +448,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.116.5 (2019-04-20)" +#define Log_PLATFORM_VERSION "SWAD 18.116.6 (2019-04-20)" #define CSS_FILE "swad18.112.1.css" #define JS_FILE "swad18.116.5.js" /* + Version 18.116.6: Apr 20, 2019 Changed the behaviour of hiding/showing an assignment. (242974 lines) Version 18.116.5: Apr 20, 2019 Changed the behaviour of hiding/showing an attendance event. Code refactoring related to anchors. (243014 lines) Version 18.116.4: Apr 20, 2019 Changed the behaviour of hiding/showing an agenda event. (243130 lines) diff --git a/swad_project.c b/swad_project.c index 286cdabf..32689fff 100644 --- a/swad_project.c +++ b/swad_project.c @@ -991,9 +991,7 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj, Prj->Hidden == Prj_HIDDEN ? "DATE_BLUE_LIGHT" : "DATE_BLUE", Gbl.RowEvenOdd); - Lay_StartArticle (Anchor); fprintf (Gbl.F.Out,"%u",NumIndex); - Lay_EndArticle (); fprintf (Gbl.F.Out,""); break; default: @@ -1051,10 +1049,13 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj, (unsigned) Gbl.Prefs.DateFormat,Txt_Today); /* Project title */ - fprintf (Gbl.F.Out,"Hidden == Prj_HIDDEN ? "ASG_TITLE_LIGHT" : + "ASG_TITLE"); if (ProjectView == Prj_LIST_PROJECTS) fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out,"\">"); + Lay_StartArticle (Anchor); if (ICanViewProjectFiles) { Frm_StartForm (ActAdmDocPrj); @@ -1067,10 +1068,8 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj, Frm_EndForm (); } else - fprintf (Gbl.F.Out,"
%s
", - Prj->Hidden == Prj_HIDDEN ? "ASG_TITLE_LIGHT" : - "ASG_TITLE", - Prj->Title); + fprintf (Gbl.F.Out,"%s",Prj->Title); + Lay_EndArticle (); fprintf (Gbl.F.Out,""); /* Department */ diff --git a/swad_text.c b/swad_text.c index bd541149..c905b9a1 100644 --- a/swad_text.c +++ b/swad_text.c @@ -2072,48 +2072,6 @@ const char *Txt_Assignment = "Atividade"; #endif -const char *Txt_Assignment_X_is_now_hidden = // Warning: it is very important to include %s in the following sentences -#if L==1 // ca - "La activitat %s ara està oculta."; -#elif L==2 // de - "Die Aufgabe %s ist jetzt ausgeblendet."; -#elif L==3 // en - "Assignment %s is now hidden."; -#elif L==4 // es - "La actividad %s ahora está oculta."; -#elif L==5 // fr - "L'activité %s est maintenant cachée."; -#elif L==6 // gn - "La actividad %s ahora está oculta."; // Okoteve traducción -#elif L==7 // it - "L'attività %s è ora nascosta."; -#elif L==8 // pl - "Zadanie %s jest ukryte."; -#elif L==9 // pt - "A atividade %s é agora oculta."; -#endif - -const char *Txt_Assignment_X_is_now_visible = // Warning: it is very important to include %s in the following sentences -#if L==1 // ca - "La activitat %s ara està visible."; -#elif L==2 // de - "Die Aufgabe %s ist jetzt sichtbar."; -#elif L==3 // en - "Assignment %s is now visible."; -#elif L==4 // es - "La actividad %s ahora está visible."; -#elif L==5 // fr - "L'activité %s est maintenant visible."; -#elif L==6 // gn - "La actividad %s ahora está visible."; // Okoteve traducción -#elif L==7 // it - "L'attività %s è ora visibile."; -#elif L==8 // pl - "Zadanie %s jest teraz widoczny."; -#elif L==9 // pt - "A atividade %s é agora visível."; -#endif - const char *Txt_Assignment_X_removed = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "Activitat %s eliminada.";