Version 17.7.1

This commit is contained in:
Antonio Cañas Vargas 2017-09-23 15:39:21 +02:00
parent efe2ec546b
commit 69c1e43fe7
3 changed files with 33 additions and 71 deletions

View File

@ -252,13 +252,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 17.7 (2017-09-23)"
#define Log_PLATFORM_VERSION "SWAD 17.7.1 (2017-09-23)"
#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.7.1: Sep 23, 2017 Changes in listing of projects. (230764 lines)
Version 17.7: Sep 23, 2017 Remove user from project. (230798 lines)
Version 17.6: Sep 22, 2017 Actions to remove user from project. (230559 lines)
6 changes necessary in database:

View File

@ -96,11 +96,11 @@ static void Prj_PutParams (void);
static void Prj_GetDataOfProject (struct Project *Prj,const char *Query);
static void Prj_ResetProject (struct Project *Prj);
static void Prj_PutParamPrjCod (long PrjCod);
static bool Prj_CheckIfSimilarProjectsExists (const char *Field,const char *Value,long PrjCod);
static void Prj_RequestCreatOrEditPrj (long PrjCod);
static void Prj_EditOneProjectTxtArea (const char *Id,
const char *Label,char *TxtField);
const char *Label,char *TxtField,
unsigned NumRows);
static void Prj_AllocMemProject (struct Project *Prj);
static void Prj_FreeMemProject (struct Project *Prj);
@ -487,14 +487,18 @@ static void Prj_ShowOneProjectDepartment (const struct Project *Prj,
Dpt_GetDataOfDepartmentByCod (&Dpt);
/***** Show department *****/
fprintf (Gbl.F.Out,"<td class=\"DAT_N LEFT_TOP");
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP",
Prj->Hidden ? "DAT_LIGHT" :
"DAT_N");
if (ProjectView == Prj_LIST_PROJECTS)
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"\">");
if (Dpt.WWW[0])
fprintf (Gbl.F.Out,"<a href=\"%s\" target=\"_blank\""
" class=\"DAT_N\">",
Dpt.WWW);
" class=\"%s\">",
Dpt.WWW,
Prj->Hidden ? "DAT_LIGHT" :
"DAT_N");
fprintf (Gbl.F.Out,"%s",Dpt.FullName);
if (Dpt.WWW[0])
fprintf (Gbl.F.Out,"</a>");
@ -1517,21 +1521,6 @@ void Prj_ShowProject (void)
Prj_SeeProjects ();
}
/*****************************************************************************/
/********** Check if the title or the folder of a project exists *************/
/*****************************************************************************/
static bool Prj_CheckIfSimilarProjectsExists (const char *Field,const char *Value,long PrjCod)
{
char Query[256 + Prj_MAX_BYTES_PROJECT_TITLE];
/***** Get number of projects with a field value from database *****/
sprintf (Query,"SELECT COUNT(*) FROM projects"
" WHERE CrsCod=%ld AND %s='%s' AND PrjCod<>%ld",
Gbl.CurrentCrs.Crs.CrsCod,Field,Value,PrjCod);
return (DB_QueryCOUNT (Query,"can not get similar projects") != 0);
}
/*****************************************************************************/
/********************* Put a form to create/edit project *********************/
/*****************************************************************************/
@ -1655,13 +1644,16 @@ static void Prj_RequestCreatOrEditPrj (long PrjCod)
"</tr>");
/* Description of the project */
Prj_EditOneProjectTxtArea ("Description",Txt_Description,Prj.Description);
Prj_EditOneProjectTxtArea ("Description",Txt_Description,
Prj.Description,12);
/* Required knowledge to carry out the project */
Prj_EditOneProjectTxtArea ("Knowledge",Txt_Required_knowledge,Prj.Knowledge);
Prj_EditOneProjectTxtArea ("Knowledge",Txt_Required_knowledge,
Prj.Knowledge,4);
/* Required materials to carry out the project */
Prj_EditOneProjectTxtArea ("Materials",Txt_Required_materials,Prj.Materials);
Prj_EditOneProjectTxtArea ("Materials",Txt_Required_materials,
Prj.Materials,4);
/* URL for additional info */
fprintf (Gbl.F.Out,"<tr>"
@ -1738,7 +1730,8 @@ static void Prj_RequestCreatOrEditPrj (long PrjCod)
/*****************************************************************************/
static void Prj_EditOneProjectTxtArea (const char *Id,
const char *Label,char *TxtField)
const char *Label,char *TxtField,
unsigned NumRows)
{
extern const char *The_ClassForm[The_NUM_THEMES];
@ -1747,13 +1740,14 @@ static void Prj_EditOneProjectTxtArea (const char *Id,
"<label for=\"%s\" class=\"%s\">%s:</label>"
"</td>"
"<td class=\"LEFT_TOP\">"
"<textarea id=\"%s\" name=\"%s\" cols=\"60\" rows=\"5\">"
"<textarea id=\"%s\" name=\"%s\" cols=\"60\" rows=\"%u\">"
"%s"
"</textarea>"
"</td>"
"</tr>",
Id,The_ClassForm[Gbl.Prefs.Theme],Label,
Id,Id,
NumRows,
TxtField);
}
@ -1802,7 +1796,6 @@ static void Prj_FreeMemProject (struct Project *Prj)
void Prj_RecFormProject (void)
{
extern const char *Txt_Already_existed_a_project_with_the_title_X;
extern const char *Txt_You_must_specify_the_title_of_the_project;
extern const char *Txt_Created_new_project_X;
extern const char *Txt_The_project_has_been_modified;
@ -1854,18 +1847,7 @@ void Prj_RecFormProject (void)
Prj.TimeUTC[Dat_END_TIME] = Prj.TimeUTC[Dat_START_TIME] + 2 * 60 * 60; // +2 hours
/***** Check if title is correct *****/
if (Prj.Title[0]) // If there's a project title
{
/* If title of project was in database... */
if (Prj_CheckIfSimilarProjectsExists ("Title",Prj.Title,Prj.PrjCod))
{
NewProjectIsCorrect = false;
sprintf (Gbl.Alert.Txt,Txt_Already_existed_a_project_with_the_title_X,
Prj.Title);
Ale_ShowAlert (Ale_WARNING,Gbl.Alert.Txt);
}
}
else // If there is not a project title
if (!Prj.Title[0]) // If there is not a project title
{
NewProjectIsCorrect = false;
Ale_ShowAlert (Ale_WARNING,Txt_You_must_specify_the_title_of_the_project);

View File

@ -2551,27 +2551,6 @@ const char *Txt_Already_existed_a_project_with_the_folder_X = // Warning: it is
"J&aacute; existe um projeto com o diret&oacute;rio <strong>%s</strong>.";
#endif
const char *Txt_Already_existed_a_project_with_the_title_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"Ja existia un projecte amb el t&iacute;tol <strong>%s</strong>.";
#elif L==2
"Es gibt bereits einen Projekt mit dem Namen <strong>%s</strong>.";
#elif L==3
"Already existed a project with the title <strong>%s</strong>.";
#elif L==4
"Ya exist&iacute;a un proyecto con el t&iacute;tulo <strong>%s</strong>.";
#elif L==5
"Il existe d&eacute;j&agrave; un projet du titre <strong>%s</strong>.";
#elif L==6
"Ya exist&iacute;a un proyecto con el t&iacute;tulo <strong>%s</strong>."; // Okoteve traducción
#elif L==7
"Esiste gi&agrave; un progetto con il titolo <strong>%s</strong>.";
#elif L==8
"By&lstrok; ju&zdot; projekt o tytule <strong>%s</strong>.";
#elif L==9
"J&aacute; existe um projeto com o t&iacute;tulo <strong>%s</strong>.";
#endif
const char *Txt_Already_existed_a_survey_with_the_title_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"Ja existia una enquesta amb el t&iacute;tol <strong>%s</strong>.";
@ -21408,23 +21387,23 @@ const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
,
// 2: ActSeePrj
#if L==1
"Projectes"
"Projectes (treballs fi de grau, projectes final de carrera, tesi&hellip;)"
#elif L==2
"Projekte"
"Projekte (Abschlussarbeiten, Diplomarbeiten&hellip;)"
#elif L==3
"Projects (final degree projects&hellip;)"
"Projects (end-of-degree projects, thesis&hellip;)"
#elif L==4
"Proyectos (proyectos fin de carrera, trabajos fin de grado&hellip;)"
"Proyectos (trabajos fin de grado/m&aacute;ster, proyectos fin de carrera, tesis&hellip;)"
#elif L==5
"Projets"
"Projets (projets de fin de cours, th&egrave;se&hellip;)"
#elif L==6
"Proyectos (proyectos fin de carrera, trabajos fin de grado&hellip;)" // Okoteve traducción
"Proyectos (trabajos fin de grado/m&aacute;ster, proyectos fin de carrera, tesis&hellip;)" // Okoteve traducción
#elif L==7
"Progetti"
"Progetti (progetti di fine corso, tesi&hellip;)"
#elif L==8
"Projekty"
"Projekty (projekty ko&nacute;cowe, praca dyplomowa&hellip;)"
#elif L==9
"Projetos"
"Projetos (projetos de fim de grau, tese&hellip;)"
#endif
,
// 3: ActReqTst
@ -31041,11 +31020,11 @@ const char *Txt_Projects =
#elif L==3
"Projects (end-of-degree projects, thesis&hellip;)";
#elif L==4
"Proyectos (trabajos fin de grado, proyectos fin de carrera, tesis&hellip;)";
"Proyectos (trabajos fin de grado/m&aacute;ster, proyectos fin de carrera, tesis&hellip;)";
#elif L==5
"Projets (projets de fin de cours, th&egrave;se&hellip;)";
#elif L==6
"Proyectos (trabajos fin de grado, proyectos fin de carrera, tesis&hellip;)"; // Okoteve traducción
"Proyectos (trabajos fin de grado/m&aacute;ster, proyectos fin de carrera, tesis&hellip;)"; // Okoteve traducción
#elif L==7
"Progetti (progetti di fine corso, tesi&hellip;)";
#elif L==8