Version 15.28

This commit is contained in:
Antonio Cañas Vargas 2015-10-28 21:47:42 +01:00
parent 4af7c60b7f
commit 568742be30
8 changed files with 304 additions and 190 deletions

View File

@ -202,6 +202,14 @@ function setTZ(id) {
FormTZ.value = d.getTimezoneOffset(); FormTZ.value = d.getTimezoneOffset();
} }
// Set form param with time difference between UTC time and client local time, in minutes
// For example, if your time zone is GMT+2, -120 will be returned
function setTZname(id) {
var FormTZname = document.getElementById(id);
var tz = jstz.determine(); // Determines the time zone of the browser client
FormTZname.value = tz.name(); // Returns the name of the time zone eg "Europe/Berlin"
}
// Adjust a date form correcting days in the month // Adjust a date form correcting days in the month
function adjustDateForm (id) { function adjustDateForm (id) {
var FormYea = document.getElementById(id+'Year' ); var FormYea = document.getElementById(id+'Year' );
@ -244,18 +252,18 @@ function setDateToYesterday() {
var d = new (Date); var d = new (Date);
d.setTime(d.getTime() - 24*60*60*1000); // Today - 1 day d.setTime(d.getTime() - 24*60*60*1000); // Today - 1 day
setDate(d); setDateRange(d);
} }
// Set a date range form to today // Set a date range form to today
function setDateToToday() { function setDateToToday() {
var d = new (Date); var d = new (Date);
setDate(d); setDateRange(d);
} }
// Set a date range form to a specific day // Set a date range form to a specific day
function setDate(d) { function setDateRange(d) {
var FormYea; var FormYea;
var Yea = d.getFullYear(); var Yea = d.getFullYear();
var Mon = d.getMonth()+1; var Mon = d.getMonth()+1;

View File

@ -108,13 +108,22 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.27 (2015/10/28)" #define Log_PLATFORM_VERSION "SWAD 15.28 (2015/10/28)"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.27: Oct 28, 2015 Fized bug in dates. (186300 lines) Version 15.28: Oct 28, 2015 IANA zone names are used in the calculation of some statistics. (186407 lines)
Version 15.26.1: Oct 27, 2015 Fized bug in statistics. (186282 lines) 1 script necessary:
Download JavaScript jstz script, available in:
https://bitbucket.org/pellepim/jstimezonedetect/
http://pellepim.bitbucket.org/jstz/
Create new directory jstz in public HTML directory.
Copy script jstz.js from https://bitbucket.org/pellepim/jstimezonedetect/ > Download repository > pellepim-jstimezonedetect-3a00f59861bd.zip > dist > jstz.js to /var/www/html/swad/jstz/jstz.js
(186302 lines)
Version 15.27: Oct 28, 2015 Fixed bug in dates. (186302 lines)
Version 15.26.1: Oct 27, 2015 Fixed bug in statistics. (186282 lines)
Version 15.26: Oct 27, 2015 Statistics are computed properly for clients with time-zones different to that of the server. (186278 lines) Version 15.26: Oct 27, 2015 Statistics are computed properly for clients with time-zones different to that of the server. (186278 lines)
Version 15.25.4: Oct 27, 2015 Day and month are displayed in clock. (186251 lines) Version 15.25.4: Oct 27, 2015 Day and month are displayed in clock. (186251 lines)
Version 15.25.3: Oct 27, 2015 Statistics computed using time UTC. (186225 lines) Version 15.25.3: Oct 27, 2015 Statistics computed using time UTC. (186225 lines)

View File

@ -28,8 +28,8 @@
/** Uncomment one of the following installations of SWAD or create your own **/ /** Uncomment one of the following installations of SWAD or create your own **/
/*****************************************************************************/ /*****************************************************************************/
//#define LOCALHOST_UBUNTU // Comment this line if not applicable #define LOCALHOST_UBUNTU // Comment this line if not applicable
#define OPENSWAD_ORG // Comment this line if not applicable //#define OPENSWAD_ORG // Comment this line if not applicable
//#define SWAD_UGR_ES // Comment this line if not applicable //#define SWAD_UGR_ES // Comment this line if not applicable
//#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable //#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable

View File

@ -28,6 +28,7 @@
#include <string.h> // For string functions #include <string.h> // For string functions
#include "swad_config.h" #include "swad_config.h"
#include "swad_database.h"
#include "swad_date.h" #include "swad_date.h"
#include "swad_global.h" #include "swad_global.h"
#include "swad_parameter.h" #include "swad_parameter.h"
@ -467,44 +468,77 @@ time_t Dat_GetTimeUTCFromForm (const char *ParamName)
/**************** in minutes ********************/ /**************** in minutes ********************/
/*****************************************************************************/ /*****************************************************************************/
void Dat_PutHiddenParClientTZDiff (void) void Dat_PutHiddenParBrowserTZDiff (void)
{ {
fprintf (Gbl.F.Out,"<input type=\"hidden\"" fprintf (Gbl.F.Out,"<input type=\"hidden\""
" id=\"ClientTZDiff\" name=\"ClientTZDiff\"" " id=\"BrowserTZName\" name=\"BrowserTZName\""
" value=\"\" />"
"<input type=\"hidden\""
" id=\"BrowserTZDiff\" name=\"BrowserTZDiff\""
" value=\"0\" />" " value=\"0\" />"
"<script type=\"text/javascript\">" "<script type=\"text/javascript\">"
"setTZ('ClientTZDiff');" "setTZname('BrowserTZName');"
"setTZ('BrowserTZDiff');"
"</script>"); "</script>");
} }
/*****************************************************************************/ /*****************************************************************************/
/**************** Get string with time difference ********************/ /*************************** Get browser time zone ***************************/
/**************** between UTC time and client local time, ********************/
/**************** in +hh:mm or -hh:mm format ********************/
/*****************************************************************************/ /*****************************************************************************/
// ClientTimeZoneDiffStr must have space for strings in +hh:mm format (6 characters + \0) // MySQL CONVERT_TZ function may fail around changes related to Daylight Saving Time
// when a fixed amount (for example +01:00) is used as destination time zone,
// because this amount may be different before and after the DST change
void Dat_GetClientTimeZoneDiff (char *ClientTimeZoneDiffStr) void Dat_GetBrowserTimeZone (char BrowserTimeZone[Dat_MAX_BYTES_TIME_ZONE+1])
{ {
char Query[512];
MYSQL_RES *mysql_res;
bool TZNameIsUsable = false;
char IntStr[1+10+1]; char IntStr[1+10+1];
int ClientUTCMinusLocal; // Time difference between UTC time and client local time, in minutes int ClientUTCMinusLocal; // Time difference between UTC time and client local time, in minutes
// The getTimezoneOffset() method returns the time difference between UTC time and local time, in minutes.
// For example, If your time zone is GMT+2, -120 will be returned.
/***** Get client time zone *****/ /***** 1. Get client time zone name *****/
Par_GetParToText ("ClientTZDiff",IntStr,1+10); // We get client time zone using JavaScript jstz script, available in:
// - http://pellepim.bitbucket.org/jstz/
// - https://bitbucket.org/pellepim/jstimezonedetect/
// The return value is an IANA zone info key (aka the Olson time zone database).
// For example, if browser is in Madrid(Spain) timezone, "Europe/Berlin" will be returned.
Par_GetParToText ("BrowserTZName",BrowserTimeZone,Dat_MAX_BYTES_TIME_ZONE);
/* Check if client time zone is usable with CONVERT_TZ */
if (BrowserTimeZone[0])
{
/* Try to convert a date from server time zone to browser time zone */
sprintf (Query,"SELECT CONVERT_TZ(NOW(),@@session.time_zone,'%s')",
BrowserTimeZone);
if (DB_QuerySELECT (Query,&mysql_res,"can not check if time zone name is usable"))
TZNameIsUsable = true;
/* Free structure that stores the query result */
DB_FreeMySQLResult (&mysql_res);
}
if (!TZNameIsUsable)
{
/***** 2. Get client time zone difference *****/
// We get client TZ difference using JavaScript getTimezoneOffset() method
// getTimezoneOffset() returns UTC-time - browser-local-time, in minutes.
// For example, if browser time zone is GMT+2, -120 will be returned.
Par_GetParToText ("BrowserTZDiff",IntStr,1+10);
if (sscanf (IntStr,"%d",&ClientUTCMinusLocal) != 1) if (sscanf (IntStr,"%d",&ClientUTCMinusLocal) != 1)
ClientUTCMinusLocal = 0; ClientUTCMinusLocal = 0;
/***** Convert from minutes to +hh:mm or -hh:mm *****/ /* Convert from minutes to +-hh:mm */
if (ClientUTCMinusLocal <= 0) // BrowserTimeZone must have space for strings in +hh:mm format (6 chars + \0)
sprintf (ClientTimeZoneDiffStr,"+%02u:%02u", if (ClientUTCMinusLocal > 0)
(unsigned) (-ClientUTCMinusLocal) / 60, sprintf (BrowserTimeZone,"-%02u:%02u",
(unsigned) (-ClientUTCMinusLocal) % 60);
else // ClientUTCMinusLocal > 0
sprintf (ClientTimeZoneDiffStr,"-%02u:%02u",
(unsigned) ClientUTCMinusLocal / 60, (unsigned) ClientUTCMinusLocal / 60,
(unsigned) ClientUTCMinusLocal % 60); (unsigned) ClientUTCMinusLocal % 60);
else // ClientUTCMinusLocal <= 0
sprintf (BrowserTimeZone,"+%02u:%02u",
(unsigned) (-ClientUTCMinusLocal) / 60,
(unsigned) (-ClientUTCMinusLocal) % 60);
}
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -37,6 +37,8 @@
#define Dat_SECONDS_IN_ONE_MONTH (30UL*24UL*60UL*60UL) #define Dat_SECONDS_IN_ONE_MONTH (30UL*24UL*60UL*60UL)
#define Dat_MAX_BYTES_TIME_ZONE 256
/*****************************************************************************/ /*****************************************************************************/
/******************************* Public types ********************************/ /******************************* Public types ********************************/
/*****************************************************************************/ /*****************************************************************************/
@ -86,8 +88,8 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
bool SubmitFormOnChange); bool SubmitFormOnChange);
time_t Dat_GetTimeUTCFromForm (const char *ParamName); time_t Dat_GetTimeUTCFromForm (const char *ParamName);
void Dat_PutHiddenParClientTZDiff (void); void Dat_PutHiddenParBrowserTZDiff (void);
void Dat_GetClientTimeZoneDiff (char *ClientTimeZoneDiffStr); void Dat_GetBrowserTimeZone (char BrowserTimeZone[Dat_MAX_BYTES_TIME_ZONE+1]);
void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear, void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
const char *Id, const char *Id,

View File

@ -481,30 +481,36 @@ static void Lay_WriteScripts (void)
Lay_WriteScriptConnectedUsrs (); Lay_WriteScriptConnectedUsrs ();
} }
/***** Scripts depending on action *****/
switch (Gbl.CurrentAct)
{
/***** Script to print world map *****/
case ActSeeCty:
Cty_WriteScriptGoogleGeochart ();
break;
/***** Script for uploading files using Dropzone.js (http://www.dropzonejs.com/) *****/ /***** Script for uploading files using Dropzone.js (http://www.dropzonejs.com/) *****/
// The public directory dropzone must hold: // The public directory dropzone must hold:
// dropzone.js // dropzone.js
// css/dropzone.css // css/dropzone.css
// images/spritemap@2x.png // images/spritemap@2x.png
// images/spritemap.png // images/spritemap.png
if (Gbl.CurrentAct == ActFrmCreDocIns || // Brw_ADMI_DOCUM_INS case ActFrmCreDocIns: // Brw_ADMI_DOCUM_INS
Gbl.CurrentAct == ActFrmCreComIns || // Brw_ADMI_SHARE_INS case ActFrmCreComIns: // Brw_ADMI_SHARE_INS
Gbl.CurrentAct == ActFrmCreDocCtr || // Brw_ADMI_DOCUM_CTR case ActFrmCreDocCtr: // Brw_ADMI_DOCUM_CTR
Gbl.CurrentAct == ActFrmCreComCtr || // Brw_ADMI_SHARE_CTR case ActFrmCreComCtr: // Brw_ADMI_SHARE_CTR
Gbl.CurrentAct == ActFrmCreDocDeg || // Brw_ADMI_DOCUM_DEG case ActFrmCreDocDeg: // Brw_ADMI_DOCUM_DEG
Gbl.CurrentAct == ActFrmCreComDeg || // Brw_ADMI_SHARE_DEG case ActFrmCreComDeg: // Brw_ADMI_SHARE_DEG
Gbl.CurrentAct == ActFrmCreDocCrs || // Brw_ADMI_DOCUM_CRS case ActFrmCreDocCrs: // Brw_ADMI_DOCUM_CRS
Gbl.CurrentAct == ActFrmCreDocGrp || // Brw_ADMI_DOCUM_GRP case ActFrmCreDocGrp: // Brw_ADMI_DOCUM_GRP
Gbl.CurrentAct == ActFrmCreComCrs || // Brw_ADMI_SHARE_CRS case ActFrmCreComCrs: // Brw_ADMI_SHARE_CRS
Gbl.CurrentAct == ActFrmCreComGrp || // Brw_ADMI_SHARE_GRP case ActFrmCreComGrp: // Brw_ADMI_SHARE_GRP
Gbl.CurrentAct == ActFrmCreAsgUsr || // Brw_ADMI_ASSIG_USR case ActFrmCreAsgUsr: // Brw_ADMI_ASSIG_USR
Gbl.CurrentAct == ActFrmCreAsgCrs || // Brw_ADMI_ASSIG_CRS case ActFrmCreAsgCrs: // Brw_ADMI_ASSIG_CRS
Gbl.CurrentAct == ActFrmCreWrkUsr || // Brw_ADMI_WORKS_USR case ActFrmCreWrkUsr: // Brw_ADMI_WORKS_USR
Gbl.CurrentAct == ActFrmCreWrkCrs || // Brw_ADMI_WORKS_CRS case ActFrmCreWrkCrs: // Brw_ADMI_WORKS_CRS
Gbl.CurrentAct == ActFrmCreMrkCrs || // Brw_ADMI_MARKS_CRS case ActFrmCreMrkCrs: // Brw_ADMI_MARKS_CRS
Gbl.CurrentAct == ActFrmCreMrkGrp || // Brw_ADMI_MARKS_GRP case ActFrmCreMrkGrp: // Brw_ADMI_MARKS_GRP
Gbl.CurrentAct == ActFrmCreBrf) // Brw_ADMI_BRIEF_USR case ActFrmCreBrf: // Brw_ADMI_BRIEF_USR
{
// Use charset="windows-1252" to force error messages in windows-1252 (default is UTF-8) // Use charset="windows-1252" to force error messages in windows-1252 (default is UTF-8)
fprintf (Gbl.F.Out,"<script type=\"text/javascript\"" fprintf (Gbl.F.Out,"<script type=\"text/javascript\""
" src=\"%s/dropzone/dropzone.js\"" " src=\"%s/dropzone/dropzone.js\""
@ -512,12 +518,21 @@ static void Lay_WriteScripts (void)
"</script>\n", "</script>\n",
Cfg_HTTPS_URL_SWAD_PUBLIC); Cfg_HTTPS_URL_SWAD_PUBLIC);
Lay_WriteScriptCustomDropzone (); Lay_WriteScriptCustomDropzone ();
break;
case ActReqAccGbl:
case ActSeeAccGbl:
case ActReqAccCrs:
case ActSeeAccCrs:
case ActSeeAllStaCrs:
fprintf (Gbl.F.Out,"<script type=\"text/javascript\""
" src=\"%s/jstz/jstz.js\">"
"</script>\n",
Cfg_HTTPS_URL_SWAD_PUBLIC);
break;
default:
break;
} }
/***** Script to print world map *****/
if (Gbl.CurrentAct == ActSeeCty)
Cty_WriteScriptGoogleGeochart ();
/***** Script for Google Analytics *****/ /***** Script for Google Analytics *****/
fprintf (Gbl.F.Out,"%s",Cfg_GOOGLE_ANALYTICS); fprintf (Gbl.F.Out,"%s",Cfg_GOOGLE_ANALYTICS);
} }

View File

@ -579,7 +579,7 @@ void Sta_AskShowCrsHits (void)
"</table>"); "</table>");
/***** Hidden param used to get client time zone *****/ /***** Hidden param used to get client time zone *****/
Dat_PutHiddenParClientTZDiff (); Dat_PutHiddenParBrowserTZDiff ();
/***** Send button *****/ /***** Send button *****/
Lay_PutConfirmButton (Txt_Show_hits); Lay_PutConfirmButton (Txt_Show_hits);
@ -727,7 +727,7 @@ void Sta_AskShowGblHits (void)
"</table>"); "</table>");
/***** Hidden param used to get client time zone *****/ /***** Hidden param used to get client time zone *****/
Dat_PutHiddenParClientTZDiff (); Dat_PutHiddenParBrowserTZDiff ();
/***** Send button *****/ /***** Send button *****/
Lay_PutConfirmButton (Txt_Show_hits); Lay_PutConfirmButton (Txt_Show_hits);
@ -843,6 +843,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
extern const char *Txt_There_are_no_accesses_with_the_selected_search_criteria; extern const char *Txt_There_are_no_accesses_with_the_selected_search_criteria;
extern const char *Txt_List_of_detailed_clicks; extern const char *Txt_List_of_detailed_clicks;
extern const char *Txt_STAT_TYPE_COUNT_CAPS[Sta_NUM_COUNT_TYPES]; extern const char *Txt_STAT_TYPE_COUNT_CAPS[Sta_NUM_COUNT_TYPES];
extern const char *Txt_Time_zone_used_in_the_calculation_of_these_statistics;
char Query[MAX_LENGTH_QUERY_ACCESS+1]; char Query[MAX_LENGTH_QUERY_ACCESS+1];
char QueryAux[512]; char QueryAux[512];
long LengthQuery; long LengthQuery;
@ -853,8 +854,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
const char *LogTable; const char *LogTable;
Sta_ClicksDetailedOrGrouped_t DetailedOrGrouped = Sta_CLICKS_GROUPED; Sta_ClicksDetailedOrGrouped_t DetailedOrGrouped = Sta_CLICKS_GROUPED;
struct UsrData UsrDat; struct UsrData UsrDat;
char ClientTimeZoneDiffStr[1+2+1+2+1]; // Time difference between UTC time and client local time, char BrowserTimeZone[Dat_MAX_BYTES_TIME_ZONE+1];
// in +hh:mm or -hh:mm format
unsigned NumUsr = 0; unsigned NumUsr = 0;
const char *Ptr; const char *Ptr;
char StrRole[256]; char StrRole[256];
@ -868,7 +868,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Dat_GetIniEndDatesFromForm (); Dat_GetIniEndDatesFromForm ();
/***** Get client time zone *****/ /***** Get client time zone *****/
Dat_GetClientTimeZoneDiff (ClientTimeZoneDiffStr); Dat_GetBrowserTimeZone (BrowserTimeZone);
/***** Set table where to find depending on initial date *****/ /***** Set table where to find depending on initial date *****/
// If initial day is older than current day minus Cfg_DAYS_IN_RECENT_LOG, then use recent log table, else use historic log table */ // If initial day is older than current day minus Cfg_DAYS_IN_RECENT_LOG, then use recent log table, else use historic log table */
@ -1032,7 +1032,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
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",
ClientTimeZoneDiffStr, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR: case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR:
@ -1041,8 +1041,8 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
"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,"
"%s FROM %s", "%s FROM %s",
ClientTimeZoneDiffStr, BrowserTimeZone,
ClientTimeZoneDiffStr, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_WEEKS: case Sta_CLICKS_CRS_PER_WEEKS:
@ -1053,7 +1053,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%x%%v') AS Week," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%x%%v') AS Week,"
"%s FROM %s", "%s FROM %s",
ClientTimeZoneDiffStr, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_MONTHS: case Sta_CLICKS_CRS_PER_MONTHS:
@ -1061,7 +1061,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
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",
ClientTimeZoneDiffStr, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_HOUR: case Sta_CLICKS_CRS_PER_HOUR:
@ -1069,7 +1069,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%H') AS Hour," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%H') AS Hour,"
"%s FROM %s", "%s FROM %s",
ClientTimeZoneDiffStr, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_MINUTE: case Sta_CLICKS_CRS_PER_MINUTE:
@ -1077,7 +1077,7 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
sprintf (Query,"SELECT SQL_NO_CACHE " sprintf (Query,"SELECT SQL_NO_CACHE "
"DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%H%%i') AS Minute," "DATE_FORMAT(CONVERT_TZ(ClickTime,@@session.time_zone,'%s'),'%%H%%i') AS Minute,"
"%s FROM %s", "%s FROM %s",
ClientTimeZoneDiffStr, BrowserTimeZone,
StrQueryCountType,LogTable); StrQueryCountType,LogTable);
break; break;
case Sta_CLICKS_CRS_PER_ACTION: case Sta_CLICKS_CRS_PER_ACTION:
@ -1377,9 +1377,10 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
/* Write start of table frame */ /* Write start of table frame */
fprintf (Gbl.F.Out,"<section id=\"stat_results\">"); fprintf (Gbl.F.Out,"<section id=\"stat_results\">");
if (Gbl.Stat.ClicksGroupedBy == Sta_CLICKS_CRS_DETAILED_LIST) if (Gbl.Stat.ClicksGroupedBy == Sta_CLICKS_CRS_DETAILED_LIST)
Lay_StartRoundFrameTable ("95%",0,Txt_List_of_detailed_clicks); Lay_StartRoundFrame ("95%",Txt_List_of_detailed_clicks);
else else
Lay_StartRoundFrameTable (NULL,0,Txt_STAT_TYPE_COUNT_CAPS[Gbl.Stat.CountType]); Lay_StartRoundFrame (NULL,Txt_STAT_TYPE_COUNT_CAPS[Gbl.Stat.CountType]);
fprintf (Gbl.F.Out,"<table>");
switch (Gbl.Stat.ClicksGroupedBy) switch (Gbl.Stat.ClicksGroupedBy)
{ {
@ -1442,9 +1443,10 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
Sta_ShowNumHitsPerCourse (NumRows,mysql_res); Sta_ShowNumHitsPerCourse (NumRows,mysql_res);
break; break;
} }
fprintf (Gbl.F.Out,"</table>");
/* End of frame */ /* End of frame */
Lay_EndRoundFrameTable (); Lay_EndRoundFrame ();
fprintf (Gbl.F.Out,"</section>"); fprintf (Gbl.F.Out,"</section>");
} }
@ -1457,6 +1459,29 @@ static void Sta_ShowHits (Sta_GlobalOrCourseAccesses_t GlobalOrCourse)
/***** Free memory used by the data of the user *****/ /***** Free memory used by the data of the user *****/
Usr_UsrDataDestructor (&UsrDat); Usr_UsrDataDestructor (&UsrDat);
/***** Write time zone used in the calculation of these statistics *****/
switch (Gbl.Stat.ClicksGroupedBy)
{
case Sta_CLICKS_CRS_PER_DAYS:
case Sta_CLICKS_GBL_PER_DAYS:
case Sta_CLICKS_CRS_PER_DAYS_AND_HOUR:
case Sta_CLICKS_GBL_PER_DAYS_AND_HOUR:
case Sta_CLICKS_CRS_PER_WEEKS:
case Sta_CLICKS_GBL_PER_WEEKS:
case Sta_CLICKS_CRS_PER_MONTHS:
case Sta_CLICKS_GBL_PER_MONTHS:
case Sta_CLICKS_CRS_PER_HOUR:
case Sta_CLICKS_GBL_PER_HOUR:
case Sta_CLICKS_CRS_PER_MINUTE:
case Sta_CLICKS_GBL_PER_MINUTE:
fprintf (Gbl.F.Out,"<p class=\"DAT_SMALL CENTER_MIDDLE\">%s: %s</p>",
Txt_Time_zone_used_in_the_calculation_of_these_statistics,
BrowserTimeZone);
break;
default:
break;
}
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -35218,123 +35218,123 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#endif #endif
, ,
#if L==0 #if L==0
"dia*" "dia"
#elif L==1 #elif L==1
"Tag*" "Tag"
#elif L==2 #elif L==2
"day*" "day"
#elif L==3 #elif L==3
"d&iacute;a*" "d&iacute;a"
#elif L==4 #elif L==4
"jour*" "jour"
#elif L==5 #elif L==5
"d&iacute;a*" // Okoteve traducción "d&iacute;a" // Okoteve traducción
#elif L==6 #elif L==6
"giorno*" "giorno"
#elif L==7 #elif L==7
"dzie&nacute;*" "dzie&nacute;"
#elif L==8 #elif L==8
"dia*" "dia"
#endif #endif
, ,
#if L==0 #if L==0
"dia i hora*" "dia i hora"
#elif L==1 #elif L==1
"Tag und Stunde*" "Tag und Stunde"
#elif L==2 #elif L==2
"day and hour*" "day and hour"
#elif L==3 #elif L==3
"d&iacute;a y hora*" "d&iacute;a y hora"
#elif L==4 #elif L==4
"jour et heure*" "jour et heure"
#elif L==5 #elif L==5
"d&iacute;a y hora*" // Okoteve traducción "d&iacute;a y hora" // Okoteve traducción
#elif L==6 #elif L==6
"giorno e ora*" "giorno e ora"
#elif L==7 #elif L==7
"dzie&nacute; i godzin&eogon;*" "dzie&nacute; i godzin&eogon;"
#elif L==8 #elif L==8
"dia e hora*" "dia e hora"
#endif #endif
, ,
#if L==0 #if L==0
"setmana*" "setmana"
#elif L==1 #elif L==1
"Woche*" "Woche"
#elif L==2 #elif L==2
"week*" "week"
#elif L==3 #elif L==3
"semana*" "semana"
#elif L==4 #elif L==4
"semaine*" "semaine"
#elif L==5 #elif L==5
"arapok&otilde;indy*" "arapok&otilde;indy"
#elif L==6 #elif L==6
"settimana*" "settimana"
#elif L==7 #elif L==7
"tydzie&nacute;*" "tydzie&nacute;"
#elif L==8 #elif L==8
"semana*" "semana"
#endif #endif
, ,
#if L==0 #if L==0
"mes*" "mes"
#elif L==1 #elif L==1
"Monat*" "Monat"
#elif L==2 #elif L==2
"month*" "month"
#elif L==3 #elif L==3
"mes*" "mes"
#elif L==4 #elif L==4
"mois*" "mois"
#elif L==5 #elif L==5
"jasy*" "jasy"
#elif L==6 #elif L==6
"mese*" "mese"
#elif L==7 #elif L==7
"miesi&aogon;c*" "miesi&aogon;c"
#elif L==8 #elif L==8
"m&ecirc;s*" "m&ecirc;s"
#endif #endif
, ,
#if L==0 #if L==0
"hora*" "hora"
#elif L==1 #elif L==1
"Stunde*" "Stunde"
#elif L==2 #elif L==2
"hour*" "hour"
#elif L==3 #elif L==3
"hora*" "hora"
#elif L==4 #elif L==4
"heure*" "heure"
#elif L==5 #elif L==5
"aravo*" "aravo"
#elif L==6 #elif L==6
"ora*" "ora"
#elif L==7 #elif L==7
"godzina*" "godzina"
#elif L==8 #elif L==8
"hora*" "hora"
#endif #endif
, ,
#if L==0 #if L==0
"minut*" "minut"
#elif L==1 #elif L==1
"Minute*" "Minute"
#elif L==2 #elif L==2
"minute*" "minute"
#elif L==3 #elif L==3
"minuto*" "minuto"
#elif L==4 #elif L==4
"minute*" "minute"
#elif L==5 #elif L==5
"aravo'i*" "aravo'i"
#elif L==6 #elif L==6
"minuto*" "minuto"
#elif L==7 #elif L==7
"minut&eogon;*" "minut&eogon;"
#elif L==8 #elif L==8
"minuto*" "minuto"
#endif #endif
, ,
#if L==0 #if L==0
@ -35358,123 +35358,123 @@ const char *Txt_STAT_CLICKS_GROUPED_BY[Sta_NUM_CLICKS_GROUPED_BY] =
#endif #endif
, ,
#if L==0 #if L==0
"dia*" "dia"
#elif L==1 #elif L==1
"Tag*" "Tag"
#elif L==2 #elif L==2
"day*" "day"
#elif L==3 #elif L==3
"d&iacute;a*" "d&iacute;a"
#elif L==4 #elif L==4
"jour*" "jour"
#elif L==5 #elif L==5
"d&iacute;a*" // Okoteve traducción "d&iacute;a" // Okoteve traducción
#elif L==6 #elif L==6
"giorno*" "giorno"
#elif L==7 #elif L==7
"dzie&nacute;*" "dzie&nacute;"
#elif L==8 #elif L==8
"dia*" "dia"
#endif #endif
, ,
#if L==0 #if L==0
"dia i hora*" "dia i hora"
#elif L==1 #elif L==1
"Tag und Stunde*" "Tag und Stunde"
#elif L==2 #elif L==2
"day and hour*" "day and hour"
#elif L==3 #elif L==3
"d&iacute;a y hora*" "d&iacute;a y hora"
#elif L==4 #elif L==4
"jour et heure*" "jour et heure"
#elif L==5 #elif L==5
"d&iacute;a y hora*" // Okoteve traducción "d&iacute;a y hora" // Okoteve traducción
#elif L==6 #elif L==6
"giorno e ora*" "giorno e ora"
#elif L==7 #elif L==7
"dzie&nacute; i godzin&eogon;*" "dzie&nacute; i godzin&eogon;"
#elif L==8 #elif L==8
"dia e hora*" "dia e hora"
#endif #endif
, ,
#if L==0 #if L==0
"setmana*" "setmana"
#elif L==1 #elif L==1
"Woche*" "Woche"
#elif L==2 #elif L==2
"week*" "week"
#elif L==3 #elif L==3
"semana*" "semana"
#elif L==4 #elif L==4
"semaine*" "semaine"
#elif L==5 #elif L==5
"arapok&otilde;indy*" "arapok&otilde;indy"
#elif L==6 #elif L==6
"settimana*" "settimana"
#elif L==7 #elif L==7
"tydzie&nacute;*" "tydzie&nacute;"
#elif L==8 #elif L==8
"semana*" "semana"
#endif #endif
, ,
#if L==0 #if L==0
"mes*" "mes"
#elif L==1 #elif L==1
"Monat*" "Monat"
#elif L==2 #elif L==2
"month*" "month"
#elif L==3 #elif L==3
"mes*" "mes"
#elif L==4 #elif L==4
"mois*" "mois"
#elif L==5 #elif L==5
"jasy*" "jasy"
#elif L==6 #elif L==6
"mese*" "mese"
#elif L==7 #elif L==7
"miesi&aogon;c*" "miesi&aogon;c"
#elif L==8 #elif L==8
"m&ecirc;s*" "m&ecirc;s"
#endif #endif
, ,
#if L==0 #if L==0
"hora*" "hora"
#elif L==1 #elif L==1
"Stunde*" "Stunde"
#elif L==2 #elif L==2
"hour*" "hour"
#elif L==3 #elif L==3
"hora*" "hora"
#elif L==4 #elif L==4
"heure*" "heure"
#elif L==5 #elif L==5
"aravo*" "aravo"
#elif L==6 #elif L==6
"ora*" "ora"
#elif L==7 #elif L==7
"godzina*" "godzina"
#elif L==8 #elif L==8
"hora*" "hora"
#endif #endif
, ,
#if L==0 #if L==0
"minut*" "minut"
#elif L==1 #elif L==1
"Minute*" "Minute"
#elif L==2 #elif L==2
"minute*" "minute"
#elif L==3 #elif L==3
"minuto*" "minuto"
#elif L==4 #elif L==4
"minute*" "minute"
#elif L==5 #elif L==5
"aravo'i*" "aravo'i"
#elif L==6 #elif L==6
"minuto*" "minuto"
#elif L==7 #elif L==7
"minut&eogon;*" "minut&eogon;"
#elif L==8 #elif L==8
"minuto*" "minuto"
#endif #endif
, ,
#if L==0 #if L==0
@ -44724,6 +44724,27 @@ const char *Txt_time =
"tempo"; "tempo";
#endif #endif
const char *Txt_Time_zone_used_in_the_calculation_of_these_statistics =
#if L==0
"Zona hor&agrave;ria usada en el c&agrave;lcul d'aquesta estad&iacute;stica";
#elif L==1
"Zeitzone in die Berechnung dieser Statistik verwendet";
#elif L==2
"Time zone used in the calculation of these statistics";
#elif L==3
"Zona horaria usada en el c&aacute;lculo de esta estad&iacute;stica";
#elif L==4
"Fuseau horaire utilis&eacute; dans le calcul de ces statistiques";
#elif L==5
"Zona horaria usada en el c&aacute;lculo de esta estad&iacute;stica"; // Okoteve traducción
#elif L==6
"Fuso orario utilizzato per il calcolo di queste statistiche";
#elif L==7
"Strefa czasowa u&zdot;ywana w obliczeniach tych statystyk";
#elif L==8
"Fuso hor&aacute;rio utilizado no c&aacute;lculo dessas estat&iacute;sticas";
#endif
const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES] = const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES] =
{ {
// TT_COURSE_TIMETABLE // TT_COURSE_TIMETABLE