From b062fe6d96d07d7b3fddebd61c39a9346b2e9c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 7 Oct 2017 18:11:49 +0200 Subject: [PATCH] Version 17.20.3 --- swad_changelog.h | 4 +++- swad_project.c | 47 +++++++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index fb7498549..e1e40cf1a 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -256,13 +256,15 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 17.20.2 (2017-10-07)" +#define Log_PLATFORM_VERSION "SWAD 17.20.3 (2017-10-07)" #define CSS_FILE "swad17.0.css" #define JS_FILE "swad17.17.1.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 17.20.3: Oct 07, 2017 Changes in layout of project. + Fixed bug when hiding/shown a project. (232971 lines) Version 17.20.2: Oct 07, 2017 Fixed bugs and changes in layout of project file browser. (232960 lines) Version 17.20.1: Oct 07, 2017 Fixed bug in file browser clipboard. (232938 lines) Version 17.20: Oct 06, 2017 New file browser for project documents. Not finished. (232915 lines) diff --git a/swad_project.c b/swad_project.c index 910f6a613..2b5176943 100644 --- a/swad_project.c +++ b/swad_project.c @@ -627,13 +627,19 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie /* Forms to remove/edit this project */ fprintf (Gbl.F.Out,"" "",Gbl.RowEvenOdd); - Prj_PutFormsToRemEditOnePrj (Prj->PrjCod,Prj->Hidden); + case Prj_LIST_PROJECTS: + fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); + // no break + case Prj_FILE_BROWSER_PROJECT: + fprintf (Gbl.F.Out,"\">"); + Prj_PutFormsToRemEditOnePrj (Prj->PrjCod,Prj->Hidden); + break; + default: + fprintf (Gbl.F.Out,"\">"); + break; } - else - fprintf (Gbl.F.Out,"\">"); fprintf (Gbl.F.Out,""); /* Start date/time */ @@ -1563,7 +1569,7 @@ static void Prj_ReqRemUsrFromPrj (Prj_RoleInProject_t RoleInProject) Prj_GetParamPrjOrder (); Prj_GetParamWhichPrjs (); Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); - if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L) + if ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0) Lay_ShowErrorAndExit ("Code of project is missing."); /***** Get data of the project from database *****/ @@ -1646,7 +1652,7 @@ static void Prj_RemUsrFromPrj (Prj_RoleInProject_t RoleInProject) Prj_GetParamPrjOrder (); Prj_GetParamWhichPrjs (); Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); - if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L) + if ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0) Lay_ShowErrorAndExit ("Code of project is missing."); /***** Get data of the project from database *****/ @@ -2186,7 +2192,7 @@ void Prj_ReqRemProject (void) Prj_GetParamPrjOrder (); Prj_GetParamWhichPrjs (); Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); - if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L) + if ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0) Lay_ShowErrorAndExit ("Code of project is missing."); /***** Get data of the project from database *****/ @@ -2229,7 +2235,7 @@ void Prj_RemoveProject (void) Prj_GetParamPrjOrder (); Prj_GetParamWhichPrjs (); Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); - if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L) + if ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0) Lay_ShowErrorAndExit ("Code of project is missing."); /***** Get data of the project from database *****/ @@ -2278,8 +2284,11 @@ void Prj_HideProject (void) /***** Allocate memory for the project *****/ Prj_AllocMemProject (&Prj); - /***** Get project code *****/ - if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L) + /***** Get parameters *****/ + Prj_GetParamPrjOrder (); + Prj_GetParamWhichPrjs (); + Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); + if ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0) Lay_ShowErrorAndExit ("Code of project is missing."); /***** Get data of the project from database *****/ @@ -2321,8 +2330,11 @@ void Prj_ShowProject (void) /***** Allocate memory for the project *****/ Prj_AllocMemProject (&Prj); - /***** Get project code *****/ - if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L) + /***** Get parameters *****/ + Prj_GetParamPrjOrder (); + Prj_GetParamWhichPrjs (); + Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); + if ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0) Lay_ShowErrorAndExit ("Code of project is missing."); /***** Get data of the project from database *****/ @@ -2385,9 +2397,7 @@ static void Prj_RequestCreatOrEditPrj (long PrjCod) Prj_GetParamPrjOrder (); Prj_GetParamWhichPrjs (); Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); - - /***** Get the code of the project *****/ - ItsANewProject = ((Prj.PrjCod = PrjCod) == -1L); + ItsANewProject = ((Prj.PrjCod = PrjCod) < 0); /***** Get from the database the data of the project *****/ if (ItsANewProject) @@ -2696,10 +2706,7 @@ void Prj_RecFormProject (void) Prj_GetParamPrjOrder (); Prj_GetParamWhichPrjs (); Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS); - - /* Get the code of the project */ - Prj.PrjCod = Prj_GetParamPrjCod (); - ItsANewProject = (Prj.PrjCod < 0); + ItsANewProject = ((Prj.PrjCod = Prj_GetParamPrjCod ()) < 0); if (ItsANewProject) {