Version 15.251.1

This commit is contained in:
Antonio Cañas Vargas 2016-09-11 21:45:29 +02:00
parent a418834880
commit 1e69d5ab81
2 changed files with 32 additions and 44 deletions

View File

@ -135,13 +135,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.251 (2016-09-11)" #define Log_PLATFORM_VERSION "SWAD 15.251.1 (2016-09-11)"
#define CSS_FILE "swad15.229.css" #define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js" #define JS_FILE "swad15.238.1.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 15.251.1: Sep 11, 2016 Changes in user's usage report. (204406 lines)
Version 15.251: Sep 11, 2016 List of courses in user's usage report. (204416 lines) Version 15.251: Sep 11, 2016 List of courses in user's usage report. (204416 lines)
Version 15.250.10:Sep 11, 2016 Details of user's profile removed from user's usage report. (? lines) Version 15.250.10:Sep 11, 2016 Details of user's profile removed from user's usage report. (? lines)
Version 15.250.9: Sep 11, 2016 Number of courses in user's usage report. (204307 lines) Version 15.250.9: Sep 11, 2016 Number of courses in user's usage report. (204307 lines)

View File

@ -113,6 +113,7 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
extern const char *Txt_messages; extern const char *Txt_messages;
extern const char *Txt_USER_in_COURSE; extern const char *Txt_USER_in_COURSE;
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_course;
extern const char *Txt_courses; extern const char *Txt_courses;
extern const char *Txt_teachers_ABBREVIATION; extern const char *Txt_teachers_ABBREVIATION;
extern const char *Txt_students_ABBREVIATION; extern const char *Txt_students_ABBREVIATION;
@ -126,10 +127,10 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
Rol_Role_t Role; Rol_Role_t Role;
unsigned NumCrss; unsigned NumCrss;
/***** Start frame and table *****/ /***** Start frame and list *****/
if (SeeOrPrint == Rep_SEE)
Lay_StartRoundFrame ("100%",Txt_Report_of_use_of_the_platform, Lay_StartRoundFrame ("100%",Txt_Report_of_use_of_the_platform,
SeeOrPrint == Rep_SEE ? Rep_PutIconToPrintMyUsageReport : Rep_PutIconToPrintMyUsageReport);
NULL);
fprintf (Gbl.F.Out,"<ul class=\"LEFT_MIDDLE\">"); fprintf (Gbl.F.Out,"<ul class=\"LEFT_MIDDLE\">");
/***** User's name *****/ /***** User's name *****/
@ -299,6 +300,7 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
fprintf (Gbl.F.Out,"<li>%s: %u %s", fprintf (Gbl.F.Out,"<li>%s: %u %s",
Gbl.Title, Gbl.Title,
NumCrss, NumCrss,
NumCrss == 1 ? Txt_course :
Txt_courses); Txt_courses);
if (NumCrss) if (NumCrss)
{ {
@ -314,13 +316,9 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
fprintf (Gbl.F.Out,"</li>"); fprintf (Gbl.F.Out,"</li>");
} }
/***** End list and frame *****/
fprintf (Gbl.F.Out,"</ul>"); fprintf (Gbl.F.Out,"</ul>");
if (SeeOrPrint == Rep_SEE)
/***** List my courses *****/
Crs_GetAndWriteCrssOfAUsr (&Gbl.Usrs.Me.UsrDat,Rol_TEACHER);
Crs_GetAndWriteCrssOfAUsr (&Gbl.Usrs.Me.UsrDat,Rol_STUDENT);
/***** End table and frame *****/
Lay_EndRoundFrame (); Lay_EndRoundFrame ();
} }
@ -351,14 +349,19 @@ static void Rep_GetAndWriteCrssOfAUsr (const struct UsrData *UsrDat,Rol_Role_t R
unsigned NumCrs; unsigned NumCrs;
/***** Get courses of a user from database *****/ /***** Get courses of a user from database *****/
sprintf (Query,"SELECT degrees.DegCod,courses.CrsCod,degrees.ShortName,degrees.FullName," /*
"courses.Year,courses.FullName,centres.ShortName" SELECT degrees.DegCod 0
" FROM crs_usr,courses,degrees,centres" courses.CrsCod 1
courses.FullName 2
courses.Year 3
degrees.FullName 4
*/
sprintf (Query,"SELECT degrees.DegCod,courses.CrsCod,courses.FullName,courses.Year,degrees.FullName"
" FROM crs_usr,courses,degrees"
" WHERE crs_usr.UsrCod='%ld'" " WHERE crs_usr.UsrCod='%ld'"
" AND crs_usr.Role='%u'" " AND crs_usr.Role='%u'"
" AND crs_usr.CrsCod=courses.CrsCod" " AND crs_usr.CrsCod=courses.CrsCod"
" AND courses.DegCod=degrees.DegCod" " AND courses.DegCod=degrees.DegCod"
" AND degrees.CtrCod=centres.CtrCod"
" ORDER BY degrees.FullName,courses.Year,courses.FullName", " ORDER BY degrees.FullName,courses.Year,courses.FullName",
UsrDat->UsrCod,(unsigned) Role); UsrDat->UsrCod,(unsigned) Role);
@ -394,23 +397,21 @@ static void Rep_GetAndWriteCrssOfAUsr (const struct UsrData *UsrDat,Rol_Role_t R
static void Rep_WriteRowCrsData (MYSQL_ROW row) static void Rep_WriteRowCrsData (MYSQL_ROW row)
{ {
extern const char *Txt_Go_to_X;
extern const char *Txt_YEAR_OF_DEGREE[1+Deg_MAX_YEARS_PER_DEGREE]; extern const char *Txt_YEAR_OF_DEGREE[1+Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_teachers_ABBREVIATION; extern const char *Txt_teachers_ABBREVIATION;
extern const char *Txt_students_ABBREVIATION; extern const char *Txt_students_ABBREVIATION;
struct Degree Deg; struct Degree Deg;
long CrsCod; long CrsCod;
unsigned Year;
unsigned NumTchs; unsigned NumTchs;
unsigned NumStds; unsigned NumStds;
/* /*
SELECT degrees.DegCod 0 SELECT degrees.DegCod 0
courses.CrsCod 1 courses.CrsCod 1
degrees.ShortName 2 courses.FullName 2
degrees.FullName 3 courses.Year 3
courses.Year 4 degrees.FullName 4
courses.FullName 5
centres.ShortName 6
*/ */
/***** Get degree code (row[0]) *****/ /***** Get degree code (row[0]) *****/
@ -430,29 +431,15 @@ static void Rep_WriteRowCrsData (MYSQL_ROW row)
/***** Start row *****/ /***** Start row *****/
fprintf (Gbl.F.Out,"<li>"); fprintf (Gbl.F.Out,"<li>");
/***** Write course full name (row[5]) *****/ /***** Write course full name (row[2]) *****/
fprintf (Gbl.F.Out,"<td class=\"DAT_N LEFT_TOP\">"); fprintf (Gbl.F.Out,"%s -",row[2]);
Act_FormGoToStart (ActSeeCrsInf);
Crs_PutParamCrsCod (CrsCod);
sprintf (Gbl.Title,Txt_Go_to_X,row[6]);
Act_LinkFormSubmit (Gbl.Title,"DAT_N",NULL);
fprintf (Gbl.F.Out,"%s</a>",row[5]);
Act_FormEnd ();
/***** Write year (row[4]) *****/ /***** Write year (row[3]) *****/
fprintf (Gbl.F.Out," - %s", if ((Year = Deg_ConvStrToYear (row[3])))
Txt_YEAR_OF_DEGREE[Deg_ConvStrToYear (row[4])]); fprintf (Gbl.F.Out," %s",Txt_YEAR_OF_DEGREE[Year]);
/***** Write degree short name (row[2]) /***** Write degree full name (row[4]) *****/
and centre short name (row[6]) *****/ fprintf (Gbl.F.Out," %s",row[4]);
Act_FormGoToStart (ActSeeDegInf);
Deg_PutParamDegCod (Deg.DegCod);
sprintf (Gbl.Title,Txt_Go_to_X,row[2]);
Act_LinkFormSubmit (Gbl.Title,"DAT_NOBR_N",NULL);
fprintf (Gbl.F.Out," %s, %s"
"</a>",
row[2],row[6]);
Act_FormEnd ();
/***** Write number of teachers / students in course *****/ /***** Write number of teachers / students in course *****/
fprintf (Gbl.F.Out," (%u %s / %u %s)" fprintf (Gbl.F.Out," (%u %s / %u %s)"