diff --git a/swad_changelog.h b/swad_changelog.h
index d79731c60..98a9f9ae3 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -252,13 +252,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 17.3.11 (2017-09-20)"
+#define Log_PLATFORM_VERSION "SWAD 17.3.12 (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.12: Sep 20, 2017 Code refactoring in listing of projects. (229977 lines)
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)
diff --git a/swad_project.c b/swad_project.c
index 46d6a361a..2a7d0e900 100644
--- a/swad_project.c
+++ b/swad_project.c
@@ -81,6 +81,8 @@ 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_ShowOneProjectUsrsRow (const struct Project *Prj,bool PrintView,
+ const char *Label,Prj_RoleInProject_t RoleInProject);
static void Prj_WriteUsrs (long PrjCod,Prj_RoleInProject_t RoleInProject);
static void Prj_GetParamPrjOrder (void);
@@ -449,52 +451,18 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
Txt_Required_materials,Prj->Materials);
/* Project tutors */
- fprintf (Gbl.F.Out,"
"
- ""
- "%s:"
- " | "
- "Hidden ? "ASG_LABEL_LIGHT" :
- "ASG_LABEL",
- Txt_Tutors);
- if (!PrintView)
- fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
- fprintf (Gbl.F.Out," %s\">",
- Prj->Hidden ? "DAT_LIGHT" :
- "DAT");
- Prj_WriteUsrs (Prj->PrjCod,Prj_ROLE_TUT);
- fprintf (Gbl.F.Out," | "
- "
");
+ Prj_ShowOneProjectUsrsRow (Prj,PrintView,
+ Txt_Tutors,Prj_ROLE_TUT);
/* Project students */
- fprintf (Gbl.F.Out,""
- ""
- "%s:"
- " | "
- "Hidden ? "ASG_LABEL_LIGHT" :
- "ASG_LABEL",
- Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN]);
- if (!PrintView)
- fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
- fprintf (Gbl.F.Out," %s\">",
- Prj->Hidden ? "DAT_LIGHT" :
- "DAT");
- Prj_WriteUsrs (Prj->PrjCod,Prj_ROLE_STD);
- fprintf (Gbl.F.Out," | "
- "
");
+ Prj_ShowOneProjectUsrsRow (Prj,PrintView,
+ Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],Prj_ROLE_STD);
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
}
/*****************************************************************************/
-/*********************** Show test info about a project **********************/
+/************************ Show text row about a project **********************/
/*****************************************************************************/
static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
@@ -528,6 +496,35 @@ static void Prj_ShowOneProjectTxtRow (struct Project *Prj,bool PrintView,
TxtField);
}
+/*****************************************************************************/
+/************************* Show users row in a project ***********************/
+/*****************************************************************************/
+
+static void Prj_ShowOneProjectUsrsRow (const struct Project *Prj,bool PrintView,
+ const char *Label,Prj_RoleInProject_t RoleInProject)
+ {
+ /***** Row with label and listing of users *****/
+ fprintf (Gbl.F.Out,""
+ ""
+ "%s:"
+ " | "
+ "Hidden ? "ASG_LABEL_LIGHT" :
+ "ASG_LABEL",
+ Label);
+ if (!PrintView)
+ fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
+ fprintf (Gbl.F.Out," %s\">",
+ Prj->Hidden ? "DAT_LIGHT" :
+ "DAT");
+ Prj_WriteUsrs (Prj->PrjCod,RoleInProject);
+ fprintf (Gbl.F.Out," | "
+ "
");
+ }
+
/*****************************************************************************/
/*************** Write list of users with a role in a project ****************/
/*****************************************************************************/