Version19.53

This commit is contained in:
Antonio Cañas Vargas 2019-11-05 15:47:35 +01:00
parent e823add14d
commit 90b9eef04a
29 changed files with 329 additions and 284 deletions

View File

@ -66,7 +66,7 @@ static unsigned HTM_A_NestingLevel = 0;
static unsigned HTM_SCRIPT_NestingLevel = 0;
static unsigned HTM_LABEL_NestingLevel = 0;
static unsigned HTM_TEXTAREA_NestingLevel = 0;
// static unsigned HTM_SELECT_NestingLevel = 0;
static unsigned HTM_SELECT_NestingLevel = 0;
/*****************************************************************************/
/***************************** Private prototypes ****************************/
@ -1195,7 +1195,7 @@ void HTM_SELECT_Begin (bool SubmitOnChange,
Gbl.Form.Id);
fprintf (Gbl.F.Out," />");
// HTM_SELECT_NestingLevel++;
HTM_SELECT_NestingLevel++;
}
static void HTM_SELECT_BeginWithoutAttr (void)
@ -1205,12 +1205,12 @@ static void HTM_SELECT_BeginWithoutAttr (void)
void HTM_SELECT_End (void)
{
// if (HTM_SELECT_NestingLevel == 0) // No SELECT open
// Ale_ShowAlert (Ale_ERROR,"Trying to close unopened SELECT.");
if (HTM_SELECT_NestingLevel == 0) // No SELECT open
Ale_ShowAlert (Ale_ERROR,"Trying to close unopened SELECT.");
fprintf (Gbl.F.Out,"</select>");
// HTM_SELECT_NestingLevel--;
HTM_SELECT_NestingLevel--;
}
/*****************************************************************************/

View File

@ -1129,7 +1129,8 @@ void Att_RequestCreatOrEditAttEvent (void)
HTM_TD_End ();
HTM_TD_Begin ("class=\"LT\"");
fprintf (Gbl.F.Out,"<select id=\"ComTchVisible\" name=\"ComTchVisible\">");
HTM_SELECT_Begin (false,
"id=\"ComTchVisible\" name=\"ComTchVisible\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!Att.CommentTchVisible)

View File

@ -428,10 +428,9 @@ static void Ctr_Configuration (bool PrintView)
/* Put form to select institution */
Frm_StartForm (ActChgCtrInsCfg);
fprintf (Gbl.F.Out,"<select id=\"OthInsCod\" name=\"OthInsCod\""
" class=\"INPUT_SHORT_NAME\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthInsCod\" name=\"OthInsCod\""
" class=\"INPUT_SHORT_NAME\"");
for (NumIns = 0;
NumIns < Gbl.Hierarchy.Cty.Inss.Num;
NumIns++)
@ -525,9 +524,8 @@ static void Ctr_Configuration (bool PrintView)
/* Put form to select place */
Frm_StartForm (ActChgCtrPlcCfg);
fprintf (Gbl.F.Out,"<select name=\"PlcCod\" class=\"INPUT_SHORT_NAME\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"PlcCod\" class=\"INPUT_SHORT_NAME\"");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Gbl.Hierarchy.Ctr.PlcCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1400,13 +1398,14 @@ void Ctr_WriteSelectorOfCentre (void)
/***** Begin form *****/
Frm_StartFormGoTo (ActSeeDeg);
fprintf (Gbl.F.Out,"<select id=\"ctr\" name=\"ctr\" class=\"HIE_SEL\"");
if (Gbl.Hierarchy.Ins.InsCod > 0)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"ctr\" name=\"ctr\" class=\"HIE_SEL\"");
else
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"ctr\" name=\"ctr\" class=\"HIE_SEL\""
" disabled=\"disabled\"");
fprintf (Gbl.F.Out,"<option value=\"\"");
if (Gbl.Hierarchy.Ctr.CtrCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1517,9 +1516,8 @@ static void Ctr_ListCentresForEdition (void)
{
Frm_StartForm (ActChgCtrPlc);
Ctr_PutParamOtherCtrCod (Ctr->CtrCod);
fprintf (Gbl.F.Out,"<select name=\"PlcCod\" class=\"PLC_SEL\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"PlcCod\" class=\"PLC_SEL\"");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Ctr->PlcCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1624,9 +1622,8 @@ static void Ctr_ListCentresForEdition (void)
{
Frm_StartForm (ActChgCtrSta);
Ctr_PutParamOtherCtrCod (Ctr->CtrCod);
fprintf (Gbl.F.Out,"<select name=\"Status\" class=\"INPUT_STATUS\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"Status\" class=\"INPUT_STATUS\"");
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
"<option value=\"%u\">%s</option>",
(unsigned) Ctr_GetStatusBitsFromStatusTxt (Ctr_STATUS_PENDING),
@ -2503,7 +2500,8 @@ static void Ctr_PutFormToCreateCentre (void)
/***** Place *****/
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select name=\"PlcCod\" class=\"PLC_SEL\">");
HTM_SELECT_Begin (false,
"name=\"PlcCod\" class=\"PLC_SEL\">");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Ctr_EditingCtr->PlcCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");

View File

@ -490,15 +490,15 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD:
ps2pdf source.ps destination.pdf
*/
#define Log_PLATFORM_VERSION "SWAD 19.52.1 (2019-11-05)"
#define Log_PLATFORM_VERSION "SWAD 19.53 (2019-11-05)"
#define CSS_FILE "swad19.47.css"
#define JS_FILE "swad19.39.js"
/*
// TODO: Hacer un nuevo rol en los TFG: tutor externo (profesor de áreas no vinculadas con el centro, profesionales de empresas, etc.)
// 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: Replace <select... by HTML_SELECT_Begin ()
Version 19.53: Nov 05, 2019 Code refactoring in HTML selects. (246011 lines)
Version 19.52.1: Nov 05, 2019 Code refactoring in HTML selects. (245967 lines)
Version 19.52: Nov 05, 2019 Code refactoring in HTML selects. (245959 lines)
Version 19.51.25: Nov 05, 2019 Fixed bug in file browser. (245909 lines)

View File

@ -1232,9 +1232,8 @@ void Cty_WriteSelectorOfCountry (void)
/***** Begin form *****/
Frm_StartFormGoTo (ActSeeIns);
fprintf (Gbl.F.Out,"<select id=\"cty\" name=\"cty\" class=\"HIE_SEL\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"cty\" name=\"cty\" class=\"HIE_SEL\"");
fprintf (Gbl.F.Out,"<option value=\"\"");
if (Gbl.Hierarchy.Cty.CtyCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");

View File

@ -253,10 +253,9 @@ static void Crs_Configuration (bool PrintView)
/* Put form to select degree */
Frm_StartForm (ActChgCrsDegCfg);
fprintf (Gbl.F.Out,"<select id=\"OthDegCod\" name=\"OthDegCod\""
" class=\"INPUT_SHORT_NAME\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthDegCod\" name=\"OthDegCod\""
" class=\"INPUT_SHORT_NAME\"");
for (NumDeg = 0;
NumDeg < Gbl.Hierarchy.Ctr.Degs.Num;
NumDeg++)
@ -344,9 +343,8 @@ static void Crs_Configuration (bool PrintView)
if (IsForm)
{
Frm_StartForm (ActChgCrsYeaCfg);
fprintf (Gbl.F.Out,"<select id=\"OthCrsYear\" name=\"OthCrsYear\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthCrsYear\" name=\"OthCrsYear\"");
for (Year = 0;
Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++)
@ -886,13 +884,13 @@ void Crs_WriteSelectorOfCourse (void)
/***** Begin form *****/
Frm_StartFormGoTo (ActSeeCrsInf);
fprintf (Gbl.F.Out,"<select id=\"crs\" name=\"crs\" class=\"HIE_SEL\"");
if (Gbl.Hierarchy.Deg.DegCod > 0)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"crs\" name=\"crs\" class=\"HIE_SEL\"");
else
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"crs\" name=\"crs\" class=\"HIE_SEL\""
" disabled=\"disabled\"");
fprintf (Gbl.F.Out,"<option value=\"\"");
if (Gbl.Hierarchy.Crs.CrsCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1059,9 +1057,8 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void)
ActReqSch);
/***** Start selector of courses *****/
fprintf (Gbl.F.Out,"<select id=\"my_courses\" name=\"crs\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"my_courses\" name=\"crs\"");
/***** Write an option when no course selected *****/
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
@ -1483,9 +1480,8 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
{
Frm_StartForm (ActChgCrsYea);
Crs_PutParamOtherCrsCod (Crs->CrsCod);
fprintf (Gbl.F.Out,"<select name=\"OthCrsYear\" class=\"HIE_SEL_NARROW\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"OthCrsYear\" class=\"HIE_SEL_NARROW\"");
for (YearAux = 0;
YearAux <= Deg_MAX_YEARS_PER_DEGREE;
YearAux++) // All the years are permitted because it's possible to move this course to another degree (with other active years)
@ -1555,9 +1551,8 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
{
Frm_StartForm (ActChgCrsSta);
Crs_PutParamOtherCrsCod (Crs->CrsCod);
fprintf (Gbl.F.Out,"<select name=\"Status\" class=\"INPUT_STATUS\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"Status\" class=\"INPUT_STATUS\"");
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
"<option value=\"%u\">%s</option>",
(unsigned) Crs_GetStatusBitsFromStatusTxt (Crs_STATUS_PENDING),
@ -1677,7 +1672,8 @@ static void Crs_PutFormToCreateCourse (void)
/***** Year *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"OthCrsYear\" class=\"HIE_SEL_NARROW\">");
HTM_SELECT_Begin (false,
"name=\"OthCrsYear\" class=\"HIE_SEL_NARROW\"");
for (Year = 0;
Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++)
@ -3291,7 +3287,8 @@ void Crs_AskRemoveOldCrss (void)
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s&nbsp;",
Txt_Eliminate_all_courses_whithout_users_PART_1_OF_2);
fprintf (Gbl.F.Out,"<select name=\"Months\">");
HTM_SELECT_Begin (false,
"name=\"Months\"");
for (i = Crs_MIN_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS;
i <= Crs_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS;
i++)

View File

@ -562,15 +562,22 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
/***** Year *****/
HTM_TD_Begin ("class=\"RM\"");
fprintf (Gbl.F.Out,"<select id=\"%sYear\" name=\"%sYear\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (false,
"id=\"%sYear\" name=\"%sYear\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,ParamName,Id,Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sYear\" name=\"%sYear\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id,Id);
for (Year = FirstYear;
Year <= LastYear;
Year++)
@ -581,15 +588,22 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
/***** Month *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select id=\"%sMonth\" name=\"%sMonth\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (false,
"id=\"%sMonth\" name=\"%sMonth\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,ParamName,Id,Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sMonth\" name=\"%sMonth\""
" onchange=\""
"adjustDateForm('%s');"
"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id,Id);
for (Month = 1;
Month <= 12;
Month++)
@ -600,13 +614,18 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
/***** Day *****/
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select id=\"%sDay\" name=\"%sDay\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (false,
"id=\"%sDay\" name=\"%sDay\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,ParamName,Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sDay\" name=\"%sDay\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
for (Day = 1;
Day <= 31;
Day++)
@ -617,13 +636,18 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
/***** Hour *****/
HTM_TD_Begin ("class=\"RM\"");
fprintf (Gbl.F.Out,"<select id=\"%sHour\" name=\"%sHour\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (false,
"id=\"%sHour\" name=\"%sHour\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,ParamName,Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sHour\" name=\"%sHour\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
for (Hour = 0;
Hour <= 23;
Hour++)
@ -634,13 +658,18 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
/***** Minute *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select id=\"%sMinute\" name=\"%sMinute\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (false,
"id=\"%sMinute\" name=\"%sMinute\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,ParamName,Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sMinute\" name=\"%sMinute\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
for (Minute = 0;
Minute < 60;
@ -655,13 +684,18 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
if (FormSeconds == Dat_FORM_SECONDS_ON)
{
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select id=\"%sSecond\" name=\"%sSecond\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (false,
"id=\"%sSecond\" name=\"%sSecond\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,ParamName,Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sSecond\" name=\"%sSecond\""
" onchange=\"setUTCFromLocalDateTimeForm('%s');",
Id,ParamName,Id);
for (Second = 0;
Second <= 59;
Second++)
@ -826,16 +860,22 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
/***** Year *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select id=\"%sYear\" name=\"%sYear\""
" onchange=\"adjustDateForm('%s');",
Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"%sYear\" name=\"%sYear\"%s"
" onchange=\"adjustDateForm('%s');",
"document.getElementById('%s').submit();return false;",
Id,Id,
Disabled ? " disabled=\"disabled\"" : "",
Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sYear\" name=\"%sYear\"%s"
" onchange=\"adjustDateForm('%s');",
Id,Id,
Disabled ? " disabled=\"disabled\"" : "",
Id);
fprintf (Gbl.F.Out,"<option value=\"0\">-</option>");
for (Year = FirstYear;
Year <= LastYear;
@ -851,16 +891,22 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
/***** Month *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select id=\"%sMonth\" name=\"%sMonth\""
" onchange=\"adjustDateForm('%s');",
Id,Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out,"document.getElementById('%s').submit();return false;",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\"");
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"%sMonth\" name=\"%sMonth\"%s"
" onchange=\"adjustDateForm('%s');"
"document.getElementById('%s').submit();return false;",
Id,Id,
Disabled ? " disabled=\"disabled\"" : "",
Id,
Gbl.Form.Id);
else
HTM_SELECT_Begin (false,
"id=\"%sMonth\" name=\"%sMonth\"%s"
" onchange=\"adjustDateForm('%s');",
Id,Id,
Disabled ? " disabled=\"disabled\"" : "",
Id);
fprintf (Gbl.F.Out,"<option value=\"0\">-</option>");
for (Month = 1;
Month <= 12;
@ -876,13 +922,10 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
/***** Day *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select id=\"%sDay\" name=\"%sDay\"",Id,Id);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
if (Disabled)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (SubmitFormOnChange,
"id=\"%sDay\" name=\"%sDay\"%s",
Id,Id,
Disabled ? " disabled=\"disabled\"" : "");
fprintf (Gbl.F.Out,"<option value=\"0\">-</option>");
NumDaysSelectedMonth = (DateSelected->Month == 0) ? 31 :
((DateSelected->Month == 2) ? Dat_GetNumDaysFebruary (DateSelected->Year) :

View File

@ -357,10 +357,9 @@ static void Deg_Configuration (bool PrintView)
/* Put form to select centre */
Frm_StartForm (ActChgDegCtrCfg);
fprintf (Gbl.F.Out,"<select id=\"OthCtrCod\" name=\"OthCtrCod\""
" class=\"INPUT_SHORT_NAME\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthCtrCod\" name=\"OthCtrCod\""
" class=\"INPUT_SHORT_NAME\"");
for (NumCtr = 0;
NumCtr < Gbl.Hierarchy.Ins.Ctrs.Num;
NumCtr++)
@ -596,13 +595,13 @@ void Deg_WriteSelectorOfDegree (void)
/***** Begin form *****/
Frm_StartFormGoTo (ActSeeCrs);
fprintf (Gbl.F.Out,"<select id=\"deg\" name=\"deg\" class=\"HIE_SEL\"");
if (Gbl.Hierarchy.Ctr.CtrCod > 0)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"deg\" name=\"deg\" class=\"HIE_SEL\"");
else
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"deg\" name=\"deg\" class=\"HIE_SEL\""
" disabled=\"disabled\"");
fprintf (Gbl.F.Out,"<option value=\"\"");
if (Gbl.Hierarchy.Deg.DegCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -769,9 +768,8 @@ static void Deg_ListDegreesForEdition (void)
{
Frm_StartForm (ActChgDegTyp);
Deg_PutParamOtherDegCod (Deg->DegCod);
fprintf (Gbl.F.Out,"<select name=\"OthDegTypCod\" class=\"HIE_SEL_NARROW\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"OthDegTypCod\" class=\"HIE_SEL_NARROW\"");
for (NumDegTyp = 0;
NumDegTyp < Gbl.DegTypes.Num;
NumDegTyp++)
@ -837,9 +835,8 @@ static void Deg_ListDegreesForEdition (void)
{
Frm_StartForm (ActChgDegSta);
Deg_PutParamOtherDegCod (Deg->DegCod);
fprintf (Gbl.F.Out,"<select name=\"Status\" class=\"INPUT_STATUS\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"Status\" class=\"INPUT_STATUS\"");
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
"<option value=\"%u\">%s</option>",
(unsigned) Deg_GetStatusBitsFromStatusTxt (Deg_STATUS_PENDING),
@ -970,7 +967,8 @@ static void Deg_PutFormToCreateDegree (void)
/***** Degree type *****/
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select name=\"OthDegTypCod\" class=\"HIE_SEL_NARROW\">");
HTM_SELECT_Begin (false,
"name=\"OthDegTypCod\" class=\"HIE_SEL_NARROW\"");
for (NumDegTyp = 0;
NumDegTyp < Gbl.DegTypes.Num;
NumDegTyp++)

View File

@ -110,9 +110,8 @@ void DT_WriteSelectorDegreeTypes (void)
DT_GetListDegreeTypes (Hie_SYS,DT_ORDER_BY_DEGREE_TYPE);
/* List degree types */
fprintf (Gbl.F.Out,"<select id=\"OthDegTypCod\" name=\"OthDegTypCod\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthDegTypCod\" name=\"OthDegTypCod\"");
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (Gbl.Stat.DegTypCod == -1L)

View File

@ -539,9 +539,8 @@ static void Dpt_ListDepartmentsForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartForm (ActChgDptIns);
Dpt_PutParamDptCod (Dpt->DptCod);
fprintf (Gbl.F.Out,"<select name=\"OthInsCod\" class=\"HIE_SEL_NARROW\""
"onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"OthInsCod\" class=\"HIE_SEL_NARROW\"");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Dpt->InsCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -918,7 +917,8 @@ static void Dpt_PutFormToCreateDepartment (void)
/***** Institution *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"OthInsCod\" class=\"HIE_SEL_NARROW\">");
HTM_SELECT_Begin (false,
"name=\"OthInsCod\" class=\"HIE_SEL_NARROW\"");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Dpt_EditingDpt->InsCod == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1104,14 +1104,9 @@ void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
/***** Selector to select department *****/
/* Start selector */
fprintf (Gbl.F.Out,"<select id=\"%s\" name=\"%s\""
" class=\"%s\"",
Dpt_PARAM_DPT_COD_NAME,Dpt_PARAM_DPT_COD_NAME,
SelectClass);
if (SubmitFormOnChange)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
fprintf (Gbl.F.Out,"\">");
HTM_SELECT_Begin (SubmitFormOnChange,
"id=\"%s\" name=\"%s\" class=\"%s\"",
Dpt_PARAM_DPT_COD_NAME,Dpt_PARAM_DPT_COD_NAME,SelectClass);
if (FirstOption <= 0)
{

View File

@ -805,7 +805,8 @@ void Enr_AskRemoveOldUsrs (void)
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s&nbsp;",
Txt_Eliminate_all_users_who_are_not_enroled_on_any_courses_PART_1_OF_2);
fprintf (Gbl.F.Out,"<select name=\"Months\">");
HTM_SELECT_Begin (false,
"name=\"Months\"");
for (Months = Usr_MIN_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS;
Months <= Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS;
Months++)

View File

@ -1119,7 +1119,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
{
fprintf (Gbl.F.Out,"<select id=\"Year\" name=\"Year\">");
HTM_SELECT_Begin (false,
"id=\"Year\" name=\"Year\"");
for (Year = 0;
Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++)
@ -1197,7 +1198,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
{
fprintf (Gbl.F.Out,"<select name=\"ExamHour\">");
HTM_SELECT_Begin (false,
"name=\"ExamHour\"");
fprintf (Gbl.F.Out,"<option value=\"0\"");
if (Gbl.ExamAnns.ExaDat.StartTime.Hour == 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1213,7 +1215,9 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
Hour,Txt_hours_ABBREVIATION);
}
HTM_SELECT_End ();
fprintf (Gbl.F.Out,"<select name=\"ExamMinute\">");
HTM_SELECT_Begin (false,
"name=\"ExamMinute\">");
for (Minute = 0;
Minute <= 59;
Minute++)
@ -1243,7 +1247,8 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
HTM_TD_Begin ("class=\"%s LT\"",StyleNormal);
if (TypeViewExamAnnouncement == Exa_FORM_VIEW)
{
fprintf (Gbl.F.Out,"<select name=\"DurationHour\">");
HTM_SELECT_Begin (false,
"name=\"DurationHour\">");
for (Hour = 0;
Hour <= 8;
Hour++)
@ -1255,7 +1260,9 @@ static void Exa_ShowExamAnnouncement (long ExaCod,
Hour,Txt_hours_ABBREVIATION);
}
HTM_SELECT_End ();
fprintf (Gbl.F.Out,"<select name=\"DurationMinute\">");
HTM_SELECT_Begin (false,
"name=\"DurationMinute\">");
for (Minute = 0;
Minute <= 59;
Minute++)

View File

@ -222,7 +222,8 @@ void Fig_ReqShowFigures (void)
/***** Type of statistic *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_Statistic);
fprintf (Gbl.F.Out,"<select name=\"FigureType\">");
HTM_SELECT_Begin (false,
"name=\"FigureType\"");
for (FigureType = (Fig_FigureType_t) 0;
FigureType < Fig_NUM_FIGURES;
FigureType++)

View File

@ -9575,7 +9575,8 @@ void Brw_ShowFileMetadata (void)
HTM_TD_Begin ("class=\"DAT LM\"");
if (ICanChangePublic) // I can change file to public
{
fprintf (Gbl.F.Out,"<select id=\"PublicFile\" name=\"PublicFile\">");
HTM_SELECT_Begin (false,
"id=\"PublicFile\" name=\"PublicFile\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!FileMetadata.IsPublic)
@ -9610,8 +9611,8 @@ void Brw_ShowFileMetadata (void)
HTM_TD_Begin ("class=\"DAT LM\"");
if (ICanEdit) // I can edit file properties
{
fprintf (Gbl.F.Out,"<select id=\"License\" name=\"License\">");
HTM_SELECT_Begin (false,
"id=\"License\" name=\"License\">");
for (License = 0;
License < Brw_NUM_LICENSES;
License++)
@ -12134,7 +12135,8 @@ void Brw_AskRemoveOldFiles (void)
/***** Form to request number of months (to remove files older) *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s&nbsp;",Txt_Remove_files_older_than_PART_1_OF_2);
fprintf (Gbl.F.Out,"<select name=\"Months\">");
HTM_SELECT_Begin (false,
"name=\"Months\"");
for (Months = Brw_MIN_MONTHS_TO_REMOVE_OLD_FILES;
Months <= Brw_MAX_MONTHS_IN_BRIEFCASE;
Months++)

View File

@ -1323,10 +1323,9 @@ static void Grp_ListGroupTypesForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartFormAnchor (ActChgMdtGrpTyp,Grp_GROUP_TYPES_SECTION_ID);
Grp_PutParamGrpTypCod (Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
fprintf (Gbl.F.Out,"<select name=\"MandatoryEnrolment\""
" style=\"width:150px;\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"MandatoryEnrolment\""
" style=\"width:150px;\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MandatoryEnrolment)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1345,10 +1344,9 @@ static void Grp_ListGroupTypesForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartFormAnchor (ActChgMulGrpTyp,Grp_GROUP_TYPES_SECTION_ID);
Grp_PutParamGrpTypCod (Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod);
fprintf (Gbl.F.Out,"<select name=\"MultipleEnrolment\""
" style=\"width:150px;\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"MultipleEnrolment\""
" style=\"width:150px;\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MultipleEnrolment)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1548,9 +1546,8 @@ static void Grp_ListGroupsForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartFormAnchor (ActChgGrpTyp,Grp_GROUPS_SECTION_ID);
Grp_PutParamGrpCod (Grp->GrpCod);
fprintf (Gbl.F.Out,"<select name=\"GrpTypCod\" style=\"width:100px;\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"GrpTypCod\" style=\"width:100px;\"");
/* Options for group types */
for (NumTipGrpAux = 0;
@ -1583,9 +1580,8 @@ static void Grp_ListGroupsForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartFormAnchor (ActChgGrpCla,Grp_GROUPS_SECTION_ID);
Grp_PutParamGrpCod (Grp->GrpCod);
fprintf (Gbl.F.Out,"<select name=\"ClaCod\" style=\"width:100px;\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"ClaCod\" style=\"width:100px;\"");
/* Option for no assigned classroom */
fprintf (Gbl.F.Out,"<option value=\"-1\"");
@ -2504,8 +2500,8 @@ static void Grp_PutFormToCreateGroupType (void)
/***** Is it mandatory to register in any groups of this type? *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"MandatoryEnrolment\""
" style=\"width:150px;\">");
HTM_SELECT_Begin (false,
"name=\"MandatoryEnrolment\" style=\"width:150px;\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!Gbl.Crs.Grps.GrpTyp.MandatoryEnrolment)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -2521,8 +2517,8 @@ static void Grp_PutFormToCreateGroupType (void)
/***** Is it possible to register in multiple groups of this type? *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"MultipleEnrolment\""
" style=\"width:150px;\">");
HTM_SELECT_Begin (false,
"name=\"MultipleEnrolment\" style=\"width:150px;\"");
fprintf (Gbl.F.Out,"<option value=\"N\"");
if (!Gbl.Crs.Grps.GrpTyp.MultipleEnrolment)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -2626,7 +2622,8 @@ static void Grp_PutFormToCreateGroup (void)
/***** Group type *****/
/* Start selector */
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"GrpTypCod\" style=\"width:100px;\">");
HTM_SELECT_Begin (false,
"name=\"GrpTypCod\" style=\"width:100px;\"");
/* Options for group types */
for (NumGrpTyp = 0;
@ -2655,7 +2652,8 @@ static void Grp_PutFormToCreateGroup (void)
/***** Classroom *****/
/* Start selector */
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"ClaCod\" style=\"width:100px;\">");
HTM_SELECT_Begin (false,
"name=\"ClaCod\" style=\"width:100px;\"");
/* Option for no assigned classroom */
fprintf (Gbl.F.Out,"<option value=\"-1\"");

View File

@ -585,9 +585,8 @@ static void Hld_ListHolidaysForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartForm (ActChgHldPlc);
Hld_PutParamHldCod (Hld->HldCod);
fprintf (Gbl.F.Out,"<select name=\"PlcCod\" class=\"PLC_COD\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"PlcCod\" class=\"PLC_COD\"");
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (Hld->PlcCod <= 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -608,9 +607,8 @@ static void Hld_ListHolidaysForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartForm (ActChgHldTyp);
Hld_PutParamHldCod (Hld->HldCod);
fprintf (Gbl.F.Out,"<select name=\"HldTyp\" style=\"width:62px;\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"HldTyp\" style=\"width:62px;\"");
for (HolidayType = (Hld_HolidayType_t) 0;
HolidayType < Hld_NUM_TYPES_HOLIDAY;
HolidayType++)
@ -986,7 +984,8 @@ static void Hld_PutFormToCreateHoliday (void)
/***** Holiday place *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"PlcCod\" class=\"PLC_COD\">");
HTM_SELECT_Begin (false,
"name=\"PlcCod\" class=\"PLC_COD\"");
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (Hld_EditingHld->PlcCod <= 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1004,7 +1003,8 @@ static void Hld_PutFormToCreateHoliday (void)
/***** Holiday type *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"HldTyp\" style=\"width:62px;\">");
HTM_SELECT_Begin (false,
"name=\"HldTyp\" style=\"width:62px;\"");
for (HolidayType = (Hld_HolidayType_t) 0;
HolidayType < Hld_NUM_TYPES_HOLIDAY;
HolidayType++)

View File

@ -369,10 +369,9 @@ static void Ins_Configuration (bool PrintView)
/* Put form to select country */
Frm_StartForm (ActChgInsCtyCfg);
fprintf (Gbl.F.Out,"<select id=\"OthCtyCod\" name=\"OthCtyCod\""
" class=\"INPUT_SHORT_NAME\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthCtyCod\" name=\"OthCtyCod\""
" class=\"INPUT_SHORT_NAME\"");
for (NumCty = 0;
NumCty < Gbl.Hierarchy.Sys.Ctys.Num;
NumCty++)
@ -1371,13 +1370,13 @@ void Ins_WriteSelectorOfInstitution (void)
/***** Begin form *****/
Frm_StartFormGoTo (ActSeeCtr);
fprintf (Gbl.F.Out,"<select id=\"ins\" name=\"ins\" class=\"HIE_SEL\"");
if (Gbl.Hierarchy.Cty.CtyCod > 0)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"ins\" name=\"ins\" class=\"HIE_SEL\"");
else
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"ins\" name=\"ins\" class=\"HIE_SEL\""
" disabled=\"disabled\"");
fprintf (Gbl.F.Out,"<option value=\"\"");
if (Gbl.Hierarchy.Ins.InsCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1563,9 +1562,8 @@ static void Ins_ListInstitutionsForEdition (void)
{
Frm_StartForm (ActChgInsSta);
Ins_PutParamOtherInsCod (Ins->InsCod);
fprintf (Gbl.F.Out,"<select name=\"Status\" class=\"INPUT_STATUS\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"Status\" class=\"INPUT_STATUS\"");
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\">%s</option>"
"<option value=\"%u\">%s</option>",
(unsigned) Ins_GetStatusBitsFromStatusTxt (Ins_STATUS_PENDING),

View File

@ -116,10 +116,8 @@ void Lan_PutSelectorToSelectLanguage (void)
Lan_Language_t Lan;
Frm_StartForm (ActReqChgLan);
fprintf (Gbl.F.Out,"<select name=\"Lan\""
" style=\"width:112px; margin:0;\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"Lan\" style=\"width:112px; margin:0;\"");
for (Lan = (Lan_Language_t) 1;
Lan <= Lan_NUM_LANGUAGES;
Lan++)

View File

@ -2616,7 +2616,8 @@ void Msg_ShowFormSelectCourseSentOrRecMsgs (void)
/***** Course selection *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s&nbsp;",TxtSelector[Gbl.Msg.TypeOfMessages]);
fprintf (Gbl.F.Out,"<select name=\"FilterCrsCod\">");
HTM_SELECT_Begin (false,
"name=\"FilterCrsCod\"");
fprintf (Gbl.F.Out,"<option value=\"\"");
if (Gbl.Msg.FilterCrsCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");

View File

@ -1797,9 +1797,8 @@ static void Pho_PutSelectorForTypeOfAvg (void)
Pho_PutHiddenParamPhotoSize ();
Pho_PutHiddenParamOrderDegrees ();
Usr_PutParamsPrefsAboutUsrList ();
fprintf (Gbl.F.Out,"<select id=\"AvgType\" name=\"AvgType\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"AvgType\" name=\"AvgType\"");
for (TypeOfAvg = (Pho_AvgPhotoTypeOfAverage_t) 0;
TypeOfAvg < Pho_NUM_AVERAGE_PHOTO_TYPES;
TypeOfAvg++)
@ -1862,9 +1861,8 @@ static void Pho_PutSelectorForHowComputePhotoSize (void)
Pho_PutHiddenParamTypeOfAvg ();
Pho_PutHiddenParamOrderDegrees ();
Usr_PutParamsPrefsAboutUsrList ();
fprintf (Gbl.F.Out,"<select id=\"PhotoSize\" name=\"PhotoSize\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"PhotoSize\" name=\"PhotoSize\"");
for (PhoSi = (Pho_HowComputePhotoSize_t) 0;
PhoSi < Pho_NUM_HOW_COMPUTE_PHOTO_SIZES;
PhoSi++)
@ -1927,9 +1925,8 @@ static void Pho_PutSelectorForHowOrderDegrees (void)
Pho_PutHiddenParamTypeOfAvg ();
Pho_PutHiddenParamPhotoSize ();
Usr_PutParamsPrefsAboutUsrList ();
fprintf (Gbl.F.Out,"<select id=\"Order\" name=\"Order\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"Order\" name=\"Order\"");
for (Order = (Pho_HowOrderDegrees_t) 0;
Order < Pho_NUM_HOW_ORDER_DEGREES;
Order++)
@ -2025,7 +2022,8 @@ static void Pho_PutLinkToCalculateDegreeStats (void)
Frm_LinkFormEnd ();
/* Selector with all the degrees with students */
fprintf (Gbl.F.Out,"<select name=\"OthDegCod\">");
HTM_SELECT_Begin (false,
"name=\"OthDegCod\"");
for (NumDeg = 0;
NumDeg < Degs.Num;
NumDeg++)

View File

@ -3341,7 +3341,8 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject)
HTM_TD_End ();
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select name=\"Assigned\">");
HTM_SELECT_Begin (false,
"name=\"Assigned\"");
fprintf (Gbl.F.Out,"<option value=\"Y\"");
if (Prj->Assigned == Prj_ASSIGNED)
@ -3379,7 +3380,8 @@ static void Prj_PutFormProject (struct Project *Prj,bool ItsANewProject)
HTM_TD_End ();
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select name=\"Proposal\">");
HTM_SELECT_Begin (false,
"name=\"Proposal\"");
for (Proposal = (Prj_Proposal_t) 0;
Proposal <= (Prj_Proposal_t) (Prj_NUM_PROPOSAL_TYPES - 1);
Proposal++)

View File

@ -332,9 +332,8 @@ void Rec_ListFieldsRecordsForEdition (void)
HTM_TD_Begin ("class=\"CM\"");
Frm_StartForm (ActChgVisFie);
Par_PutHiddenParamLong (NULL,"FieldCod",Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod);
fprintf (Gbl.F.Out,"<select name=\"Visibility\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"Visibility\"");
for (Vis = (Rec_VisibilityRecordFields_t) 0;
Vis < (Rec_VisibilityRecordFields_t) Rec_NUM_TYPES_VISIBILITY;
Vis++)
@ -398,7 +397,8 @@ void Rec_ShowFormCreateRecordField (void)
/***** Visibility to students *****/
HTM_TD_Begin ("class=\"CM\"");
fprintf (Gbl.F.Out,"<select name=\"Visibility\">");
HTM_SELECT_Begin (false,
"name=\"Visibility\"");
for (Vis = (Rec_VisibilityRecordFields_t) 0;
Vis < (Rec_VisibilityRecordFields_t) Rec_NUM_TYPES_VISIBILITY;
Vis++)
@ -409,7 +409,6 @@ void Rec_ShowFormCreateRecordField (void)
fprintf (Gbl.F.Out,">%s</option>",
Txt_RECORD_FIELD_VISIBILITY_MENU[Vis]);
}
HTM_SELECT_End ();
HTM_TD_End ();
@ -1494,7 +1493,9 @@ static void Rec_ShowLinkToPrintPreviewOfRecords (void)
Txt_Print);
Frm_LinkFormEnd ();
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"(<select name=\"RecsPerPag\">");
fprintf (Gbl.F.Out,"(");
HTM_SELECT_Begin (false,
"name=\"RecsPerPag\"");
for (i = Rec_MIN_RECORDS_PER_PAGE;
i <= Rec_MAX_RECORDS_PER_PAGE;
i++)
@ -2931,7 +2932,8 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
DefaultRoleInForm = Rol_STD; // Request sign up as a student
/***** Selector of role *****/
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\">");
HTM_SELECT_Begin (false,
"id=\"Role\" name=\"Role\"");
for (Role = Rol_STD;
Role <= Rol_TCH;
Role++)
@ -2992,7 +2994,8 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
}
/***** Selector of role *****/
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\">");
HTM_SELECT_Begin (false,
"id=\"Role\" name=\"Role\"");
switch (Gbl.Usrs.Me.Role.Logged)
{
case Rol_GST:
@ -3036,7 +3039,8 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
Rol_GST; // If user don't belong to any course
/***** Selector of role *****/
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\">");
HTM_SELECT_Begin (false,
"id=\"Role\" name=\"Role\"");
fprintf (Gbl.F.Out,"<option value=\"%u\" selected=\"selected\""
" disabled=\"disabled\">%s</option>",
(unsigned) DefaultRoleInForm,
@ -3071,7 +3075,8 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
}
/***** Selector of role *****/
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\">");
HTM_SELECT_Begin (false,
"id=\"Role\" name=\"Role\"");
for (Role = Rol_STD;
Role <= Rol_TCH;
Role++)
@ -3092,7 +3097,8 @@ static void Rec_ShowRole (struct UsrData *UsrDat,
{
case Rol_SYS_ADM:
/***** Selector of role *****/
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\">");
HTM_SELECT_Begin (false,
"id=\"Role\" name=\"Role\"");
fprintf (Gbl.F.Out,"<option value=\"%u\""
" selected=\"selected\">%s</option>",
(unsigned) Rol_GST,Txt_ROLES_SINGUL_Abc[Rol_GST][Usr_SEX_UNKNOWN]);
@ -3279,8 +3285,9 @@ static void Rec_ShowCountry (struct UsrData *UsrDat,
HTM_TD_Begin ("colspan=\"2\" class=\"REC_C2_BOT LM\"");
/***** Selector of country *****/
fprintf (Gbl.F.Out,"<select id=\"OthCtyCod\" name=\"OthCtyCod\""
" class=\"REC_C2_BOT_INPUT\" required=\"required\">");
HTM_SELECT_Begin (false,
"id=\"OthCtyCod\" name=\"OthCtyCod\""
" class=\"REC_C2_BOT_INPUT\" required=\"required\"");
fprintf (Gbl.F.Out,"<option value=\"\">%s</option>"
"<option value=\"0\"",
Txt_Country);
@ -4017,10 +4024,9 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
/* Begin form to select the country of my institution */
Frm_StartFormAnchor (ActChgCtyMyIns,Rec_MY_INS_CTR_DPT_ID);
fprintf (Gbl.F.Out,"<select id=\"OthCtyCod\" name=\"OthCtyCod\""
" class=\"REC_C2_BOT_INPUT\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthCtyCod\" name=\"OthCtyCod\""
" class=\"REC_C2_BOT_INPUT\"");
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (Gbl.Usrs.Me.UsrDat.InsCtyCod <= 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -4060,10 +4066,9 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
/* Begin form to select institution */
Frm_StartFormAnchor (ActChgMyIns,Rec_MY_INS_CTR_DPT_ID);
fprintf (Gbl.F.Out,"<select id=\"OthInsCod\" name=\"OthInsCod\""
" class=\"REC_C2_BOT_INPUT\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthInsCod\" name=\"OthInsCod\""
" class=\"REC_C2_BOT_INPUT\"");
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (Gbl.Usrs.Me.UsrDat.InsCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");
@ -4110,10 +4115,9 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
/* Begin form to select centre */
Frm_StartFormAnchor (ActChgMyCtr,Rec_MY_INS_CTR_DPT_ID);
fprintf (Gbl.F.Out,"<select id=\"OthCtrCod\" name=\"OthCtrCod\""
" class=\"REC_C2_BOT_INPUT\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"OthCtrCod\" name=\"OthCtrCod\""
" class=\"REC_C2_BOT_INPUT\"");
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0)
fprintf (Gbl.F.Out," selected=\"selected\"");

View File

@ -471,14 +471,21 @@ void Rol_PutFormToChangeMyRole (const char *ClassSelect)
{
extern const char *Txt_ROLES_SINGUL_Abc[Rol_NUM_ROLES][Usr_NUM_SEXS];
Rol_Role_t Role;
bool PutClassSelect;
Frm_StartForm (ActChgMyRol);
fprintf (Gbl.F.Out,"<select name=\"MyRole\"");
HTM_SELECT_Begin (true,
"name=\"MyRole\"%s");
PutClassSelect = false;
if (ClassSelect)
if (ClassSelect[0])
fprintf (Gbl.F.Out," class=\"%s\"",ClassSelect);
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
PutClassSelect = true;
if (PutClassSelect)
HTM_SELECT_Begin (true,
"name=\"MyRole\" class=\"%s\"",ClassSelect);
else
HTM_SELECT_Begin (true,
"name=\"MyRole\"");
for (Role = Rol_GST;
Role < Rol_NUM_ROLES;
Role++)

View File

@ -74,11 +74,8 @@ void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange)
Hie_Level_t Scope;
bool WriteScope;
fprintf (Gbl.F.Out,"<select id=\"%s\" name=\"%s\"",ParamName,ParamName);
if (SendOnChange)
fprintf (Gbl.F.Out," onchange=\"document.getElementById('%s').submit();return false;\"",
Gbl.Form.Id);
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (SendOnChange,
"id=\"%s\" name=\"%s\"",ParamName,ParamName);
for (Scope = (Hie_Level_t) 0;
Scope < Hie_NUM_LEVELS;

View File

@ -164,7 +164,8 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (Act_Action_t Action,Hie
/***** What to search? *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out," %s&nbsp;",Txt_SEARCH_X_in_Y);
fprintf (Gbl.F.Out,"<select name=\"WhatToSearch\" class=\"WHAT_TO_SEARCH\">");
HTM_SELECT_Begin (false,
"name=\"WhatToSearch\" class=\"WHAT_TO_SEARCH\"");
for (WhatToSearch = (Sch_WhatToSearch_t) 0;
WhatToSearch < Sch_NUM_WHAT_TO_SEARCH;
WhatToSearch++)

View File

@ -418,9 +418,9 @@ void Sta_AskShowCrsHits (void)
Sta_WriteSelectorCountType ();
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;"
"<select id=\"GroupedBy\" name=\"GroupedBy\">",
Txt_distributed_by);
fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;",Txt_distributed_by);
HTM_SELECT_Begin (false,
"id=\"GroupedBy\" name=\"GroupedBy\"");
for (ClicksGroupedBy = Sta_CLICKS_CRS_PER_USR;
ClicksGroupedBy <= Sta_CLICKS_CRS_PER_ACTION;
ClicksGroupedBy++)
@ -454,10 +454,9 @@ void Sta_AskShowCrsHits (void)
// To use getElementById in Firefox, it's necessary to have the id attribute
HTM_LABEL_Begin (NULL);
fprintf (Gbl.F.Out,"(%s: ",Txt_results_per_page);
fprintf (Gbl.F.Out,"<select id=\"RowsPage\" name=\"RowsPage\"");
if (Gbl.Stat.ClicksGroupedBy != Sta_CLICKS_CRS_DETAILED_LIST)
fprintf (Gbl.F.Out," disabled=\"disabled\"");
fprintf (Gbl.F.Out,">");
HTM_SELECT_Begin (false,
"id=\"RowsPage\" name=\"RowsPage\"%s",
Gbl.Stat.ClicksGroupedBy == Sta_CLICKS_CRS_DETAILED_LIST ? "" : " disabled=\"disabled\"");
for (i = 0;
i < NUM_OPTIONS_ROWS_PER_PAGE;
i++)
@ -548,7 +547,8 @@ void Sta_AskShowGblHits (void)
HTM_TD_End ();
HTM_TD_Begin ("colspan=\"2\" class=\"LM\"");
fprintf (Gbl.F.Out,"<select id=\"Role\" name=\"Role\" class=\"STAT_SEL\">");
HTM_SELECT_Begin (false,
"id=\"Role\" name=\"Role\" class=\"STAT_SEL\"");
for (RoleStat = (Sta_Role_t) 0;
RoleStat < Sta_NUM_ROLES_STAT;
RoleStat++)
@ -609,7 +609,8 @@ void Sta_AskShowGblHits (void)
Gbl.Stat.ClicksGroupedBy > Sta_CLICKS_GBL_PER_COURSE)
Gbl.Stat.ClicksGroupedBy = Sta_CLICKS_GBL_PER_DAY;
fprintf (Gbl.F.Out,"<select name=\"GroupedBy\">");
HTM_SELECT_Begin (false,
"name=\"GroupedBy\"");
for (ClicksGroupedBy = Sta_CLICKS_GBL_PER_DAY;
ClicksGroupedBy <= Sta_CLICKS_GBL_PER_COURSE;
ClicksGroupedBy++)
@ -685,7 +686,8 @@ static void Sta_WriteSelectorCountType (void)
Sta_CountType_t StatCountType;
/**** Count type *****/
fprintf (Gbl.F.Out,"<select id=\"CountType\" name=\"CountType\">");
HTM_SELECT_Begin (false,
"id=\"CountType\" name=\"CountType\"");
for (StatCountType = (Sta_CountType_t) 0;
StatCountType < Sta_NUM_COUNT_TYPES;
StatCountType++)
@ -720,7 +722,8 @@ static void Sta_WriteSelectorAction (void)
HTM_TD_End ();
HTM_TD_Begin ("colspan=\"2\" class=\"LM\"");
fprintf (Gbl.F.Out,"<select id=\"StatAct\" name=\"StatAct\" class=\"STAT_SEL\">");
HTM_SELECT_Begin (false,
"id=\"StatAct\" name=\"StatAct\" class=\"STAT_SEL\"");
for (Action = (Act_Action_t) 0;
Action < Act_NUM_ACTIONS;
Action++)
@ -2078,9 +2081,8 @@ static void Sta_ShowDistrAccessesPerDayAndHour (unsigned long NumRows,MYSQL_RES
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s:&nbsp;",Txt_Color_of_the_graphic);
fprintf (Gbl.F.Out,"<select name=\"ColorType\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"ColorType\"");
for (ColorType = (Sta_ColorType_t) 0;
ColorType < Sta_NUM_COLOR_TYPES;
ColorType++)

View File

@ -3515,7 +3515,8 @@ static void Tst_WriteTFAnsViewTest (unsigned NumQst)
extern const char *Txt_TF_QST[2];
/***** Write selector for the answer *****/
fprintf (Gbl.F.Out,"<select name=\"Ans%06u\">",NumQst);
HTM_SELECT_Begin (false,
"name=\"Ans%06u\"",NumQst);
fprintf (Gbl.F.Out,"<option value=\"\" selected=\"selected\">&nbsp;</option>"
"<option value=\"T\">%s</option>"
"<option value=\"F\">%s</option>",
@ -5087,9 +5088,10 @@ static void Tst_PutFormEditOneQst (char Stem[Cns_MAX_BYTES_TEXT + 1],
/***** Write the tags already existing in a selector *****/
HTM_TD_Begin ("class=\"LM\"");
fprintf (Gbl.F.Out,"<select id=\"SelDesc%u\" name=\"SelDesc%u\""
" class=\"TAG_SEL\" onchange=\"changeTxtTag('%u')\">",
NumTag,NumTag,NumTag);
HTM_SELECT_Begin (false,
"id=\"SelDesc%u\" name=\"SelDesc%u\""
" class=\"TAG_SEL\" onchange=\"changeTxtTag('%u')\"",
NumTag,NumTag,NumTag);
fprintf (Gbl.F.Out,"<option value=\"\">&nbsp;</option>");
mysql_data_seek (mysql_res,0);
TagNotFound = true;

View File

@ -1596,9 +1596,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
Par_PutHiddenParamUnsigned (NULL,"TTCol",Column);
/***** Class type *****/
fprintf (Gbl.F.Out,"<select name=\"TTTyp\" class=\"TT_TYP\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"TTTyp\" class=\"TT_TYP\"");
for (CT = (TT_ClassType_t) 0;
CT < (TT_ClassType_t) TT_NUM_CLASS_TYPES;
CT++)
@ -1636,9 +1635,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
else
{
/***** Class duration *****/
fprintf (Gbl.F.Out,"<select name=\"TTDur\" class=\"TT_DUR\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"TTDur\" class=\"TT_DUR\"");
for (i = Interval + TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals;
i < Gbl.TimeTable.Config.IntervalsPerDay;
i++)
@ -1668,11 +1666,10 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
HTM_LABEL_Begin ("for=\"TTGrp%s\"",CellStr);
fprintf (Gbl.F.Out,"%s",Txt_Group);
HTM_LABEL_End ();
fprintf (Gbl.F.Out,"<select id=\"TTGrp%s\" name=\"TTGrp\""
" class=\"TT_GRP\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
CellStr,
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"id=\"TTGrp%s\" name=\"TTGrp\""
" class=\"TT_GRP\"",
CellStr);
fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (GrpCod <= 0)
fprintf (Gbl.F.Out," selected=\"selected\"");

View File

@ -8938,9 +8938,8 @@ void Usr_PutSelectorNumColsClassPhoto (void)
/***** Start selector *****/
HTM_LABEL_Begin ("class=\"%s\"",The_ClassFormInBox[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<select name=\"ColsClassPhoto\""
" onchange=\"document.getElementById('%s').submit();return false;\">",
Gbl.Form.Id);
HTM_SELECT_Begin (true,
"name=\"ColsClassPhoto\"");
/***** Put a row in selector for every number from 1 to Usr_CLASS_PHOTO_COLS_MAX *****/
for (Cols = 1;