diff --git a/swad_changelog.h b/swad_changelog.h index 7876273e7..afe9ee566 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.9 (2019-04-20)" +#define Log_PLATFORM_VERSION "SWAD 18.116.10 (2019-04-20)" #define CSS_FILE "swad18.112.1.css" #define JS_FILE "swad18.116.5.js" /* + Version 18.116.10: Apr 20, 2019 Changed the behaviour of hiding/showing a survey. (242802 lines) Version 18.116.9: Apr 20, 2019 Changed the behaviour of hiding/showing a game. (242841 lines) Version 18.116.8: Apr 20, 2019 Changed the behaviour of hiding/showing an exam announcement. (242881 lines) Version 18.116.7: Apr 20, 2019 Changed the behaviour of hiding/showing a banner. (242934 lines) diff --git a/swad_survey.c b/swad_survey.c index 6a9d17845..016331dde 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -106,7 +106,8 @@ static void Svy_WriteAuthor (struct Survey *Svy); static void Svy_WriteStatus (struct Survey *Svy); static void Svy_GetParamSvyOrder (void); -static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible); +static void Svy_PutFormsToRemEditOneSvy (const struct Survey *Svy, + const char *Anchor); static void Svy_PutParams (void); static void Svy_SetAllowedAndHiddenScopes (unsigned *ScopesAllowed, @@ -431,6 +432,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, extern const char *Txt_Users; extern const char *Txt_Answer_survey; extern const char *Txt_View_survey_results; + char *Anchor = NULL; static unsigned UniqueId = 0; struct Survey Svy; char Txt[Cns_MAX_BYTES_TEXT + 1]; @@ -444,6 +446,9 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, Svy.SvyCod = SvyCod; Svy_GetDataOfSurveyByCod (&Svy); + /***** Set anchor string *****/ + Frm_SetAnchorStr (Svy.SvyCod,&Anchor); + /***** Start table *****/ if (ShowOnlyThisSvyComplete) Tbl_StartTableWide (2); @@ -456,7 +461,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out,"\">"); if (Svy.Status.ICanEdit) - Svy_PutFormsToRemEditOneSvy (Svy.SvyCod,Svy.Status.Visible); + Svy_PutFormsToRemEditOneSvy (&Svy,Anchor); fprintf (Gbl.F.Out,""); /* Start date/time */ @@ -501,8 +506,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, if (!ShowOnlyThisSvyComplete) fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out,"\">"); - - /* Put form to view survey */ + Lay_StartArticle (Anchor); Frm_StartForm (ActSeeOneSvy); Svy_PutParamSvyCod (SvyCod); Svy_PutHiddenParamSvyOrder (); @@ -514,6 +518,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, fprintf (Gbl.F.Out,"%s", Svy.Title); Frm_EndForm (); + Lay_EndArticle (); /* Number of questions and number of distinct users who have already answered this survey */ fprintf (Gbl.F.Out,"
%s: %u; %s: %u
" @@ -677,6 +682,9 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst, /***** End box *****/ Box_EndBox (); } + + /***** Free anchor string *****/ + Frm_FreeAnchorStr (Anchor); } /*****************************************************************************/ @@ -794,11 +802,12 @@ void Svy_PutHiddenParamSvyOrder (void) /******************* Put a link (form) to edit one survey ********************/ /*****************************************************************************/ -static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) +static void Svy_PutFormsToRemEditOneSvy (const struct Survey *Svy, + const char *Anchor) { extern const char *Txt_Reset; - Gbl.Svys.SvyCodToEdit = SvyCod; // Used as parameters in contextual links + Gbl.Svys.SvyCodToEdit = Svy->SvyCod; // Used as parameters in contextual links /***** Put form to remove survey *****/ Ico_PutContextualIconToRemove (ActReqRemSvy,Svy_PutParams); @@ -809,10 +818,10 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) Txt_Reset); /***** Put form to hide/show survey *****/ - if (Visible) - Ico_PutContextualIconToHide (ActHidSvy,NULL,Svy_PutParams); + if (Svy->Status.Visible) + Ico_PutContextualIconToHide (ActHidSvy,Anchor,Svy_PutParams); else - Ico_PutContextualIconToUnhide (ActShoSvy,NULL,Svy_PutParams); + Ico_PutContextualIconToUnhide (ActShoSvy,Anchor,Svy_PutParams); /***** Put form to edit survey *****/ Ico_PutContextualIconToEdit (ActEdiOneSvy,Svy_PutParams); @@ -1677,7 +1686,6 @@ void Svy_ResetSurvey (void) void Svy_HideSurvey (void) { - extern const char *Txt_Survey_X_is_now_hidden; struct Survey Svy; struct SurveyQuestion SvyQst; @@ -1698,10 +1706,6 @@ void Svy_HideSurvey (void) "UPDATE surveys SET Hidden='Y' WHERE SvyCod=%ld", Svy.SvyCod); - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_Survey_X_is_now_hidden, - Svy.Title); - /***** Show surveys again *****/ Svy_ListAllSurveys (&SvyQst); } @@ -1712,7 +1716,6 @@ void Svy_HideSurvey (void) void Svy_UnhideSurvey (void) { - extern const char *Txt_Survey_X_is_now_visible; struct Survey Svy; struct SurveyQuestion SvyQst; @@ -1733,10 +1736,6 @@ void Svy_UnhideSurvey (void) "UPDATE surveys SET Hidden='N' WHERE SvyCod=%ld", Svy.SvyCod); - /***** Write message to show the change made *****/ - Ale_ShowAlert (Ale_SUCCESS,Txt_Survey_X_is_now_visible, - Svy.Title); - /***** Show surveys again *****/ Svy_ListAllSurveys (&SvyQst); } diff --git a/swad_text.c b/swad_text.c index ed368db12..5b70ecf81 100644 --- a/swad_text.c +++ b/swad_text.c @@ -41547,48 +41547,6 @@ const char *Txt_SURVEY_Type_of_user_not_allowed = "Tipo de usuário não permitido"; #endif -const char *Txt_Survey_X_is_now_hidden = // Warning: it is very important to include %s in the following sentences -#if L==1 // ca - "L'enquesta %s ara està oculta."; -#elif L==2 // de - "Die Umfrage %s ist jetzt ausgeblendet."; -#elif L==3 // en - "Survey %s is now hidden."; -#elif L==4 // es - "La encuesta %s ahora está oculta."; -#elif L==5 // fr - "Le sondage %s est maintenant caché."; -#elif L==6 // gn - "La encuesta %s ahora está oculta."; // Okoteve traducción -#elif L==7 // it - "Il sondaggio %s è ora nascosto."; -#elif L==8 // pl - "Badanie %s jest teraz ukryta."; -#elif L==9 // pt - "O inquérito %s é agora oculto."; -#endif - -const char *Txt_Survey_X_is_now_visible = // Warning: it is very important to include %s in the following sentences -#if L==1 // ca - "L'enquesta %s ara està visible."; -#elif L==2 // de - "Die Umfrage %s ist jetzt sichtbar."; -#elif L==3 // en - "Survey %s is now visible."; -#elif L==4 // es - "La encuesta %s ahora está visible."; -#elif L==5 // fr - "Le sondage %s est maintenant visible."; -#elif L==6 // gn - "La encuesta %s ahora está visible."; // Okoteve traducción -#elif L==7 // it - "Il sondaggio %s è ora visibile."; -#elif L==8 // pl - "Badanie %s jest teraz widoczne."; -#elif L==9 // pt - "O inquérito %s é agora visível."; -#endif - const char *Txt_Survey_X_removed = // Warning: it is very important to include %s in the following sentences #if L==1 // ca "Enquesta %s eliminada.";