From 44de356aabc58da83789172b12178b360557255f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 2 Oct 2016 21:14:07 +0200 Subject: [PATCH] Version 16.6.3 --- swad_changelog.h | 3 ++- swad_report.c | 64 +++++++++++++++++++++++++++++++++++++++-------- swad_text.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 119 insertions(+), 13 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 2b986a490..a1b5057a0 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -143,13 +143,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.6.2 (2016-10-02)" +#define Log_PLATFORM_VERSION "SWAD 16.6.3 (2016-10-02)" #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.6.3: Oct 02, 2016 Current time in user's usage report. (205559 lines) Version 16.6.2: Oct 02, 2016 Message translated. (205456 lines) Version 16.6.1: Oct 02, 2016 Message translated. (205454 lines) Version 16.6: Oct 02, 2016 Hits in historic courses in user's usage report. (205432 lines) diff --git a/swad_report.c b/swad_report.c index 25656e7f9..ea4bfbd9f 100644 --- a/swad_report.c +++ b/swad_report.c @@ -128,7 +128,8 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) extern const char *Txt_Country; extern const char *Txt_Institution; extern const char *Txt_Figures; - extern const char *Txt_From_TIME; + 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; @@ -152,7 +153,13 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) char CtyName[Cty_MAX_BYTES_COUNTRY_NAME+1]; struct Institution Ins; struct UsrFigures UsrFigures; + time_t CurrentTime; + struct tm tm_CurrentTime; struct tm tm_FirstClickTime; + char StrCurrentDate[10+1]; // Example: 2016-10-02 + // 1234567890 + char StrCurrentTime[8+1]; // Example: 19:03:49 + // 12345678 unsigned NumFiles; unsigned NumPublicFiles; Rol_Role_t Role; @@ -161,14 +168,40 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint) /***** Get client time zone *****/ Dat_GetBrowserTimeZone (BrowserTimeZone); + /***** Get current date-time *****/ + time (&CurrentTime); + if ((gmtime_r (&CurrentTime,&tm_CurrentTime)) != NULL) + { + sprintf (StrCurrentDate,"%04d-%02d-%02d", + 1900 + tm_CurrentTime.tm_year, // year + 1 + tm_CurrentTime.tm_mon, // month + tm_CurrentTime.tm_mday); // day of the month + sprintf (StrCurrentTime,"%02d:%02d:%02d", + tm_CurrentTime.tm_hour, // hours + tm_CurrentTime.tm_min, // minutes + tm_CurrentTime.tm_sec); // seconds + } + else + { + StrCurrentDate[0] = '\0'; + StrCurrentTime[0] = '\0'; + } + /***** Start frame *****/ if (SeeOrPrint == Rep_SEE) Lay_StartRoundFrame (NULL,Txt_Report_of_use_of_the_platform, - Rep_PutIconToPrintMyUsageReport); + Rep_PutIconToPrintMyUsageReport); fprintf (Gbl.F.Out,"
"); + /***** Head *****/ + fprintf (Gbl.F.Out,"

%s

",Txt_Report_of_use_of_the_platform); + fprintf (Gbl.F.Out,"

%s",Gbl.Usrs.Me.UsrDat.FullName); + if (StrCurrentDate[0]) + fprintf (Gbl.F.Out,", %s",StrCurrentDate); + fprintf (Gbl.F.Out,"

"); + /***** Personal information *****/ - fprintf (Gbl.F.Out,"

%s

" + fprintf (Gbl.F.Out,"

%s

" ""); /***** Figures *****/ - fprintf (Gbl.F.Out,"

%s

" + fprintf (Gbl.F.Out,"

%s

" ""); /***** Current courses *****/ - fprintf (Gbl.F.Out,"

%s (actuales)

" // TODO: Need translation!!! - "