Version 18.1

This commit is contained in:
Antonio Cañas Vargas 2018-10-07 14:01:25 +02:00
parent e7da37b8b3
commit a252d31dce
7 changed files with 423 additions and 188 deletions

View File

@ -1,12 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project> <project>
<configuration id="cdt.managedbuild.toolchain.gnu.base.1290182859" name="Default">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider"> <configuration id="cdt.managedbuild.toolchain.gnu.base.1290182859" name="Default">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/> <extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(gcc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/> <provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension> <provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
</configuration>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(gcc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project> </project>

View File

@ -340,7 +340,7 @@ Buenos d
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 18.0 (2018-10-04)" #define Log_PLATFORM_VERSION "SWAD 18.1 (2018-10-07)"
#define CSS_FILE "swad17.25.4.css" #define CSS_FILE "swad17.25.4.css"
#define JS_FILE "swad17.17.1.js" #define JS_FILE "swad17.17.1.js"
@ -359,6 +359,7 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
/* /*
Version 18.1: Oct 07, 2018 New statistics grouped per year. (234943 lines)
Version 18.0.1: Oct 04, 2018 My courses are highlighted in listing of courses of current degree. (234738 lines) Version 18.0.1: Oct 04, 2018 My courses are highlighted in listing of courses of current degree. (234738 lines)
Version 18.0: Oct 04, 2018 New version of fotomaton, programmed by Daniel Calandria and Jesús Mesa. Version 18.0: Oct 04, 2018 New version of fotomaton, programmed by Daniel Calandria and Jesús Mesa.
Changes in code to avoid new warnings with GCC 7.3. (234736 lines) Changes in code to avoid new warnings with GCC 7.3. (234736 lines)

View File

@ -1009,37 +1009,7 @@ void Dat_WriteRFC822DateFromTM (FILE *File,struct tm *tm_ptr)
} }
/*****************************************************************************/ /*****************************************************************************/
/************** Compute the preceding date of a given date *******************/ /************** Compute the subsequent date of a given date ******************/
/*****************************************************************************/
void Dat_GetDateBefore (struct Date *Date,struct Date *PrecedingDate)
{
if (Date->Day == 1)
{
if (Date->Month == 1)
{
PrecedingDate->Year = Date->Year - 1;
PrecedingDate->Month = 12;
PrecedingDate->Day = 31;
}
else
{
PrecedingDate->Year = Date->Year;
PrecedingDate->Month = Date->Month - 1;
PrecedingDate->Day = (PrecedingDate->Month == 2) ? Dat_GetNumDaysFebruary (PrecedingDate->Year) :
Dat_NumDaysMonth[PrecedingDate->Month];
}
}
else
{
PrecedingDate->Year = Date->Year;
PrecedingDate->Month = Date->Month;
PrecedingDate->Day = Date->Day - 1;
}
}
/*****************************************************************************/
/************** Compute the preceding date of a given date *******************/
/*****************************************************************************/ /*****************************************************************************/
void Dat_GetDateAfter (struct Date *Date,struct Date *SubsequentDate) void Dat_GetDateAfter (struct Date *Date,struct Date *SubsequentDate)
@ -1070,6 +1040,36 @@ void Dat_GetDateAfter (struct Date *Date,struct Date *SubsequentDate)
} }
} }
/*****************************************************************************/
/************** Compute the preceding date of a given date *******************/
/*****************************************************************************/
void Dat_GetDateBefore (struct Date *Date,struct Date *PrecedingDate)
{
if (Date->Day == 1)
{
if (Date->Month == 1)
{
PrecedingDate->Year = Date->Year - 1;
PrecedingDate->Month = 12;
PrecedingDate->Day = 31;
}
else
{
PrecedingDate->Year = Date->Year;
PrecedingDate->Month = Date->Month - 1;
PrecedingDate->Day = (PrecedingDate->Month == 2) ? Dat_GetNumDaysFebruary (PrecedingDate->Year) :
Dat_NumDaysMonth[PrecedingDate->Month];
}
}
else
{
PrecedingDate->Year = Date->Year;
PrecedingDate->Month = Date->Month;
PrecedingDate->Day = Date->Day - 1;
}
}
/*****************************************************************************/ /*****************************************************************************/
/**************** Compute the week before to a given week ********************/ /**************** Compute the week before to a given week ********************/
/*****************************************************************************/ /*****************************************************************************/
@ -1106,6 +1106,15 @@ void Dat_GetMonthBefore (struct Date *Date,struct Date *PrecedingDate)
} }
} }
/*****************************************************************************/
/**************** Compute the year before to a given year ********************/
/*****************************************************************************/
void Dat_GetYearBefore (struct Date *Date,struct Date *PrecedingDate)
{
PrecedingDate->Year = Date->Year - 1;
}
/*****************************************************************************/ /*****************************************************************************/
/************** Compute the number of days beteen two dates ******************/ /************** Compute the number of days beteen two dates ******************/
/*****************************************************************************/ /*****************************************************************************/
@ -1113,7 +1122,8 @@ void Dat_GetMonthBefore (struct Date *Date,struct Date *PrecedingDate)
// If the old date is the day before the new data, return 2 // If the old date is the day before the new data, return 2
// ... // ...
unsigned Dat_GetNumDaysBetweenDates (struct Date *DateIni,struct Date *DateEnd) unsigned Dat_GetNumDaysBetweenDates (struct Date *DateIni,
struct Date *DateEnd)
{ {
int DiffDays; int DiffDays;
unsigned Year; unsigned Year;
@ -1138,7 +1148,8 @@ unsigned Dat_GetNumDaysBetweenDates (struct Date *DateIni,struct Date *DateEnd)
/*****************************************************************************/ /*****************************************************************************/
// If the two dates are in the same week, return 1 // If the two dates are in the same week, return 1
unsigned Dat_GetNumWeeksBetweenDates (struct Date *DateIni,struct Date *DateEnd) unsigned Dat_GetNumWeeksBetweenDates (struct Date *DateIni,
struct Date *DateEnd)
{ {
int DiffWeeks; int DiffWeeks;
unsigned Year; unsigned Year;
@ -1148,7 +1159,8 @@ unsigned Dat_GetNumWeeksBetweenDates (struct Date *DateIni,struct Date *DateEnd)
if (DateIni->Year > DateEnd->Year) if (DateIni->Year > DateEnd->Year)
return 0; return 0;
/***** Initial year is lower or equal to ending year ==> compute difference in weeks *****/ /***** Initial year is lower or equal to ending year ==>
compute difference in weeks *****/
DiffWeeks = (int) DateEnd->Week - (int) DateIni->Week + 1; DiffWeeks = (int) DateEnd->Week - (int) DateIni->Week + 1;
for (Year = DateIni->Year; for (Year = DateIni->Year;
Year < DateEnd->Year; Year < DateEnd->Year;
@ -1163,7 +1175,8 @@ unsigned Dat_GetNumWeeksBetweenDates (struct Date *DateIni,struct Date *DateEnd)
/*****************************************************************************/ /*****************************************************************************/
// If the two dates are in the same month, return 1 // If the two dates are in the same month, return 1
unsigned Dat_GetNumMonthsBetweenDates (struct Date *DateIni,struct Date *DateEnd) unsigned Dat_GetNumMonthsBetweenDates (struct Date *DateIni,
struct Date *DateEnd)
{ {
int DiffMonths; int DiffMonths;
@ -1174,6 +1187,22 @@ unsigned Dat_GetNumMonthsBetweenDates (struct Date *DateIni,struct Date *DateEnd
0; 0;
} }
/*****************************************************************************/
/************** Compute the number of years between two dates ****************/
/*****************************************************************************/
// If the two dates are in the same year, return 1
unsigned Dat_GetNumYearsBetweenDates (struct Date *DateIni,
struct Date *DateEnd)
{
int DiffYears;
/***** Compute the difference in years *****/
DiffYears = (int) DateEnd->Year - (int) DateIni->Year + 1;
return (DiffYears > 0) ? (unsigned) DiffYears :
0;
}
/*****************************************************************************/ /*****************************************************************************/
/*************** Compute the number of days in a given year ******************/ /*************** Compute the number of days in a given year ******************/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -162,13 +162,19 @@ void Dat_GetIniEndDatesFromForm (void);
void Dat_WriteRFC822DateFromTM (FILE *File,struct tm *tm); void Dat_WriteRFC822DateFromTM (FILE *File,struct tm *tm);
void Dat_GetDateBefore (struct Date *Date,struct Date *PrecedingDate); void Dat_GetDateAfter (struct Date *Date,struct Date *SubsequentDate);
void Dat_GetDateAfter (struct Date *Date,struct Date *SubsequentDate); void Dat_GetDateBefore (struct Date *Date,struct Date *PrecedingDate );
void Dat_GetWeekBefore (struct Date *Date,struct Date *PrecedingDate); void Dat_GetWeekBefore (struct Date *Date,struct Date *PrecedingDate );
void Dat_GetMonthBefore (struct Date *Date,struct Date *PrecedingDate); void Dat_GetMonthBefore (struct Date *Date,struct Date *PrecedingDate );
unsigned Dat_GetNumDaysBetweenDates (struct Date *DateIni,struct Date *DateEnd); void Dat_GetYearBefore (struct Date *Date,struct Date *PrecedingDate );
unsigned Dat_GetNumWeeksBetweenDates (struct Date *DateIni,struct Date *DateEnd); unsigned Dat_GetNumDaysBetweenDates (struct Date *DateIni,
unsigned Dat_GetNumMonthsBetweenDates (struct Date *DateIni,struct Date *DateEnd); struct Date *DateEnd);
unsigned Dat_GetNumWeeksBetweenDates (struct Date *DateIni,
struct Date *DateEnd);
unsigned Dat_GetNumMonthsBetweenDates (struct Date *DateIni,
struct Date *DateEnd);
unsigned Dat_GetNumYearsBetweenDates (struct Date *DateIni,
struct Date *DateEnd);
unsigned Dat_GetNumDaysInYear (unsigned Year); unsigned Dat_GetNumDaysInYear (unsigned Year);
unsigned Dat_GetNumDaysFebruary (unsigned Year); unsigned Dat_GetNumDaysFebruary (unsigned Year);
bool Dat_GetIfLeapYear (unsigned Year); bool Dat_GetIfLeapYear (unsigned Year);

View File

@ -74,23 +74,25 @@ const unsigned Sta_CellPadding[Sta_NUM_CLICKS_GROUPED_BY] =
2, // Sta_CLICKS_CRS_DETAILED_LIST 2, // Sta_CLICKS_CRS_DETAILED_LIST
1, // Sta_CLICKS_CRS_PER_USR 1, // Sta_CLICKS_CRS_PER_USR
1, // Sta_CLICKS_CRS_PER_DAYS 1, // Sta_CLICKS_CRS_PER_DAY
0, // Sta_CLICKS_CRS_PER_DAYS_AND_HOUR 0, // Sta_CLICKS_CRS_PER_DAY_AND_HOUR
1, // Sta_CLICKS_CRS_PER_WEEKS 1, // Sta_CLICKS_CRS_PER_WEEK
1, // Sta_CLICKS_CRS_PER_MONTHS 1, // Sta_CLICKS_CRS_PER_MONTH
1, // Sta_CLICKS_CRS_PER_YEAR
1, // Sta_CLICKS_CRS_PER_HOUR 1, // Sta_CLICKS_CRS_PER_HOUR
0, // Sta_CLICKS_CRS_PER_MINUTE 0, // Sta_CLICKS_CRS_PER_MINUTE
1, // Sta_CLICKS_CRS_PER_ACTION 1, // Sta_CLICKS_CRS_PER_ACTION
1, // Sta_CLICKS_GBL_PER_DAYS 1, // Sta_CLICKS_GBL_PER_DAY
0, // Sta_CLICKS_GBL_PER_DAYS_AND_HOUR 0, // Sta_CLICKS_GBL_PER_DAY_AND_HOUR
1, // Sta_CLICKS_GBL_PER_WEEKS 1, // Sta_CLICKS_GBL_PER_WEEK
1, // Sta_CLICKS_GBL_PER_MONTHS 1, // Sta_CLICKS_GBL_PER_MONTH
1, // Sta_CLICKS_GBL_PER_YEAR
1, // Sta_CLICKS_GBL_PER_HOUR 1, // Sta_CLICKS_GBL_PER_HOUR
0, // Sta_CLICKS_GBL_PER_MINUTE 0, // Sta_CLICKS_GBL_PER_MINUTE
1, // Sta_CLICKS_GBL_PER_ACTION 1, // Sta_CLICKS_GBL_PER_ACTION
1, // Sta_CLICKS_GBL_PER_PLUGIN 1, // Sta_CLICKS_GBL_PER_PLUGIN
1, // Sta_CLICKS_GBL_PER_WEB_SERVICE_FUNCTION 1, // Sta_CLICKS_GBL_PER_API_FUNCTION
1, // Sta_CLICKS_GBL_PER_BANNER 1, // Sta_CLICKS_GBL_PER_BANNER
1, // Sta_CLICKS_GBL_PER_COUNTRY 1, // Sta_CLICKS_GBL_PER_COUNTRY
1, // Sta_CLICKS_GBL_PER_INSTITUTION 1, // Sta_CLICKS_GBL_PER_INSTITUTION
@ -140,17 +142,19 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse);
static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql_res); static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql_res);
static void Sta_WriteLogComments (long LogCod); static void Sta_WriteLogComments (long LogCod);
static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,MYSQL_RES *mysql_res); static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,MYSQL_RES *mysql_res);
static void Sta_ShowNumHitsPerDays (unsigned long NumRows,MYSQL_RES *mysql_res); static void Sta_ShowNumHitsPerDay (unsigned long NumRows,MYSQL_RES *mysql_res);
static void Sta_ShowDistrAccessesPerDaysAndHour (unsigned long NumRows,MYSQL_RES *mysql_res); static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES *mysql_res);
static Sta_ColorType_t Sta_GetStatColorType (void); static Sta_ColorType_t Sta_GetStatColorType (void);
static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax); static void Sta_DrawBarColors (Sta_ColorType_t ColorType,float HitsMax);
static void Sta_DrawAccessesPerHourForADay (Sta_ColorType_t ColorType,float HitsNum[24],float HitsMax); static void Sta_DrawAccessesPerHourForADay (Sta_ColorType_t ColorType,float HitsNum[24],float HitsMax);
static void Sta_SetColor (Sta_ColorType_t ColorType,float HitsNum,float HitsMax, static void Sta_SetColor (Sta_ColorType_t ColorType,float HitsNum,float HitsMax,
unsigned *R,unsigned *G,unsigned *B); unsigned *R,unsigned *G,unsigned *B);
static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows, static void Sta_ShowNumHitsPerWeek (unsigned long NumRows,
MYSQL_RES *mysql_res); MYSQL_RES *mysql_res);
static void Sta_ShowNumHitsPerMonths (unsigned long NumRows, static void Sta_ShowNumHitsPerMonth (unsigned long NumRows,
MYSQL_RES *mysql_res); MYSQL_RES *mysql_res);
static void Sta_ShowNumHitsPerYear (unsigned long NumRows,
MYSQL_RES *mysql_res);
static void Sta_ShowNumHitsPerHour (unsigned long NumRows, static void Sta_ShowNumHitsPerHour (unsigned long NumRows,
MYSQL_RES *mysql_res); MYSQL_RES *mysql_res);
static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned ColumnWidth); static void Sta_WriteAccessHour (unsigned Hour,struct Sta_Hits *Hits,unsigned ColumnWidth);
@ -739,12 +743,12 @@ void Sta_AskShowGblHits (void)
fprintf (Gbl.F.Out,"<label class=\"%s\">&nbsp;%s&nbsp;", fprintf (Gbl.F.Out,"<label class=\"%s\">&nbsp;%s&nbsp;",
The_ClassForm[Gbl.Prefs.Theme],Txt_distributed_by); The_ClassForm[Gbl.Prefs.Theme],Txt_distributed_by);
if (Gbl.Stat.ClicksGroupedBy < Sta_CLICKS_GBL_PER_DAYS || if (Gbl.Stat.ClicksGroupedBy < Sta_CLICKS_GBL_PER_DAY ||
Gbl.Stat.ClicksGroupedBy > Sta_CLICKS_GBL_PER_COURSE) Gbl.Stat.ClicksGroupedBy > Sta_CLICKS_GBL_PER_COURSE)
Gbl.Stat.ClicksGroupedBy = Sta_CLICKS_GBL_PER_DAYS; Gbl.Stat.ClicksGroupedBy = Sta_CLICKS_GBL_PER_DAY;
fprintf (Gbl.F.Out,"<select name=\"GroupedBy\">"); fprintf (Gbl.F.Out,"<select name=\"GroupedBy\">");
for (ClicksGroupedBy = Sta_CLICKS_GBL_PER_DAYS; for (ClicksGroupedBy = Sta_CLICKS_GBL_PER_DAY;
ClicksGroupedBy <= Sta_CLICKS_GBL_PER_COURSE; ClicksGroupedBy <= Sta_CLICKS_GBL_PER_COURSE;
ClicksGroupedBy++) ClicksGroupedBy++)
{ {
@ -1075,16 +1079,16 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
sprintf (Query,"SELECT SQL_NO_CACHE UsrCod,%s AS Num FROM %s", sprintf (Query,"SELECT SQL_NO_CACHE UsrCod,%s AS Num FROM %s",
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_DAYS: case Sta_CLICKS_CRS_PER_DAY:
case Sta_CLICKS_GBL_PER_DAYS: case Sta_CLICKS_GBL_PER_DAY:
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y%%m%%d') AS Day," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y%%m%%d') AS Day,"
"%s FROM %s", "%s FROM %s",
BrowserTimeZone, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR: case Sta_CLICKS_CRS_PER_DAY_AND_HOUR:
case Sta_CLICKS_GBL_PER_DAYS_AND_HOUR: case Sta_CLICKS_GBL_PER_DAY_AND_HOUR:
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y%%m%%d') AS Day," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y%%m%%d') AS Day,"
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%H') AS Hour," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%H') AS Hour,"
@ -1093,8 +1097,8 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
BrowserTimeZone, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_WEEKS: case Sta_CLICKS_CRS_PER_WEEK:
case Sta_CLICKS_GBL_PER_WEEKS: case Sta_CLICKS_GBL_PER_WEEK:
/* With %x%v the weeks are counted from monday to sunday. /* With %x%v the weeks are counted from monday to sunday.
With %X%V the weeks are counted from sunday to saturday. */ With %X%V the weeks are counted from sunday to saturday. */
sprintf (Query,(Gbl.Prefs.FirstDayOfWeek == 0) ? sprintf (Query,(Gbl.Prefs.FirstDayOfWeek == 0) ?
@ -1107,14 +1111,22 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
BrowserTimeZone, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_MONTHS: case Sta_CLICKS_CRS_PER_MONTH:
case Sta_CLICKS_GBL_PER_MONTHS: case Sta_CLICKS_GBL_PER_MONTH:
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y%%m') AS Month," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y%%m') AS Month,"
"%s FROM %s", "%s FROM %s",
BrowserTimeZone, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_YEAR:
case Sta_CLICKS_GBL_PER_YEAR:
sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%Y') AS Year,"
"%s FROM %s",
BrowserTimeZone,
StrQueryCountType,LogTable);
break;
case Sta_CLICKS_CRS_PER_HOUR: case Sta_CLICKS_CRS_PER_HOUR:
case Sta_CLICKS_GBL_PER_HOUR: case Sta_CLICKS_GBL_PER_HOUR:
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
@ -1140,7 +1152,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
sprintf (Query,"SELECT SQL_NO_CACHE log_ws.PlgCod,%s AS Num FROM %s,log_ws", sprintf (Query,"SELECT SQL_NO_CACHE log_ws.PlgCod,%s AS Num FROM %s,log_ws",
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_GBL_PER_WEB_SERVICE_FUNCTION: case Sta_CLICKS_GBL_PER_API_FUNCTION:
sprintf (Query,"SELECT SQL_NO_CACHE log_ws.FunCod,%s AS Num FROM %s,log_ws", sprintf (Query,"SELECT SQL_NO_CACHE log_ws.FunCod,%s AS Num FROM %s,log_ws",
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
@ -1302,7 +1314,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
switch (Gbl.Stat.ClicksGroupedBy) switch (Gbl.Stat.ClicksGroupedBy)
{ {
case Sta_CLICKS_GBL_PER_PLUGIN: case Sta_CLICKS_GBL_PER_PLUGIN:
case Sta_CLICKS_GBL_PER_WEB_SERVICE_FUNCTION: case Sta_CLICKS_GBL_PER_API_FUNCTION:
sprintf (QueryAux," AND %s.LogCod=log_ws.LogCod", sprintf (QueryAux," AND %s.LogCod=log_ws.LogCod",
LogTable); LogTable);
Str_Concat (Query,QueryAux, Str_Concat (Query,QueryAux,
@ -1378,26 +1390,31 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Str_Concat (Query,QueryAux, Str_Concat (Query,QueryAux,
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
case Sta_CLICKS_CRS_PER_DAYS: case Sta_CLICKS_CRS_PER_DAY:
case Sta_CLICKS_GBL_PER_DAYS: case Sta_CLICKS_GBL_PER_DAY:
Str_Concat (Query," GROUP BY Day DESC", Str_Concat (Query," GROUP BY Day DESC",
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR: case Sta_CLICKS_CRS_PER_DAY_AND_HOUR:
case Sta_CLICKS_GBL_PER_DAYS_AND_HOUR: case Sta_CLICKS_GBL_PER_DAY_AND_HOUR:
Str_Concat (Query," GROUP BY Day DESC,Hour", Str_Concat (Query," GROUP BY Day DESC,Hour",
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
case Sta_CLICKS_CRS_PER_WEEKS: case Sta_CLICKS_CRS_PER_WEEK:
case Sta_CLICKS_GBL_PER_WEEKS: case Sta_CLICKS_GBL_PER_WEEK:
Str_Concat (Query," GROUP BY Week DESC", Str_Concat (Query," GROUP BY Week DESC",
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
case Sta_CLICKS_CRS_PER_MONTHS: case Sta_CLICKS_CRS_PER_MONTH:
case Sta_CLICKS_GBL_PER_MONTHS: case Sta_CLICKS_GBL_PER_MONTH:
Str_Concat (Query," GROUP BY Month DESC", Str_Concat (Query," GROUP BY Month DESC",
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
case Sta_CLICKS_CRS_PER_YEAR:
case Sta_CLICKS_GBL_PER_YEAR:
Str_Concat (Query," GROUP BY Year DESC",
Sta_MAX_BYTES_QUERY_ACCESS);
break;
case Sta_CLICKS_CRS_PER_HOUR: case Sta_CLICKS_CRS_PER_HOUR:
case Sta_CLICKS_GBL_PER_HOUR: case Sta_CLICKS_GBL_PER_HOUR:
Str_Concat (Query," GROUP BY Hour", Str_Concat (Query," GROUP BY Hour",
@ -1418,7 +1435,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Str_Concat (Query," GROUP BY log_ws.PlgCod ORDER BY Num DESC", Str_Concat (Query," GROUP BY log_ws.PlgCod ORDER BY Num DESC",
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
case Sta_CLICKS_GBL_PER_WEB_SERVICE_FUNCTION: case Sta_CLICKS_GBL_PER_API_FUNCTION:
Str_Concat (Query," GROUP BY log_ws.FunCod ORDER BY Num DESC", Str_Concat (Query," GROUP BY log_ws.FunCod ORDER BY Num DESC",
Sta_MAX_BYTES_QUERY_ACCESS); Sta_MAX_BYTES_QUERY_ACCESS);
break; break;
@ -1454,8 +1471,8 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
} }
/***** Write query for debug *****/ /***** Write query for debug *****/
/* /*
if (Gbl.Usrs.Me.Roles.LoggedRole == Rol_SYS_ADM) if (Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM)
Lay_ShowAlert (Lay_INFO,Query); Ale_ShowAlert (Ale_INFO,Query);
*/ */
/***** Make the query *****/ /***** Make the query *****/
NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get clicks"); NumRows = DB_QuerySELECT (Query,&mysql_res,"can not get clicks");
@ -1487,21 +1504,25 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
case Sta_CLICKS_CRS_PER_USR: case Sta_CLICKS_CRS_PER_USR:
Sta_ShowNumHitsPerUsr (NumRows,mysql_res); Sta_ShowNumHitsPerUsr (NumRows,mysql_res);
break; break;
case Sta_CLICKS_CRS_PER_DAYS: case Sta_CLICKS_CRS_PER_DAY:
case Sta_CLICKS_GBL_PER_DAYS: case Sta_CLICKS_GBL_PER_DAY:
Sta_ShowNumHitsPerDays (NumRows,mysql_res); Sta_ShowNumHitsPerDay (NumRows,mysql_res);
break; break;
case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR: case Sta_CLICKS_CRS_PER_DAY_AND_HOUR:
case Sta_CLICKS_GBL_PER_DAYS_AND_HOUR: case Sta_CLICKS_GBL_PER_DAY_AND_HOUR:
Sta_ShowDistrAccessesPerDaysAndHour (NumRows,mysql_res); Sta_ShowDistrAccessesPerDayAndHour (NumRows,mysql_res);
break; break;
case Sta_CLICKS_CRS_PER_WEEKS: case Sta_CLICKS_CRS_PER_WEEK:
case Sta_CLICKS_GBL_PER_WEEKS: case Sta_CLICKS_GBL_PER_WEEK:
Sta_ShowNumHitsPerWeeks (NumRows,mysql_res); Sta_ShowNumHitsPerWeek (NumRows,mysql_res);
break; break;
case Sta_CLICKS_CRS_PER_MONTHS: case Sta_CLICKS_CRS_PER_MONTH:
case Sta_CLICKS_GBL_PER_MONTHS: case Sta_CLICKS_GBL_PER_MONTH:
Sta_ShowNumHitsPerMonths (NumRows,mysql_res); Sta_ShowNumHitsPerMonth (NumRows,mysql_res);
break;
case Sta_CLICKS_CRS_PER_YEAR:
case Sta_CLICKS_GBL_PER_YEAR:
Sta_ShowNumHitsPerYear (NumRows,mysql_res);
break; break;
case Sta_CLICKS_CRS_PER_HOUR: case Sta_CLICKS_CRS_PER_HOUR:
case Sta_CLICKS_GBL_PER_HOUR: case Sta_CLICKS_GBL_PER_HOUR:
@ -1518,7 +1539,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
case Sta_CLICKS_GBL_PER_PLUGIN: case Sta_CLICKS_GBL_PER_PLUGIN:
Sta_ShowNumHitsPerPlugin (NumRows,mysql_res); Sta_ShowNumHitsPerPlugin (NumRows,mysql_res);
break; break;
case Sta_CLICKS_GBL_PER_WEB_SERVICE_FUNCTION: case Sta_CLICKS_GBL_PER_API_FUNCTION:
Sta_ShowNumHitsPerWSFunction (NumRows,mysql_res); Sta_ShowNumHitsPerWSFunction (NumRows,mysql_res);
break; break;
case Sta_CLICKS_GBL_PER_BANNER: case Sta_CLICKS_GBL_PER_BANNER:
@ -1557,14 +1578,16 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
/***** Write time zone used in the calculation of these statistics *****/ /***** Write time zone used in the calculation of these statistics *****/
switch (Gbl.Stat.ClicksGroupedBy) switch (Gbl.Stat.ClicksGroupedBy)
{ {
case Sta_CLICKS_CRS_PER_DAYS: case Sta_CLICKS_CRS_PER_DAY:
case Sta_CLICKS_GBL_PER_DAYS: case Sta_CLICKS_GBL_PER_DAY:
case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR: case Sta_CLICKS_CRS_PER_DAY_AND_HOUR:
case Sta_CLICKS_GBL_PER_DAYS_AND_HOUR: case Sta_CLICKS_GBL_PER_DAY_AND_HOUR:
case Sta_CLICKS_CRS_PER_WEEKS: case Sta_CLICKS_CRS_PER_WEEK:
case Sta_CLICKS_GBL_PER_WEEKS: case Sta_CLICKS_GBL_PER_WEEK:
case Sta_CLICKS_CRS_PER_MONTHS: case Sta_CLICKS_CRS_PER_MONTH:
case Sta_CLICKS_GBL_PER_MONTHS: case Sta_CLICKS_GBL_PER_MONTH:
case Sta_CLICKS_CRS_PER_YEAR:
case Sta_CLICKS_GBL_PER_YEAR:
case Sta_CLICKS_CRS_PER_HOUR: case Sta_CLICKS_CRS_PER_HOUR:
case Sta_CLICKS_GBL_PER_HOUR: case Sta_CLICKS_GBL_PER_HOUR:
case Sta_CLICKS_CRS_PER_MINUTE: case Sta_CLICKS_CRS_PER_MINUTE:
@ -1994,7 +2017,7 @@ static void Sta_ShowNumHitsPerUsr (unsigned long NumRows,MYSQL_RES *mysql_res)
/********** Show a listing of with the number of clicks in each date *********/ /********** Show a listing of with the number of clicks in each date *********/
/*****************************************************************************/ /*****************************************************************************/
static void Sta_ShowNumHitsPerDays (unsigned long NumRows,MYSQL_RES *mysql_res) static void Sta_ShowNumHitsPerDay (unsigned long NumRows,MYSQL_RES *mysql_res)
{ {
extern const char *Txt_Date; extern const char *Txt_Date;
extern const char *Txt_Day; extern const char *Txt_Day;
@ -2076,7 +2099,7 @@ static void Sta_ShowNumHitsPerDays (unsigned long NumRows,MYSQL_RES *mysql_res)
"LOG", "LOG",
Txt_DAYS_SMALL[NumDayWeek]); Txt_DAYS_SMALL[NumDayWeek]);
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Sta_DrawBarNumHits (NumDayWeek == 6 ? 'r' : Sta_DrawBarNumHits (NumDayWeek == 6 ? 'r' :
'c', 'c',
D == NumDaysFromLastDateToCurrDate ? Hits.Num : D == NumDaysFromLastDateToCurrDate ? Hits.Num :
@ -2116,7 +2139,7 @@ static void Sta_ShowNumHitsPerDays (unsigned long NumRows,MYSQL_RES *mysql_res)
"LOG", "LOG",
Txt_DAYS_SMALL[NumDayWeek]); Txt_DAYS_SMALL[NumDayWeek]);
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Sta_DrawBarNumHits (NumDayWeek == 6 ? 'r' : Sta_DrawBarNumHits (NumDayWeek == 6 ? 'r' :
'c', 'c',
0.0,Hits.Max,Hits.Total,500); 0.0,Hits.Max,Hits.Total,500);
@ -2133,7 +2156,7 @@ static void Sta_ShowNumHitsPerDays (unsigned long NumRows,MYSQL_RES *mysql_res)
#define GRAPH_DISTRIBUTION_PER_HOUR_HOUR_WIDTH 25 #define GRAPH_DISTRIBUTION_PER_HOUR_HOUR_WIDTH 25
#define GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH (GRAPH_DISTRIBUTION_PER_HOUR_HOUR_WIDTH * 24) #define GRAPH_DISTRIBUTION_PER_HOUR_TOTAL_WIDTH (GRAPH_DISTRIBUTION_PER_HOUR_HOUR_WIDTH * 24)
static void Sta_ShowDistrAccessesPerDaysAndHour (unsigned long NumRows,MYSQL_RES *mysql_res) static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES *mysql_res)
{ {
extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassForm[The_NUM_THEMES];
extern const char *Txt_Color_of_the_graphic; extern const char *Txt_Color_of_the_graphic;
@ -2579,7 +2602,7 @@ static void Sta_SetColor (Sta_ColorType_t ColorType,float HitsNum,float HitsMax,
/********** Show listing with number of pages generated per week *************/ /********** Show listing with number of pages generated per week *************/
/*****************************************************************************/ /*****************************************************************************/
static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows, static void Sta_ShowNumHitsPerWeek (unsigned long NumRows,
MYSQL_RES *mysql_res) MYSQL_RES *mysql_res)
{ {
extern const char *Txt_Week; extern const char *Txt_Week;
@ -2589,7 +2612,7 @@ static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows,
struct Date LastDate; struct Date LastDate;
struct Date Date; struct Date Date;
unsigned W; unsigned W;
unsigned NumWeeksBetweenLastDateAndCurrentDate; unsigned NumWeeksBetweenLastDateAndCurDate;
struct Sta_Hits Hits; struct Sta_Hits Hits;
MYSQL_ROW row; MYSQL_ROW row;
@ -2628,9 +2651,9 @@ static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows,
Hits.Num = Str_GetFloatNumFromStr (row[1]); Hits.Num = Str_GetFloatNumFromStr (row[1]);
Dat_AssignDate (&Date,&LastDate); Dat_AssignDate (&Date,&LastDate);
NumWeeksBetweenLastDateAndCurrentDate = Dat_GetNumWeeksBetweenDates (&ReadDate,&LastDate); NumWeeksBetweenLastDateAndCurDate = Dat_GetNumWeeksBetweenDates (&ReadDate,&LastDate);
for (W = 1; for (W = 1;
W <= NumWeeksBetweenLastDateAndCurrentDate; W <= NumWeeksBetweenLastDateAndCurDate;
W++) W++)
{ {
/* Write week */ /* Write week */
@ -2640,10 +2663,10 @@ static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows,
"</td>", "</td>",
Date.Year,Date.Week); Date.Year,Date.Week);
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Sta_DrawBarNumHits ('c', Sta_DrawBarNumHits ('c',
W == NumWeeksBetweenLastDateAndCurrentDate ? Hits.Num : W == NumWeeksBetweenLastDateAndCurDate ? Hits.Num :
0.0, 0.0,
Hits.Max,Hits.Total,500); Hits.Max,Hits.Total,500);
/* Decrement week */ /* Decrement week */
@ -2654,9 +2677,10 @@ static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows,
/***** Finally, show the old weeks without pages generated *****/ /***** Finally, show the old weeks without pages generated *****/
Dat_CalculateWeekOfYear (&Gbl.DateRange.DateIni.Date); // Changes Week and Year Dat_CalculateWeekOfYear (&Gbl.DateRange.DateIni.Date); // Changes Week and Year
NumWeeksBetweenLastDateAndCurrentDate = Dat_GetNumWeeksBetweenDates (&Gbl.DateRange.DateIni.Date,&LastDate); NumWeeksBetweenLastDateAndCurDate = Dat_GetNumWeeksBetweenDates (&Gbl.DateRange.DateIni.Date,
&LastDate);
for (W = 1; for (W = 1;
W <= NumWeeksBetweenLastDateAndCurrentDate; W <= NumWeeksBetweenLastDateAndCurDate;
W++) W++)
{ {
/* Write week */ /* Write week */
@ -2666,7 +2690,7 @@ static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows,
"</td>", "</td>",
Date.Year,Date.Week); Date.Year,Date.Week);
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Sta_DrawBarNumHits ('c',0.0,Hits.Max,Hits.Total,500); Sta_DrawBarNumHits ('c',0.0,Hits.Max,Hits.Total,500);
/* Decrement week */ /* Decrement week */
@ -2678,7 +2702,7 @@ static void Sta_ShowNumHitsPerWeeks (unsigned long NumRows,
/********** Show a graph with the number of clicks in each month *************/ /********** Show a graph with the number of clicks in each month *************/
/*****************************************************************************/ /*****************************************************************************/
static void Sta_ShowNumHitsPerMonths (unsigned long NumRows, static void Sta_ShowNumHitsPerMonth (unsigned long NumRows,
MYSQL_RES *mysql_res) MYSQL_RES *mysql_res)
{ {
extern const char *Txt_Month; extern const char *Txt_Month;
@ -2688,7 +2712,7 @@ static void Sta_ShowNumHitsPerMonths (unsigned long NumRows,
struct Date LastDate; struct Date LastDate;
struct Date Date; struct Date Date;
unsigned M; unsigned M;
unsigned NumMonthsBetweenLastDateAndCurrentDate; unsigned NumMonthsBetweenLastDateAndCurDate;
struct Sta_Hits Hits; struct Sta_Hits Hits;
MYSQL_ROW row; MYSQL_ROW row;
@ -2726,9 +2750,10 @@ static void Sta_ShowNumHitsPerMonths (unsigned long NumRows,
Hits.Num = Str_GetFloatNumFromStr (row[1]); Hits.Num = Str_GetFloatNumFromStr (row[1]);
Dat_AssignDate (&Date,&LastDate); Dat_AssignDate (&Date,&LastDate);
NumMonthsBetweenLastDateAndCurrentDate = Dat_GetNumMonthsBetweenDates (&ReadDate,&LastDate); NumMonthsBetweenLastDateAndCurDate = Dat_GetNumMonthsBetweenDates (&ReadDate,
&LastDate);
for (M = 1; for (M = 1;
M <= NumMonthsBetweenLastDateAndCurrentDate; M <= NumMonthsBetweenLastDateAndCurDate;
M++) M++)
{ {
/* Write the month */ /* Write the month */
@ -2738,10 +2763,10 @@ static void Sta_ShowNumHitsPerMonths (unsigned long NumRows,
"</td>", "</td>",
Date.Year,Date.Month); Date.Year,Date.Month);
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Sta_DrawBarNumHits ('c', Sta_DrawBarNumHits ('c',
M == NumMonthsBetweenLastDateAndCurrentDate ? Hits.Num : M == NumMonthsBetweenLastDateAndCurDate ? Hits.Num :
0.0, 0.0,
Hits.Max,Hits.Total,500); Hits.Max,Hits.Total,500);
/* Decrease month */ /* Decrease month */
@ -2751,9 +2776,10 @@ static void Sta_ShowNumHitsPerMonths (unsigned long NumRows,
} }
/***** Finally, show the oldest months without clicks *****/ /***** Finally, show the oldest months without clicks *****/
NumMonthsBetweenLastDateAndCurrentDate = Dat_GetNumMonthsBetweenDates (&Gbl.DateRange.DateIni.Date,&LastDate); NumMonthsBetweenLastDateAndCurDate = Dat_GetNumMonthsBetweenDates (&Gbl.DateRange.DateIni.Date,
&LastDate);
for (M = 1; for (M = 1;
M <= NumMonthsBetweenLastDateAndCurrentDate; M <= NumMonthsBetweenLastDateAndCurDate;
M++) M++)
{ {
/* Write the month */ /* Write the month */
@ -2763,7 +2789,7 @@ static void Sta_ShowNumHitsPerMonths (unsigned long NumRows,
"</td>", "</td>",
Date.Year,Date.Month); Date.Year,Date.Month);
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Sta_DrawBarNumHits ('c',0.0,Hits.Max,Hits.Total,500); Sta_DrawBarNumHits ('c',0.0,Hits.Max,Hits.Total,500);
/* Decrease month */ /* Decrease month */
@ -2771,6 +2797,105 @@ static void Sta_ShowNumHitsPerMonths (unsigned long NumRows,
} }
} }
/*****************************************************************************/
/*********** Show a graph with the number of clicks in each year *************/
/*****************************************************************************/
static void Sta_ShowNumHitsPerYear (unsigned long NumRows,
MYSQL_RES *mysql_res)
{
extern const char *Txt_Year;
extern const char *Txt_STAT_TYPE_COUNT_CAPS[Sta_NUM_COUNT_TYPES];
unsigned long NumRow;
struct Date ReadDate;
struct Date LastDate;
struct Date Date;
unsigned Y;
unsigned NumYearsBetweenLastDateAndCurDate;
struct Sta_Hits Hits;
MYSQL_ROW row;
/***** Initialize LastDate *****/
Dat_AssignDate (&LastDate,&Gbl.DateRange.DateEnd.Date);
/***** Write heading *****/
fprintf (Gbl.F.Out,"<tr>"
"<th class=\"LEFT_TOP\">"
"%s"
"</th>"
"<th class=\"LEFT_TOP\">"
"%s"
"</th>"
"</tr>",
Txt_Year,
Txt_STAT_TYPE_COUNT_CAPS[Gbl.Stat.CountType]);
/***** Compute maximum number of pages generated per year *****/
Sta_ComputeMaxAndTotalHits (&Hits,NumRows,mysql_res,1,1);
/***** Write rows *****/
mysql_data_seek (mysql_res,0);
for (NumRow = 1;
NumRow <= NumRows;
NumRow++)
{
row = mysql_fetch_row (mysql_res);
/* Get the year (in row[0] is the date in YYYY format) */
if (sscanf (row[0],"%04u",&ReadDate.Year) != 1)
Lay_ShowErrorAndExit ("Wrong date.");
/* Get number of pages generated (in row[1]) */
Hits.Num = Str_GetFloatNumFromStr (row[1]);
Dat_AssignDate (&Date,&LastDate);
NumYearsBetweenLastDateAndCurDate = Dat_GetNumYearsBetweenDates (&ReadDate,
&LastDate);
for (Y = 1;
Y <= NumYearsBetweenLastDateAndCurDate;
Y++)
{
/* Write the year */
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LOG LEFT_TOP\">"
"%04u&nbsp;"
"</td>",
Date.Year);
/* Draw bar proportional to number of hits */
Sta_DrawBarNumHits ('c',
Y == NumYearsBetweenLastDateAndCurDate ? Hits.Num :
0.0,
Hits.Max,Hits.Total,500);
/* Decrease year */
Dat_GetYearBefore (&Date,&Date);
}
Dat_AssignDate (&LastDate,&Date);
}
/***** Finally, show the oldest years without clicks *****/
NumYearsBetweenLastDateAndCurDate = Dat_GetNumYearsBetweenDates (&Gbl.DateRange.DateIni.Date,
&LastDate);
for (Y = 1;
Y <= NumYearsBetweenLastDateAndCurDate;
Y++)
{
/* Write the year */
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LOG LEFT_TOP\">"
"%04u&nbsp;"
"</td>",
Date.Year);
/* Draw bar proportional to number of hits */
Sta_DrawBarNumHits ('c',0.0,Hits.Max,Hits.Total,500);
/* Decrease year */
Dat_GetYearBefore (&Date,&Date);
}
}
/*****************************************************************************/ /*****************************************************************************/
/**************** Show graphic of number of pages generated per hour ***************/ /**************** Show graphic of number of pages generated per hour ***************/
/*****************************************************************************/ /*****************************************************************************/
@ -3142,7 +3267,7 @@ static void Sta_ShowNumHitsPerAction (unsigned long NumRows,
"?&nbsp;" "?&nbsp;"
"</td>"); "</td>");
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Hits.Num = Str_GetFloatNumFromStr (row[1]); Hits.Num = Str_GetFloatNumFromStr (row[1]);
Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,500); Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,500);
} }
@ -3196,7 +3321,7 @@ static void Sta_ShowNumHitsPerPlugin (unsigned long NumRows,
fprintf (Gbl.F.Out,"?"); fprintf (Gbl.F.Out,"?");
fprintf (Gbl.F.Out,"&nbsp;</td>"); fprintf (Gbl.F.Out,"&nbsp;</td>");
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Hits.Num = Str_GetFloatNumFromStr (row[1]); Hits.Num = Str_GetFloatNumFromStr (row[1]);
Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,500); Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,500);
} }
@ -3248,7 +3373,7 @@ static void Sta_ShowNumHitsPerWSFunction (unsigned long NumRows,
"</td>", "</td>",
Svc_GetFunctionNameFromFunCod (FunCod)); Svc_GetFunctionNameFromFunCod (FunCod));
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Hits.Num = Str_GetFloatNumFromStr (row[1]); Hits.Num = Str_GetFloatNumFromStr (row[1]);
Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,500); Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,500);
} }
@ -3806,7 +3931,7 @@ static void Sta_ShowNumHitsPerCourse (unsigned long NumRows,
Act_FormEnd (); Act_FormEnd ();
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/* Draw bar proportional to number of pages generated */ /* Draw bar proportional to number of hits */
Hits.Num = Str_GetFloatNumFromStr (row[1]); Hits.Num = Str_GetFloatNumFromStr (row[1]);
Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,375); Sta_DrawBarNumHits ('c',Hits.Num,Hits.Max,Hits.Total,375);
} }

View File

@ -72,35 +72,37 @@ typedef enum
} Sta_ClicksDetailedOrGrouped_t; } Sta_ClicksDetailedOrGrouped_t;
#define Sta_CLICKS_DETAILED_OR_GROUPED_DEFAULT Sta_CLICKS_GROUPED #define Sta_CLICKS_DETAILED_OR_GROUPED_DEFAULT Sta_CLICKS_GROUPED
#define Sta_NUM_CLICKS_GROUPED_BY 24 #define Sta_NUM_CLICKS_GROUPED_BY 26
typedef enum typedef enum
{ {
Sta_CLICKS_CRS_DETAILED_LIST = 0, Sta_CLICKS_CRS_DETAILED_LIST = 0,
Sta_CLICKS_CRS_PER_USR = 1, Sta_CLICKS_CRS_PER_USR = 1,
Sta_CLICKS_CRS_PER_DAYS = 2, Sta_CLICKS_CRS_PER_DAY = 2,
Sta_CLICKS_CRS_PER_DAYS_AND_HOUR = 3, Sta_CLICKS_CRS_PER_DAY_AND_HOUR = 3,
Sta_CLICKS_CRS_PER_WEEKS = 4, Sta_CLICKS_CRS_PER_WEEK = 4,
Sta_CLICKS_CRS_PER_MONTHS = 5, Sta_CLICKS_CRS_PER_MONTH = 5,
Sta_CLICKS_CRS_PER_HOUR = 6, Sta_CLICKS_CRS_PER_YEAR = 6,
Sta_CLICKS_CRS_PER_MINUTE = 7, Sta_CLICKS_CRS_PER_HOUR = 7,
Sta_CLICKS_CRS_PER_ACTION = 8, Sta_CLICKS_CRS_PER_MINUTE = 8,
Sta_CLICKS_CRS_PER_ACTION = 9,
Sta_CLICKS_GBL_PER_DAYS = 9, Sta_CLICKS_GBL_PER_DAY = 10,
Sta_CLICKS_GBL_PER_DAYS_AND_HOUR = 10, Sta_CLICKS_GBL_PER_DAY_AND_HOUR = 11,
Sta_CLICKS_GBL_PER_WEEKS = 11, Sta_CLICKS_GBL_PER_WEEK = 12,
Sta_CLICKS_GBL_PER_MONTHS = 12, Sta_CLICKS_GBL_PER_MONTH = 13,
Sta_CLICKS_GBL_PER_HOUR = 13, Sta_CLICKS_GBL_PER_YEAR = 14,
Sta_CLICKS_GBL_PER_MINUTE = 14, Sta_CLICKS_GBL_PER_HOUR = 15,
Sta_CLICKS_GBL_PER_ACTION = 15, Sta_CLICKS_GBL_PER_MINUTE = 16,
Sta_CLICKS_GBL_PER_PLUGIN = 16, Sta_CLICKS_GBL_PER_ACTION = 17,
Sta_CLICKS_GBL_PER_WEB_SERVICE_FUNCTION = 17, Sta_CLICKS_GBL_PER_PLUGIN = 18,
Sta_CLICKS_GBL_PER_BANNER = 18, Sta_CLICKS_GBL_PER_API_FUNCTION = 19,
Sta_CLICKS_GBL_PER_COUNTRY = 19, Sta_CLICKS_GBL_PER_BANNER = 20,
Sta_CLICKS_GBL_PER_INSTITUTION = 20, Sta_CLICKS_GBL_PER_COUNTRY = 21,
Sta_CLICKS_GBL_PER_CENTRE = 21, Sta_CLICKS_GBL_PER_INSTITUTION = 22,
Sta_CLICKS_GBL_PER_DEGREE = 22, Sta_CLICKS_GBL_PER_CENTRE = 23,
Sta_CLICKS_GBL_PER_COURSE = 23, Sta_CLICKS_GBL_PER_DEGREE = 24,
Sta_CLICKS_GBL_PER_COURSE = 25,
} Sta_ClicksGroupedBy_t; } Sta_ClicksGroupedBy_t;
#define Sta_CLICKS_GROUPED_BY_DEFAULT Sta_CLICKS_CRS_PER_USR #define Sta_CLICKS_GROUPED_BY_DEFAULT Sta_CLICKS_CRS_PER_USR

View File

@ -40684,6 +40684,7 @@ const char *Txt_Source_of_information =
const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] = const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
{ {
// Sta_CLICKS_CRS_DETAILED_LIST
#if L==1 #if L==1
"clics detallats" "clics detallats"
#elif L==2 #elif L==2
@ -40703,7 +40704,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"detalhadamente cliques" "detalhadamente cliques"
#endif #endif
, , // Sta_CLICKS_CRS_PER_USR
#if L==1 #if L==1
"usuari" "usuari"
#elif L==2 #elif L==2
@ -40723,7 +40724,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"utilizador" "utilizador"
#endif #endif
, , // Sta_CLICKS_CRS_PER_DAY
#if L==1 #if L==1
"dia" "dia"
#elif L==2 #elif L==2
@ -40735,7 +40736,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==5 #elif L==5
"jour" "jour"
#elif L==6 #elif L==6
"d&iacute;a" // Okoteve traducción "&aacute;ra"
#elif L==7 #elif L==7
"giorno" "giorno"
#elif L==8 #elif L==8
@ -40743,7 +40744,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"dia" "dia"
#endif #endif
, , // Sta_CLICKS_CRS_PER_DAY_AND_HOUR
#if L==1 #if L==1
"dia i hora" "dia i hora"
#elif L==2 #elif L==2
@ -40755,7 +40756,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==5 #elif L==5
"jour et heure" "jour et heure"
#elif L==6 #elif L==6
"d&iacute;a y hora" // Okoteve traducción "&aacute;ra ha aravo"
#elif L==7 #elif L==7
"giorno e ora" "giorno e ora"
#elif L==8 #elif L==8
@ -40763,7 +40764,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"dia e hora" "dia e hora"
#endif #endif
, , // Sta_CLICKS_CRS_PER_WEEK
#if L==1 #if L==1
"setmana" "setmana"
#elif L==2 #elif L==2
@ -40783,7 +40784,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"semana" "semana"
#endif #endif
, , // Sta_CLICKS_CRS_PER_MONTH
#if L==1 #if L==1
"mes" "mes"
#elif L==2 #elif L==2
@ -40803,7 +40804,27 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"m&ecirc;s" "m&ecirc;s"
#endif #endif
, , // Sta_CLICKS_CRS_PER_YEAR
#if L==1
"any"
#elif L==2
"Jahr"
#elif L==3
"year"
#elif L==4
"a&ntilde;o"
#elif L==5
"ann&eacute;e"
#elif L==6
"ary"
#elif L==7
"anno"
#elif L==8
"rok"
#elif L==9
"ano"
#endif
, // Sta_CLICKS_CRS_PER_HOUR
#if L==1 #if L==1
"hora" "hora"
#elif L==2 #elif L==2
@ -40823,7 +40844,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"hora" "hora"
#endif #endif
, , // Sta_CLICKS_CRS_PER_MINUTE
#if L==1 #if L==1
"minut" "minut"
#elif L==2 #elif L==2
@ -40843,7 +40864,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"minuto" "minuto"
#endif #endif
, , // Sta_CLICKS_CRS_PER_ACTION
#if L==1 #if L==1
"acci&oacute;" "acci&oacute;"
#elif L==2 #elif L==2
@ -40863,7 +40884,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"a&ccedil;&atilde;o" "a&ccedil;&atilde;o"
#endif #endif
, , // Sta_CLICKS_GBL_PER_DAY
#if L==1 #if L==1
"dia" "dia"
#elif L==2 #elif L==2
@ -40875,7 +40896,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==5 #elif L==5
"jour" "jour"
#elif L==6 #elif L==6
"d&iacute;a" // Okoteve traducción "&aacute;ra"
#elif L==7 #elif L==7
"giorno" "giorno"
#elif L==8 #elif L==8
@ -40883,7 +40904,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"dia" "dia"
#endif #endif
, , // Sta_CLICKS_GBL_PER_DAY_AND_HOUR
#if L==1 #if L==1
"dia i hora" "dia i hora"
#elif L==2 #elif L==2
@ -40895,7 +40916,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==5 #elif L==5
"jour et heure" "jour et heure"
#elif L==6 #elif L==6
"d&iacute;a y hora" // Okoteve traducción "&aacute;ra ha aravo"
#elif L==7 #elif L==7
"giorno e ora" "giorno e ora"
#elif L==8 #elif L==8
@ -40903,7 +40924,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"dia e hora" "dia e hora"
#endif #endif
, , // Sta_CLICKS_GBL_PER_WEEK
#if L==1 #if L==1
"setmana" "setmana"
#elif L==2 #elif L==2
@ -40923,7 +40944,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"semana" "semana"
#endif #endif
, , // Sta_CLICKS_GBL_PER_MONTH
#if L==1 #if L==1
"mes" "mes"
#elif L==2 #elif L==2
@ -40943,7 +40964,27 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"m&ecirc;s" "m&ecirc;s"
#endif #endif
, , // Sta_CLICKS_GBL_PER_YEAR
#if L==1
"any"
#elif L==2
"Jahr"
#elif L==3
"year"
#elif L==4
"a&ntilde;o"
#elif L==5
"ann&eacute;e"
#elif L==6
"ary"
#elif L==7
"anno"
#elif L==8
"rok"
#elif L==9
"ano"
#endif
, // Sta_CLICKS_GBL_PER_HOUR
#if L==1 #if L==1
"hora" "hora"
#elif L==2 #elif L==2
@ -40963,7 +41004,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"hora" "hora"
#endif #endif
, , // Sta_CLICKS_GBL_PER_MINUTE
#if L==1 #if L==1
"minut" "minut"
#elif L==2 #elif L==2
@ -40983,7 +41024,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"minuto" "minuto"
#endif #endif
, , // Sta_CLICKS_GBL_PER_ACTION
#if L==1 #if L==1
"acci&oacute;" "acci&oacute;"
#elif L==2 #elif L==2
@ -41003,7 +41044,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"a&ccedil;&atilde;o" "a&ccedil;&atilde;o"
#endif #endif
, , // Sta_CLICKS_GBL_PER_PLUGIN
#if L==1 #if L==1
"complement" "complement"
#elif L==2 #elif L==2
@ -41023,7 +41064,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"plugin" "plugin"
#endif #endif
, , // Sta_CLICKS_GBL_PER_API_FUNCTION
#if L==1 #if L==1
"funci&oacute;" "funci&oacute;"
#elif L==2 #elif L==2
@ -41043,7 +41084,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"fun&ccedil;&atilde;o" "fun&ccedil;&atilde;o"
#endif #endif
, , // Sta_CLICKS_GBL_PER_BANNER
#if L==1 #if L==1
"banner" "banner"
#elif L==2 #elif L==2
@ -41063,7 +41104,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"banner" "banner"
#endif #endif
, , // Sta_CLICKS_GBL_PER_COUNTRY
#if L==1 #if L==1
"pa&iacute;s" "pa&iacute;s"
#elif L==2 #elif L==2
@ -41083,7 +41124,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"pa&iacute;s" "pa&iacute;s"
#endif #endif
, , // Sta_CLICKS_GBL_PER_INSTITUTION
#if L==1 #if L==1
"instituci&oacute;" "instituci&oacute;"
#elif L==2 #elif L==2
@ -41103,7 +41144,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"institu&ccedil;&atilde;o" "institu&ccedil;&atilde;o"
#endif #endif
, , // Sta_CLICKS_GBL_PER_CENTRE
#if L==1 #if L==1
"centre" "centre"
#elif L==2 #elif L==2
@ -41123,7 +41164,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"centro" "centro"
#endif #endif
, , // Sta_CLICKS_GBL_PER_DEGREE
#if L==1 #if L==1
"titulaci&oacute;" "titulaci&oacute;"
#elif L==2 #elif L==2
@ -41143,7 +41184,7 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#elif L==9 #elif L==9
"titula&ccedil;&atilde;o" "titula&ccedil;&atilde;o"
#endif #endif
, , // Sta_CLICKS_GBL_PER_COURSE
#if L==1 #if L==1
"assignatura" "assignatura"
#elif L==2 #elif L==2
@ -54141,6 +54182,27 @@ const char *Txt_XML_file_content =
"Conte&uacute;do do arquivo XML"; "Conte&uacute;do do arquivo XML";
#endif #endif
const char *Txt_Year = // 1984, 2011...
#if L==1
"Any";
#elif L==2
"Jahr";
#elif L==3
"Year";
#elif L==4
"A&ntilde;o";
#elif L==5
"Ann&eacute;e";
#elif L==6
"Ary";
#elif L==7
"Anno";
#elif L==8
"Rok";
#elif L==9
"Ano";
#endif
const char *Txt_Year_OF_A_DEGREE = // 1, 2, 3..., not 1984, 2011... const char *Txt_Year_OF_A_DEGREE = // 1, 2, 3..., not 1984, 2011...
#if L==1 #if L==1
"Any o semestre"; "Any o semestre";