mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-18 14:35:46 +02:00
Version 17.2.5
This commit is contained in:
parent
855e07ea6e
commit
572a9c8182
|
@ -252,13 +252,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 17.2.4 (2017-09-18)"
|
#define Log_PLATFORM_VERSION "SWAD 17.2.5 (2017-09-18)"
|
||||||
#define CSS_FILE "swad17.0.css"
|
#define CSS_FILE "swad17.0.css"
|
||||||
#define JS_FILE "swad16.206.3.js"
|
#define JS_FILE "swad16.206.3.js"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 17.2.5: Sep 18, 2017 Get URL from form in projects. (229940 lines)
|
||||||
Version 17.2.4: Sep 18, 2017 New field URL in projects. (229929 lines)
|
Version 17.2.4: Sep 18, 2017 New field URL in projects. (229929 lines)
|
||||||
1 change necessary in database:
|
1 change necessary in database:
|
||||||
ALTER TABLE projects ADD COLUMN URL VARCHAR(255) NOT NULL AFTER Txt;
|
ALTER TABLE projects ADD COLUMN URL VARCHAR(255) NOT NULL AFTER Txt;
|
||||||
|
|
|
@ -153,7 +153,7 @@ static void Prj_ShowAllProjects (void)
|
||||||
NumPrj <= Pagination.LastItemVisible;
|
NumPrj <= Pagination.LastItemVisible;
|
||||||
NumPrj++)
|
NumPrj++)
|
||||||
Prj_ShowOneProject (Gbl.Prjs.LstPrjCods[NumPrj - 1],
|
Prj_ShowOneProject (Gbl.Prjs.LstPrjCods[NumPrj - 1],
|
||||||
false); // Not print view
|
false); // Not print view
|
||||||
|
|
||||||
/***** End table *****/
|
/***** End table *****/
|
||||||
Tbl_EndTable ();
|
Tbl_EndTable ();
|
||||||
|
@ -650,7 +650,7 @@ void Prj_GetDataOfProjectByCod (struct Project *Prj)
|
||||||
"UNIX_TIMESTAMP(StartTime),"
|
"UNIX_TIMESTAMP(StartTime),"
|
||||||
"UNIX_TIMESTAMP(EndTime),"
|
"UNIX_TIMESTAMP(EndTime),"
|
||||||
"NOW() BETWEEN StartTime AND EndTime,"
|
"NOW() BETWEEN StartTime AND EndTime,"
|
||||||
"Title,Preassigned"
|
"Title,Preassigned,URL"
|
||||||
" FROM projects"
|
" FROM projects"
|
||||||
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
||||||
Prj->PrjCod,Gbl.CurrentCrs.Crs.CrsCod);
|
Prj->PrjCod,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
|
@ -710,6 +710,10 @@ static void Prj_GetDataOfProject (struct Project *Prj,const char *Query)
|
||||||
Prj->Preassigned = (row[7][0] == 'Y') ? Prj_PREASSIGNED :
|
Prj->Preassigned = (row[7][0] == 'Y') ? Prj_PREASSIGNED :
|
||||||
Prj_NOT_PREASSIGNED;
|
Prj_NOT_PREASSIGNED;
|
||||||
|
|
||||||
|
/* Get the title of the project (row[8]) */
|
||||||
|
Str_Copy (Prj->URL,row[8],
|
||||||
|
Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/* Can I do this project? */
|
/* Can I do this project? */
|
||||||
Prj->IBelongToCrsOrGrps = Prj_CheckIfIBelongToCrsOrGrpsThisProject (Prj->PrjCod);
|
Prj->IBelongToCrsOrGrps = Prj_CheckIfIBelongToCrsOrGrpsThisProject (Prj->PrjCod);
|
||||||
}
|
}
|
||||||
|
@ -1191,37 +1195,41 @@ void Prj_RecFormProject (void)
|
||||||
bool NewProjectIsCorrect = true;
|
bool NewProjectIsCorrect = true;
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||||
|
|
||||||
/***** Get the code of the project *****/
|
/***** Get parameters from form *****/
|
||||||
|
/* Get the code of the project */
|
||||||
NewPrj.PrjCod = Prj_GetParamPrjCod ();
|
NewPrj.PrjCod = Prj_GetParamPrjCod ();
|
||||||
ItsANewProject = (NewPrj.PrjCod < 0);
|
ItsANewProject = (NewPrj.PrjCod < 0);
|
||||||
|
|
||||||
if (ItsANewProject)
|
if (ItsANewProject)
|
||||||
{
|
{
|
||||||
/***** Reset old (current, not existing) project data *****/
|
/* Reset old (current, not existing) project data */
|
||||||
OldPrj.PrjCod = -1L;
|
OldPrj.PrjCod = -1L;
|
||||||
Prj_ResetProject (&OldPrj);
|
Prj_ResetProject (&OldPrj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Get data of the old (current) project from database *****/
|
/* Get data of the old (current) project from database */
|
||||||
OldPrj.PrjCod = NewPrj.PrjCod;
|
OldPrj.PrjCod = NewPrj.PrjCod;
|
||||||
Prj_GetDataOfProjectByCod (&OldPrj);
|
Prj_GetDataOfProjectByCod (&OldPrj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Get start/end date-times *****/
|
/* Get start/end date-times */
|
||||||
NewPrj.TimeUTC[Dat_START_TIME] = Dat_GetTimeUTCFromForm ("StartTimeUTC");
|
NewPrj.TimeUTC[Dat_START_TIME] = Dat_GetTimeUTCFromForm ("StartTimeUTC");
|
||||||
NewPrj.TimeUTC[Dat_END_TIME ] = Dat_GetTimeUTCFromForm ("EndTimeUTC" );
|
NewPrj.TimeUTC[Dat_END_TIME ] = Dat_GetTimeUTCFromForm ("EndTimeUTC" );
|
||||||
|
|
||||||
/***** Get project title *****/
|
/* Get project title */
|
||||||
Par_GetParToText ("Title",NewPrj.Title,Prj_MAX_BYTES_PROJECT_TITLE);
|
Par_GetParToText ("Title",NewPrj.Title,Prj_MAX_BYTES_PROJECT_TITLE);
|
||||||
|
|
||||||
/***** Get folder name where to send works of the project *****/
|
/* Get folder name where to send works of the project */
|
||||||
NewPrj.Preassigned = (Par_GetParToBool ("Preassigned")) ? Prj_PREASSIGNED :
|
NewPrj.Preassigned = (Par_GetParToBool ("Preassigned")) ? Prj_PREASSIGNED :
|
||||||
Prj_NOT_PREASSIGNED;
|
Prj_NOT_PREASSIGNED;
|
||||||
|
|
||||||
/***** Get project text *****/
|
/* Get project text */
|
||||||
Par_GetParToHTML ("Txt",Txt,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
|
Par_GetParToHTML ("Txt",Txt,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
|
||||||
|
|
||||||
|
/* Get degree WWW */
|
||||||
|
Par_GetParToText ("URL",NewPrj.URL,Cns_MAX_BYTES_WWW);
|
||||||
|
|
||||||
/***** Adjust dates *****/
|
/***** Adjust dates *****/
|
||||||
if (NewPrj.TimeUTC[Dat_START_TIME] == 0)
|
if (NewPrj.TimeUTC[Dat_START_TIME] == 0)
|
||||||
NewPrj.TimeUTC[Dat_START_TIME] = Gbl.StartExecutionTimeUTC;
|
NewPrj.TimeUTC[Dat_START_TIME] = Gbl.StartExecutionTimeUTC;
|
||||||
|
@ -1287,14 +1295,15 @@ static void Prj_CreateProject (struct Project *Prj,const char *Txt)
|
||||||
{
|
{
|
||||||
char Query[1024 +
|
char Query[1024 +
|
||||||
Prj_MAX_BYTES_PROJECT_TITLE +
|
Prj_MAX_BYTES_PROJECT_TITLE +
|
||||||
Cns_MAX_BYTES_TEXT];
|
Cns_MAX_BYTES_TEXT +
|
||||||
|
Cns_MAX_BYTES_WWW];
|
||||||
|
|
||||||
/***** Create a new project *****/
|
/***** Create a new project *****/
|
||||||
sprintf (Query,"INSERT INTO projects"
|
sprintf (Query,"INSERT INTO projects"
|
||||||
" (CrsCod,UsrCod,StartTime,EndTime,Title,Preassigned,Txt)"
|
" (CrsCod,UsrCod,StartTime,EndTime,Title,Preassigned,Txt,URL)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%ld,FROM_UNIXTIME(%ld),FROM_UNIXTIME(%ld),"
|
" (%ld,%ld,FROM_UNIXTIME(%ld),FROM_UNIXTIME(%ld),"
|
||||||
"'%s','%c','%s')",
|
"'%s','%c','%s','%s')",
|
||||||
Gbl.CurrentCrs.Crs.CrsCod,
|
Gbl.CurrentCrs.Crs.CrsCod,
|
||||||
Gbl.Usrs.Me.UsrDat.UsrCod,
|
Gbl.Usrs.Me.UsrDat.UsrCod,
|
||||||
Prj->TimeUTC[Dat_START_TIME],
|
Prj->TimeUTC[Dat_START_TIME],
|
||||||
|
@ -1302,7 +1311,8 @@ static void Prj_CreateProject (struct Project *Prj,const char *Txt)
|
||||||
Prj->Title,
|
Prj->Title,
|
||||||
Prj->Preassigned == Prj_PREASSIGNED ? 'Y' :
|
Prj->Preassigned == Prj_PREASSIGNED ? 'Y' :
|
||||||
'N',
|
'N',
|
||||||
Txt);
|
Txt,
|
||||||
|
Prj->URL);
|
||||||
Prj->PrjCod = DB_QueryINSERTandReturnCode (Query,"can not create new project");
|
Prj->PrjCod = DB_QueryINSERTandReturnCode (Query,"can not create new project");
|
||||||
|
|
||||||
/***** Create groups *****/
|
/***** Create groups *****/
|
||||||
|
@ -1318,13 +1328,14 @@ static void Prj_UpdateProject (struct Project *Prj,const char *Txt)
|
||||||
{
|
{
|
||||||
char Query[1024 +
|
char Query[1024 +
|
||||||
Prj_MAX_BYTES_PROJECT_TITLE +
|
Prj_MAX_BYTES_PROJECT_TITLE +
|
||||||
Cns_MAX_BYTES_TEXT];
|
Cns_MAX_BYTES_TEXT +
|
||||||
|
Cns_MAX_BYTES_WWW];
|
||||||
|
|
||||||
/***** Update the data of the project *****/
|
/***** Update the data of the project *****/
|
||||||
sprintf (Query,"UPDATE projects SET "
|
sprintf (Query,"UPDATE projects SET "
|
||||||
"StartTime=FROM_UNIXTIME(%ld),"
|
"StartTime=FROM_UNIXTIME(%ld),"
|
||||||
"EndTime=FROM_UNIXTIME(%ld),"
|
"EndTime=FROM_UNIXTIME(%ld),"
|
||||||
"Title='%s',Preassigned='%c',Txt='%s'"
|
"Title='%s',Preassigned='%c',Txt='%s',URL='%s'"
|
||||||
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
" WHERE PrjCod=%ld AND CrsCod=%ld",
|
||||||
Prj->TimeUTC[Dat_START_TIME],
|
Prj->TimeUTC[Dat_START_TIME],
|
||||||
Prj->TimeUTC[Dat_END_TIME ],
|
Prj->TimeUTC[Dat_END_TIME ],
|
||||||
|
@ -1332,6 +1343,7 @@ static void Prj_UpdateProject (struct Project *Prj,const char *Txt)
|
||||||
Prj->Preassigned == Prj_PREASSIGNED ? 'Y' :
|
Prj->Preassigned == Prj_PREASSIGNED ? 'Y' :
|
||||||
'N',
|
'N',
|
||||||
Txt,
|
Txt,
|
||||||
|
Prj->URL,
|
||||||
Prj->PrjCod,Gbl.CurrentCrs.Crs.CrsCod);
|
Prj->PrjCod,Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
DB_QueryUPDATE (Query,"can not update project");
|
DB_QueryUPDATE (Query,"can not update project");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user