Version 16.17.7

This commit is contained in:
Antonio Cañas Vargas 2016-10-08 23:47:20 +02:00
parent 93719b16c7
commit edd59547d2
2 changed files with 22 additions and 23 deletions

View File

@ -148,13 +148,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.17.6 (2016-10-08)"
#define Log_PLATFORM_VERSION "SWAD 16.17.7 (2016-10-08)"
#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.17.7: Oct 08, 2016 Code refactoring in user's usage report. (206290 lines)
Version 16.17.6: Oct 08, 2016 Code refactoring in user's usage report. (206291 lines)
Version 16.17.5: Oct 08, 2016 Code refactoring in user's usage report. (206301 lines)
Version 16.17.4: Oct 08, 2016 Code refactoring in user's usage report. (206292 lines)

View File

@ -106,8 +106,7 @@ static void Rep_CreateMyUsageReport (struct Rep_Report *Report);
static void Rep_PutLinkToMyUsageReport (struct Rep_Report *Report);
static void Req_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC);
static void Rep_GetCurrentDateTimeUTC (struct tm *tm_CurrentTime,
struct Rep_CurrentTimeUTC *CurrentTimeUTC);
static void Rep_GetCurrentDateTimeUTC (struct Rep_Report *Report);
static void Rep_CreateNewReportFile (const struct Rep_CurrentTimeUTC *CurrentTimeUTC,
char *FilenameReport,char *Permalink);
@ -214,7 +213,7 @@ static void Rep_CreateMyUsageReport (struct Rep_Report *Report)
bool GetUsrFiguresAgain;
/***** Get current date-time *****/
Rep_GetCurrentDateTimeUTC (&Report->tm_CurrentTime,&Report->CurrentTimeUTC);
Rep_GetCurrentDateTimeUTC (Report);
/***** Create a new report file *****/
Rep_CreateNewReportFile (&Report->CurrentTimeUTC,Report->FilenameReport,Report->Permalink);
@ -339,36 +338,35 @@ static void Req_TitleReport (struct Rep_CurrentTimeUTC *CurrentTimeUTC)
/********************* Get current date and time in UTC **********************/
/*****************************************************************************/
static void Rep_GetCurrentDateTimeUTC (struct tm *tm_CurrentTime,
struct Rep_CurrentTimeUTC *CurrentTimeUTC)
static void Rep_GetCurrentDateTimeUTC (struct Rep_Report *Report)
{
time_t CurrentTime;
/***** Initialize to empty strings *****/
CurrentTimeUTC->StrDate[0] = '\0';
CurrentTimeUTC->StrTime[0] = '\0';
Report->CurrentTimeUTC.StrDate[0] = '\0';
Report->CurrentTimeUTC.StrTime[0] = '\0';
/***** Get current time UTC *****/
time (&CurrentTime);
if ((gmtime_r (&CurrentTime,tm_CurrentTime)) != NULL)
if ((gmtime_r (&CurrentTime,&Report->tm_CurrentTime)) != NULL)
{
/* Date and time as strings */
sprintf (CurrentTimeUTC->StrDate,"%04d-%02d-%02d",
1900 + tm_CurrentTime->tm_year, // year
1 + tm_CurrentTime->tm_mon, // month
tm_CurrentTime->tm_mday); // day of the month
sprintf (CurrentTimeUTC->StrTime,"%02d:%02d:%02d",
tm_CurrentTime->tm_hour, // hours
tm_CurrentTime->tm_min, // minutes
tm_CurrentTime->tm_sec); // seconds
sprintf (Report->CurrentTimeUTC.StrDate,"%04d-%02d-%02d",
1900 + Report->tm_CurrentTime.tm_year, // year
1 + Report->tm_CurrentTime.tm_mon, // month
Report->tm_CurrentTime.tm_mday); // day of the month
sprintf (Report->CurrentTimeUTC.StrTime,"%02d:%02d:%02d",
Report->tm_CurrentTime.tm_hour, // hours
Report->tm_CurrentTime.tm_min, // minutes
Report->tm_CurrentTime.tm_sec); // seconds
/* Date and time as unsigned */
CurrentTimeUTC->Date = (1900 + tm_CurrentTime->tm_year) * 10000 +
(1 + tm_CurrentTime->tm_mon) * 100 +
tm_CurrentTime->tm_mday;
CurrentTimeUTC->Time = tm_CurrentTime->tm_hour * 10000 +
tm_CurrentTime->tm_min * 100 +
tm_CurrentTime->tm_sec;
Report->CurrentTimeUTC.Date = (1900 + Report->tm_CurrentTime.tm_year) * 10000 +
(1 + Report->tm_CurrentTime.tm_mon) * 100 +
Report->tm_CurrentTime.tm_mday;
Report->CurrentTimeUTC.Time = Report->tm_CurrentTime.tm_hour * 10000 +
Report->tm_CurrentTime.tm_min * 100 +
Report->tm_CurrentTime.tm_sec;
}
}