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
"
"
",
Txt_Personal_information);
@@ -211,15 +244,15 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
fprintf (Gbl.F.Out,"
");
/***** Figures *****/
- fprintf (Gbl.F.Out,"
%s
"
+ fprintf (Gbl.F.Out,"
%s
"
"
",
Txt_Figures);
/***** Get figures *****/
Prf_GetUsrFigures (Gbl.Usrs.Me.UsrDat.UsrCod,&UsrFigures);
- /***** Time since first click *****/
- fprintf (Gbl.F.Out,"- %s: ",Txt_From_TIME);
+ /***** Time since first click until now *****/
+ fprintf (Gbl.F.Out,"
- %s ",Txt_TIME_Since);
if (UsrFigures.FirstClickTimeUTC)
{
if ((gmtime_r (&UsrFigures.FirstClickTimeUTC,&tm_FirstClickTime)) != NULL)
@@ -231,6 +264,9 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
tm_FirstClickTime.tm_hour, // hours
tm_FirstClickTime.tm_min, // minutes
tm_FirstClickTime.tm_sec); // seconds
+ if (StrCurrentDate[0])
+ fprintf (Gbl.F.Out," %s %s %s UTC",
+ Txt_TIME_until,StrCurrentDate,StrCurrentTime);
if (UsrFigures.NumDays > 0)
fprintf (Gbl.F.Out," (%d %s)",
UsrFigures.NumDays,
@@ -239,7 +275,11 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
}
}
else // Time of first click is unknown
+ {
fprintf (Gbl.F.Out,"?");
+ if (StrCurrentDate[0])
+ fprintf (Gbl.F.Out," - %s %s UTC",StrCurrentDate,StrCurrentTime);
+ }
fprintf (Gbl.F.Out,"
");
/***** Number of clicks *****/
@@ -336,9 +376,11 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
fprintf (Gbl.F.Out,"
");
/***** Current courses *****/
- fprintf (Gbl.F.Out,"
%s (actuales)
" // TODO: Need translation!!!
- "
",
- Txt_Courses);
+ fprintf (Gbl.F.Out,"%s",Txt_Courses);
+ if (StrCurrentDate[0])
+ fprintf (Gbl.F.Out," (%s)",StrCurrentDate);
+ fprintf (Gbl.F.Out,"
"
+ "");
/* Number of courses in which the user is student/teacher */
MaxHitsPerYear = Rep_GetMaxHitsPerYear (BrowserTimeZone,UsrFigures.FirstClickTimeUTC);
@@ -354,7 +396,7 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
fprintf (Gbl.F.Out,"
");
/***** Historic courses *****/
- fprintf (Gbl.F.Out,"%s (histórico)
" // TODO: Need translation!!!
+ fprintf (Gbl.F.Out,"%s (histórico)
" // TODO: Need translation!!!
"",
Txt_Courses);
@@ -371,7 +413,7 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
fprintf (Gbl.F.Out,"
");
/***** Global hits *****/
- fprintf (Gbl.F.Out,"%s
",Txt_Hits);
+ fprintf (Gbl.F.Out,"%s
",Txt_Hits);
Rep_ShowMyHitsPerYear (true,-1L,Rol_UNKNOWN,
BrowserTimeZone,
UsrFigures.FirstClickTimeUTC,
diff --git a/swad_text.c b/swad_text.c
index 3e4dbea3f..bdadc2e22 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -31006,7 +31006,28 @@ const char *Txt_Reply_message = // "Reply" as a noun, not as a verb
#elif L==9
"Mensagem de resposta";
#endif
-
+/*
+const char *Txt_Report =
+#if L==1
+ "Informe";
+#elif L==2
+ "Nutzungsbericht";
+#elif L==3
+ "Report";
+#elif L==4
+ "Informe";
+#elif L==5
+ "Rapport";
+#elif L==6
+ "Informe"; // Okoteve traducción
+#elif L==7
+ "Rapporto";
+#elif L==8
+ "Raport";
+#elif L==9
+ "Relatório";
+#endif
+*/
const char *Txt_Report_of_use_of_the_platform =
#if L==1
"Informe d'ús de la plataforma";
@@ -47063,6 +47084,48 @@ const char *Txt_threads =
"threads";
#endif
+const char *Txt_TIME_Since =
+#if L==1
+ "Des de";
+#elif L==2
+ "Seit dem";
+#elif L==3
+ "Since";
+#elif L==4
+ "Desde";
+#elif L==5
+ "Depuis";
+#elif L==6
+ "Desde"; // Okoteve traducción
+#elif L==7
+ "Dal";
+#elif L==8
+ "Od";
+#elif L==9
+ "Desde";
+#endif
+
+const char *Txt_TIME_until =
+#if L==1
+ "fins al";
+#elif L==2
+ "bis zum";
+#elif L==3
+ "until";
+#elif L==4
+ "hasta";
+#elif L==5
+ "jusqu'au";
+#elif L==6
+ "hasta"; // Okoteve traducción
+#elif L==7
+ "al";
+#elif L==8
+ "do";
+#elif L==9
+ "até";
+#endif
+
const char *Txt_time =
#if L==1
"temps";