diff --git a/swad_changelog.h b/swad_changelog.h index 351d4dae8..9008cdff2 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -143,13 +143,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.7.5 (2016-10-03)" +#define Log_PLATFORM_VERSION "SWAD 16.7.6 (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.6: Oct 03, 2016 Code refactoring in user's usage report. (205591 lines) 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) diff --git a/swad_report.c b/swad_report.c index 6073bcea1..1c28fa0eb 100644 --- a/swad_report.c +++ b/swad_report.c @@ -80,6 +80,10 @@ static void Rep_PutIconToPrintMyUsageReport (void); static void Rep_WriteHeader (const char *StrCurrentDate); static void Rep_WriteSectionPlatform (void); static void Rep_WriteSectionUsrInfo (void); +static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures, + struct tm *tm_FirstClickTime, + const char *StrCurrentDate, + const char *StrCurrentTime); static unsigned long Rep_GetMaxHitsPerYear (time_t FirstClickTimeUTC); static void Rep_GetAndWriteCurrentCrssOfAUsr (const struct UsrData *UsrDat,Rol_Role_t Role, @@ -119,25 +123,6 @@ void Rep_PrintMyUsageReport (void) static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) { extern const char *Txt_Report; - extern const char *Txt_Figures; - extern const char *Txt_TIME_Since; - extern const char *Txt_TIME_until; - extern const char *Txt_day; - extern const char *Txt_days; - extern const char *Txt_Clicks; - extern const char *Txt_Files_uploaded; - extern const char *Txt_file; - extern const char *Txt_files; - extern const char *Txt_public_FILES; - extern const char *Txt_Downloads; - extern const char *Txt_download; - extern const char *Txt_downloads; - extern const char *Txt_Forum_posts; - extern const char *Txt_post; - extern const char *Txt_posts; - extern const char *Txt_Messages_sent; - extern const char *Txt_message; - extern const char *Txt_messages; extern const char *Txt_Courses; extern const char *Txt_historical_log; extern const char *Txt_Hits; @@ -149,8 +134,6 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) // 1234567890 char StrCurrentTime[8+1]; // Example: 19:03:49 // 12345678 - unsigned NumFiles; - unsigned NumPublicFiles; Rol_Role_t Role; unsigned long MaxHitsPerYear; @@ -190,136 +173,11 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) Rep_WriteSectionUsrInfo (); /***** Figures *****/ - fprintf (Gbl.F.Out,"

%s

" - ""); + gmtime_r (&UsrFigures.FirstClickTimeUTC,&tm_FirstClickTime); + Rep_WriteSectionUsrFigures (&UsrFigures,&tm_FirstClickTime, + StrCurrentDate,StrCurrentTime); /***** Global hits *****/ fprintf (Gbl.F.Out,"

%s

",Txt_Hits); @@ -487,6 +345,170 @@ static void Rep_WriteSectionUsrInfo (void) ""); } +/*****************************************************************************/ +/********* Write section for user's figures in user's usage report ***********/ +/*****************************************************************************/ + +static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures, + struct tm *tm_FirstClickTime, + const char *StrCurrentDate, + const char *StrCurrentTime) + { + extern const char *Txt_Figures; + extern const char *Txt_TIME_Since; + extern const char *Txt_TIME_until; + extern const char *Txt_day; + extern const char *Txt_days; + extern const char *Txt_Clicks; + extern const char *Txt_Files_uploaded; + extern const char *Txt_file; + extern const char *Txt_files; + extern const char *Txt_public_FILES; + extern const char *Txt_Downloads; + extern const char *Txt_download; + extern const char *Txt_downloads; + extern const char *Txt_Forum_posts; + extern const char *Txt_post; + extern const char *Txt_posts; + extern const char *Txt_Messages_sent; + extern const char *Txt_message; + extern const char *Txt_messages; + unsigned NumFiles; + unsigned NumPublicFiles; + + /***** Start of section *****/ + fprintf (Gbl.F.Out,"
" + "

%s

" + "" + "
"); + } + /*****************************************************************************/ /************ Get the maximum number of hits per course-year-role ************/ /*****************************************************************************/