mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-14 12:44:09 +02:00
Version 17.3.7
This commit is contained in:
parent
3f85ea33be
commit
51f95f5b41
|
@ -252,13 +252,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 17.3.6 (2017-09-19)"
|
#define Log_PLATFORM_VERSION "SWAD 17.3.7 (2017-09-19)"
|
||||||
#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.3.7: Sep 19, 2017 New row in listing of projects for tutors. Not finished. (229983 lines)
|
||||||
Version 17.3.6: Sep 19, 2017 Changes in listing of projects. (229849 lines)
|
Version 17.3.6: Sep 19, 2017 Changes in listing of projects. (229849 lines)
|
||||||
Version 17.3.5: Sep 19, 2017 Removed groups in projects. (229858 lines)
|
Version 17.3.5: Sep 19, 2017 Removed groups in projects. (229858 lines)
|
||||||
Version 17.3.4: Sep 19, 2017 Changes in edition of projects. (230170 lines)
|
Version 17.3.4: Sep 19, 2017 Changes in edition of projects. (230170 lines)
|
||||||
|
|
131
swad_project.c
131
swad_project.c
|
@ -70,6 +70,7 @@ 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,bool PrintView);
|
||||||
|
static void Prj_WriteUsrs (long PrjCod);
|
||||||
static void Prj_WritePrjAuthor (struct Project *Prj);
|
static void Prj_WritePrjAuthor (struct Project *Prj);
|
||||||
static void Prj_GetParamPrjOrder (void);
|
static void Prj_GetParamPrjOrder (void);
|
||||||
|
|
||||||
|
@ -335,6 +336,7 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
|
||||||
extern const char *Txt_Description;
|
extern const char *Txt_Description;
|
||||||
extern const char *Txt_Required_knowledge;
|
extern const char *Txt_Required_knowledge;
|
||||||
extern const char *Txt_Required_materials;
|
extern const char *Txt_Required_materials;
|
||||||
|
extern const char *Txt_Tutors;
|
||||||
static unsigned UniqueId = 0;
|
static unsigned UniqueId = 0;
|
||||||
|
|
||||||
/***** Get data of this project *****/
|
/***** Get data of this project *****/
|
||||||
|
@ -343,7 +345,7 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
|
||||||
/***** Write first row of data of this project *****/
|
/***** Write first row of data of this project *****/
|
||||||
/* Forms to remove/edit this project */
|
/* Forms to remove/edit this project */
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
"<td rowspan=\"5\" class=\"CONTEXT_COL");
|
"<td rowspan=\"6\" class=\"CONTEXT_COL");
|
||||||
if (PrintView)
|
if (PrintView)
|
||||||
fprintf (Gbl.F.Out,"\">");
|
fprintf (Gbl.F.Out,"\">");
|
||||||
else
|
else
|
||||||
|
@ -512,9 +514,136 @@ static void Prj_ShowOneProject (struct Project *Prj,bool PrintView)
|
||||||
"DAT",
|
"DAT",
|
||||||
Prj->Materials);
|
Prj->Materials);
|
||||||
|
|
||||||
|
/* Project tutors */
|
||||||
|
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_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);
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"</tr>");
|
||||||
|
|
||||||
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************** Write list of recipients of a message ******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static void Prj_WriteUsrs (long PrjCod)
|
||||||
|
{
|
||||||
|
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];
|
||||||
|
char Query[2048];
|
||||||
|
MYSQL_RES *mysql_res;
|
||||||
|
MYSQL_ROW row;
|
||||||
|
unsigned NumUsr;
|
||||||
|
unsigned NumUsrs;
|
||||||
|
unsigned NumUsrsKnown;
|
||||||
|
unsigned NumUsrsUnknown;
|
||||||
|
unsigned NumUsrsToShow;
|
||||||
|
struct UsrData UsrDat;
|
||||||
|
bool UsrValid;
|
||||||
|
bool ShowPhoto;
|
||||||
|
char PhotoURL[PATH_MAX + 1];
|
||||||
|
|
||||||
|
/***** Get number of users of a project from database *****/
|
||||||
|
sprintf (Query,"SELECT COUNT(*) FROM prj_usr WHERE PrjCod=%ld",
|
||||||
|
PrjCod);
|
||||||
|
NumUsrs = (unsigned) DB_QueryCOUNT (Query,"can not get number of recipients");
|
||||||
|
|
||||||
|
/***** Get users of a project from database *****/
|
||||||
|
sprintf (Query,"SELECT prj_usr.UsrCod,"
|
||||||
|
"usr_data.Surname1 AS S1,"
|
||||||
|
"usr_data.Surname2 AS S2,"
|
||||||
|
"usr_data.FirstName AS FN"
|
||||||
|
" FROM prj_usr,usr_data"
|
||||||
|
" WHERE prj_usr.PrjCod=%ld"
|
||||||
|
" AND prj_usr.UsrCod=usr_data.UsrCod"
|
||||||
|
" ORDER BY S1,S2,FN",
|
||||||
|
PrjCod);
|
||||||
|
NumUsrsKnown = (unsigned) DB_QuerySELECT (Query,&mysql_res,"can not get users of a project");
|
||||||
|
|
||||||
|
/***** Check number of users *****/
|
||||||
|
if (NumUsrs)
|
||||||
|
{
|
||||||
|
/***** Start table *****/
|
||||||
|
fprintf (Gbl.F.Out,"<table>");
|
||||||
|
|
||||||
|
/***** How many users will be shown? *****/
|
||||||
|
NumUsrsToShow = NumUsrsKnown;
|
||||||
|
|
||||||
|
/***** Initialize structure with user's data *****/
|
||||||
|
Usr_UsrDataConstructor (&UsrDat);
|
||||||
|
|
||||||
|
/***** Write known users *****/
|
||||||
|
for (NumUsr = 0;
|
||||||
|
NumUsr < NumUsrsToShow;
|
||||||
|
NumUsr++)
|
||||||
|
{
|
||||||
|
/* Get user's code */
|
||||||
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
UsrDat.UsrCod = Str_ConvertStrCodToLongCod (row[0]);
|
||||||
|
|
||||||
|
/* Get user's data */
|
||||||
|
UsrValid = Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
|
||||||
|
|
||||||
|
/* Put user's photo */
|
||||||
|
fprintf (Gbl.F.Out,"<td class=\"CENTER_TOP\" style=\"width:30px;\">");
|
||||||
|
ShowPhoto = (UsrValid ? Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL) :
|
||||||
|
false);
|
||||||
|
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
||||||
|
NULL,
|
||||||
|
"PHOTO21x28",Pho_ZOOM,false);
|
||||||
|
|
||||||
|
/* Write user's name */
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"<td class=\"AUTHOR_TXT LEFT_MIDDLE\">");
|
||||||
|
if (UsrValid)
|
||||||
|
fprintf (Gbl.F.Out,"%s",UsrDat.FullName);
|
||||||
|
else
|
||||||
|
fprintf (Gbl.F.Out,"[%s]",
|
||||||
|
Txt_ROLES_SINGUL_abc[Rol_UNK][Usr_SEX_UNKNOWN]); // User not found, likely a user who has been removed
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"</tr>");
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** If any users are unknown *****/
|
||||||
|
if ((NumUsrsUnknown = NumUsrs - NumUsrsKnown))
|
||||||
|
/***** Start form to show all the users *****/
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td colspan=\"3\" class=\"AUTHOR_TXT LEFT_MIDDLE\">"
|
||||||
|
"[%u %s]"
|
||||||
|
"</td>"
|
||||||
|
"</tr>",
|
||||||
|
NumUsrsUnknown,
|
||||||
|
(NumUsrsUnknown == 1) ?
|
||||||
|
Txt_ROLES_SINGUL_abc[Rol_UNK][Usr_SEX_UNKNOWN] :
|
||||||
|
Txt_ROLES_PLURAL_abc[Rol_UNK][Usr_SEX_UNKNOWN]);
|
||||||
|
|
||||||
|
/***** Free memory used for user's data *****/
|
||||||
|
Usr_UsrDataDestructor (&UsrDat);
|
||||||
|
|
||||||
|
/***** End table *****/
|
||||||
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
|
}
|
||||||
|
|
||||||
|
/***** Free structure that stores the query result *****/
|
||||||
|
DB_FreeMySQLResult (&mysql_res);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*********************** Write the author of a project ***********************/
|
/*********************** Write the author of a project ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -50216,6 +50216,27 @@ const char *Txt_TF_QST[2] =
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const char *Txt_Tutors =
|
||||||
|
#if L==1
|
||||||
|
"Tutors";
|
||||||
|
#elif L==2
|
||||||
|
"Tutoren";
|
||||||
|
#elif L==3
|
||||||
|
"Tutors";
|
||||||
|
#elif L==4
|
||||||
|
"Tutores";
|
||||||
|
#elif L==5
|
||||||
|
"Tuteurs";
|
||||||
|
#elif L==6
|
||||||
|
"Tutores"; // Okoteve traducción
|
||||||
|
#elif L==7
|
||||||
|
"Tutori";
|
||||||
|
#elif L==8
|
||||||
|
"Opiekunowie";
|
||||||
|
#elif L==9
|
||||||
|
"Tutores";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_Type =
|
const char *Txt_Type =
|
||||||
#if L==1
|
#if L==1
|
||||||
"Tipus";
|
"Tipus";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user