Version 17.4.2

This commit is contained in:
Antonio Cañas Vargas 2017-09-20 23:25:55 +02:00
parent ea4c3d5703
commit b809c0c474
3 changed files with 166 additions and 94 deletions

View File

@ -252,13 +252,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 17.4.1 (2017-09-20)" #define Log_PLATFORM_VERSION "SWAD 17.4.2 (2017-09-20)"
#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.4.2: Sep 20, 2017 Changes in listing and edition of projects. (230203 lines)
Version 17.4.1: Sep 20, 2017 Changes adding users to a project. Not finished. (230141 lines) Version 17.4.1: Sep 20, 2017 Changes adding users to a project. Not finished. (230141 lines)
Version 17.4: Sep 20, 2017 Actions to add users to a project. (230137 lines) Version 17.4: Sep 20, 2017 Actions to add users to a project. (230137 lines)
6 changes necessary in database: 6 changes necessary in database:

View File

@ -64,6 +64,13 @@ typedef enum
Prj_ROLE_REV = 3, // Reviewer Prj_ROLE_REV = 3, // Reviewer
} Prj_RoleInProject_t; } Prj_RoleInProject_t;
typedef enum
{
Prj_LIST_PROJECTS,
Prj_PRINT_ONE_PROJECT,
Prj_EDIT_ONE_PROJECT,
} Prj_ProjectView_t;
/*****************************************************************************/ /*****************************************************************************/
/***************************** Private variables *****************************/ /***************************** Private variables *****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -78,12 +85,15 @@ static bool Prj_CheckIfICanCreateProjects (void);
static void Prj_PutIconsListProjects (void); static void Prj_PutIconsListProjects (void);
static void Prj_PutIconToCreateNewPrj (void); static void Prj_PutIconToCreateNewPrj (void);
static void Prj_PutButtonToCreateNewPrj (void); static void Prj_PutButtonToCreateNewPrj (void);
static void Prj_ShowOneProject (struct Project *Prj,bool PrintView); static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectView);
static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView, static void Prj_ShowOneProjectTxtRow (struct Project *Prj,
Prj_ProjectView_t ProjectView,
const char *Label,char *TxtField); const char *Label,char *TxtField);
static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,bool PrintView, static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,
Prj_ProjectView_t ProjectView,
const char *Label,Prj_RoleInProject_t RoleInProject); const char *Label,Prj_RoleInProject_t RoleInProject);
static void Prj_WriteUsrs (long PrjCod,Prj_RoleInProject_t RoleInProject); static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
Prj_RoleInProject_t RoleInProject);
static void Prj_ReqAnotherUsrID (Prj_RoleInProject_t RoleInProject); static void Prj_ReqAnotherUsrID (Prj_RoleInProject_t RoleInProject);
static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject); static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject);
@ -96,6 +106,9 @@ static void Prj_ResetProject (struct Project *Prj);
static void Prj_PutParamPrjCod (long PrjCod); static void Prj_PutParamPrjCod (long PrjCod);
static bool Prj_CheckIfSimilarProjectsExists (const char *Field,const char *Value,long PrjCod); static bool Prj_CheckIfSimilarProjectsExists (const char *Field,const char *Value,long PrjCod);
static void Prj_EditOneProjectTxtArea (const char *Id,
const char *Label,char *TxtField);
static void Prj_AllocMemProject (struct Project *Prj); static void Prj_AllocMemProject (struct Project *Prj);
static void Prj_FreeMemProject (struct Project *Prj); static void Prj_FreeMemProject (struct Project *Prj);
@ -163,8 +176,7 @@ static void Prj_ShowAllProjects (void)
NumPrj++) NumPrj++)
{ {
Prj.PrjCod = Gbl.Prjs.LstPrjCods[NumPrj - 1]; Prj.PrjCod = Gbl.Prjs.LstPrjCods[NumPrj - 1];
Prj_ShowOneProject (&Prj, Prj_ShowOneProject (&Prj,Prj_LIST_PROJECTS);
false); // Not print view
} }
/***** End table *****/ /***** End table *****/
@ -328,8 +340,7 @@ void Prj_PrintOneProject (void)
Prj_PutHeadForSeeing (true); // Print view Prj_PutHeadForSeeing (true); // Print view
/***** Write project *****/ /***** Write project *****/
Prj_ShowOneProject (&Prj, Prj_ShowOneProject (&Prj,Prj_PRINT_ONE_PROJECT);
true); // Print view
/***** End table *****/ /***** End table *****/
Tbl_EndTable (); Tbl_EndTable ();
@ -342,7 +353,7 @@ void Prj_PrintOneProject (void)
/***************************** Show one project ******************************/ /***************************** Show one project ******************************/
/*****************************************************************************/ /*****************************************************************************/
static void Prj_ShowOneProject (struct Project *Prj,bool PrintView) static void Prj_ShowOneProject (struct Project *Prj,Prj_ProjectView_t ProjectView)
{ {
extern const char *Txt_Today; extern const char *Txt_Today;
extern const char *Txt_PREASSIGNED_TYPES[Prj_NUM_TYPES_PREASSIGNED]; extern const char *Txt_PREASSIGNED_TYPES[Prj_NUM_TYPES_PREASSIGNED];
@ -362,13 +373,13 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
/* Forms to remove/edit this project */ /* Forms to remove/edit this project */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td rowspan=\"6\" class=\"CONTEXT_COL"); "<td rowspan=\"6\" class=\"CONTEXT_COL");
if (PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out,"\">");
else
{ {
fprintf (Gbl.F.Out," COLOR%u\">",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u\">",Gbl.RowEvenOdd);
Prj_PutFormsToRemEditOnePrj (Prj->PrjCod,Prj->Hidden); Prj_PutFormsToRemEditOnePrj (Prj->PrjCod,Prj->Hidden);
} }
else
fprintf (Gbl.F.Out,"\">");
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Start date/time */ /* Start date/time */
@ -379,7 +390,7 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
"DATE_RED_LIGHT") : "DATE_RED_LIGHT") :
(Prj->Open ? "DATE_GREEN" : (Prj->Open ? "DATE_GREEN" :
"DATE_RED")); "DATE_RED"));
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">" fprintf (Gbl.F.Out,"\">"
"<script type=\"text/javascript\">" "<script type=\"text/javascript\">"
@ -398,7 +409,7 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
"DATE_RED_LIGHT") : "DATE_RED_LIGHT") :
(Prj->Open ? "DATE_GREEN" : (Prj->Open ? "DATE_GREEN" :
"DATE_RED")); "DATE_RED"));
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">" fprintf (Gbl.F.Out,"\">"
"<script type=\"text/javascript\">" "<script type=\"text/javascript\">"
@ -411,7 +422,7 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
/* Project title */ /* Project title */
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP"); fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">" fprintf (Gbl.F.Out,"\">"
"<div class=\"%s\">%s</div>", "<div class=\"%s\">%s</div>",
@ -424,7 +435,7 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP", fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP",
(Prj->Preassigned == Prj_PREASSIGNED) ? "DAT_N" : (Prj->Preassigned == Prj_PREASSIGNED) ? "DAT_N" :
"DAT"); "DAT");
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">" fprintf (Gbl.F.Out,"\">"
"<img src=\"%s/%s64x64.png\"" "<img src=\"%s/%s64x64.png\""
@ -442,23 +453,23 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
/***** Write rows of data of this project *****/ /***** Write rows of data of this project *****/
/* Description of the project */ /* Description of the project */
Prj_ShowOneProjectTxtRow (Prj,PrintView, Prj_ShowOneProjectTxtRow (Prj,ProjectView,
Txt_Description,Prj->Description); Txt_Description,Prj->Description);
/* Required knowledge to carry out the project */ /* Required knowledge to carry out the project */
Prj_ShowOneProjectTxtRow (Prj,PrintView, Prj_ShowOneProjectTxtRow (Prj,ProjectView,
Txt_Required_knowledge,Prj->Knowledge); Txt_Required_knowledge,Prj->Knowledge);
/* Required materials to carry out the project */ /* Required materials to carry out the project */
Prj_ShowOneProjectTxtRow (Prj,PrintView, Prj_ShowOneProjectTxtRow (Prj,ProjectView,
Txt_Required_materials,Prj->Materials); Txt_Required_materials,Prj->Materials);
/* Project tutors */ /* Project tutors */
Prj_ShowOneProjectUsrsRow (Prj,PrintView, Prj_ShowOneProjectUsrsRow (Prj,ProjectView,
Txt_Tutors,Prj_ROLE_TUT); Txt_Tutors,Prj_ROLE_TUT);
/* Project students */ /* Project students */
Prj_ShowOneProjectUsrsRow (Prj,PrintView, Prj_ShowOneProjectUsrsRow (Prj,ProjectView,
Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],Prj_ROLE_STD); Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],Prj_ROLE_STD);
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd; Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
@ -468,7 +479,8 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
/************************ Show text row about a project **********************/ /************************ Show text row about a project **********************/
/*****************************************************************************/ /*****************************************************************************/
static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView, static void Prj_ShowOneProjectTxtRow (struct Project *Prj,
Prj_ProjectView_t ProjectView,
const char *Label,char *TxtField) const char *Label,char *TxtField)
{ {
/***** Change format *****/ /***** Change format *****/
@ -479,7 +491,7 @@ static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
/***** Row with label and text *****/ /***** Row with label and text *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"RIGHT_TOP"); "<td colspan=\"2\" class=\"RIGHT_TOP");
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">" fprintf (Gbl.F.Out," %s\">"
"%s:" "%s:"
@ -488,7 +500,7 @@ static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
Prj->Hidden ? "ASG_LABEL_LIGHT" : Prj->Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL", "ASG_LABEL",
Label); Label);
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">" fprintf (Gbl.F.Out," %s\">"
"%s" "%s"
@ -503,13 +515,14 @@ static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
/************************* Show users row in a project ***********************/ /************************* Show users row in a project ***********************/
/*****************************************************************************/ /*****************************************************************************/
static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,bool PrintView, static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,
Prj_ProjectView_t ProjectView,
const char *Label,Prj_RoleInProject_t RoleInProject) const char *Label,Prj_RoleInProject_t RoleInProject)
{ {
/***** Row with label and listing of users *****/ /***** Row with label and listing of users *****/
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"RIGHT_TOP"); "<td colspan=\"2\" class=\"RIGHT_TOP");
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">" fprintf (Gbl.F.Out," %s\">"
"%s:" "%s:"
@ -518,12 +531,12 @@ static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,bool PrintView,
Prj->Hidden ? "ASG_LABEL_LIGHT" : Prj->Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL", "ASG_LABEL",
Label); Label);
if (!PrintView) if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd); fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">", fprintf (Gbl.F.Out," %s\">",
Prj->Hidden ? "DAT_LIGHT" : Prj->Hidden ? "DAT_LIGHT" :
"DAT"); "DAT");
Prj_WriteUsrs (Prj->PrjCod,RoleInProject); Prj_WriteUsrs (Prj->PrjCod,ProjectView,RoleInProject);
fprintf (Gbl.F.Out,"</td>" fprintf (Gbl.F.Out,"</td>"
"</tr>"); "</tr>");
} }
@ -532,7 +545,8 @@ static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,bool PrintView,
/*************** Write list of users with a role in a project ****************/ /*************** Write list of users with a role in a project ****************/
/*****************************************************************************/ /*****************************************************************************/
static void Prj_WriteUsrs (long PrjCod,Prj_RoleInProject_t RoleInProject) static void Prj_WriteUsrs (long PrjCod,Prj_ProjectView_t ProjectView,
Prj_RoleInProject_t RoleInProject)
{ {
extern const char *Txt_ROLES_SINGUL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_ROLES_SINGUL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS]; extern const char *Txt_ROLES_PLURAL_abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
@ -638,14 +652,18 @@ static void Prj_WriteUsrs (long PrjCod,Prj_RoleInProject_t RoleInProject)
} }
/***** Row to add a new user *****/ /***** Row to add a new user *****/
fprintf (Gbl.F.Out,"<tr>" if (ProjectView == Prj_EDIT_ONE_PROJECT)
"<td colspan=\"3\" class=\"LEFT_MIDDLE\">"); {
Lay_PutContextualLink (ActionReqAddUsr[RoleInProject],NULL,NULL, fprintf (Gbl.F.Out,"<tr>"
"plus64x64.png", "<td colspan=\"3\" class=\"LEFT_MIDDLE\">");
Txt_Add_user,Txt_Add_user, Gbl.Prjs.PrjCodToEdit = PrjCod; // Used to pass project code as a parameter
NULL); Lay_PutContextualLink (ActionReqAddUsr[RoleInProject],NULL,Prj_PutParams,
fprintf (Gbl.F.Out,"</td>" "plus64x64.png",
"</tr>"); Txt_Add_user,Txt_Add_user,
NULL);
fprintf (Gbl.F.Out,"</td>"
"</tr>");
}
/***** End table *****/ /***** End table *****/
fprintf (Gbl.F.Out,"</table>"); fprintf (Gbl.F.Out,"</table>");
@ -721,6 +739,10 @@ void Prj_AddRev (void)
static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject) static void Prj_AddUsrToProject (Prj_RoleInProject_t RoleInProject)
{ {
/***** Get project code *****/
if ((Gbl.Prjs.PrjCodToEdit = Prj_GetParamPrjCod ()) == -1L)
Lay_ShowErrorAndExit ("Code of project is missing.");
if (RoleInProject != Prj_ROLE_UNK) // TODO: Remove if (RoleInProject != Prj_ROLE_UNK) // TODO: Remove
Ale_ShowAlert (Ale_WARNING,"Not yet implemented."); Ale_ShowAlert (Ale_WARNING,"Not yet implemented.");
} }
@ -1206,6 +1228,7 @@ void Prj_RequestCreatOrEditPrj (void)
extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_New_project; extern const char *Txt_New_project;
extern const char *Txt_Edit_project; extern const char *Txt_Edit_project;
extern const char *Txt_Project_data;
extern const char *Txt_Title; extern const char *Txt_Title;
extern const char *Txt_No; extern const char *Txt_No;
extern const char *Txt_Yes; extern const char *Txt_Yes;
@ -1216,6 +1239,9 @@ void Prj_RequestCreatOrEditPrj (void)
extern const char *Txt_Preassigned_QUESTION; extern const char *Txt_Preassigned_QUESTION;
extern const char *Txt_Create_project; extern const char *Txt_Create_project;
extern const char *Txt_Save; extern const char *Txt_Save;
extern const char *Txt_Project_members;
extern const char *Txt_Tutors;
extern const char *Txt_ROLES_PLURAL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
struct Project Prj; struct Project Prj;
bool ItsANewProject; bool ItsANewProject;
@ -1242,28 +1268,29 @@ void Prj_RequestCreatOrEditPrj (void)
/* Get data of the project from database */ /* Get data of the project from database */
Prj_GetDataOfProjectByCod (&Prj); Prj_GetDataOfProjectByCod (&Prj);
/***** Start form *****/ /***** Start box and form *****/
if (ItsANewProject) if (ItsANewProject)
{ {
Box_StartBox (NULL,Txt_New_project,NULL,
Hlp_ASSESSMENT_Projects_new_project,Box_NOT_CLOSABLE);
Act_FormStart (ActNewPrj); Act_FormStart (ActNewPrj);
Gbl.Prjs.PrjCodToEdit = -1L; Gbl.Prjs.PrjCodToEdit = -1L;
} }
else else
{ {
Box_StartBox (NULL,Txt_Edit_project,NULL,
Hlp_ASSESSMENT_Projects_edit_project,Box_NOT_CLOSABLE);
Act_FormStart (ActChgPrj); Act_FormStart (ActChgPrj);
Gbl.Prjs.PrjCodToEdit = Prj.PrjCod; Gbl.Prjs.PrjCodToEdit = Prj.PrjCod;
} }
Prj_PutParams (); Prj_PutParams ();
/***** Start box and table *****/ /***** 1. Project data *****/
if (ItsANewProject) /* Start box and table */
Box_StartBoxTable (NULL,Txt_New_project,NULL, Box_StartBoxTable (NULL,Txt_Project_data,NULL,
Hlp_ASSESSMENT_Projects_new_project,Box_NOT_CLOSABLE,2); NULL,Box_NOT_CLOSABLE,2);
else
Box_StartBoxTable (NULL,Txt_Edit_project,NULL,
Hlp_ASSESSMENT_Projects_edit_project,Box_NOT_CLOSABLE,2);
/***** Project title *****/ /* Project title */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">" "<td class=\"RIGHT_MIDDLE\">"
"<label for=\"Title\" class=\"%s\">%s:</label>" "<label for=\"Title\" class=\"%s\">%s:</label>"
@ -1277,55 +1304,19 @@ void Prj_RequestCreatOrEditPrj (void)
The_ClassForm[Gbl.Prefs.Theme],Txt_Title, The_ClassForm[Gbl.Prefs.Theme],Txt_Title,
Prj_MAX_CHARS_PROJECT_TITLE,Prj.Title); Prj_MAX_CHARS_PROJECT_TITLE,Prj.Title);
/***** Project start and end dates *****/ /* Project start and end dates */
Dat_PutFormStartEndClientLocalDateTimes (Prj.TimeUTC,Dat_FORM_SECONDS_ON); Dat_PutFormStartEndClientLocalDateTimes (Prj.TimeUTC,Dat_FORM_SECONDS_ON);
/***** Description of the project *****/ /* Description of the project */
fprintf (Gbl.F.Out,"<tr>" Prj_EditOneProjectTxtArea ("Description",Txt_Description,Prj.Description);
"<td class=\"RIGHT_TOP\">"
"<label for=\"Description\" class=\"%s\">%s:</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"Description\" name=\"Description\""
" cols=\"60\" rows=\"10\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_Description);
if (!ItsANewProject)
fprintf (Gbl.F.Out,"%s",Prj.Description);
fprintf (Gbl.F.Out,"</textarea>"
"</td>"
"</tr>");
/***** Required knowledge to carry out the project *****/ /* Required knowledge to carry out the project */
fprintf (Gbl.F.Out,"<tr>" Prj_EditOneProjectTxtArea ("Knowledge",Txt_Required_knowledge,Prj.Knowledge);
"<td class=\"RIGHT_TOP\">"
"<label for=\"Knowledge\" class=\"%s\">%s:</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"Knowledge\" name=\"Knowledge\""
" cols=\"60\" rows=\"5\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_Required_knowledge);
if (!ItsANewProject)
fprintf (Gbl.F.Out,"%s",Prj.Knowledge);
fprintf (Gbl.F.Out,"</textarea>"
"</td>"
"</tr>");
/***** Required materials to carry out the project *****/ /* Required materials to carry out the project */
fprintf (Gbl.F.Out,"<tr>" Prj_EditOneProjectTxtArea ("Materials",Txt_Required_materials,Prj.Materials);
"<td class=\"RIGHT_TOP\">"
"<label for=\"Materials\" class=\"%s\">%s:</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"Materials\" name=\"Materials\""
" cols=\"60\" rows=\"5\">",
The_ClassForm[Gbl.Prefs.Theme],Txt_Required_materials);
if (!ItsANewProject)
fprintf (Gbl.F.Out,"%s",Prj.Materials);
fprintf (Gbl.F.Out,"</textarea>"
"</td>"
"</tr>");
/***** URL for additional info *****/ /* URL for additional info */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_MIDDLE\">" "<td class=\"RIGHT_MIDDLE\">"
"<label for=\"WWW\" class=\"%s\">%s:</label>" "<label for=\"WWW\" class=\"%s\">%s:</label>"
@ -1339,7 +1330,7 @@ void Prj_RequestCreatOrEditPrj (void)
Txt_URL, Txt_URL,
Cns_MAX_CHARS_WWW,Prj.URL); Cns_MAX_CHARS_WWW,Prj.URL);
/***** Preassigned? *****/ /* Preassigned? */
fprintf (Gbl.F.Out,"<tr>" fprintf (Gbl.F.Out,"<tr>"
"<td class=\"%s RIGHT_MIDDLE\">" "<td class=\"%s RIGHT_MIDDLE\">"
"%s:" "%s:"
@ -1363,15 +1354,29 @@ void Prj_RequestCreatOrEditPrj (void)
"</td>" "</td>"
"</tr>"); "</tr>");
/***** End table, send button and end box *****/ /* End table, send button and end box */
if (ItsANewProject) if (ItsANewProject)
Box_EndBoxTableWithButton (Btn_CREATE_BUTTON,Txt_Create_project); Box_EndBoxTableWithButton (Btn_CREATE_BUTTON,Txt_Create_project);
else else
Box_EndBoxTableWithButton (Btn_CONFIRM_BUTTON,Txt_Save); Box_EndBoxTableWithButton (Btn_CONFIRM_BUTTON,Txt_Save);
/***** End form *****/ /* End form */
Act_FormEnd (); Act_FormEnd ();
/***** Project members *****/
Box_StartBoxTable (NULL,Txt_Project_members,NULL,
NULL,Box_NOT_CLOSABLE,2);
Prj_ShowOneProjectUsrsRow (&Prj,Prj_EDIT_ONE_PROJECT,
Txt_Tutors,
Prj_ROLE_TUT); // Tutors
Prj_ShowOneProjectUsrsRow (&Prj,Prj_EDIT_ONE_PROJECT,
Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],
Prj_ROLE_STD); // Students
Box_EndBoxTable ();
/***** End box *****/
Box_EndBox ();
/***** Free memory of the project *****/ /***** Free memory of the project *****/
Prj_FreeMemProject (&Prj); Prj_FreeMemProject (&Prj);
@ -1379,6 +1384,30 @@ void Prj_RequestCreatOrEditPrj (void)
Prj_ShowAllProjects (); Prj_ShowAllProjects ();
} }
/*****************************************************************************/
/************************ Show text row about a project **********************/
/*****************************************************************************/
static void Prj_EditOneProjectTxtArea (const char *Id,
const char *Label,char *TxtField)
{
extern const char *The_ClassForm[The_NUM_THEMES];
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"RIGHT_TOP\">"
"<label for=\"%s\" class=\"%s\">%s:</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"%s\" name=\"%s\" cols=\"60\" rows=\"5\">"
"%s"
"</textarea>"
"</td>"
"</tr>",
Id,The_ClassForm[Gbl.Prefs.Theme],Label,
Id,Id,
TxtField);
}
/*****************************************************************************/ /*****************************************************************************/
/*** Allocate memory for those parameters of a project with a lot of text ****/ /*** Allocate memory for those parameters of a project with a lot of text ****/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -30745,6 +30745,27 @@ const char *Txt_Project =
"Projeto"; "Projeto";
#endif #endif
const char *Txt_Project_data =
#if L==1
"Dades del projecte";
#elif L==2
"Projektdaten";
#elif L==3
"Project data";
#elif L==4
"Datos del proyecto";
#elif L==5
"Donn&eacute;es du projet";
#elif L==6
"Datos del proyecto"; // Okoteve traducción
#elif L==7
"Dati del progetto";
#elif L==8
"Dane projektu";
#elif L==9
"Dados do projeto";
#endif
const char *Txt_Project_X_is_now_hidden = // Warning: it is very important to include %s in the following sentences const char *Txt_Project_X_is_now_hidden = // Warning: it is very important to include %s in the following sentences
#if L==1 #if L==1
"El projecte <strong>%s</strong> ara est&agrave; ocult."; "El projecte <strong>%s</strong> ara est&agrave; ocult.";
@ -30787,6 +30808,27 @@ const char *Txt_Project_X_is_now_visible = // Warning: it is very important to i
"O projeto <strong>%s</strong> &eacute; agora vis&iacute;vel."; "O projeto <strong>%s</strong> &eacute; agora vis&iacute;vel.";
#endif #endif
const char *Txt_Project_members =
#if L==1
"Membres del projecte";
#elif L==2
"Projektmitarbeiter";
#elif L==3
"Project members";
#elif L==4
"Miembros del proyecto";
#elif L==5
"Membres du projet";
#elif L==6
"Miembros del proyecto"; // Okoteve traducción
#elif L==7
"Membri del progetto";
#elif L==8
"Cz&lstrok;onkowie projektu";
#elif L==9
"Membros do projeto";
#endif
const char *Txt_Project_X_removed = // Warning: it is very important to include %s in the following sentences const char *Txt_Project_X_removed = // Warning: it is very important to include %s in the following sentences
#if L==1 #if L==1
"Projecte <strong>%s</strong> eliminat."; "Projecte <strong>%s</strong> eliminat.";