From c84a33492c7f926eef30f220b9e1b6033ba5a047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 13 Dec 2015 19:37:08 +0100 Subject: [PATCH] Version 15.64.10 --- swad_assignment.c | 18 +++++++----------- swad_attendance.c | 44 ++++++++++++++++++++++---------------------- swad_changelog.h | 4 +++- swad_global.h | 4 +++- swad_survey.c | 46 +++++++++++++++++++++++----------------------- 5 files changed, 58 insertions(+), 58 deletions(-) diff --git a/swad_assignment.c b/swad_assignment.c index a95d8cf8..308f8b30 100644 --- a/swad_assignment.c +++ b/swad_assignment.c @@ -496,38 +496,34 @@ static void Asg_PutFormsToRemEditOneAsg (long AsgCod,bool Hidden) fprintf (Gbl.F.Out,"
"); - Gbl.Asgs.AsgCod = AsgCod; // Used as parameters in contextual links + Gbl.Asgs.AsgCodToEdit = AsgCod; // Used as parameter in contextual links /***** Put form to remove assignment *****/ - Lay_PutContextualLink (ActReqRemAsg,Asg_PutParams, - "remove-on64x64.png", + Lay_PutContextualLink (ActReqRemAsg,Asg_PutParams,"remove-on64x64.png", Txt_Remove,NULL); /***** Put form to hide/show assignment *****/ if (Hidden) - Lay_PutContextualLink (ActShoAsg,Asg_PutParams, - "eye-slash-on64x64.png", + Lay_PutContextualLink (ActShoAsg,Asg_PutParams,"eye-slash-on64x64.png", Txt_Show,NULL); else - Lay_PutContextualLink (ActHidAsg,Asg_PutParams, - "eye-on64x64.png", + Lay_PutContextualLink (ActHidAsg,Asg_PutParams,"eye-on64x64.png", Txt_Hide,NULL); /***** Put form to edit assignment *****/ - Lay_PutContextualLink (ActEdiOneAsg,Asg_PutParams, - "edit64x64.png", + Lay_PutContextualLink (ActEdiOneAsg,Asg_PutParams,"edit64x64.png", Txt_Edit,NULL); fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ -/********************** Params related to an assignment **********************/ +/******************** Params used to edit an assignment **********************/ /*****************************************************************************/ static void Asg_PutParams (void) { - Asg_PutParamAsgCod (Gbl.Asgs.AsgCod); + Asg_PutParamAsgCod (Gbl.Asgs.AsgCodToEdit); Asg_PutHiddenParamAsgOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); diff --git a/swad_attendance.c b/swad_attendance.c index 8e4bf733..06e9a315 100644 --- a/swad_attendance.c +++ b/swad_attendance.c @@ -83,6 +83,7 @@ static void Att_PutFormToCreateNewAttEvent (void); static void Att_PutFormToCreateNewAttEventParams (void); static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden); +static void Att_PutParams (void); static void Att_GetListAttEvents (Att_OrderTime_t Order); static void Att_GetDataOfAttEventByCodAndCheckCrs (struct AttendanceEvent *Att); static void Att_GetAttEventTxtFromDB (long AttCod,char *Txt); @@ -525,38 +526,37 @@ static void Att_PutFormsToRemEditOneAttEvent (long AttCod,bool Hidden) fprintf (Gbl.F.Out,"
"); + Gbl.AttEvents.AttCodToEdit = AttCod; // Used as parameters in contextual links + /***** Put form to remove attendance event *****/ - Act_FormStart (ActReqRemAtt); - Att_PutParamAttCod (AttCod); - Att_PutHiddenParamAttOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutIconLink ("remove-on64x64.png",Txt_Remove,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActReqRemAtt,Att_PutParams,"remove-on64x64.png", + Txt_Remove,NULL); /***** Put form to hide/show attendance event *****/ - Act_FormStart (Hidden ? ActShoAtt : - ActHidAtt); - Att_PutParamAttCod (AttCod); - Att_PutHiddenParamAttOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); if (Hidden) - Lay_PutIconLink ("eye-slash-on64x64.png",Txt_Show,NULL,NULL); + Lay_PutContextualLink (ActShoAtt,Att_PutParams,"eye-slash-on64x64.png", + Txt_Show,NULL); else - Lay_PutIconLink ("eye-on64x64.png",Txt_Hide,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActHidAtt,Att_PutParams,"eye-on64x64.png", + Txt_Hide,NULL); /***** Put form to edit attendance event *****/ - Act_FormStart (ActEdiOneAtt); - Att_PutParamAttCod (AttCod); + Lay_PutContextualLink (ActEdiOneAtt,Att_PutParams,"edit64x64.png", + Txt_Edit,NULL); + + fprintf (Gbl.F.Out,"
"); + } + +/*****************************************************************************/ +/***************** Params used to edit an attendance event *******************/ +/*****************************************************************************/ + +static void Att_PutParams (void) + { + Att_PutParamAttCod (Gbl.AttEvents.AttCodToEdit); Att_PutHiddenParamAttOrderType (); Grp_PutParamWhichGrps (); Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutIconLink ("edit64x64.png",Txt_Edit,NULL,NULL); - Act_FormEnd (); - - fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_changelog.h b/swad_changelog.h index 60d09d05..a422df72 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -117,12 +117,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.64.8 (2015/12/13)" +#define Log_PLATFORM_VERSION "SWAD 15.64.10 (2015/12/13)" #define CSS_FILE "swad15.64.5.css" // 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 15.64.10: Dec 13, 2015 Code refactoring in contextual links. (187060 lines) + Version 15.64.9: Dec 13, 2015 Code refactoring in contextual links. (187061 lines) Version 15.64.8: Dec 13, 2015 Code refactoring in contextual links. (187066 lines) Version 15.64.7: Dec 13, 2015 Code refactoring in contextual links. (187063 lines) Version 15.64.6: Dec 13, 2015 Code refactoring in contextual links. (186974 lines) diff --git a/swad_global.h b/swad_global.h index 7c3fce09..bd777cae 100644 --- a/swad_global.h +++ b/swad_global.h @@ -540,7 +540,7 @@ struct Globals unsigned Num; // Number of assignments long *LstAsgCods; // List of assigment codes tAsgsOrderType SelectedOrderType; - long AsgCod; // Used as parameter in contextual links + long AsgCodToEdit; // Used as parameter in contextual links } Asgs; struct { @@ -551,6 +551,7 @@ struct Globals long AttCod; bool ShowDetails; char *StrAttCodsSelected; + long AttCodToEdit; // Used as parameter in contextual links } AttEvents; struct { @@ -653,6 +654,7 @@ struct Globals unsigned Num; // Number of surveys long *LstSvyCods; // List of survey codes tSvysOrderType SelectedOrderType; + long SvyCodToEdit; // Used as parameter in contextual links } Svys; struct { diff --git a/swad_survey.c b/swad_survey.c index f92fb405..480c3e09 100644 --- a/swad_survey.c +++ b/swad_survey.c @@ -102,6 +102,7 @@ static void Svy_PutFormToCreateNewSvy (void); static void Svy_PutFormToCreateNewSvyParams (void); static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible); +static void Svy_PutParams (void); static void Svy_GetSurveyTxtFromDB (long SvyCod,char *Txt); static void Svy_PutParamSvyCod (long SvyCod); static long Svy_GetParamSvyCod (void); @@ -729,14 +730,11 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) fprintf (Gbl.F.Out,"
"); + Gbl.Svys.SvyCodToEdit = SvyCod; // Used as parameters in contextual links + /***** Put form to remove survey *****/ - Act_FormStart (ActReqRemSvy); - Svy_PutParamSvyCod (SvyCod); - Svy_PutHiddenParamSvyOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutIconLink ("remove-on64x64.png",Txt_Remove,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActReqRemSvy,Svy_PutParams,"remove-on64x64.png", + Txt_Remove,NULL); /***** Put form to reset survey *****/ Act_FormStart (ActReqRstSvy); @@ -748,30 +746,32 @@ static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible) Act_FormEnd (); /***** Put form to hide/show survey *****/ - Act_FormStart (Visible ? ActHidSvy : - ActShoSvy); - Svy_PutParamSvyCod (SvyCod); - Svy_PutHiddenParamSvyOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); if (Visible) - Lay_PutIconLink ("eye-on64x64.png",Txt_Hide,NULL,NULL); + Lay_PutContextualLink (ActHidSvy,Svy_PutParams,"eye-on64x64.png", + Txt_Hide,NULL); else - Lay_PutIconLink ("eye-slash-on64x64.png",Txt_Show,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActShoSvy,Svy_PutParams,"eye-slash-on64x64.png", + Txt_Show,NULL); /***** Put form to edit survey *****/ - Act_FormStart (ActEdiOneSvy); - Svy_PutParamSvyCod (SvyCod); - Svy_PutHiddenParamSvyOrderType (); - Grp_PutParamWhichGrps (); - Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); - Lay_PutIconLink ("edit64x64.png",Txt_Edit,NULL,NULL); - Act_FormEnd (); + Lay_PutContextualLink (ActEdiOneSvy,Svy_PutParams,"edit64x64.png", + Txt_Edit,NULL); fprintf (Gbl.F.Out,"
"); } +/*****************************************************************************/ +/********************** Params used to edit a survey *************************/ +/*****************************************************************************/ + +static void Svy_PutParams (void) + { + Att_PutParamAttCod (Gbl.AttEvents.AttCodToEdit); + Att_PutHiddenParamAttOrderType (); + Grp_PutParamWhichGrps (); + Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage); + } + /*****************************************************************************/ /*********************** Get list of all the surveys *************************/ /*****************************************************************************/