Version 17.3.11

This commit is contained in:
Antonio Cañas Vargas 2017-09-20 14:06:24 +02:00
parent 5163bb992a
commit cfc4a53504
2 changed files with 46 additions and 74 deletions

View File

@ -252,13 +252,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 17.3.10 (2017-09-19)"
#define Log_PLATFORM_VERSION "SWAD 17.3.11 (2017-09-20)"
#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.3.11: Sep 20, 2017 Code refactoring in listing of projects. (229981 lines)
Version 17.3.10: Sep 19, 2017 New row in listing of projects for students. (230009 lines)
Version 17.3.9: Sep 19, 2017 Tutor code moved from table projects to table prj_grp. (229987 lines)
1 change necessary in database:

View File

@ -79,6 +79,8 @@ static void Prj_PutIconsListProjects (void);
static void Prj_PutIconToCreateNewPrj (void);
static void Prj_PutButtonToCreateNewPrj (void);
static void Prj_ShowOneProject (struct Project *Prj,bool PrintView);
static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
const char *Label,char *TxtField);
static void Prj_WriteUsrs (long PrjCod,Prj_RoleInProject_t RoleInProject);
static void Prj_GetParamPrjOrder (void);
@ -433,84 +435,18 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
(Prj->Preassigned == Prj_PREASSIGNED) ? Txt_Yes :
Txt_No);
/***** Write second row of data of this project *****/
/***** Write rows of data of this project *****/
/* Description of the project */
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
Prj->Description,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
Str_InsertLinks (Prj->Description,Cns_MAX_BYTES_TEXT,60); // Insert links
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"RIGHT_TOP");
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s:"
"</td>"
"<td colspan=\"2\" class=\"LEFT_TOP",
Prj->Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL",
Txt_Description);
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s"
"</td>"
"</tr>",
Prj->Hidden ? "DAT_LIGHT" :
"DAT",
Prj->Description);
Prj_ShowOneProjectTxtRow (Prj,PrintView,
Txt_Description,Prj->Description);
/* Required knowledge to carry out the project */
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
Prj->Knowledge,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
Str_InsertLinks (Prj->Knowledge,Cns_MAX_BYTES_TEXT,60); // Insert links
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"RIGHT_TOP");
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s:"
"</td>"
"<td colspan=\"2\" class=\"LEFT_TOP",
Prj->Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL",
Txt_Required_knowledge);
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s"
"</td>"
"</tr>",
Prj->Hidden ? "DAT_LIGHT" :
"DAT",
Prj->Knowledge);
Prj_ShowOneProjectTxtRow (Prj,PrintView,
Txt_Required_knowledge,Prj->Knowledge);
/* Required materials to carry out the project */
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
Prj->Materials,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
Str_InsertLinks (Prj->Materials,Cns_MAX_BYTES_TEXT,60); // Insert links
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"RIGHT_TOP");
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s:"
"</td>"
"<td colspan=\"2\" class=\"LEFT_TOP",
Prj->Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL",
Txt_Required_materials);
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s"
"</td>"
"</tr>",
Prj->Hidden ? "DAT_LIGHT" :
"DAT",
Prj->Materials);
Prj_ShowOneProjectTxtRow (Prj,PrintView,
Txt_Required_materials,Prj->Materials);
/* Project tutors */
fprintf (Gbl.F.Out,"<tr>"
@ -557,6 +493,41 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
}
/*****************************************************************************/
/*********************** Show test info about a project **********************/
/*****************************************************************************/
static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
const char *Label,char *TxtField)
{
/***** Change format *****/
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
TxtField,Cns_MAX_BYTES_TEXT,false); // Convert from HTML to recpectful HTML
Str_InsertLinks (TxtField,Cns_MAX_BYTES_TEXT,60); // Insert links
/***** Row with label and text *****/
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\" class=\"RIGHT_TOP");
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s:"
"</td>"
"<td colspan=\"2\" class=\"LEFT_TOP",
Prj->Hidden ? "ASG_LABEL_LIGHT" :
"ASG_LABEL",
Label);
if (!PrintView)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out," %s\">"
"%s"
"</td>"
"</tr>",
Prj->Hidden ? "DAT_LIGHT" :
"DAT",
TxtField);
}
/*****************************************************************************/
/*************** Write list of users with a role in a project ****************/
/*****************************************************************************/