Version 16.7.5

This commit is contained in:
Antonio Cañas Vargas 2016-10-03 09:44:32 +02:00
parent 3478936cac
commit 07aacdf20c
2 changed files with 52 additions and 36 deletions

View File

@ -143,13 +143,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.7.4 (2016-10-03)"
#define Log_PLATFORM_VERSION "SWAD 16.7.5 (2016-10-03)"
#define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.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 16.7.5: Oct 03, 2016 Code refactoring in user's usage report. (205570 lines)
Version 16.7.4: Oct 03, 2016 Code refactoring in user's usage report. (205557 lines)
Version 16.7.3: Oct 03, 2016 User's ID is removed from user's usage report. (205533 lines)
Version 16.7.2: Oct 02, 2016 Change in order of hits in user's usage report. (205546 lines)

View File

@ -79,6 +79,7 @@ static void Rep_PutIconToPrintMyUsageReport (void);
static void Rep_WriteHeader (const char *StrCurrentDate);
static void Rep_WriteSectionPlatform (void);
static void Rep_WriteSectionUsrInfo (void);
static unsigned long Rep_GetMaxHitsPerYear (time_t FirstClickTimeUTC);
static void Rep_GetAndWriteCurrentCrssOfAUsr (const struct UsrData *UsrDat,Rol_Role_t Role,
@ -118,11 +119,6 @@ void Rep_PrintMyUsageReport (void)
static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
{
extern const char *Txt_Report;
extern const char *Txt_Name;
extern const char *Txt_Personal_information;
extern const char *Txt_Email;
extern const char *Txt_Country;
extern const char *Txt_Institution;
extern const char *Txt_Figures;
extern const char *Txt_TIME_Since;
extern const char *Txt_TIME_until;
@ -145,8 +141,6 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
extern const char *Txt_Courses;
extern const char *Txt_historical_log;
extern const char *Txt_Hits;
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1];
struct Institution Ins;
struct UsrFigures UsrFigures;
time_t CurrentTime;
struct tm tm_CurrentTime;
@ -193,34 +187,7 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
Rep_WriteSectionPlatform ();
/***** Personal information *****/
fprintf (Gbl.F.Out,"<h3>%s</h3>"
"<ul>",
Txt_Personal_information);
/* User's name */
fprintf (Gbl.F.Out,"<li>%s: <strong>%s</strong></li>",
Txt_Name,
Gbl.Usrs.Me.UsrDat.FullName);
/* User's e-mail */
fprintf (Gbl.F.Out,"<li>%s: %s</li>",
Txt_Email,
Gbl.Usrs.Me.UsrDat.Email);
/* User's country */
Cty_GetCountryName (Gbl.Usrs.Me.UsrDat.CtyCod,CtyName);
fprintf (Gbl.F.Out,"<li>%s: %s</li>",
Txt_Country,
CtyName);
/* User's institution */
Ins.InsCod = Gbl.Usrs.Me.UsrDat.InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
fprintf (Gbl.F.Out,"<li>%s: %s</li>",
Txt_Institution,
Ins.FullName);
fprintf (Gbl.F.Out,"</ul>");
Rep_WriteSectionUsrInfo ();
/***** Figures *****/
fprintf (Gbl.F.Out,"<h3>%s</h3>"
@ -472,6 +439,54 @@ static void Rep_WriteSectionPlatform (void)
"</section>");
}
/*****************************************************************************/
/*********** Write section for user's info in user's usage report ************/
/*****************************************************************************/
static void Rep_WriteSectionUsrInfo (void)
{
extern const char *Txt_Personal_information;
extern const char *Txt_Name;
extern const char *Txt_Email;
extern const char *Txt_Country;
extern const char *Txt_Institution;
char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1];
struct Institution Ins;
/***** Start of section *****/
fprintf (Gbl.F.Out,"<section>"
"<h3>%s</h3>"
"<ul>",
Txt_Personal_information);
/***** User's name *****/
fprintf (Gbl.F.Out,"<li>%s: <strong>%s</strong></li>",
Txt_Name,
Gbl.Usrs.Me.UsrDat.FullName);
/***** User's e-mail *****/
fprintf (Gbl.F.Out,"<li>%s: %s</li>",
Txt_Email,
Gbl.Usrs.Me.UsrDat.Email);
/***** User's country *****/
Cty_GetCountryName (Gbl.Usrs.Me.UsrDat.CtyCod,CtyName);
fprintf (Gbl.F.Out,"<li>%s: %s</li>",
Txt_Country,
CtyName);
/***** User's institution *****/
Ins.InsCod = Gbl.Usrs.Me.UsrDat.InsCod;
Ins_GetDataOfInstitutionByCod (&Ins,Ins_GET_BASIC_DATA);
fprintf (Gbl.F.Out,"<li>%s: %s</li>",
Txt_Institution,
Ins.FullName);
/***** End of section *****/
fprintf (Gbl.F.Out,"</ul>"
"</section>");
}
/*****************************************************************************/
/************ Get the maximum number of hits per course-year-role ************/
/*****************************************************************************/