Version19.50

This commit is contained in:
Antonio Cañas Vargas 2019-11-01 17:35:26 +01:00
parent 2f0d018c6b
commit 8bd17316e2
26 changed files with 278 additions and 280 deletions

View File

@ -63,6 +63,7 @@ static unsigned HTM_DIV_NestingLevel = 0;
static unsigned HTM_UL_NestingLevel = 0; static unsigned HTM_UL_NestingLevel = 0;
static unsigned HTM_LI_NestingLevel = 0; static unsigned HTM_LI_NestingLevel = 0;
static unsigned HTM_A_NestingLevel = 0; static unsigned HTM_A_NestingLevel = 0;
static unsigned HTM_SCRIPT_NestingLevel = 0;
static unsigned HTM_TEXTAREA_NestingLevel = 0; static unsigned HTM_TEXTAREA_NestingLevel = 0;
/*****************************************************************************/ /*****************************************************************************/
@ -707,6 +708,34 @@ void HTM_A_End (void)
HTM_A_NestingLevel--; HTM_A_NestingLevel--;
} }
/*****************************************************************************/
/*********************************** Scripts *********************************/
/*****************************************************************************/
void HTM_SCRIPT_Begin (const char *URL,const char *CharSet)
{
fprintf (Gbl.F.Out,"<script type=\"text/javascript\"");
if (URL)
if (URL[0])
fprintf (Gbl.F.Out," src=\"%s\"",URL);
if (CharSet)
if (CharSet[0])
fprintf (Gbl.F.Out," charset=\"%s\"",CharSet);
fprintf (Gbl.F.Out,">");
HTM_SCRIPT_NestingLevel++;
}
void HTM_SCRIPT_End (void)
{
if (HTM_SCRIPT_NestingLevel == 0) // No SCRIPT open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened SCRIPT.");
fprintf (Gbl.F.Out,"</script>");
HTM_SCRIPT_NestingLevel--;
}
/*****************************************************************************/ /*****************************************************************************/
/********************************* Text areas ********************************/ /********************************* Text areas ********************************/
/*****************************************************************************/ /*****************************************************************************/

View File

@ -83,6 +83,9 @@ void HTM_LI_End (void);
void HTM_A_Begin (const char *fmt,...); void HTM_A_Begin (const char *fmt,...);
void HTM_A_End (void); void HTM_A_End (void);
void HTM_SCRIPT_Begin (const char *URL,const char *CharSet);
void HTM_SCRIPT_End (void);
void HTM_TEXTAREA_Begin (const char *fmt,...); void HTM_TEXTAREA_Begin (const char *fmt,...);
void HTM_TEXTAREA_End (void); void HTM_TEXTAREA_End (void);

View File

@ -752,13 +752,11 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
AgdEvent.Hidden ? Dat_TimeStatusClassHidden[AgdEvent.TimeStatus] : AgdEvent.Hidden ? Dat_TimeStatusClassHidden[AgdEvent.TimeStatus] :
Dat_TimeStatusClassVisible[AgdEvent.TimeStatus], Dat_TimeStatusClassVisible[AgdEvent.TimeStatus],
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'agd_date_%u_%u',%ld,"
"writeLocalDateHMSFromUTC('agd_date_%u_%u',%ld," "%u,'<br />','%s',true,true,0x6",
"%u,'<br />','%s',true,true,0x6);" (unsigned) StartEndTime,UniqueId,
"</script>", AgdEvent.TimeUTC[StartEndTime],
(unsigned) StartEndTime,UniqueId, (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
AgdEvent.TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }

View File

@ -386,12 +386,10 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
(Asg.Open ? "DATE_GREEN" : (Asg.Open ? "DATE_GREEN" :
"DATE_RED"), "DATE_RED"),
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'asg_date_%u_%u',%ld,"
"writeLocalDateHMSFromUTC('asg_date_%u_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" (unsigned) StartEndTime,UniqueId,Asg.TimeUTC[StartEndTime],
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
(unsigned) StartEndTime,UniqueId,Asg.TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }

View File

@ -423,12 +423,10 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
(Att->Open ? "DATE_GREEN" : (Att->Open ? "DATE_GREEN" :
"DATE_RED"), "DATE_RED"),
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'att_date_%u_%u',%ld,"
"writeLocalDateHMSFromUTC('att_date_%u_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" (unsigned) StartEndTime,UniqueId,Att->TimeUTC[StartEndTime],
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
(unsigned) StartEndTime,UniqueId,Att->TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }
@ -3136,14 +3134,12 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd); HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<label for=\"Att%u\">" fprintf (Gbl.F.Out,"<label for=\"Att%u\">"
"<span id=\"att_date_start_%u\"></span>" "<span id=\"att_date_start_%u\"></span>"
"</label>" "</label>",
"<script type=\"text/javascript\">" NumAttEvent,UniqueId);
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld," Dat_WriteLocalDateHMSFromUTC ("'att_date_start_%u',%ld,"
"%u,',&nbsp;','%s',true,true,0x7);" "%u,',&nbsp;','%s',true,true,0x7",
"</script>", UniqueId,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
NumAttEvent,UniqueId, (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd); HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
@ -3580,16 +3576,14 @@ static void Att_ListAttEventsForAStd (unsigned NumUsr,struct UsrData *UsrDat)
HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd); HTM_TD_Begin ("class=\"DAT LT COLOR%u\"",Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<span id=\"att_date_start_%u_%u\"></span>" fprintf (Gbl.F.Out,"<span id=\"att_date_start_%u_%u\"></span>"
"<br />%s" "<br />%s",
"<script type=\"text/javascript\">"
"writeLocalDateHMSFromUTC('att_date_start_%u_%u',%ld,"
"%u,',&nbsp;','%s',true,true,0x7);"
"</script>",
NumUsr,UniqueId, NumUsr,UniqueId,
Gbl.AttEvents.Lst[NumAttEvent].Title, Gbl.AttEvents.Lst[NumAttEvent].Title);
NumUsr,UniqueId, Dat_WriteLocalDateHMSFromUTC ("'att_date_start_%u_%u',%ld,"
Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME], "%u,',&nbsp;','%s',true,true,0x7",
(unsigned) Gbl.Prefs.DateFormat,Txt_Today); NumUsr,UniqueId,
Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -214,8 +214,8 @@ void Cal_DrawCurrentMonth (void)
HTM_DIV_End (); HTM_DIV_End ();
/* Write script to draw the month */ /* Write script to draw the month */
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" HTM_SCRIPT_Begin (NULL,NULL);
" Gbl_HTMLContent = '';" fprintf (Gbl.F.Out," Gbl_HTMLContent = '';"
" DrawCurrentMonth ('CurrentMonth',%u,%ld,%ld,'%s/%s',", " DrawCurrentMonth ('CurrentMonth',%u,%ld,%ld,'%s/%s',",
Gbl.Prefs.FirstDayOfWeek, Gbl.Prefs.FirstDayOfWeek,
(long) Gbl.StartExecutionTimeUTC, (long) Gbl.StartExecutionTimeUTC,
@ -225,8 +225,8 @@ void Cal_DrawCurrentMonth (void)
Frm_SetParamsForm (ParamsStr,ActSeeCal,true); Frm_SetParamsForm (ParamsStr,ActSeeCal,true);
fprintf (Gbl.F.Out,"'%s',",ParamsStr); fprintf (Gbl.F.Out,"'%s',",ParamsStr);
Frm_SetParamsForm (ParamsStr,ActSeeDatExaAnn,true); Frm_SetParamsForm (ParamsStr,ActSeeDatExaAnn,true);
fprintf (Gbl.F.Out,"'%s');" fprintf (Gbl.F.Out,"'%s');",ParamsStr);
"</script>",ParamsStr); HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -282,8 +282,8 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
HTM_DIV_End (); HTM_DIV_End ();
/* Write script to draw the month */ /* Write script to draw the month */
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" HTM_SCRIPT_Begin (NULL,NULL);
" Gbl_HTMLContent = '';" fprintf (Gbl.F.Out," Gbl_HTMLContent = '';"
" Cal_DrawCalendar('calendar',%u,%ld,%ld,%s,'%s/%s',", " Cal_DrawCalendar('calendar',%u,%ld,%ld,%s,'%s/%s',",
Gbl.Prefs.FirstDayOfWeek, Gbl.Prefs.FirstDayOfWeek,
(long) Gbl.StartExecutionTimeUTC, (long) Gbl.StartExecutionTimeUTC,
@ -296,9 +296,8 @@ static void Cal_DrawCalendar (Act_Action_t ActionSeeCalendar,
fprintf (Gbl.F.Out,"'%s',", fprintf (Gbl.F.Out,"'%s',",
ParamsStr); ParamsStr);
Frm_SetParamsForm (ParamsStr,ActSeeDatExaAnn,true); Frm_SetParamsForm (ParamsStr,ActSeeDatExaAnn,true);
fprintf (Gbl.F.Out,"'%s');" fprintf (Gbl.F.Out,"'%s');",ParamsStr);
"</script>", HTM_SCRIPT_End ();
ParamsStr);
/***** End box *****/ /***** End box *****/
Box_BoxEnd (); Box_BoxEnd ();

View File

@ -487,7 +487,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 19.48 (2019-10-31)" #define Log_PLATFORM_VERSION "SWAD 19.50 (2019-11-01)"
#define CSS_FILE "swad19.47.css" #define CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.39.js" #define JS_FILE "swad19.39.js"
/* /*
@ -495,7 +495,9 @@ ps2pdf source.ps destination.pdf
// TODO: Impedir la creación y edición de proyectos si no son editables. // TODO: Impedir la creación y edición de proyectos si no son editables.
// TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia) // TODO: Importante: filtrar proyectos por usuarios (igual que en trabajos o en asistencia)
Version 19.48: Oct 31, 2019 Code refactoring in HTML textarea. (246038 lines) Version 19.50: Nov 01, 2019 Code refactoring related with writing of local date-time. (246016 lines)
Version 19.49: Nov 01, 2019 Code refactoring in HTML scripts. (246052 lines)
Version 19.48: Oct 31, 2019 Code refactoring in HTML textareas. (246038 lines)
Version 19.47.2: Oct 31, 2019 Removed obsolete function to activate results in match questions. (246009 lines) Version 19.47.2: Oct 31, 2019 Removed obsolete function to activate results in match questions. (246009 lines)
Version 19.47.1: Oct 31, 2019 Removed obsolete messages. (246033 lines) Version 19.47.1: Oct 31, 2019 Removed obsolete messages. (246033 lines)
Version 19.47: Oct 31, 2019 Return to old way to activate results in match questions. (246230 lines) Version 19.47: Oct 31, 2019 Return to old way to activate results in match questions. (246230 lines)

View File

@ -103,12 +103,10 @@ void Con_ShowConnectedUsrs (void)
Txt_Connected_users); Txt_Connected_users);
Box_BoxBegin (NULL,Gbl.Title,Con_PutIconToUpdateConnected, Box_BoxBegin (NULL,Gbl.Title,Con_PutIconToUpdateConnected,
Hlp_USERS_Connected,Box_NOT_CLOSABLE); Hlp_USERS_Connected,Box_NOT_CLOSABLE);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'connected_current_time',%ld,"
"writeLocalDateHMSFromUTC('connected_current_time',%ld," "%u,',&nbsp;',null,false,true,0x7",
"%u,',&nbsp;',null,false,true,0x7);" (long) Gbl.StartExecutionTimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat);
(long) Gbl.StartExecutionTimeUTC,
(unsigned) Gbl.Prefs.DateFormat);
/***** Number of connected users in the whole platform *****/ /***** Number of connected users in the whole platform *****/
Con_ShowGlobalConnectedUsrs (); Con_ShowGlobalConnectedUsrs ();

View File

@ -897,9 +897,11 @@ void Cty_WriteScriptGoogleGeochart (void)
unsigned NumCtysWithUsrs = 0; unsigned NumCtysWithUsrs = 0;
/***** Write start of the script *****/ /***** Write start of the script *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\" src=\"https://www.google.com/jsapi\"></script>\n" HTM_SCRIPT_Begin ("https://www.google.com/jsapi",NULL);
"<script type=\"text/javascript\">\n" HTM_SCRIPT_End ();
" google.load('visualization', '1', {'packages': ['geochart']});\n"
HTM_SCRIPT_Begin (NULL,NULL);
fprintf (Gbl.F.Out," google.load('visualization', '1', {'packages': ['geochart']});\n"
" google.setOnLoadCallback(drawRegionsMap);\n" " google.setOnLoadCallback(drawRegionsMap);\n"
" function drawRegionsMap() {\n" " function drawRegionsMap() {\n"
" var data = new google.visualization.DataTable();\n" " var data = new google.visualization.DataTable();\n"
@ -937,10 +939,10 @@ void Cty_WriteScriptGoogleGeochart (void)
" colorAxis:{colors:['#EAF1F4','#4D88A1'],minValue:0,maxValue:%u}};\n" " colorAxis:{colors:['#EAF1F4','#4D88A1'],minValue:0,maxValue:%u}};\n"
" var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));\n" " var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));\n"
" chart.draw(data, options);\n" " chart.draw(data, options);\n"
" };\n" " };\n",
"</script>\n",
NumCtysWithUsrs ? MaxUsrsInCountry : NumCtysWithUsrs ? MaxUsrsInCountry :
0); 0);
HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -25,6 +25,8 @@
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For vasprintf
#include <stdio.h> // For vasprintf
#include <string.h> // For string functions #include <string.h> // For string functions
#include <time.h> // For time functions (mktime...) #include <time.h> // For time functions (mktime...)
@ -164,12 +166,10 @@ void Dat_PutSpanDateFormat (Dat_Format_t Format)
void Dat_PutScriptDateFormat (Dat_Format_t Format) void Dat_PutScriptDateFormat (Dat_Format_t Format)
{ {
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'date_format_%u',%ld,"
"writeLocalDateHMSFromUTC('date_format_%u',%ld," "%u,'',null,true,false,0x0",
"%u,'',null,true,false,0x0);" (unsigned) Format,(long) Gbl.StartExecutionTimeUTC,
"</script>", (unsigned) Format);
(unsigned) Format,(long) Gbl.StartExecutionTimeUTC,
(unsigned) Format);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -345,11 +345,11 @@ void Dat_ShowClientLocalTime (void)
HTM_DIV_End (); HTM_DIV_End ();
/* Write script to draw the month */ /* Write script to draw the month */
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n" HTM_SCRIPT_Begin (NULL,NULL);
"secondsSince1970UTC = %ld;\n" fprintf (Gbl.F.Out,"secondsSince1970UTC = %ld;\n"
"writeLocalClock();\n" "writeLocalClock();\n",
"</script>",
(long) Gbl.StartExecutionTimeUTC); (long) Gbl.StartExecutionTimeUTC);
HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -680,8 +680,8 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
Id,ParamName,(long) TimeUTC); Id,ParamName,(long) TimeUTC);
/***** Script to set selectors to local date and time from UTC time *****/ /***** Script to set selectors to local date and time from UTC time *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" HTM_SCRIPT_Begin (NULL,NULL);
"setLocalDateTimeFormFromUTC('%s',%ld);" fprintf (Gbl.F.Out,"setLocalDateTimeFormFromUTC('%s',%ld);"
"adjustDateForm('%s');", "adjustDateForm('%s');",
Id,(long) TimeUTC,Id); Id,(long) TimeUTC,Id);
switch (SetHMS) switch (SetHMS)
@ -697,7 +697,7 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
default: default:
break; break;
} }
fprintf (Gbl.F.Out,"</script>"); HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -723,11 +723,11 @@ void Dat_PutHiddenParBrowserTZDiff (void)
" value=\"\" />" " value=\"\" />"
"<input type=\"hidden\"" "<input type=\"hidden\""
" id=\"BrowserTZDiff\" name=\"BrowserTZDiff\"" " id=\"BrowserTZDiff\" name=\"BrowserTZDiff\""
" value=\"0\" />" " value=\"0\" />");
"<script type=\"text/javascript\">" HTM_SCRIPT_Begin (NULL,NULL);
"setTZname('BrowserTZName');" fprintf (Gbl.F.Out,"setTZname('BrowserTZName');"
"setTZ('BrowserTZDiff');" "setTZ('BrowserTZDiff');");
"</script>"); HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1605,3 +1605,34 @@ void Dat_WriteHoursMinutesSeconds (struct Time *Time)
fprintf (Gbl.F.Out,"%u&quot;", fprintf (Gbl.F.Out,"%u&quot;",
Time->Second); Time->Second);
} }
/*****************************************************************************/
/**** Write call to JavaScript function to write local date from UTC time ****/
/*****************************************************************************/
void Dat_WriteLocalDateHMSFromUTC (const char *fmt,...)
{
va_list ap;
int NumBytesPrinted;
char *Params;
if (fmt)
if (fmt[0])
{
va_start (ap,fmt);
NumBytesPrinted = vasprintf (&Params,fmt,ap);
va_end (ap);
if (NumBytesPrinted < 0) // If memory allocation wasn't possible,
// or some other error occurs,
// vasprintf will return -1
Lay_NotEnoughMemoryExit ();
/***** Print HTML *****/
// HTM_SCRIPT_Begin (NULL,NULL);
// fprintf (Gbl.F.Out,"writeLocalDateHMSFromUTC(%s);",Params);
// HTM_SCRIPT_End ();
free ((void *) Params);
}
}

View File

@ -193,4 +193,6 @@ void Dat_WriteScriptMonths (void);
void Dat_WriteHoursMinutesSecondsFromSeconds (time_t Seconds); void Dat_WriteHoursMinutesSecondsFromSeconds (time_t Seconds);
void Dat_WriteHoursMinutesSeconds (struct Time *Time); void Dat_WriteHoursMinutesSeconds (struct Time *Time);
void Dat_WriteLocalDateHMSFromUTC (const char *fmt,...);
#endif #endif

View File

@ -6399,29 +6399,22 @@ static void Brw_WriteDatesAssignment (void)
UniqueId++; UniqueId++;
/***** Write start and end dates *****/ /***** Write start and end dates *****/
fprintf (Gbl.F.Out,"<span id=\"asg_start_date_%u\">" fprintf (Gbl.F.Out,"<span id=\"asg_start_date_%u\">",UniqueId);
"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'asg_start_date_%u',%ld,"
"writeLocalDateHMSFromUTC('asg_start_date_%u',%ld," "%u,',&nbsp;','%s',true,false,0x7",
"%u,',&nbsp;','%s',true,false,0x7);" UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_START_TIME],
"</script>" (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
"</span>" fprintf (Gbl.F.Out,"</span>"
"&rarr;" "&rarr;"
"<span id=\"asg_end_date_%u\">" "<span id=\"asg_end_date_%u\">",UniqueId);
"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'asg_end_date_%u',%ld,"
"writeLocalDateHMSFromUTC('asg_end_date_%u',%ld," "%u,',&nbsp;','%s',false,false,0x7",
"%u,',&nbsp;','%s',false,false,0x7);" UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_END_TIME],
"</script>" (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
"</span>", fprintf (Gbl.F.Out,"</span>");
UniqueId,
UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_START_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today,
UniqueId,
UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_END_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
} }
else else
fprintf (Gbl.F.Out,"&nbsp;(%s)", fprintf (Gbl.F.Out,"&nbsp;(%s)",Txt_unknown_assignment);
Txt_unknown_assignment);
HTM_TD_End (); HTM_TD_End ();
} }
@ -6453,14 +6446,11 @@ static void Brw_WriteFileSizeAndDate (struct FileMetadata *FileMetadata)
Gbl.FileBrowser.FilFolLnk.Type == Brw_IS_LINK) Gbl.FileBrowser.FilFolLnk.Type == Brw_IS_LINK)
{ {
UniqueId++; UniqueId++;
fprintf (Gbl.F.Out,"<span id=\"filedate%u\"></span>" fprintf (Gbl.F.Out,"<span id=\"filedate%u\"></span>",UniqueId);
"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'filedate%u',%ld,"
"writeLocalDateHMSFromUTC('filedate%u',%ld," "%u,',&nbsp;','%s',true,false,0x6",
"%u,',&nbsp;','%s',true,false,0x6);" UniqueId,(long) FileMetadata->Time,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,
UniqueId,(long) FileMetadata->Time,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
} }
HTM_TD_End (); HTM_TD_End ();
} }
@ -9576,12 +9566,10 @@ void Brw_ShowFileMetadata (void)
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("id=\"filedate\" class=\"DAT LM\""); HTM_TD_Begin ("id=\"filedate\" class=\"DAT LM\"");
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'filedate',%ld,"
"writeLocalDateHMSFromUTC('filedate',%ld," "%u,',&nbsp;','%s',true,true,0x7",
"%u,',&nbsp;','%s',true,true,0x7);" (long) FileMetadata.Time,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
(long) FileMetadata.Time,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -3459,12 +3459,10 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
UniqueId++; UniqueId++;
HTM_TD_Begin ("id=\"thr_date_%u\" class=\"%s LT %s\"", HTM_TD_Begin ("id=\"thr_date_%u\" class=\"%s LT %s\"",
UniqueId,Style,BgColor); UniqueId,Style,BgColor);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'thr_date_%u',%ld,"
"writeLocalDateHMSFromUTC('thr_date_%u',%ld," "%u,'<br />','%s',true,false,0x6",
"%u,'<br />','%s',true,false,0x6);" UniqueId,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }
else else

View File

@ -431,13 +431,11 @@ void Gam_ShowOneGame (long GamCod,
"DATE_GREEN", "DATE_GREEN",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
if (Game.TimeUTC[Dat_START_TIME]) if (Game.TimeUTC[Dat_START_TIME])
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'gam_date_%u_%u',%ld,"
"writeLocalDateHMSFromUTC('gam_date_%u_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" (unsigned) StartEndTime,UniqueId,
"</script>", Game.TimeUTC[StartEndTime],
(unsigned) StartEndTime,UniqueId, (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
Game.TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }

View File

@ -2338,15 +2338,13 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp)
{ {
UniqueId++; UniqueId++;
fprintf (Gbl.F.Out,"<br />%s: " fprintf (Gbl.F.Out,"<br />%s: "
"<span id=\"open_time_%u\"></span>" "<span id=\"open_time_%u\"></span>",
"<script type=\"text/javascript\">"
"writeLocalDateHMSFromUTC('open_time_%u',%ld,"
"%u,',&nbsp;','%s',true,true,0x7);"
"</script>",
Txt_Opening_of_groups, Txt_Opening_of_groups,
UniqueId, UniqueId);
UniqueId,(long) GrpTyp->OpenTimeUTC, Dat_WriteLocalDateHMSFromUTC ("'open_time_%u',%ld,"
(unsigned) Gbl.Prefs.DateFormat,Txt_Today); "%u,',&nbsp;','%s',true,true,0x7",
UniqueId,(long) GrpTyp->OpenTimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
} }
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -484,9 +484,8 @@ static void Lay_WriteScripts (void)
unsigned NumExamAnnouncement; // Number of exam announcement unsigned NumExamAnnouncement; // Number of exam announcement
/***** General scripts for swad *****/ /***** General scripts for swad *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\" src=\"%s/%s\">" HTM_SCRIPT_Begin (Cfg_URL_SWAD_PUBLIC "/" JS_FILE,NULL);
"</script>\n", HTM_SCRIPT_End ();
Cfg_URL_SWAD_PUBLIC,JS_FILE);
/***** Script for MathJax *****/ /***** Script for MathJax *****/
Lay_WriteScriptMathJax (); Lay_WriteScriptMathJax ();
@ -515,8 +514,9 @@ static void Lay_WriteScripts (void)
Exa_CreateListDatesOfExamAnnouncements (); Exa_CreateListDatesOfExamAnnouncements ();
/***** Write script to initialize variables used to draw months *****/ /***** Write script to initialize variables used to draw months *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n" HTM_SCRIPT_Begin (NULL,NULL);
" var DAYS_CAPS = [");
fprintf (Gbl.F.Out," var DAYS_CAPS = [");
for (DayOfWeek = 0; for (DayOfWeek = 0;
DayOfWeek < 7; DayOfWeek < 7;
DayOfWeek++) DayOfWeek++)
@ -563,7 +563,7 @@ static void Lay_WriteScripts (void)
Gbl.ExamAnns.Lst[NumExamAnnouncement].ExamDate.Month, Gbl.ExamAnns.Lst[NumExamAnnouncement].ExamDate.Month,
Gbl.ExamAnns.Lst[NumExamAnnouncement].ExamDate.Day); Gbl.ExamAnns.Lst[NumExamAnnouncement].ExamDate.Day);
fprintf (Gbl.F.Out,"</script>\n"); HTM_SCRIPT_End ();
/***** Free list of dates of exam announcements *****/ /***** Free list of dates of exam announcements *****/
Exa_FreeListExamAnnouncements (); Exa_FreeListExamAnnouncements ();
@ -604,11 +604,8 @@ static void Lay_WriteScripts (void)
case ActFrmCreMrkGrp: // Brw_ADMI_MRK_GRP case ActFrmCreMrkGrp: // Brw_ADMI_MRK_GRP
case ActFrmCreBrf: // Brw_ADMI_BRF_USR case ActFrmCreBrf: // Brw_ADMI_BRF_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\"" HTM_SCRIPT_Begin (Cfg_URL_SWAD_PUBLIC "/dropzone/dropzone.js","windows-1252");
" src=\"%s/dropzone/dropzone.js\"" HTM_SCRIPT_End ();
" charset=\"windows-1252\">"
"</script>\n",
Cfg_URL_SWAD_PUBLIC);
Lay_WriteScriptCustomDropzone (); Lay_WriteScriptCustomDropzone ();
break; break;
case ActReqAccGbl: case ActReqAccGbl:
@ -616,10 +613,8 @@ static void Lay_WriteScripts (void)
case ActReqAccCrs: case ActReqAccCrs:
case ActSeeAccCrs: case ActSeeAccCrs:
case ActSeeAllStaCrs: case ActSeeAllStaCrs:
fprintf (Gbl.F.Out,"<script type=\"text/javascript\"" HTM_SCRIPT_Begin (Cfg_URL_SWAD_PUBLIC "/jstz/jstz.js",NULL);
" src=\"%s/jstz/jstz.js\">" HTM_SCRIPT_End ();
"</script>\n",
Cfg_URL_SWAD_PUBLIC);
break; break;
default: default:
break; break;
@ -642,27 +637,23 @@ static void Lay_WriteScriptMathJax (void)
{ {
// MathJax configuration // MathJax configuration
/* /*
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" HTM_SCRIPT_Begin (NULL,NULL);
" window.MathJax = {" fprintf (Gbl.F.Out," window.MathJax = {"
" tex2jax: {" " tex2jax: {"
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ]," " inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],"
" processEscapes: true" " processEscapes: true"
" }" " }"
" };" " };");
"</script>"); HTM_SCRIPT_End ();
*/ */
#ifdef Cfg_MATHJAX_LOCAL #ifdef Cfg_MATHJAX_LOCAL
// Use the local copy of MathJax // Use the local copy of MathJax
fprintf (Gbl.F.Out,"<script type=\"text/javascript\"" HTM_SCRIPT_Begin (Cfg_URL_SWAD_PUBLIC "/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML",NULL);
" src=\"%s/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">"
"</script>\n",
Cfg_URL_SWAD_PUBLIC);
#else #else
// Use the MathJax Content Delivery Network (CDN) // Use the MathJax Content Delivery Network (CDN)
fprintf (Gbl.F.Out,"<script type=\"text/javascript\"" HTM_SCRIPT_Begin ("//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML",NULL);
" src=\"//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">"
"</script>\n");
#endif #endif
HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -674,8 +665,8 @@ static void Lay_WriteScriptInit (void)
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES]; extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
bool RefreshConnected; bool RefreshConnected;
bool RefreshNewTimeline = false; bool RefreshNewTimeline = false;
bool RefreshMatchStd = false; bool RefreshMatchStd = false;
bool RefreshMatchTch = false; bool RefreshMatchTch = false;
bool RefreshLastClicks = false; bool RefreshLastClicks = false;
RefreshConnected = Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB && RefreshConnected = Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB &&
@ -712,7 +703,7 @@ static void Lay_WriteScriptInit (void)
break; break;
} }
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n"); HTM_SCRIPT_Begin (NULL,NULL);
Dat_WriteScriptMonths (); Dat_WriteScriptMonths ();
@ -723,6 +714,7 @@ static void Lay_WriteScriptInit (void)
else if (RefreshMatchTch) // Refresh match via AJAX else if (RefreshMatchTch) // Refresh match via AJAX
fprintf (Gbl.F.Out,"\tvar delayMatch = %lu;\n",Cfg_TIME_TO_REFRESH_MATCH_TCH); fprintf (Gbl.F.Out,"\tvar delayMatch = %lu;\n",Cfg_TIME_TO_REFRESH_MATCH_TCH);
/***** Function init () ******/
fprintf (Gbl.F.Out,"function init(){\n"); fprintf (Gbl.F.Out,"function init(){\n");
fprintf (Gbl.F.Out,"\tActionAJAX = \"%s\";\n", fprintf (Gbl.F.Out,"\tActionAJAX = \"%s\";\n",
@ -745,8 +737,9 @@ static void Lay_WriteScriptInit (void)
else if (RefreshNewTimeline) // Refresh timeline via AJAX else if (RefreshNewTimeline) // Refresh timeline via AJAX
fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshNewTL()\",delayNewTL);\n"); fprintf (Gbl.F.Out,"\tsetTimeout(\"refreshNewTL()\",delayNewTL);\n");
fprintf (Gbl.F.Out,"}\n" fprintf (Gbl.F.Out,"}\n");
"</script>\n");
HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -756,7 +749,7 @@ static void Lay_WriteScriptInit (void)
static void Lay_WriteScriptParamsAJAX (void) static void Lay_WriteScriptParamsAJAX (void)
{ {
/***** Start script *****/ /***** Start script *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n"); HTM_SCRIPT_Begin (NULL,NULL);
/***** Parameters with code of session and current course code *****/ /***** Parameters with code of session and current course code *****/
// Refresh parameters // Refresh parameters
@ -859,7 +852,7 @@ static void Lay_WriteScriptParamsAJAX (void)
} }
/***** End script *****/ /***** End script *****/
fprintf (Gbl.F.Out,"</script>\n"); HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -871,8 +864,8 @@ static void Lay_WriteScriptCustomDropzone (void)
{ {
// "myAwesomeDropzone" is the camelized version of the HTML element's ID // "myAwesomeDropzone" is the camelized version of the HTML element's ID
// Add a line "forceFallback: true,\n" to test classic upload // Add a line "forceFallback: true,\n" to test classic upload
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n" HTM_SCRIPT_Begin (NULL,NULL);
"Dropzone.options.myAwesomeDropzone = {\n" fprintf (Gbl.F.Out,"Dropzone.options.myAwesomeDropzone = {\n"
"maxFiles: 100,\n" "maxFiles: 100,\n"
"parallelUploads: 100,\n" "parallelUploads: 100,\n"
"maxFilesize: %lu,\n" "maxFilesize: %lu,\n"
@ -880,9 +873,9 @@ static void Lay_WriteScriptCustomDropzone (void)
"document.getElementById('dropzone-upload').style.display='none';\n" "document.getElementById('dropzone-upload').style.display='none';\n"
"document.getElementById('classic-upload').style.display='block';\n" "document.getElementById('classic-upload').style.display='block';\n"
"}\n" "}\n"
"};\n" "};\n",
"</script>\n",
(unsigned long) (Fil_MAX_FILE_SIZE / (1024ULL * 1024ULL) - 1)); (unsigned long) (Fil_MAX_FILE_SIZE / (1024ULL * 1024ULL) - 1));
HTM_SCRIPT_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -935,6 +928,7 @@ static void Lay_WritePageTopHeading (void)
Cfg_PLATFORM_LOGO_SMALL_WIDTH,Cfg_PLATFORM_LOGO_SMALL_HEIGHT); Cfg_PLATFORM_LOGO_SMALL_WIDTH,Cfg_PLATFORM_LOGO_SMALL_HEIGHT);
Frm_LinkFormEnd (); Frm_LinkFormEnd ();
HTM_DIV_End (); // head_row_1_logo_small HTM_DIV_End (); // head_row_1_logo_small
HTM_DIV_Begin ("id=\"head_row_1_logo_big\""); HTM_DIV_Begin ("id=\"head_row_1_logo_big\"");
Frm_LinkFormSubmit (Txt_System,NULL,NULL); Frm_LinkFormSubmit (Txt_System,NULL,NULL);
HTM_IMG (Cfg_URL_ICON_PUBLIC,Cfg_PLATFORM_LOGO_BIG_FILENAME,Cfg_PLATFORM_SHORT_NAME, HTM_IMG (Cfg_URL_ICON_PUBLIC,Cfg_PLATFORM_LOGO_BIG_FILENAME,Cfg_PLATFORM_SHORT_NAME,
@ -942,6 +936,7 @@ static void Lay_WritePageTopHeading (void)
Cfg_PLATFORM_LOGO_BIG_WIDTH,Cfg_PLATFORM_LOGO_BIG_HEIGHT); Cfg_PLATFORM_LOGO_BIG_WIDTH,Cfg_PLATFORM_LOGO_BIG_HEIGHT);
Frm_LinkFormEnd (); Frm_LinkFormEnd ();
HTM_DIV_End (); // head_row_1_logo_big HTM_DIV_End (); // head_row_1_logo_big
HTM_DIV_Begin ("id=\"head_row_1_tagline\""); HTM_DIV_Begin ("id=\"head_row_1_tagline\"");
Frm_LinkFormSubmit (Txt_TAGLINE,The_ClassTagline[Gbl.Prefs.Theme],NULL); Frm_LinkFormSubmit (Txt_TAGLINE,The_ClassTagline[Gbl.Prefs.Theme],NULL);
fprintf (Gbl.F.Out,"%s",Txt_TAGLINE_BR); fprintf (Gbl.F.Out,"%s",Txt_TAGLINE_BR);
@ -969,6 +964,7 @@ static void Lay_WritePageTopHeading (void)
else else
Usr_PutFormLogIn (); Usr_PutFormLogIn ();
HTM_DIV_End (); // login_box HTM_DIV_End (); // login_box
HTM_DIV_End (); // head_row_1_right HTM_DIV_End (); // head_row_1_right
/* End 1st. row */ /* End 1st. row */

View File

@ -554,13 +554,11 @@ static void Mch_ListOneOrMoreMatchesTimes (const struct Match *Match,unsigned Un
Match->Status.QstInd >= Mch_AFTER_LAST_QUESTION ? "DATE_RED" : Match->Status.QstInd >= Mch_AFTER_LAST_QUESTION ? "DATE_RED" :
"DATE_GREEN", "DATE_GREEN",
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'mch_time_%u_%u',"
"writeLocalDateHMSFromUTC('mch_time_%u_%u'," "%ld,%u,'<br />','%s',true,true,0x7",
"%ld,%u,'<br />','%s',true,true,0x7);" (unsigned) StartEndTime,UniqueId,
"</script>", Match->TimeUTC[StartEndTime],
(unsigned) StartEndTime,UniqueId, (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
Match->TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }
} }

View File

@ -434,13 +434,11 @@ static void McR_ShowMchResults (Usr_MeOrOther_t MeOrOther)
HTM_TD_Begin ("id =\"mch_time_%u_%u\" class=\"DAT LT COLOR%u\"", HTM_TD_Begin ("id =\"mch_time_%u_%u\" class=\"DAT LT COLOR%u\"",
(unsigned) StartEndTime,UniqueId, (unsigned) StartEndTime,UniqueId,
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'mch_time_%u_%u',"
"writeLocalDateHMSFromUTC('mch_time_%u_%u'," "%ld,%u,'<br />','%s',true,false,0x7",
"%ld,%u,'<br />','%s',true,false,0x7);" (unsigned) StartEndTime,UniqueId,
"</script>", (long) TimeUTC[StartEndTime],
(unsigned) StartEndTime,UniqueId, (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
(long) TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
} }
@ -790,13 +788,11 @@ void McR_ShowOneMchResult (void)
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("id=\"match_%u\" class=\"DAT LT\"",(unsigned) StartEndTime); HTM_TD_Begin ("id=\"match_%u\" class=\"DAT LT\"",(unsigned) StartEndTime);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'match_%u',%ld,"
"writeLocalDateHMSFromUTC('match_%u',%ld," "%u,',&nbsp;','%s',true,true,0x7",
"%u,',&nbsp;','%s',true,true,0x7);" (unsigned) StartEndTime,
"</script>", TimeUTC[StartEndTime],
(unsigned) StartEndTime, (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
TimeUTC[StartEndTime],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -3620,12 +3620,10 @@ void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassBackground)
UniqueId,ClassBackground); UniqueId,ClassBackground);
/***** Write date and time *****/ /***** Write date and time *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'msg_date_%u',%ld,"
"writeLocalDateHMSFromUTC('msg_date_%u',%ld," "%u,',&nbsp;','%s',true,false,0x6",
"%u,',&nbsp;','%s',true,false,0x6);" UniqueId,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
/***** End cell *****/ /***** End cell *****/
HTM_TD_End (); HTM_TD_End ();

View File

@ -698,12 +698,10 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
Frm_LinkFormEnd (); Frm_LinkFormEnd ();
Frm_EndForm (); Frm_EndForm ();
} }
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'not_date_%u',%ld,"
"writeLocalDateHMSFromUTC('not_date_%u',%ld," "%u,'<br />','%s',true,false,0x6",
"%u,'<br />','%s',true,false,0x6);" UniqueId,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_DIV_End (); HTM_DIV_End ();
/***** Write the content of the notice *****/ /***** Write the content of the notice *****/

View File

@ -501,12 +501,10 @@ static void Prf_ShowTimeSinceFirstClick (const struct UsrData *UsrDat,
} }
fprintf (Gbl.F.Out,")"); fprintf (Gbl.F.Out,")");
} }
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'%s',%ld,"
"writeLocalDateHMSFromUTC('%s',%ld," "%u,',&nbsp;','%s',true,false,0x6",
"%u,',&nbsp;','%s',true,false,0x6);" IdFirstClickTime,(long) UsrFigures->FirstClickTimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
IdFirstClickTime,(long) UsrFigures->FirstClickTimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
} }
else // First click time is unknown or user never logged else // First click time is unknown or user never logged
/***** Button to fetch and store user's figures *****/ /***** Button to fetch and store user's figures *****/

View File

@ -1116,12 +1116,10 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj,
UniqueId,ClassDate); UniqueId,ClassDate);
break; break;
} }
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'prj_creat_%u',%ld,"
"writeLocalDateHMSFromUTC('prj_creat_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" UniqueId,Prj->CreatTime,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Prj->CreatTime,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Modification date/time */ /* Modification date/time */
@ -1137,12 +1135,10 @@ static void Prj_ShowOneProject (unsigned NumIndex,struct Project *Prj,
UniqueId,ClassDate); UniqueId,ClassDate);
break; break;
} }
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'prj_modif_%u',%ld,"
"writeLocalDateHMSFromUTC('prj_modif_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" UniqueId,Prj->ModifTime,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Prj->ModifTime,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Project title */ /* Project title */
@ -1495,24 +1491,20 @@ static void Prj_ShowTableAllProjectsOneRow (struct Project *Prj)
UniqueId++; UniqueId++;
HTM_TD_Begin ("id=\"prj_creat_%u\" class=\"LT %s COLOR%u\"", HTM_TD_Begin ("id=\"prj_creat_%u\" class=\"LT %s COLOR%u\"",
UniqueId,ClassDate,Gbl.RowEvenOdd); UniqueId,ClassDate,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'prj_creat_%u',%ld,"
"writeLocalDateHMSFromUTC('prj_creat_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" UniqueId,Prj->CreatTime,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Prj->CreatTime,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/***** End date/time *****/ /***** End date/time *****/
UniqueId++; UniqueId++;
HTM_TD_Begin ("id=\"prj_modif_%u\" class=\"LT %s COLOR%u\"", HTM_TD_Begin ("id=\"prj_modif_%u\" class=\"LT %s COLOR%u\"",
UniqueId,ClassDate,Gbl.RowEvenOdd); UniqueId,ClassDate,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'prj_modif_%u',%ld,"
"writeLocalDateHMSFromUTC('prj_modif_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" UniqueId,Prj->ModifTime,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Prj->ModifTime,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/***** Project title *****/ /***** Project title *****/

View File

@ -1716,13 +1716,11 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
/* Write the date-time (row[3]) */ /* Write the date-time (row[3]) */
HTM_TD_Begin ("id=\"log_date_%u\" class=\"LOG RT COLOR%u\"", HTM_TD_Begin ("id=\"log_date_%u\" class=\"LOG RT COLOR%u\"",
UniqueId,Gbl.RowEvenOdd); UniqueId,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'log_date_%u',%ld,"
"writeLocalDateHMSFromUTC('log_date_%u',%ld," "%u,',&nbsp;','%s',true,false,0x7",
"%u,',&nbsp;','%s',true,false,0x7);" UniqueId,(long) Dat_GetUNIXTimeFromStr (row[3]),
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) Dat_GetUNIXTimeFromStr (row[3]),
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Write the action */ /* Write the action */

View File

@ -485,12 +485,10 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
(Svy.Status.Open ? "DATE_GREEN_LIGHT" : (Svy.Status.Open ? "DATE_GREEN_LIGHT" :
"DATE_RED_LIGHT"), "DATE_RED_LIGHT"),
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'svy_date_start_%u',%ld,"
"writeLocalDateHMSFromUTC('svy_date_start_%u',%ld," "%u,'<br />','%s',true,true,0x7",
"%u,'<br />','%s',true,true,0x7);" UniqueId,Svy.TimeUTC[Svy_START_TIME],
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Svy.TimeUTC[Svy_START_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* End date/time */ /* End date/time */
@ -509,12 +507,10 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
(Svy.Status.Open ? "DATE_GREEN_LIGHT" : (Svy.Status.Open ? "DATE_GREEN_LIGHT" :
"DATE_RED_LIGHT"), "DATE_RED_LIGHT"),
Gbl.RowEvenOdd); Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'svy_date_end_%u',%ld,"
"writeLocalDateHMSFromUTC('svy_date_end_%u',%ld," "%u,'<br />','%s',false,true,0x7",
"%u,'<br />','%s',false,true,0x7);" UniqueId,Svy.TimeUTC[Svy_END_TIME],
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,Svy.TimeUTC[Svy_END_TIME],
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Survey title */ /* Survey title */

View File

@ -2931,12 +2931,10 @@ static void Tst_ListOneOrMoreQuestionsForEdition (unsigned long NumRows,
TimeUTC = Dat_GetUNIXTimeFromStr (row[1]); TimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
HTM_TD_Begin ("id=\"tst_date_%u\" class=\"DAT_SMALL CT COLOR%u\"", HTM_TD_Begin ("id=\"tst_date_%u\" class=\"DAT_SMALL CT COLOR%u\"",
UniqueId,Gbl.RowEvenOdd); UniqueId,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'tst_date_%u',%ld,"
"writeLocalDateHMSFromUTC('tst_date_%u',%ld," "%u,'<br />','%s',true,false,0x7",
"%u,'<br />','%s',true,false,0x7);" UniqueId,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Write the question tags */ /* Write the question tags */
@ -3142,12 +3140,10 @@ static void Tst_ListOneOrMoreQuestionsForSelection (unsigned long NumRows,
TimeUTC = Dat_GetUNIXTimeFromStr (row[1]); TimeUTC = Dat_GetUNIXTimeFromStr (row[1]);
HTM_TD_Begin ("id=\"tst_date_%u\" class=\"DAT_SMALL CT COLOR%u\">", HTM_TD_Begin ("id=\"tst_date_%u\" class=\"DAT_SMALL CT COLOR%u\">",
UniqueId,Gbl.RowEvenOdd); UniqueId,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'tst_date_%u',%ld,"
"writeLocalDateHMSFromUTC('tst_date_%u',%ld," "%u,'<br />','%s',true,false,0x7",
"%u,'<br />','%s',true,false,0x7);" UniqueId,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Write the question tags */ /* Write the question tags */
@ -7778,12 +7774,10 @@ static void Tst_ShowTstResults (struct UsrData *UsrDat)
UniqueId++; UniqueId++;
HTM_TD_Begin ("id=\"tst_date_%u\" class=\"%s RT COLOR%u\"", HTM_TD_Begin ("id=\"tst_date_%u\" class=\"%s RT COLOR%u\"",
UniqueId,ClassDat,Gbl.RowEvenOdd); UniqueId,ClassDat,Gbl.RowEvenOdd);
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'tst_date_%u',%ld,"
"writeLocalDateHMSFromUTC('tst_date_%u',%ld," "%u,',&nbsp;','%s',true,false,0x7",
"%u,',&nbsp;','%s',true,false,0x7);" UniqueId,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
UniqueId,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
/* Get number of questions (row[3]) */ /* Get number of questions (row[3]) */
@ -8118,12 +8112,10 @@ void Tst_ShowOneTstResult (void)
HTM_TD_End (); HTM_TD_End ();
HTM_TD_Begin ("id=\"test\" class=\"DAT LT\""); HTM_TD_Begin ("id=\"test\" class=\"DAT LT\"");
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'test',%ld,"
"writeLocalDateHMSFromUTC('test',%ld," "%u,',&nbsp;','%s',true,true,0x7",
"%u,',&nbsp;','%s',true,true,0x7);" TstTimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
TstTimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -1789,12 +1789,10 @@ static void TL_WriteDateTime (time_t TimeUTC)
/***** Script to write date and time in browser local time *****/ /***** Script to write date and time in browser local time *****/
// This must be out of the div where the output is written // This must be out of the div where the output is written
// because it will be evaluated in a loop in JavaScript // because it will be evaluated in a loop in JavaScript
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">" Dat_WriteLocalDateHMSFromUTC ("'%s',%ld,"
"writeLocalDateHMSFromUTC('%s',%ld," "%u,',&nbsp;','%s',true,false,0x6",
"%u,',&nbsp;','%s',true,false,0x6);" IdDateTime,(long) TimeUTC,
"</script>", (unsigned) Gbl.Prefs.DateFormat,Txt_Today);
IdDateTime,(long) TimeUTC,
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
} }
/*****************************************************************************/ /*****************************************************************************/