Version 17.5.1

This commit is contained in:
Antonio Cañas Vargas 2017-09-21 12:43:35 +02:00
parent ffe019a50a
commit 6bc7833226
2 changed files with 27 additions and 6 deletions

View File

@ -252,13 +252,15 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 17.5 (2017-09-21)"
#define Log_PLATFORM_VERSION "SWAD 17.5.1 (2017-09-21)"
#define CSS_FILE "swad17.0.css"
#define JS_FILE "swad16.206.3.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.5.2: Sep 21, 2017 Do not display users when creating a new project. (? lines)
Version 17.5.1: Sep 21, 2017 Fixed bug when removing a project. (230267 lines)
Version 17.5: Sep 21, 2017 Users can be added to a project. (230250 lines)
Version 17.4.3: Sep 21, 2017 Changes in listing and edition of projects. (230222 lines)
Version 17.4.2: Sep 20, 2017 Changes in listing and edition of projects. (230203 lines)

View File

@ -1117,7 +1117,7 @@ long Prj_GetParamPrjCod (void)
}
/*****************************************************************************/
/*************** Ask for confirmation of removing a project ******************/
/**************** Ask for confirmation of removing a project *****************/
/*****************************************************************************/
void Prj_ReqRemProject (void)
@ -1126,11 +1126,12 @@ void Prj_ReqRemProject (void)
extern const char *Txt_Remove_project;
struct Project Prj;
/***** Allocate memory for the project *****/
Prj_AllocMemProject (&Prj);
/***** Get parameters *****/
Prj_GetParamPrjOrder ();
Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS);
/***** Get project code *****/
if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of project is missing.");
@ -1145,6 +1146,9 @@ void Prj_ReqRemProject (void)
ActRemPrj,NULL,NULL,Prj_PutParams,
Btn_REMOVE_BUTTON,Txt_Remove_project);
/***** Free memory of the project *****/
Prj_FreeMemProject (&Prj);
/***** Show projects again *****/
Prj_SeeProjects ();
}
@ -1156,16 +1160,28 @@ void Prj_ReqRemProject (void)
void Prj_RemoveProject (void)
{
extern const char *Txt_Project_X_removed;
char Query[512];
char Query[256];
struct Project Prj;
/***** Get project code *****/
/***** Allocate memory for the project *****/
Prj_AllocMemProject (&Prj);
/***** Get parameters *****/
Prj_GetParamPrjOrder ();
Gbl.Prjs.CurrentPage = Pag_GetParamPagNum (Pag_PROJECTS);
if ((Prj.PrjCod = Prj_GetParamPrjCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of project is missing.");
/***** Get data of the project from database *****/
Prj_GetDataOfProjectByCod (&Prj); // Inside this function, the course is checked to be the current one
/***** Remove users in project *****/
sprintf (Query,"DELETE FROM prj_usr USING projects,prj_usr"
" WHERE projects.PrjCod=%ld AND projects.CrsCod=%ld"
" AND projects.PrjCod=prj_usr.PrjCod",
Prj.PrjCod,Gbl.CurrentCrs.Crs.CrsCod);
DB_QueryDELETE (Query,"can not remove project");
/***** Remove project *****/
sprintf (Query,"DELETE FROM projects"
" WHERE PrjCod=%ld AND CrsCod=%ld",
@ -1177,6 +1193,9 @@ void Prj_RemoveProject (void)
Prj.Title);
Ale_ShowAlert (Ale_SUCCESS,Gbl.Alert.Txt);
/***** Free memory of the project *****/
Prj_FreeMemProject (&Prj);
/***** Show projects again *****/
Prj_SeeProjects ();
}