Version 15.17.1

This commit is contained in:
Antonio Cañas Vargas 2015-10-23 01:06:32 +02:00
parent 6e767f3340
commit eb151fb02c
11 changed files with 187 additions and 152 deletions

View File

@ -48,30 +48,33 @@ function writeLocalDateTimeFromUTC(id,secsSince1970UTC) {
d.setTime(secsSince1970UTC * 1000);
Minutes = d.getMinutes();
Seconds = d.getSeconds();
StrMinutes = ((Minutes < 10) ? "0" : "") + Minutes;
document.getElementById(id).innerHTML = d.toLocaleDateString() + " " + d.getHours() + ":" + StrMinutes;
StrSeconds = ((Seconds < 10) ? "0" : "") + Seconds;
document.getElementById(id).innerHTML = d.toLocaleDateString() + "<br />" +
d.getHours() + ":" + StrMinutes + ":" + StrSeconds;
}
// Set local date-time form fields from UTC time
function setLocalDateTimeFormFromUTC(id,secsSince1970UTC) {
var d = new Date;
var Day;
var Month;
var YearForm = document.getElementById(id+'Year');
var Year;
var Hour;
var Minute;
d.setTime(secsSince1970UTC * 1000);
Year = d.getFullYear();
Month = d.getMonth() + 1;
Day = d.getDate();
Hour = d.getHours();
Minute = d.getMinutes();
document.getElementById(id+'_year_' +Year ).selected = true;
document.getElementById(id+'_month_' +Month ).selected = true;
document.getElementById(id+'_day_' +Day ).selected = true;
document.getElementById(id+'_hour_' +Hour ).selected = true;
document.getElementById(id+'_minute_'+Minute).selected = true;
Year = d.getFullYear()
for (var i=0; i<YearForm.options.length ; i++)
if (YearForm.options[i].value == Year)
{
YearForm.options[i].selected = true;
break;
}
document.getElementById(id+'Month' ).options[d.getMonth()+1].selected = true;
document.getElementById(id+'Day' ).options[d.getDate() ].selected = true;
document.getElementById(id+'Hour' ).options[d.getHours() ].selected = true;
document.getElementById(id+'Minute').options[d.getMinutes()].selected = true;
document.getElementById(id+'Second').options[d.getSeconds()].selected = true;
}
// Set UTC time from local date-time form fields
@ -80,16 +83,57 @@ function setUTCFromLocalDateTimeForm(id) {
// Important: set year first in order to work properly with leap years
d.setFullYear(document.getElementById(id+'Year' ).value);
d.setMonth (document.getElementById(id+'Month' ).value - 1);
d.setMonth (document.getElementById(id+'Month' ).value-1);
d.setDate (document.getElementById(id+'Day' ).value);
d.setHours (document.getElementById(id+'Hour' ).value);
d.setMinutes (document.getElementById(id+'Minute').value);
d.setSeconds(0);
d.setSeconds (document.getElementById(id+'Second').value);
d.setMilliseconds(0);
document.getElementById(id+'TimeUTC').value = d.getTime() / 1000;
}
// Adjust a date form correcting days in the month
function adjustDateForm (id) {
var Days = 31;
var YearForm = document.getElementById(id+'Year' );
var MonthForm = document.getElementById(id+'Month');
var DayForm = document.getElementById(id+'Day' );
var Year = YearForm.options[YearForm.selectedIndex].value;
if (MonthForm.options[2].selected) // Adjust days of february
Days = ((((Year % 4) == 0) && ((Year % 100) != 0)) || ((Year % 400) == 0)) ? 29 : 28;
else if (MonthForm.options[ 4].selected ||
MonthForm.options[ 6].selected ||
MonthForm.options[ 9].selected ||
MonthForm.options[11].selected)
Days = 30;
if (DayForm.selectedIndex > Days)
DayForm.options[Days].selected = true;
for (var i=DayForm.options.length; i<=Days ; i++) // Create new days
{
var x = String (i);
DayForm.options[i] = new Option(x,x);
}
for (var i=DayForm.options.length-1; i>Days; i--) // Remove days
DayForm.options[i] = null;
}
// Set a the date in a date form to a specified date
function setDateTo (elem,Day,Month,Year) {
document.getElementById('StartYear' ).options[Year ].selected = true;
document.getElementById('StartMonth').options[Month].selected = true;
adjustDateForm (elem.form.StartDay,elem.form.StartMonth,elem.form.StartYear)
document.getElementById('StartDay' ).options[Day ].selected = true;
document.getElementById('EndYear' ).options[Year ].selected = true;
document.getElementById('EndMonth').options[Month].selected = true;
adjustDateForm (elem.form.EndDay,elem.form.EndMonth,elem.form.EndYear)
document.getElementById('EndDay' ).options[Day ].selected = true;
}
// Write clock in client local time updated every minute
function writeLocalClock() {
var d = new Date;
@ -329,32 +373,6 @@ function uncheckChildren(MainCheckbox, GroupCheckboxes) {
if (Formul.elements[i].name == GroupCheckboxes) Formul.elements[i].checked = false;
}
// Adjust a date form correcting days in the month
function adjustDateForm (DayForm,MonthForm,YearForm) {
var Days = 31;
var Year = YearForm.options[YearForm.selectedIndex].value;
if (MonthForm.options[2].selected) // Adjust days of february
{ if ((((Year % 4) == 0) && ((Year % 100) != 0)) || ((Year % 400) == 0)) Days = 29; else Days = 28; }
else if (MonthForm.options[4].selected || MonthForm.options[6].selected || MonthForm.options[9].selected || MonthForm.options[11].selected) Days = 30;
if (DayForm.selectedIndex > Days) DayForm.options[Days].selected = true;
for (var i=DayForm.options.length; i<=Days ; i++) // Create new days at start
{ var x = String (i); DayForm.options[i] = new Option(x,x); }
for (var i=DayForm.options.length-1; i>Days; i--) // Remove days at the end
DayForm.options[i] = null;
}
// Set a the date in a date form to a specified date
function setDateTo (elem,Day,Month,Year) {
document.getElementById('StartYear').options[Year].selected = true;
document.getElementById('StartMonth').options[Month].selected = true;
adjustDateForm (elem.form.StartDay,elem.form.StartMonth,elem.form.StartYear)
document.getElementById('StartDay').options[Day].selected = true;
document.getElementById('EndYear').options[Year].selected = true;
document.getElementById('EndMonth').options[Month].selected = true;
adjustDateForm (elem.form.EndDay,elem.form.EndMonth,elem.form.EndYear)
document.getElementById('EndDay').options[Day].selected = true;
}
// Change text of a test descriptor
function changeTxtTag(NumTag){
var Sel = document.getElementById('SelDesc'+NumTag);

View File

@ -1323,6 +1323,7 @@ void Asg_RecFormAssignment (void)
Grp_FreeListCodSelectedGrps ();
}
else
// TODO: The form should be filled with partial data, now is always empty
Asg_RequestCreatOrEditAsg ();
/***** Notify by e-mail about the new assignment *****/

View File

@ -1022,9 +1022,7 @@ void Att_RequestCreatOrEditAttEvent (void)
struct AttendanceEvent Att;
bool ItsANewAttEvent;
Att_StartOrEndTime_t StartOrEndTime;
const char *NameSelectYear [Att_NUM_DATES] = {"StartYear" ,"EndYear" };
const char *NameSelectMonth [Att_NUM_DATES] = {"StartMonth" ,"EndMonth" };
const char *NameSelectDay [Att_NUM_DATES] = {"StartDay" ,"EndDay" };
const char *Id[Att_NUM_DATES] = {"Start","End"};
const char *NameSelectHour [Att_NUM_DATES] = {"StartHour" ,"EndHour" };
const char *NameSelectMinute[Att_NUM_DATES] = {"StartMinute","EndMinute"};
const char *Dates[Att_NUM_DATES] = {Txt_Start_date,Txt_End_date};
@ -1112,9 +1110,7 @@ void Att_RequestCreatOrEditAttEvent (void)
/* Date */
Dat_WriteFormDate (Gbl.Now.Date.Year-1,Gbl.Now.Date.Year+1,
NameSelectDay [StartOrEndTime],
NameSelectMonth[StartOrEndTime],
NameSelectYear [StartOrEndTime],
Id[StartOrEndTime],
&(Att.DateTimes[StartOrEndTime].Date),
false,false);

View File

@ -102,16 +102,18 @@
// TODO: A teacher should may confirm a student ID? In what conditions? (Necessary in order to a student can view his/her marks)
// TODO: Put headers Content-type and Content-disposition when redirecting with Location:
// TODO: System admin should be able to remove/edit user's mail (when he/she detects a recipient does not exists, for example)
// TODO: When a new assignment is incorrect, the second time the form is shown, it should be filled with partial data, now is always empty
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.17 (2015/10/22)"
#define Log_PLATFORM_VERSION "SWAD 15.17.1 (2015/10/23)"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/*
Version 15.17.1: Oct 23, 2015 Code refactoring related to dates and JavaScript. (186407 lines)
Version 15.17: Oct 22, 2015 Code refactoring related to dates and JavaScript.
Fixed bug in internal editor of syllabus. (186379 lines)
Version 15.16.2: Oct 22, 2015 Assignment date-times are displayed in client local date-time. Not finished. (186479 lines)

View File

@ -229,7 +229,7 @@ void Dat_WriteFormIniEndDates (void)
"<td class=\"LEFT_MIDDLE\">",
The_ClassForm[Gbl.Prefs.Theme],
Txt_Start_date);
Dat_WriteFormDate (Cfg_LOG_START_YEAR,Gbl.Now.Date.Year,"StartDay","StartMonth","StartYear",
Dat_WriteFormDate (Cfg_LOG_START_YEAR,Gbl.Now.Date.Year,"Start",
&(Gbl.DateRange.DateIni),
false,false);
@ -259,7 +259,7 @@ void Dat_WriteFormIniEndDates (void)
"<td class=\"LEFT_MIDDLE\">",
The_ClassForm[Gbl.Prefs.Theme],
Txt_End_date);
Dat_WriteFormDate (Cfg_LOG_START_YEAR,Gbl.Now.Date.Year,"EndDay","EndMonth","EndYear",
Dat_WriteFormDate (Cfg_LOG_START_YEAR,Gbl.Now.Date.Year,"End",
&(Gbl.DateRange.DateEnd),
false,false);
fprintf (Gbl.F.Out,"</td>"
@ -282,11 +282,58 @@ void Dat_WriteFormClientLocalDateTime (const char *Id,
unsigned Year;
unsigned Hour;
unsigned Minute;
unsigned Second;
/***** Start table *****/
fprintf (Gbl.F.Out,"<table>"
"<tr>");
/***** Year *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%sYear\" name=\"%sYear\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,"><option value=\"0\">-</option>");
for (Year = FirstYear;
Year <= LastYear;
Year++)
fprintf (Gbl.F.Out,"<option value=\"%u\">%u</option>",
Year,Year);
fprintf (Gbl.F.Out,"</select>"
"</td>");
/***** Month *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%sMonth\" name=\"%sMonth\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,"><option value=\"0\">-</option>");
for (Month = 1;
Month <= 12;
Month++)
fprintf (Gbl.F.Out,"<option value=\"%u\">%s</option>",
Month,Txt_MONTHS_SMALL[Month-1]);
fprintf (Gbl.F.Out,"</select>"
"</td>");
/***** Day *****/
fprintf (Gbl.F.Out,"<table>"
"<tr>"
"<td class=\"CENTER_MIDDLE\">"
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%sDay\" name=\"%sDay\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id);
@ -301,57 +348,13 @@ void Dat_WriteFormClientLocalDateTime (const char *Id,
for (Day = 1;
Day <= 31;
Day++)
fprintf (Gbl.F.Out,"<option id=\"%s_day_%u\" value=\"%u\">%u</option>",
Id,Day,Day,Day);
/***** Month *****/
fprintf (Gbl.F.Out,"</select>"
"</td>"
"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%sMonth\" name=\"%sMonth\""
" onchange=\""
"adjustDateForm(this.form.%sDay,this.form.%sMonth,this.form.%sYear);"
"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id,Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,"><option value=\"0\">-</option>");
for (Month = 1;
Month <= 12;
Month++)
fprintf (Gbl.F.Out,"<option id=\"%s_month_%u\" value=\"%u\">%s</option>",
Id,Month,Month,Txt_MONTHS_SMALL[Month-1]);
/***** Year *****/
fprintf (Gbl.F.Out,"</select>"
"</td>"
"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%sYear\" name=\"%sYear\""
" onchange=\""
"adjustDateForm(this.form.%sDay,this.form.%sMonth,this.form.%sYear);"
"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id,Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,"><option value=\"0\">-</option>");
for (Year = FirstYear;
Year <= LastYear;
Year++)
fprintf (Gbl.F.Out,"<option id=\"%s_year_%u\" value=\"%u\">%u</option>",
Id,Year,Year,Year);
fprintf (Gbl.F.Out,"<option value=\"%u\">%u</option>",
Day,Day);
fprintf (Gbl.F.Out,"</select>"
"</td>");
/***** Hour *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_MIDDLE\">,&nbsp;"
"<select id=\"%sHour\" name=\"%sHour\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id);
@ -365,13 +368,13 @@ void Dat_WriteFormClientLocalDateTime (const char *Id,
for (Hour = 0;
Hour <= 23;
Hour++)
fprintf (Gbl.F.Out,"<option id=\"%s_hour_%u\" value=\"%u\">%02u h</option>",
Id,Hour,Hour,Hour);
fprintf (Gbl.F.Out,"<option value=\"%u\">%02u h</option>",
Hour,Hour);
fprintf (Gbl.F.Out,"</select>"
"</td>");
/***** Minute *****/
fprintf (Gbl.F.Out,"</select>"
"</td>"
"<td class=\"LEFT_MIDDLE\">"
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<select id=\"%sMinute\" name=\"%sMinute\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id);
@ -379,18 +382,39 @@ void Dat_WriteFormClientLocalDateTime (const char *Id,
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
for (Minute = 0;
Minute <= 59;
Minute++)
fprintf (Gbl.F.Out,"<option id=\"%s_minute_%u\" value=\"%u\">%02u &#39;</option>",
Id,Minute,Minute,Minute);
fprintf (Gbl.F.Out,"<option value=\"%u\">%02u &#39;</option>",
Minute,Minute);
fprintf (Gbl.F.Out,"</select>"
"</td>"
"</tr>"
"</td>");
/***** Second *****/
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<select id=\"%sSecond\" name=\"%sSecond\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
for (Second = 0;
Second <= 59;
Second++)
fprintf (Gbl.F.Out,"<option value=\"%u\">%02u &quot;</option>",
Second,Second);
fprintf (Gbl.F.Out,"</select>"
"</td>");
/***** End table *****/
fprintf (Gbl.F.Out,"</tr>"
"</table>");
/***** Hidden field with UTC time (seconds since 1970) used to send time *****/
@ -400,8 +424,9 @@ void Dat_WriteFormClientLocalDateTime (const char *Id,
/***** Script to set selectors to local date and time from UTC time *****/
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
"setLocalDateTimeFormFromUTC('%s',%ld);"
"adjustDateForm('%s');"
"</script>",
Id,(long) TimeUTC);
Id,(long) TimeUTC,Id);
}
/*****************************************************************************/
@ -432,9 +457,7 @@ http://javascript.internet.com/forms/category-selection.html
See also http://www.ashleyit.com/rs/jsrs/select/php/select.php
*/
void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
const char *NameSelectDay,
const char *NameSelectMonth,
const char *NameSelectYear,
const char *Id,
struct Date *DateSelected,
bool SubmitFormOnChange,bool Disabled)
{
@ -448,8 +471,8 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
fprintf (Gbl.F.Out,"<table>"
"<tr>"
"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%s\" name=\"%s\"",
NameSelectDay,NameSelectDay);
"<select id=\"%sDay\" name=\"%sDay\"",
Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();\"",
Gbl.FormId);
@ -473,9 +496,9 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
fprintf (Gbl.F.Out,"</select>"
"</td>"
"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%s\" name=\"%s\""
" onchange=\"adjustDateForm(this.form.%s,this.form.%s,this.form.%s);",
NameSelectMonth,NameSelectMonth,NameSelectDay,NameSelectMonth,NameSelectYear);
"<select id=\"%sMonth\" name=\"%sMonth\""
" onchange=\"adjustDateForm('%s');",
Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);
@ -497,8 +520,9 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
fprintf (Gbl.F.Out,"</select>"
"</td>"
"<td class=\"CENTER_MIDDLE\">"
"<select id=\"%s\" name=\"%s\" onchange=\"adjustDateForm(this.form.%s,this.form.%s,this.form.%s);",
NameSelectYear,NameSelectYear,NameSelectDay,NameSelectMonth,NameSelectYear);
"<select id=\"%sYear\" name=\"%sYear\""
" onchange=\"adjustDateForm('%s');",
Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();",
Gbl.FormId);

View File

@ -86,9 +86,7 @@ void Dat_WriteFormClientLocalDateTime (const char *Id,
time_t Dat_GetTimeUTCFromForm (const char *ParamName);
void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
const char *NameSelectDay,
const char *NameSelectMonth,
const char *NameSelectYear,
const char *Id,
struct Date *DateSelected,
bool SubmitFormOnChange,bool Disabled);
void Dat_WriteFormHourMinute (const char *NameSelectHour,const char *NameSelectMinute,

View File

@ -929,8 +929,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP\">");
Dat_WriteFormDate (Gbl.ExamAnnouncement.ExamDate.Year < Gbl.Now.Date.Year ? Gbl.ExamAnnouncement.ExamDate.Year :
Gbl.Now.Date.Year,
Gbl.Now.Date.Year+1,
"ExamDay","ExamMonth","ExamYear",
Gbl.Now.Date.Year + 1,"Exam",
&(Gbl.ExamAnnouncement.ExamDate),
false,false);
fprintf (Gbl.F.Out,"</td>");

View File

@ -1218,8 +1218,7 @@ static void Grp_ListGroupTypesForEdition (void)
Txt_The_groups_will_not_automatically_open,
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MustBeOpened ? Txt_The_groups_will_automatically_open :
Txt_The_groups_will_not_automatically_open);
Dat_WriteFormDate (Gbl.Now.Date.Year,Gbl.Now.Date.Year + 1,
"OpenDay","OpenMonth","OpenYear",
Dat_WriteFormDate (Gbl.Now.Date.Year,Gbl.Now.Date.Year + 1,"Open",
&(Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].OpenTime.Date),
true,false);
fprintf (Gbl.F.Out,"</td>"
@ -2110,8 +2109,7 @@ static void Grp_PutFormToCreateGroupType (void)
Txt_The_groups_will_not_automatically_open,
Gbl.CurrentCrs.Grps.GrpTyp.MustBeOpened ? Txt_The_groups_will_automatically_open :
Txt_The_groups_will_not_automatically_open);
Dat_WriteFormDate (Gbl.Now.Date.Year,Gbl.Now.Date.Year + 1,
"OpenDay","OpenMonth","OpenYear",
Dat_WriteFormDate (Gbl.Now.Date.Year,Gbl.Now.Date.Year + 1,"Open",
&(Gbl.CurrentCrs.Grps.GrpTyp.OpenTime.Date),
false,false);
fprintf (Gbl.F.Out,"</td>"

View File

@ -546,9 +546,9 @@ static void Hld_ListHolidaysForEdition (void)
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">");
Act_FormStart (ActChgHldStrDat);
Hld_PutParamHldCod (Hld->HldCod);
Dat_WriteFormDate (Gbl.Now.Date.Year-1,
Gbl.Now.Date.Year+1,
"StartDay","StartMonth","StartYear",
Dat_WriteFormDate (Gbl.Now.Date.Year - 1,
Gbl.Now.Date.Year + 1,
"Start",
&(Gbl.Hlds.Lst[NumHld].StartDate),
true,false);
Act_FormEnd ();
@ -558,9 +558,9 @@ static void Hld_ListHolidaysForEdition (void)
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">");
Act_FormStart (ActChgHldEndDat);
Hld_PutParamHldCod (Hld->HldCod);
Dat_WriteFormDate (Gbl.Now.Date.Year-1,
Gbl.Now.Date.Year+1,
"EndDay","EndMonth","EndYear",
Dat_WriteFormDate (Gbl.Now.Date.Year - 1,
Gbl.Now.Date.Year + 1,
"End",
&(Gbl.Hlds.Lst[NumHld].EndDate),
true,(Hld->HldTyp == Hld_HOLIDAY));
Act_FormEnd ();
@ -971,18 +971,18 @@ static void Hld_PutFormToCreateHoliday (void)
/***** Holiday date / Non school period start date *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">");
Dat_WriteFormDate (Gbl.Now.Date.Year-1,
Gbl.Now.Date.Year+1,
"StartDay","StartMonth","StartYear",
Dat_WriteFormDate (Gbl.Now.Date.Year - 1,
Gbl.Now.Date.Year + 1,
"Start",
&(Hld->StartDate),
false,false);
fprintf (Gbl.F.Out,"</td>");
/***** Non school period end date *****/
fprintf (Gbl.F.Out,"<td class=\"CENTER_MIDDLE\">");
Dat_WriteFormDate (Gbl.Now.Date.Year-1,
Gbl.Now.Date.Year+1,
"EndDay","EndMonth","EndYear",
Dat_WriteFormDate (Gbl.Now.Date.Year - 1,
Gbl.Now.Date.Year + 1,
"End",
&(Hld->EndDate),
false,false);
fprintf (Gbl.F.Out,"</td>");

View File

@ -2865,7 +2865,7 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
if (DataForm)
Dat_WriteFormDate (Gbl.Now.Date.Year - 99,
Gbl.Now.Date.Year - 16,
"DiaNac","MesNac","AnoNac",
"Birth",
&(UsrDat->Birthday),
false,false);
else if (UsrDat->StrBirthday[0])
@ -3285,7 +3285,10 @@ void Rec_GetUsrExtraDataFromRecordForm (struct UsrData *UsrDat)
Par_GetParToText ("OriginPlace",UsrDat->OriginPlace,Cns_MAX_BYTES_STRING);
Str_ConvertToTitleType (UsrDat->OriginPlace);
Dat_GetDateFromForm ("DiaNac","MesNac","AnoNac",&(UsrDat->Birthday.Day),&(UsrDat->Birthday.Month),&(UsrDat->Birthday.Year));
Dat_GetDateFromForm ("BirthDay","BirthMonth","BirthYear",
&(UsrDat->Birthday.Day ),
&(UsrDat->Birthday.Month),
&(UsrDat->Birthday.Year ));
Dat_ConvDateToDateStr (&(UsrDat->Birthday),UsrDat->StrBirthday);
Par_GetParToText ("LocalAddress",UsrDat->LocalAddress,Cns_MAX_BYTES_STRING);

View File

@ -1497,9 +1497,7 @@ void Svy_RequestCreatOrEditSvy (void)
struct SurveyQuestion SvyQst;
bool ItsANewSurvey;
Svy_StartOrEndTime_t StartOrEndTime;
const char *NameSelectYear [Svy_NUM_DATES] = {"StartYear" ,"EndYear" };
const char *NameSelectMonth [Svy_NUM_DATES] = {"StartMonth" ,"EndMonth" };
const char *NameSelectDay [Svy_NUM_DATES] = {"StartDay" ,"EndDay" };
const char *Id[Svy_NUM_DATES] = {"Start","End"};
const char *NameSelectHour [Svy_NUM_DATES] = {"StartHour" ,"EndHour" };
const char *NameSelectMinute[Svy_NUM_DATES] = {"StartMinute","EndMinute"};
const char *Dates[Svy_NUM_DATES] = {Txt_Start_date,Txt_End_date};
@ -1619,9 +1617,7 @@ void Svy_RequestCreatOrEditSvy (void)
Dates[StartOrEndTime]);
Dat_WriteFormDate (Gbl.Now.Date.Year-1,
Gbl.Now.Date.Year+1,
NameSelectDay [StartOrEndTime],
NameSelectMonth[StartOrEndTime],
NameSelectYear [StartOrEndTime],
Id[StartOrEndTime],
&(Svy.DateTimes[StartOrEndTime].Date),
false,false);
fprintf (Gbl.F.Out,"</td>"