diff --git a/js/swad17.13.js b/js/swad17.15.js
similarity index 99%
rename from js/swad17.13.js
rename to js/swad17.15.js
index 98edccd29..64284767b 100644
--- a/js/swad17.13.js
+++ b/js/swad17.15.js
@@ -686,7 +686,7 @@ function expandTextarea (textareaElem,idButton,rows) {
function toggleProject (prjID) {
toggleDisplay('prj_exp_' + prjID);
toggleDisplay('prj_con_' + prjID);
- toggleDisplay('prj_sta_' + prjID);
+ toggleDisplay('prj_pro_' + prjID);
toggleDisplay('prj_dsc_' + prjID);
toggleDisplay('prj_knw_' + prjID);
toggleDisplay('prj_mtr_' + prjID);
diff --git a/sql/swad.sql b/sql/swad.sql
index fcfee4486..74313b81a 100644
--- a/sql/swad.sql
+++ b/sql/swad.sql
@@ -947,7 +947,7 @@ CREATE TABLE IF NOT EXISTS projects (
Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',
Preassigned ENUM('N','Y') NOT NULL DEFAULT 'N',
NumStds INT NOT NULL DEFAULT 1,
- Status ENUM('new','reproposed') NOT NULL DEFAULT 'new',
+ Proposal ENUM('new','modified','unmodified') NOT NULL DEFAULT 'new',
StartTime DATETIME NOT NULL,
EndTime DATETIME NOT NULL,
Title VARCHAR(2047) NOT NULL,
diff --git a/swad_changelog.h b/swad_changelog.h
index b5b616d86..7f35f4b61 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -252,13 +252,20 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 17.14 (2017-10-02)"
+#define Log_PLATFORM_VERSION "SWAD 17.15 (2017-10-02)"
#define CSS_FILE "swad17.0.css"
-#define JS_FILE "swad17.13.js"
+#define JS_FILE "swad17.15.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.15: Oct 02, 2017 Status in projects changed for proposal. (231985 lines)
+ 4 changes necessary in database:
+ALTER TABLE projects ADD COLUMN Proposal ENUM('new','modified','unmodified') NOT NULL DEFAULT 'new' AFTER Status;
+UPDATE projects SET Proposal='new' WHERE Status='new';
+UPDATE projects SET Proposal='unmodified' WHERE Status='reproposed';
+ALTER TABLE projects DROP COLUMN Status;
+
Version 17.14: Oct 02, 2017 New field number of students in projects. (231937 lines)
1 change necessary in database:
ALTER TABLE projects ADD COLUMN NumStds INT NOT NULL DEFAULT 1 AFTER Preassigned;
diff --git a/swad_database.c b/swad_database.c
index c24792b51..d8c58dee5 100644
--- a/swad_database.c
+++ b/swad_database.c
@@ -2006,24 +2006,24 @@ mysql> DESCRIBE prj_usr;
/***** Table projects *****/
/*
mysql> DESCRIBE projects;
-+-------------+--------------------------+------+-----+---------+----------------+
-| Field | Type | Null | Key | Default | Extra |
-+-------------+--------------------------+------+-----+---------+----------------+
-| PrjCod | int(11) | NO | PRI | NULL | auto_increment |
-| CrsCod | int(11) | NO | MUL | -1 | |
-| DptCod | int(11) | NO | | -1 | |
-| Hidden | enum('N','Y') | NO | | N | |
-| Preassigned | enum('N','Y') | NO | | N | |
-| NumStds | int(11) | NO | | 1 | |
-| Status | enum('new','reproposed') | NO | | new | |
-| StartTime | datetime | NO | | NULL | |
-| EndTime | datetime | NO | | NULL | |
-| Title | varchar(2047) | NO | | NULL | |
-| Description | text | NO | | NULL | |
-| Knowledge | text | NO | | NULL | |
-| Materials | text | NO | | NULL | |
-| URL | varchar(255) | NO | | NULL | |
-+-------------+--------------------------+------+-----+---------+----------------+
++-------------+-------------------------------------+------+-----+---------+----------------+
+| Field | Type | Null | Key | Default | Extra |
++-------------+-------------------------------------+------+-----+---------+----------------+
+| PrjCod | int(11) | NO | PRI | NULL | auto_increment |
+| CrsCod | int(11) | NO | MUL | -1 | |
+| DptCod | int(11) | NO | | -1 | |
+| Hidden | enum('N','Y') | NO | | N | |
+| Preassigned | enum('N','Y') | NO | | N | |
+| NumStds | int(11) | NO | | 1 | |
+| Proposal | enum('new','modified','unmodified') | NO | | new | |
+| StartTime | datetime | NO | | NULL | |
+| EndTime | datetime | NO | | NULL | |
+| Title | varchar(2047) | NO | | NULL | |
+| Description | text | NO | | NULL | |
+| Knowledge | text | NO | | NULL | |
+| Materials | text | NO | | NULL | |
+| URL | varchar(255) | NO | | NULL | |
++-------------+-------------------------------------+------+-----+---------+----------------+
14 rows in set (0,00 sec)
*/
DB_CreateTable ("CREATE TABLE IF NOT EXISTS projects ("
@@ -2033,7 +2033,7 @@ mysql> DESCRIBE projects;
"Hidden ENUM('N','Y') NOT NULL DEFAULT 'N',"
"Preassigned ENUM('N','Y') NOT NULL DEFAULT 'N',"
"NumStds INT NOT NULL DEFAULT 1,"
- "Status ENUM('new','reproposed') NOT NULL DEFAULT 'new',"
+ "Proposal ENUM('new','modified','unmodified') NOT NULL DEFAULT 'new',"
"StartTime DATETIME NOT NULL,"
"EndTime DATETIME NOT NULL,"
"Title VARCHAR(2047) NOT NULL," // Prj_MAX_BYTES_PROJECT_TITLE
diff --git a/swad_project.c b/swad_project.c
index b61472b92..6f5e9656c 100644
--- a/swad_project.c
+++ b/swad_project.c
@@ -69,10 +69,11 @@ const Prj_RoleInProject_t Prj_RolesToShow[] =
};
const unsigned Brw_NUM_ROLES_TO_SHOW = sizeof (Prj_RolesToShow) / sizeof (Prj_RolesToShow[0]);
-const char *Prj_Status_DB[Prj_NUM_STATUS] =
+const char *Prj_Proposal_DB[Prj_NUM_PROPOSAL_TYPES] =
{
- "new", // Prj_STATUS_NEW
- "reproposed", // Prj_STATUS_REPROPOSED
+ "new", // Prj_PROPOSAL_NEW
+ "modified", // Prj_PROPOSAL_MODIFIED
+ "unmodified", // Prj_PROPOSAL_UNMODIFIED
};
/*****************************************************************************/
@@ -421,7 +422,7 @@ static void Prj_ShowTableAllProjectsHead (void)
extern const char *Txt_Preassigned_QUESTION;
extern const char *Txt_Number_of_students;
extern const char *Txt_PROJECT_ROLES_PLURAL_Abc[Prj_NUM_ROLES_IN_PROJECT];
- extern const char *Txt_Status;
+ extern const char *Txt_Proposal;
extern const char *Txt_Description;
extern const char *Txt_Required_knowledge;
extern const char *Txt_Required_materials;
@@ -453,7 +454,7 @@ static void Prj_ShowTableAllProjectsHead (void)
"
%s | "
"%s | "
"%s | ",
- Txt_Status,
+ Txt_Proposal,
Txt_Description,
Txt_Required_knowledge,
Txt_Required_materials,
@@ -595,8 +596,8 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie
extern const char *Txt_Number_of_students;
extern const char *Txt_See_more;
extern const char *Txt_See_less;
- extern const char *Txt_Status;
- extern const char *Txt_PROJECT_STATUS[Prj_NUM_STATUS];
+ extern const char *Txt_Proposal;
+ extern const char *Txt_PROJECT_STATUS[Prj_NUM_PROPOSAL_TYPES];
extern const char *Txt_Description;
extern const char *Txt_Required_knowledge;
extern const char *Txt_Required_materials;
@@ -736,9 +737,9 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie
"");
}
- /***** Status *****/
+ /***** Proposal *****/
if (ProjectView == Prj_LIST_PROJECTS)
- fprintf (Gbl.F.Out,""
+ fprintf (Gbl.F.Out,"
"
"Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL",
- Txt_Status);
+ Txt_Proposal);
if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
@@ -759,7 +760,7 @@ static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectVie
" |
",
Prj->Hidden ? "DAT_LIGHT" :
"DAT",
- Txt_PROJECT_STATUS[Prj->Status]);
+ Txt_PROJECT_STATUS[Prj->Proposal]);
/***** Write rows of data of this project *****/
/* Description of the project */
@@ -807,7 +808,7 @@ static void Prj_ShowTableAllProjectsOneRow (struct Project *Prj)
extern const char *Txt_Today;
extern const char *Txt_Yes;
extern const char *Txt_No;
- extern const char *Txt_PROJECT_STATUS[Prj_NUM_STATUS];
+ extern const char *Txt_PROJECT_STATUS[Prj_NUM_PROPOSAL_TYPES];
unsigned NumRoleToShow;
static unsigned UniqueId = 0;
@@ -888,14 +889,14 @@ static void Prj_ShowTableAllProjectsOneRow (struct Project *Prj)
NumRoleToShow++)
Prj_ShowTableAllProjectsMembersWithARole (Prj,Prj_RolesToShow[NumRoleToShow]);
- /***** Status *****/
+ /***** Proposal *****/
fprintf (Gbl.F.Out,""
"%s"
" | ",
Gbl.RowEvenOdd,
Prj->Hidden ? "DAT_LIGHT" :
"DAT",
- Txt_PROJECT_STATUS[Prj->Status]);
+ Txt_PROJECT_STATUS[Prj->Proposal]);
/***** Write rows of data of this project *****/
/* Description of the project */
@@ -1885,7 +1886,7 @@ void Prj_GetDataOfProjectByCod (struct Project *Prj)
if (Prj->PrjCod > 0)
{
/***** Build query *****/
- sprintf (Query,"SELECT PrjCod,DptCod,Hidden,Preassigned,NumStds,Status,"
+ sprintf (Query,"SELECT PrjCod,DptCod,Hidden,Preassigned,NumStds,Proposal,"
"UNIX_TIMESTAMP(StartTime),"
"UNIX_TIMESTAMP(EndTime),"
"NOW() BETWEEN StartTime AND EndTime,"
@@ -1899,7 +1900,7 @@ void Prj_GetDataOfProjectByCod (struct Project *Prj)
row[ 2]: Hidden
row[ 3]: Preassigned
row[ 4]: NumStds
- row[ 5]: Status
+ row[ 5]: Proposal
row[ 6]: UNIX_TIMESTAMP(StartTime)
row[ 7]: UNIX_TIMESTAMP(EndTime)
row[ 8]: NOW() BETWEEN StartTime AND EndTime
@@ -1930,7 +1931,7 @@ static void Prj_GetDataOfProject (struct Project *Prj,const char *Query)
MYSQL_RES *mysql_res;
MYSQL_ROW row;
long NumLong;
- Prj_Status_t Status;
+ Prj_Proposal_t Proposal;
/***** Clear all project data *****/
Prj_ResetProject (Prj);
@@ -1946,7 +1947,7 @@ static void Prj_GetDataOfProject (struct Project *Prj,const char *Query)
row[ 2]: Hidden
row[ 3]: Preassigned
row[ 4]: NumStds
- row[ 5]: Status
+ row[ 5]: Proposal
row[ 6]: UNIX_TIMESTAMP(StartTime)
row[ 7]: UNIX_TIMESTAMP(EndTime)
row[ 8]: NOW() BETWEEN StartTime AND EndTime
@@ -1978,13 +1979,13 @@ static void Prj_GetDataOfProject (struct Project *Prj,const char *Query)
Prj->NumStds = 1;
/* Get project status (row[5]) */
- Prj->Status = Prj_STATUS_DEFAULT;
- for (Status = (Prj_Status_t) 0;
- Status <= (Prj_Status_t) (Prj_NUM_STATUS - 1);
- Status++)
- if (!strcmp (Prj_Status_DB[Status],row[5]))
+ Prj->Proposal = Prj_PROPOSAL_DEFAULT;
+ for (Proposal = (Prj_Proposal_t) 0;
+ Proposal <= (Prj_Proposal_t) (Prj_NUM_PROPOSAL_TYPES - 1);
+ Proposal++)
+ if (!strcmp (Prj_Proposal_DB[Proposal],row[5]))
{
- Prj->Status = Status;
+ Prj->Proposal = Proposal;
break;
}
@@ -2033,7 +2034,7 @@ static void Prj_ResetProject (struct Project *Prj)
Prj->Hidden = false;
Prj->Preassigned = Prj_PREASSIGNED_DEFAULT;
Prj->NumStds = 1;
- Prj->Status = Prj_STATUS_DEFAULT;
+ Prj->Proposal = Prj_PROPOSAL_DEFAULT;
Prj->TimeUTC[Dat_START_TIME] =
Prj->TimeUTC[Dat_END_TIME ] = (time_t) 0;
Prj->Open = false;
@@ -2336,8 +2337,8 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject)
extern const char *Txt_Department;
extern const char *Txt_Preassigned_QUESTION;
extern const char *Txt_Number_of_students;
- extern const char *Txt_Status;
- extern const char *Txt_PROJECT_STATUS[Prj_NUM_STATUS];
+ extern const char *Txt_Proposal;
+ extern const char *Txt_PROJECT_STATUS[Prj_NUM_PROPOSAL_TYPES];
extern const char *Txt_Description;
extern const char *Txt_Required_knowledge;
extern const char *Txt_Required_materials;
@@ -2347,7 +2348,7 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject)
extern const char *Txt_Create_project;
extern const char *Txt_Save;
extern const char *Txt_Members;
- Prj_Status_t Status;
+ Prj_Proposal_t Proposal;
unsigned NumRoleToShow;
/***** Start project box *****/
@@ -2458,24 +2459,24 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject)
Txt_Number_of_students,
Prj->NumStds);
- /* Status */
+ /* Proposal */
fprintf (Gbl.F.Out,""
""
"%s:"
" | "
""
- " | "
@@ -2650,11 +2651,11 @@ void Prj_RecFormProject (void)
1);
/* Get status */
- Prj.Status = (Prj_Status_t)
- Par_GetParToUnsignedLong ("Status",
- 0,
- Prj_NUM_STATUS - 1,
- (unsigned long) Prj_STATUS_DEFAULT);
+ Prj.Proposal = (Prj_Proposal_t)
+ Par_GetParToUnsignedLong ("Proposal",
+ 0,
+ Prj_NUM_PROPOSAL_TYPES - 1,
+ (unsigned long) Prj_PROPOSAL_DEFAULT);
/* Get project description, required knowledge and required materials */
Par_GetParToHTML ("Description",Prj.Description,Cns_MAX_BYTES_TEXT); // Store in HTML format (not rigorous)
@@ -2723,7 +2724,7 @@ static void Prj_CreateProject (struct Project *Prj)
/***** Create a new project *****/
sprintf (Query,"INSERT INTO projects"
- " (CrsCod,DptCod,Hidden,Preassigned,NumStds,Status,"
+ " (CrsCod,DptCod,Hidden,Preassigned,NumStds,Proposal,"
"StartTime,EndTime,"
"Title,Description,Knowledge,Materials,URL)"
" VALUES"
@@ -2737,7 +2738,7 @@ static void Prj_CreateProject (struct Project *Prj)
Prj->Preassigned == Prj_PREASSIGNED ? 'Y' :
'N',
Prj->NumStds,
- Prj_Status_DB[Prj->Status],
+ Prj_Proposal_DB[Prj->Proposal],
Prj->TimeUTC[Dat_START_TIME],
Prj->TimeUTC[Dat_END_TIME ],
Prj->Title,
@@ -2771,7 +2772,7 @@ static void Prj_UpdateProject (struct Project *Prj)
/***** Update the data of the project *****/
sprintf (Query,"UPDATE projects SET "
- "DptCod=%ld,Hidden='%c',Preassigned='%c',NumStds=%u,Status='%s',"
+ "DptCod=%ld,Hidden='%c',Preassigned='%c',NumStds=%u,Proposal='%s',"
"StartTime=FROM_UNIXTIME(%ld),"
"EndTime=FROM_UNIXTIME(%ld),"
"Title='%s',"
@@ -2783,7 +2784,7 @@ static void Prj_UpdateProject (struct Project *Prj)
Prj->Preassigned == Prj_PREASSIGNED ? 'Y' :
'N',
Prj->NumStds,
- Prj_Status_DB[Prj->Status],
+ Prj_Proposal_DB[Prj->Proposal],
Prj->TimeUTC[Dat_START_TIME],
Prj->TimeUTC[Dat_END_TIME ],
Prj->Title,
diff --git a/swad_project.h b/swad_project.h
index fa724b581..80644cb42 100644
--- a/swad_project.h
+++ b/swad_project.h
@@ -47,13 +47,14 @@ typedef enum
} Prj_Preassigned_t;
#define Prj_PREASSIGNED_DEFAULT Prj_NOT_PREASSIGNED
-#define Prj_NUM_STATUS 2
+#define Prj_NUM_PROPOSAL_TYPES 3
typedef enum
{
- Prj_STATUS_NEW,
- Prj_STATUS_REPROPOSED,
- } Prj_Status_t;
-#define Prj_STATUS_DEFAULT Prj_STATUS_NEW
+ Prj_PROPOSAL_NEW,
+ Prj_PROPOSAL_MODIFIED,
+ Prj_PROPOSAL_UNMODIFIED,
+ } Prj_Proposal_t;
+#define Prj_PROPOSAL_DEFAULT Prj_PROPOSAL_NEW
// Related with user's roles in a project
// Don't change these numbers! They are used in database
@@ -72,7 +73,7 @@ struct Project
bool Hidden;
Prj_Preassigned_t Preassigned;
unsigned NumStds;
- Prj_Status_t Status;
+ Prj_Proposal_t Proposal;
time_t TimeUTC[Dat_NUM_START_END_TIME];
bool Open;
char Title[Prj_MAX_BYTES_PROJECT_TITLE + 1];
diff --git a/swad_text.c b/swad_text.c
index 87d0e23bf..fb3a14cde 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -31248,46 +31248,66 @@ const char *Txt_PROJECT_ROLES_PLURAL_Abc[Prj_NUM_ROLES_IN_PROJECT] =
#endif
};
-const char *Txt_PROJECT_STATUS[Prj_NUM_STATUS] =
+const char *Txt_PROJECT_STATUS[Prj_NUM_PROPOSAL_TYPES] =
{
-#if L==1 // Prj_STATUS_NEW
- "Projecte nou, proposat per primera vegada"
+#if L==1 // Prj_PROPOSAL_NEW
+ "Projecte nou"
#elif L==2
- "Neues Projekt, das zum ersten Mal vorgeschlagen wurde"
+ "Neues Projekt"
#elif L==3
- "New project, proposed for the first time"
+ "New project"
#elif L==4
- "Proyecto nuevo, propuesto por primera vez"
+ "Proyecto nuevo"
#elif L==5
- "Nouveau projet, proposé pour la première fois"
+ "Projet nouveau"
#elif L==6
- "Proyecto nuevo, propuesto por primera vez" // Okoteve traducción
+ "Proyecto nuevo" // Okoteve traducción
#elif L==7
- "Nuovo progetto, proposto per la prima volta"
+ "Progetto nuovo"
#elif L==8
- "Nowy projekt, zaproponowany po raz pierwszy"
+ "Nowy projekt"
#elif L==9
- "Novo projeto, proposto pela primeira vez"
+ "Projeto novo"
#endif
,
-#if L==1 // Prj_STATUS_REPROPOSED
- "Projecte ja proposat en convocatòries anteriors"
+#if L==1 // Prj_PROPOSAL_MODIFIED
+ "Projecte ja proposat en convocatòries anteriors, amb modificacions"
#elif L==2
- "Projekt bereits in früheren Anrufen vorgeschlagen"
+ "Projekt in früheren Anrufen vorgeschlagen, mit Änderungen"
#elif L==3
- "Project already proposed in previous calls"
+ "Project proposed in previous calls, with modifications"
#elif L==4
- "Proyecto ya propuesto en convocatorias anteriores"
+ "Proyecto propuesto en convocatorias anteriores, con modificaciones"
#elif L==5
- "Projet déjà proposé dans les appels précédents"
+ "Projet proposé dans les appels précédents, avec modifications"
#elif L==6
- "Proyecto ya propuesto en convocatorias anteriores" // Okoteve traducción
+ "Proyecto propuesto en convocatorias anteriores, con modificaciones" // Okoteve traducción
#elif L==7
- "Progetto già proposto nelle chiamate precedenti"
+ "Progetto proposto nelle chiamate precedenti, con modifiche"
#elif L==8
- "Projekt już zaproponował w poprzednich rozmowach"
+ "Proponowany projekt we wcześniejszych rozmowach z modyfikacjami"
#elif L==9
- "Projeto já proposto em chamadas anteriores"
+ "Projeto proposto em chamadas anteriores, com modificações"
+#endif
+ ,
+#if L==1 // Prj_PROPOSAL_UNMODIFIED
+ "Projecte ja proposat en convocatòries anteriors, sense modificacions"
+#elif L==2
+ "Projekt in früheren Anrufen vorgeschlagen, ohne Änderungen"
+#elif L==3
+ "Project proposed in previous calls, without modifications"
+#elif L==4
+ "Proyecto propuesto en convocatorias anteriores, sin modificaciones"
+#elif L==5
+ "Projet proposé dans les appels précédents, sans modifications"
+#elif L==6
+ "Proyecto propuesto en convocatorias anteriores, sin modificaciones" // Okoteve traducción
+#elif L==7
+ "Progetto proposto nelle chiamate precedenti, senza modifiche"
+#elif L==8
+ "Proponowany projekt we wcześniejszych rozmowach bez modyfikacji"
+#elif L==9
+ "Projeto proposto em chamadas anteriores, sem modificações"
#endif
};
@@ -31355,6 +31375,27 @@ const char *Txt_Projects =
"Projetos (projetos de fim de grau, tese…)";
#endif
+const char *Txt_Proposal =
+#if L==1
+ "Proposta";
+#elif L==2
+ "Vorschlag";
+#elif L==3
+ "Proposal";
+#elif L==4
+ "Propuesta";
+#elif L==5
+ "Proposition";
+#elif L==6
+ "Propuesta"; // Okoteve traducción
+#elif L==7
+ "Proposta";
+#elif L==8
+ "Wniosek";
+#elif L==9
+ "Proposta";
+#endif
+
const char *Txt_Public_agenda_USER = // Warning: it is very important to include %s in the following sentences
#if L==1
"Agenda pública de %s";