Version 22.96: Apr 12, 2023 Changes in configuration of projects.

This commit is contained in:
acanas 2023-04-13 14:25:52 +02:00
parent b8c3daf585
commit 4733738aa4
46 changed files with 780 additions and 397 deletions

View File

@ -1206,7 +1206,10 @@ CREATE TABLE IF NOT EXISTS prg_resources (
-- --
CREATE TABLE IF NOT EXISTS prj_config ( CREATE TABLE IF NOT EXISTS prj_config (
CrsCod INT NOT NULL DEFAULT -1, CrsCod INT NOT NULL DEFAULT -1,
Editable ENUM('N','Y') NOT NULL DEFAULT 'Y', RubTutCod INT NOT NULL DEFAULT -1,
RubEvlCod INT NOT NULL DEFAULT -1,
RubGblCod INT NOT NULL DEFAULT -1,
NETCanCreate ENUM('N','Y') NOT NULL DEFAULT 'Y',
UNIQUE INDEX(CrsCod)); UNIQUE INDEX(CrsCod));
-- --
-- Table prj_projects: stores the projects proposed by the teachers to their students -- Table prj_projects: stores the projects proposed by the teachers to their students

View File

@ -1064,9 +1064,13 @@ void Att_ReqCreatOrEditEvent (void)
"id=\"ComTchVisible\" name=\"ComTchVisible\"" "id=\"ComTchVisible\" name=\"ComTchVisible\""
" class=\"INPUT_%s\"", " class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"N",!Events.Event.CommentTchVisible,false, HTM_OPTION (HTM_Type_STRING,"N",
!Events.Event.CommentTchVisible, // Selected?
false, // Not disabled
"%s",Txt_Hidden_MALE_PLURAL); "%s",Txt_Hidden_MALE_PLURAL);
HTM_OPTION (HTM_Type_STRING,"Y", Events.Event.CommentTchVisible,false, HTM_OPTION (HTM_Type_STRING,"Y",
Events.Event.CommentTchVisible, // Selected?
false, // Not disabled
"%s",Txt_Visible_MALE_PLURAL); "%s",Txt_Visible_MALE_PLURAL);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -7692,10 +7692,12 @@ void Brw_ShowFileMetadata (void)
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL,
"id=\"PublicFile\" name=\"PublicFile\" class=\"PUBLIC_FILE\""); "id=\"PublicFile\" name=\"PublicFile\" class=\"PUBLIC_FILE\"");
HTM_OPTION (HTM_Type_STRING,"N", HTM_OPTION (HTM_Type_STRING,"N",
!FileMetadata.IsPublic,false, !FileMetadata.IsPublic, // Selected?
false, // Not disabled
"%s",Txt_Private_available_to_certain_users_identified); "%s",Txt_Private_available_to_certain_users_identified);
HTM_OPTION (HTM_Type_STRING,"Y", HTM_OPTION (HTM_Type_STRING,"Y",
FileMetadata.IsPublic,false, FileMetadata.IsPublic, // Selected?
false, // Not disabled
"%s",Txt_Public_open_educational_resource_OER_for_everyone); "%s",Txt_Public_open_educational_resource_OER_for_everyone);
HTM_SELECT_End (); HTM_SELECT_End ();
} }
@ -7727,7 +7729,8 @@ void Brw_ShowFileMetadata (void)
{ {
LicenseUnsigned = (unsigned) License; LicenseUnsigned = (unsigned) License;
HTM_OPTION (HTM_Type_UNSIGNED,&LicenseUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&LicenseUnsigned,
License == FileMetadata.License,false, License == FileMetadata.License, // Selected?
false, // Not disabled
"%s",Txt_LICENSES[License]); "%s",Txt_LICENSES[License]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -9752,7 +9755,8 @@ void Brw_AskRemoveOldFiles (void)
Months <= Brw_MAX_MONTHS_IN_BRIEFCASE; Months <= Brw_MAX_MONTHS_IN_BRIEFCASE;
Months++) Months++)
HTM_OPTION (HTM_Type_UNSIGNED,&Months, HTM_OPTION (HTM_Type_UNSIGNED,&Months,
Months == Brw_DEF_MONTHS_TO_REMOVE_OLD_FILES,false, Months == Brw_DEF_MONTHS_TO_REMOVE_OLD_FILES, // Selected?
false, // Not disabled
"%u",Months); "%u",Months);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_NBSP (); HTM_NBSP ();

View File

@ -1054,7 +1054,8 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
Year <= Deg_MAX_YEARS_PER_DEGREE; Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++) Year++)
HTM_OPTION (HTM_Type_UNSIGNED,&Year, HTM_OPTION (HTM_Type_UNSIGNED,&Year,
CallsForExams->CallForExam.Year == Year,false, Year == CallsForExams->CallForExam.Year, // Selected
false, // Not disabled
"%s",Txt_YEAR_OF_DEGREE[Year]); "%s",Txt_YEAR_OF_DEGREE[Year]);
HTM_SELECT_End (); HTM_SELECT_End ();
} }
@ -1138,13 +1139,15 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
" class=\"INPUT_%s\"", " class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"0", HTM_OPTION (HTM_Type_STRING,"0",
CallsForExams->CallForExam.StartTime.Hour == 0,false, CallsForExams->CallForExam.StartTime.Hour == 0, // Selected?
false, // Not disabled
"-"); "-");
for (Hour = 7; for (Hour = 7;
Hour <= 22; Hour <= 22;
Hour++) Hour++)
HTM_OPTION (HTM_Type_UNSIGNED,&Hour, HTM_OPTION (HTM_Type_UNSIGNED,&Hour,
CallsForExams->CallForExam.StartTime.Hour == Hour,false, Hour == CallsForExams->CallForExam.StartTime.Hour, // Selected?
false, // Not disabled
"%02u %s",Hour,Txt_hours_ABBREVIATION); "%02u %s",Hour,Txt_hours_ABBREVIATION);
HTM_SELECT_End (); HTM_SELECT_End ();
@ -1155,7 +1158,8 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
Minute <= 59; Minute <= 59;
Minute++) Minute++)
HTM_OPTION (HTM_Type_UNSIGNED,&Minute, HTM_OPTION (HTM_Type_UNSIGNED,&Minute,
CallsForExams->CallForExam.StartTime.Minute == Minute,false, Minute == CallsForExams->CallForExam.StartTime.Minute, // Selected?
false, // Not disabled
"%02u &prime;",Minute); "%02u &prime;",Minute);
HTM_SELECT_End (); HTM_SELECT_End ();
} }
@ -1188,7 +1192,8 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
Hour <= 8; Hour <= 8;
Hour++) Hour++)
HTM_OPTION (HTM_Type_UNSIGNED,&Hour, HTM_OPTION (HTM_Type_UNSIGNED,&Hour,
CallsForExams->CallForExam.Duration.Hour == Hour,false, Hour == CallsForExams->CallForExam.Duration.Hour, // Selected?
false, // Not disabled
"%02u %s",Hour,Txt_hours_ABBREVIATION); "%02u %s",Hour,Txt_hours_ABBREVIATION);
HTM_SELECT_End (); HTM_SELECT_End ();
@ -1200,7 +1205,8 @@ static void Cfe_ShowCallForExam (struct Cfe_CallsForExams *CallsForExams,
Minute <= 59; Minute <= 59;
Minute++) Minute++)
HTM_OPTION (HTM_Type_UNSIGNED,&Minute, HTM_OPTION (HTM_Type_UNSIGNED,&Minute,
CallsForExams->CallForExam.Duration.Minute == Minute,false, Minute == CallsForExams->CallForExam.Duration.Minute, // Selected?
false, // Not disabled
"%02u &prime;",Minute); "%02u &prime;",Minute);
HTM_SELECT_End (); HTM_SELECT_End ();
} }

View File

@ -343,10 +343,6 @@ static void Ctr_ListOneCenterForSeeing (struct Ctr_Center *Ctr,unsigned NumCtr)
const char *TxtClassStrong; const char *TxtClassStrong;
const char *BgColor; const char *BgColor;
/***** Get data of place of this center *****/
Plc.PlcCod = Ctr->PlcCod;
Plc_GetPlaceDataByCod (&Plc);
if (Ctr->Status & Hie_STATUS_BIT_PENDING) if (Ctr->Status & Hie_STATUS_BIT_PENDING)
{ {
TxtClassNormal = TxtClassNormal =
@ -383,6 +379,8 @@ static void Ctr_ListOneCenterForSeeing (struct Ctr_Center *Ctr,unsigned NumCtr)
/***** Place *****/ /***** Place *****/
HTM_TD_Begin ("class=\"LM %s_%s %s\"", HTM_TD_Begin ("class=\"LM %s_%s %s\"",
TxtClassNormal,The_GetSuffix (),BgColor); TxtClassNormal,The_GetSuffix (),BgColor);
Plc.PlcCod = Ctr->PlcCod;
Plc_GetPlaceDataByCod (&Plc);
HTM_Txt (Plc.ShrtName); HTM_Txt (Plc.ShrtName);
HTM_TD_End (); HTM_TD_End ();
@ -706,7 +704,8 @@ void Ctr_WriteSelectorOfCenter (void)
" disabled=\"disabled\"", " disabled=\"disabled\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"", HTM_OPTION (HTM_Type_STRING,"",
Gbl.Hierarchy.Ctr.CtrCod < 0,true, Gbl.Hierarchy.Ctr.CtrCod < 0, // Selected?
true, // Disabled
"[%s]",Txt_Center); "[%s]",Txt_Center);
if (Gbl.Hierarchy.Ins.InsCod > 0) if (Gbl.Hierarchy.Ins.InsCod > 0)
@ -727,7 +726,8 @@ void Ctr_WriteSelectorOfCenter (void)
/* Write option */ /* Write option */
HTM_OPTION (HTM_Type_LONG,&CtrCod, HTM_OPTION (HTM_Type_LONG,&CtrCod,
Gbl.Hierarchy.Ctr.CtrCod > 0 && Gbl.Hierarchy.Ctr.CtrCod > 0 &&
CtrCod == Gbl.Hierarchy.Ctr.CtrCod,false, CtrCod == Gbl.Hierarchy.Ctr.CtrCod, // Selected?
false, // Not disabled
"%s",row[1]); "%s",row[1]);
} }
@ -753,6 +753,7 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
unsigned NumCtr; unsigned NumCtr;
struct Ctr_Center *Ctr; struct Ctr_Center *Ctr;
unsigned NumPlc; unsigned NumPlc;
const struct Plc_Place *PlcInLst;
char WWW[Cns_MAX_BYTES_WWW + 1]; char WWW[Cns_MAX_BYTES_WWW + 1];
struct Usr_Data UsrDat; struct Usr_Data UsrDat;
bool ICanEdit; bool ICanEdit;
@ -824,9 +825,13 @@ static void Ctr_ListCentersForEdition (const struct Plc_Places *Places)
for (NumPlc = 0; for (NumPlc = 0;
NumPlc < Places->Num; NumPlc < Places->Num;
NumPlc++) NumPlc++)
HTM_OPTION (HTM_Type_LONG,&Places->Lst[NumPlc].PlcCod, {
Places->Lst[NumPlc].PlcCod == Ctr->PlcCod,false, PlcInLst = &Places->Lst[NumPlc];
"%s",Places->Lst[NumPlc].ShrtName); HTM_OPTION (HTM_Type_LONG,&PlcInLst->PlcCod,
PlcInLst->PlcCod == Ctr->PlcCod, // Selected?
false, // Not disabled
"%s",PlcInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
} }
@ -1268,6 +1273,7 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
extern const char *Txt_Another_place; extern const char *Txt_Another_place;
extern const char *Txt_Create_center; extern const char *Txt_Create_center;
unsigned NumPlc; unsigned NumPlc;
const struct Plc_Place *PlcInLst;
/***** Begin form *****/ /***** Begin form *****/
if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) if (Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM)
@ -1311,9 +1317,13 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
for (NumPlc = 0; for (NumPlc = 0;
NumPlc < Places->Num; NumPlc < Places->Num;
NumPlc++) NumPlc++)
HTM_OPTION (HTM_Type_LONG,&Places->Lst[NumPlc].PlcCod, {
Places->Lst[NumPlc].PlcCod == Ctr_EditingCtr->PlcCod,false, PlcInLst = &Places->Lst[NumPlc];
"%s",Places->Lst[NumPlc].ShrtName); HTM_OPTION (HTM_Type_LONG,&PlcInLst->PlcCod,
PlcInLst->PlcCod == Ctr_EditingCtr->PlcCod, // Selected?
false, // Not disabled
"%s",PlcInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -543,6 +543,7 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
extern const char *Par_CodeStr[]; extern const char *Par_CodeStr[];
extern const char *Txt_Institution; extern const char *Txt_Institution;
unsigned NumIns; unsigned NumIns;
const struct Ins_Instit *InsInLst;
/***** Institution *****/ /***** Institution *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -568,9 +569,13 @@ static void CtrCfg_Institution (bool PrintView,bool PutForm)
for (NumIns = 0; for (NumIns = 0;
NumIns < Gbl.Hierarchy.Inss.Num; NumIns < Gbl.Hierarchy.Inss.Num;
NumIns++) NumIns++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Inss.Lst[NumIns].InsCod, {
Gbl.Hierarchy.Inss.Lst[NumIns].InsCod == Gbl.Hierarchy.Ins.InsCod,false, InsInLst = &Gbl.Hierarchy.Inss.Lst[NumIns];
"%s",Gbl.Hierarchy.Inss.Lst[NumIns].ShrtName); HTM_OPTION (HTM_Type_LONG,&InsInLst->InsCod,
InsInLst->InsCod == Gbl.Hierarchy.Ins.InsCod, // Selected?
false, // Not disabled
"%s",InsInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -637,14 +642,11 @@ static void CtrCfg_Place (bool PutForm)
struct Plc_Places Places; struct Plc_Places Places;
struct Plc_Place Plc; struct Plc_Place Plc;
unsigned NumPlc; unsigned NumPlc;
const struct Plc_Place *PlcInLst;
/***** Reset places context *****/ /***** Reset places context *****/
Plc_ResetPlaces (&Places); Plc_ResetPlaces (&Places);
/***** Get data of place *****/
Plc.PlcCod = Gbl.Hierarchy.Ctr.PlcCod;
Plc_GetPlaceDataByCod (&Plc);
/***** Place *****/ /***** Place *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -655,6 +657,7 @@ static void CtrCfg_Place (bool PutForm)
/* Data */ /* Data */
HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"LB DAT_%s\"",The_GetSuffix ());
if (PutForm) if (PutForm)
{ {
/* Get list of places of the current institution */ /* Get list of places of the current institution */
@ -673,9 +676,13 @@ static void CtrCfg_Place (bool PutForm)
for (NumPlc = 0; for (NumPlc = 0;
NumPlc < Places.Num; NumPlc < Places.Num;
NumPlc++) NumPlc++)
HTM_OPTION (HTM_Type_LONG,&Places.Lst[NumPlc].PlcCod, {
Places.Lst[NumPlc].PlcCod == Gbl.Hierarchy.Ctr.PlcCod,false, PlcInLst = &Places.Lst[NumPlc];
"%s",Places.Lst[NumPlc].ShrtName); HTM_OPTION (HTM_Type_LONG,&PlcInLst->PlcCod,
PlcInLst->PlcCod == Gbl.Hierarchy.Ctr.PlcCod, // Selected?
false, // Not disabled
"%s",PlcInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -683,7 +690,13 @@ static void CtrCfg_Place (bool PutForm)
Plc_FreeListPlaces (&Places); Plc_FreeListPlaces (&Places);
} }
else // I can not change center place else // I can not change center place
{
/* Text with the place name */
Plc.PlcCod = Gbl.Hierarchy.Ctr.PlcCod;
Plc_GetPlaceDataByCod (&Plc);
HTM_Txt (Plc.FullName); HTM_Txt (Plc.FullName);
}
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();

View File

@ -629,10 +629,18 @@ TODO: Emilce Barrera Mesa: Podr
TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen. TODO: Emilce Barrera Mesa: Mis estudiantes presentan muchas dificultades a la hora de poner la foto porque la plataforma es muy exigente respecto al fondo de la imagen.
*/ */
#define Log_PLATFORM_VERSION "SWAD 22.95 (2023-04-12)" #define Log_PLATFORM_VERSION "SWAD 22.96 (2023-04-12)"
#define CSS_FILE "swad22.95.css" #define CSS_FILE "swad22.95.css"
#define JS_FILE "swad22.49.js" #define JS_FILE "swad22.49.js"
/* /*
Version 22.96: Apr 12, 2023 Changes in configuration of projects.
Code refactoring in selectors. (338977 lines)
4 changes necessary in database:
ALTER TABLE prj_config CHANGE COLUMN Editable NETCanCreate ENUM('N','Y') NOT NULL DEFAULT 'Y';
ALTER TABLE prj_config ADD COLUMN RubTutCod INT NOT NULL DEFAULT -1 AFTER CrsCod;
ALTER TABLE prj_config ADD COLUMN RubEvlCod INT NOT NULL DEFAULT -1 AFTER RubTutCod;
ALTER TABLE prj_config ADD COLUMN RubGblCod INT NOT NULL DEFAULT -1 AFTER RubEvlCod;
Version 22.95: Apr 12, 2023 Changes in configuration of projects. (338602 lines) Version 22.95: Apr 12, 2023 Changes in configuration of projects. (338602 lines)
Version 22.94: Apr 12, 2023 Code refactoring in rubrics. Version 22.94: Apr 12, 2023 Code refactoring in rubrics.
Changes in configuration of projects. (338537 lines) Changes in configuration of projects. (338537 lines)

View File

@ -868,6 +868,7 @@ void Cty_WriteSelectorOfCountry (void)
{ {
extern const char *Txt_Country; extern const char *Txt_Country;
unsigned NumCty; unsigned NumCty;
const struct Cty_Countr *CtyInLst;
/***** Get list of countries *****/ /***** Get list of countries *****/
Cty_GetBasicListOfCountries (); Cty_GetBasicListOfCountries ();
@ -881,16 +882,22 @@ void Cty_WriteSelectorOfCountry (void)
The_GetSuffix ()); The_GetSuffix ());
/***** Initial disabled option *****/ /***** Initial disabled option *****/
HTM_OPTION (HTM_Type_STRING,"",Gbl.Hierarchy.Cty.CtyCod < 0,true, HTM_OPTION (HTM_Type_STRING,"",
Gbl.Hierarchy.Cty.CtyCod < 0, // Selected?
true, // Disabled
"[%s]",Txt_Country); "[%s]",Txt_Country);
/***** List countries *****/ /***** List countries *****/
for (NumCty = 0; for (NumCty = 0;
NumCty < Gbl.Hierarchy.Ctys.Num; NumCty < Gbl.Hierarchy.Ctys.Num;
NumCty++) NumCty++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod, {
Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod == Gbl.Hierarchy.Cty.CtyCod,false, CtyInLst = &Gbl.Hierarchy.Ctys.Lst[NumCty];
"%s",Gbl.Hierarchy.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); HTM_OPTION (HTM_Type_LONG,&CtyInLst->CtyCod,
CtyInLst->CtyCod == Gbl.Hierarchy.Cty.CtyCod, // Selected?
false, // Not disabled
"%s",CtyInLst->Name[Gbl.Prefs.Language]);
}
/***** End selector of country *****/ /***** End selector of country *****/
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -642,7 +642,9 @@ void Crs_WriteSelectorOfCourse (void)
The_GetSuffix ()); The_GetSuffix ());
/***** Initial disabled option *****/ /***** Initial disabled option *****/
HTM_OPTION (HTM_Type_STRING,"",Gbl.Hierarchy.Crs.CrsCod < 0,true, HTM_OPTION (HTM_Type_STRING,"",
Gbl.Hierarchy.Crs.CrsCod < 0, // Selected?
true, // Disabled
"[%s]",Txt_Course); "[%s]",Txt_Course);
if (Gbl.Hierarchy.Deg.DegCod > 0) if (Gbl.Hierarchy.Deg.DegCod > 0)
@ -663,7 +665,8 @@ void Crs_WriteSelectorOfCourse (void)
/* Write option */ /* Write option */
HTM_OPTION (HTM_Type_LONG,&CrsCod, HTM_OPTION (HTM_Type_LONG,&CrsCod,
Gbl.Hierarchy.Level == HieLvl_CRS && // Course selected Gbl.Hierarchy.Level == HieLvl_CRS && // Course selected
CrsCod == Gbl.Hierarchy.Crs.CrsCod,false, CrsCod == Gbl.Hierarchy.Crs.CrsCod,
false, // Not disabled
"%s",row[1]); // Short name (row[1]) "%s",row[1]); // Short name (row[1])
} }
@ -776,7 +779,9 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void)
/***** Write an option when no course selected *****/ /***** Write an option when no course selected *****/
if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected if (Gbl.Hierarchy.Crs.CrsCod <= 0) // No course selected
HTM_OPTION (HTM_Type_STRING,"-1",true,true, HTM_OPTION (HTM_Type_STRING,"-1",
true, // Selected
true, // Disabled
"%s",Txt_Course); "%s",Txt_Course);
if (Gbl.Usrs.Me.MyCrss.Num) if (Gbl.Usrs.Me.MyCrss.Num)
@ -799,8 +804,9 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void)
LastDegCod = DegCod; LastDegCod = DegCod;
} }
HTM_OPTION (HTM_Type_LONG,&Gbl.Usrs.Me.MyCrss.Crss[NumMyCrs].CrsCod, HTM_OPTION (HTM_Type_LONG,&CrsCod,
CrsCod == Gbl.Hierarchy.Crs.CrsCod,false, // Course selected CrsCod == Gbl.Hierarchy.Crs.CrsCod, // Selected?
false, // Not disabled
"%s",CrsShortName); "%s",CrsShortName);
} }
@ -812,7 +818,9 @@ void Crs_WriteSelectorMyCoursesInBreadcrumb (void)
when I don't belong to it *****/ when I don't belong to it *****/
if (Gbl.Hierarchy.Level == HieLvl_CRS && // Course selected if (Gbl.Hierarchy.Level == HieLvl_CRS && // Course selected
!Gbl.Usrs.Me.IBelongToCurrentCrs) // I do not belong to it !Gbl.Usrs.Me.IBelongToCurrentCrs) // I do not belong to it
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Crs.CrsCod,true,true, HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Crs.CrsCod,
true, // Selected
true, // Disabled
"%s",Gbl.Hierarchy.Crs.ShrtName); "%s",Gbl.Hierarchy.Crs.ShrtName);
/***** End selector of courses *****/ /***** End selector of courses *****/
@ -1210,7 +1218,8 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
// because it's possible to move this course // because it's possible to move this course
// to another degree (with other active years) // to another degree (with other active years)
HTM_OPTION (HTM_Type_UNSIGNED,&YearAux, HTM_OPTION (HTM_Type_UNSIGNED,&YearAux,
YearAux == Crs->Year,false, YearAux == Crs->Year, // Selected?
false, // Not disabled
"%s",Txt_YEAR_OF_DEGREE[YearAux]); "%s",Txt_YEAR_OF_DEGREE[YearAux]);
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -1352,7 +1361,8 @@ static void Crs_PutFormToCreateCourse (void)
Year <= Deg_MAX_YEARS_PER_DEGREE; Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++) Year++)
HTM_OPTION (HTM_Type_UNSIGNED,&Year, HTM_OPTION (HTM_Type_UNSIGNED,&Year,
Year == Crs_EditingCrs->Year,false, Year == Crs_EditingCrs->Year, // Selected?
false, // Not disabled
"%s",Txt_YEAR_OF_DEGREE[Year]); "%s",Txt_YEAR_OF_DEGREE[Year]);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -2544,7 +2554,8 @@ void Crs_AskRemoveOldCrss (void)
i <= Crs_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS; i <= Crs_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_CRSS;
i++) i++)
HTM_OPTION (HTM_Type_UNSIGNED,&i, HTM_OPTION (HTM_Type_UNSIGNED,&i,
i == MonthsWithoutAccess,false, i == MonthsWithoutAccess, // Selected?
false, // Not disabled
"%u",i); "%u",i);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_NBSP (); HTM_NBSP ();

View File

@ -214,6 +214,7 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
extern const char *Par_CodeStr[]; extern const char *Par_CodeStr[];
extern const char *Txt_Degree; extern const char *Txt_Degree;
unsigned NumDeg; unsigned NumDeg;
const struct Deg_Degree *DegInLst;
/***** Degree *****/ /***** Degree *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -239,9 +240,13 @@ static void CrsCfg_Degree (bool PrintView,bool PutForm)
for (NumDeg = 0; for (NumDeg = 0;
NumDeg < Gbl.Hierarchy.Degs.Num; NumDeg < Gbl.Hierarchy.Degs.Num;
NumDeg++) NumDeg++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Degs.Lst[NumDeg].DegCod, {
Gbl.Hierarchy.Degs.Lst[NumDeg].DegCod == Gbl.Hierarchy.Deg.DegCod,false, DegInLst = &Gbl.Hierarchy.Degs.Lst[NumDeg];
"%s",Gbl.Hierarchy.Degs.Lst[NumDeg].ShrtName); HTM_OPTION (HTM_Type_LONG,&DegInLst->DegCod,
DegInLst->DegCod == Gbl.Hierarchy.Deg.DegCod, // Selected?
false, // Not disabled
"%s",DegInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -326,7 +331,8 @@ static void CrsCfg_Year (bool PutForm)
Year <= Deg_MAX_YEARS_PER_DEGREE; Year <= Deg_MAX_YEARS_PER_DEGREE;
Year++) Year++)
HTM_OPTION (HTM_Type_UNSIGNED,&Year, HTM_OPTION (HTM_Type_UNSIGNED,&Year,
Year == Gbl.Hierarchy.Crs.Year,false, Year == Gbl.Hierarchy.Crs.Year, // Selected?
false, // Not disabled
"%s",Txt_YEAR_OF_DEGREE[Year]); "%s",Txt_YEAR_OF_DEGREE[Year]);
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();

View File

@ -2554,17 +2554,23 @@ mysql> DESCRIBE prg_resources;
/***** Table prj_config *****/ /***** Table prj_config *****/
/* /*
mysql> DESCRIBE prj_config; mysql> DESCRIBE prj_config;
+----------+---------------+------+-----+---------+-------+ +--------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra | | Field | Type | Null | Key | Default | Extra |
+----------+---------------+------+-----+---------+-------+ +--------------+---------------+------+-----+---------+-------+
| CrsCod | int(11) | NO | PRI | -1 | | | CrsCod | int | NO | PRI | -1 | |
| Editable | enum('N','Y') | NO | | Y | | | RubTutCod | int | NO | | -1 | |
+----------+---------------+------+-----+---------+-------+ | RubEvlCod | int | NO | | -1 | |
2 rows in set (0.00 sec) | RubGblCod | int | NO | | -1 | |
| NETCanCreate | enum('N','Y') | NO | | Y | |
+--------------+---------------+------+-----+---------+-------+
5 rows in set (0,00 sec)
*/ */
DB_CreateTable ("CREATE TABLE IF NOT EXISTS prj_config (" DB_CreateTable ("CREATE TABLE IF NOT EXISTS prj_config ("
"CrsCod INT NOT NULL DEFAULT -1," "CrsCod INT NOT NULL DEFAULT -1,"
"Editable ENUM('N','Y') NOT NULL DEFAULT 'Y'," "RubTutCod INT NOT NULL DEFAULT -1,"
"RubEvlCod INT NOT NULL DEFAULT -1,"
"RubGblCod INT NOT NULL DEFAULT -1,"
"NETCanCreate ENUM('N','Y') NOT NULL DEFAULT 'Y',"
"UNIQUE INDEX(CrsCod))"); "UNIQUE INDEX(CrsCod))");
/***** Table prj_projects *****/ /***** Table prj_projects *****/

View File

@ -766,7 +766,9 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
for (Year = FirstYear; for (Year = FirstYear;
Year <= LastYear; Year <= LastYear;
Year++) Year++)
HTM_OPTION (HTM_Type_UNSIGNED,&Year,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&Year,
false, // Not selected
false, // Not disabled
"%u",Year); "%u",Year);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -781,7 +783,9 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
for (Month = 1; for (Month = 1;
Month <= 12; Month <= 12;
Month++) Month++)
HTM_OPTION (HTM_Type_UNSIGNED,&Month,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&Month,
false, // Not selected
false, // Not disabled
"%s",Txt_MONTHS_SMALL[Month - 1]); "%s",Txt_MONTHS_SMALL[Month - 1]);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -796,7 +800,9 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
for (Day = 1; for (Day = 1;
Day <= 31; Day <= 31;
Day++) Day++)
HTM_OPTION (HTM_Type_UNSIGNED,&Day,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&Day,
false, // Not selected
false, // Not disabled
"%u",Day); "%u",Day);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -811,7 +817,9 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
for (Hour = 0; for (Hour = 0;
Hour <= 23; Hour <= 23;
Hour++) Hour++)
HTM_OPTION (HTM_Type_UNSIGNED,&Hour,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&Hour,
false, // Not selected
false, // Not disabled
"%02u h",Hour); "%02u h",Hour);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -826,7 +834,9 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
for (Minute = 0; for (Minute = 0;
Minute < 60; Minute < 60;
Minute += MinutesIInterval[FormSeconds]) Minute += MinutesIInterval[FormSeconds])
HTM_OPTION (HTM_Type_UNSIGNED,&Minute,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&Minute,
false, // Not selected
false, // Not disabled
"%02u &prime;",Minute); "%02u &prime;",Minute);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -843,7 +853,9 @@ void Dat_WriteFormClientLocalDateTimeFromTimeUTC (const char *Id,
for (Second = 0; for (Second = 0;
Second <= 59; Second <= 59;
Second++) Second++)
HTM_OPTION (HTM_Type_UNSIGNED,&Second,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&Second,
false, // Not selected
false, // Not disabled
"%02u &Prime;",Second); "%02u &Prime;",Second);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -1008,13 +1020,16 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
The_GetSuffix (), The_GetSuffix (),
Disabled ? " disabled=\"disabled\"" : Disabled ? " disabled=\"disabled\"" :
""); "");
HTM_OPTION (HTM_Type_STRING,"0",false,false, HTM_OPTION (HTM_Type_STRING,"0",
false, // Not selected
false, // Not disabled
"-"); "-");
for (Year = FirstYear; for (Year = FirstYear;
Year <= LastYear; Year <= LastYear;
Year++) Year++)
HTM_OPTION (HTM_Type_UNSIGNED,&Year, HTM_OPTION (HTM_Type_UNSIGNED,&Year,
Year == DateSelected->Year,false, Year == DateSelected->Year, // Selected?
false, // Not disabled
"%u",Year); "%u",Year);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -1028,13 +1043,16 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
The_GetSuffix (), The_GetSuffix (),
Disabled ? " disabled=\"disabled\"" : Disabled ? " disabled=\"disabled\"" :
""); "");
HTM_OPTION (HTM_Type_STRING,"0",false,false, HTM_OPTION (HTM_Type_STRING,"0",
false, // Not selected
false, // Not disabled
"-"); "-");
for (Month = 1; for (Month = 1;
Month <= 12; Month <= 12;
Month++) Month++)
HTM_OPTION (HTM_Type_UNSIGNED,&Month, HTM_OPTION (HTM_Type_UNSIGNED,&Month,
Month == DateSelected->Month,false, Month == DateSelected->Month, // Selected?
false, // Not disabled
"%s",Txt_MONTHS_SMALL[Month - 1]); "%s",Txt_MONTHS_SMALL[Month - 1]);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -1050,7 +1068,9 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
The_GetSuffix (), The_GetSuffix (),
Disabled ? " disabled=\"disabled\"" : Disabled ? " disabled=\"disabled\"" :
""); "");
HTM_OPTION (HTM_Type_STRING,"0",false,false, HTM_OPTION (HTM_Type_STRING,"0",
false, // Not selected
false, // Not disabled
"-"); "-");
NumDaysSelectedMonth = (DateSelected->Month == 0) ? 31 : NumDaysSelectedMonth = (DateSelected->Month == 0) ? 31 :
((DateSelected->Month == 2) ? Dat_GetNumDaysFebruary (DateSelected->Year) : ((DateSelected->Month == 2) ? Dat_GetNumDaysFebruary (DateSelected->Year) :
@ -1059,7 +1079,8 @@ void Dat_WriteFormDate (unsigned FirstYear,unsigned LastYear,
Day <= NumDaysSelectedMonth; Day <= NumDaysSelectedMonth;
Day++) Day++)
HTM_OPTION (HTM_Type_UNSIGNED,&Day, HTM_OPTION (HTM_Type_UNSIGNED,&Day,
Day == DateSelected->Day,false, Day == DateSelected->Day, // Selected?
false, // Not disabled
"%u",Day); "%u",Day);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -241,7 +241,8 @@ void Deg_WriteSelectorOfDegree (void)
" disabled=\"disabled\"", " disabled=\"disabled\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"", HTM_OPTION (HTM_Type_STRING,"",
Gbl.Hierarchy.Deg.DegCod < 0,true, Gbl.Hierarchy.Deg.DegCod <= 0, // Selected?
true, // Disabled
"[%s]",Txt_Degree); "[%s]",Txt_Degree);
if (Gbl.Hierarchy.Ctr.CtrCod > 0) if (Gbl.Hierarchy.Ctr.CtrCod > 0)
@ -264,7 +265,8 @@ void Deg_WriteSelectorOfDegree (void)
/* Write option */ /* Write option */
HTM_OPTION (HTM_Type_LONG,&DegCod, HTM_OPTION (HTM_Type_LONG,&DegCod,
Gbl.Hierarchy.Deg.DegCod > 0 && Gbl.Hierarchy.Deg.DegCod > 0 &&
DegCod == Gbl.Hierarchy.Deg.DegCod,false, DegCod == Gbl.Hierarchy.Deg.DegCod, // Selected?
false, // Not disabled
"%s",row[1]); "%s",row[1]);
} }
@ -312,9 +314,9 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
{ {
extern const char *Txt_DEGREE_STATUS[Hie_NUM_STATUS_TXT]; extern const char *Txt_DEGREE_STATUS[Hie_NUM_STATUS_TXT];
unsigned NumDeg; unsigned NumDeg;
struct DegTyp_DegreeType *DegTyp; struct Deg_Degree *DegInLst;
struct Deg_Degree *Deg;
unsigned NumDegTyp; unsigned NumDegTyp;
struct DegTyp_DegreeType *DegTypInLst;
char WWW[Cns_MAX_BYTES_WWW + 1]; char WWW[Cns_MAX_BYTES_WWW + 1];
struct Usr_Data UsrDat; struct Usr_Data UsrDat;
bool ICanEdit; bool ICanEdit;
@ -335,11 +337,11 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
NumDeg < Gbl.Hierarchy.Degs.Num; NumDeg < Gbl.Hierarchy.Degs.Num;
NumDeg++) NumDeg++)
{ {
Deg = &(Gbl.Hierarchy.Degs.Lst[NumDeg]); DegInLst = &(Gbl.Hierarchy.Degs.Lst[NumDeg]);
ICanEdit = Deg_CheckIfICanEditADegree (Deg); ICanEdit = Deg_CheckIfICanEditADegree (DegInLst);
NumCrss = Crs_GetNumCrssInDeg (Deg->DegCod); NumCrss = Crs_GetNumCrssInDeg (DegInLst->DegCod);
NumUsrsInCrssOfDeg = Enr_GetNumUsrsInCrss (HieLvl_DEG,Deg->DegCod, NumUsrsInCrssOfDeg = Enr_GetNumUsrsInCrss (HieLvl_DEG,DegInLst->DegCod,
1 << Rol_STD | 1 << Rol_STD |
1 << Rol_NET | 1 << Rol_NET |
1 << Rol_TCH); // Any user 1 << Rol_TCH); // Any user
@ -354,17 +356,17 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
Ico_PutIconRemovalNotAllowed (); Ico_PutIconRemovalNotAllowed ();
else else
Ico_PutContextualIconToRemove (ActRemDeg,NULL, Ico_PutContextualIconToRemove (ActRemDeg,NULL,
Hie_PutParOtherHieCod,&Deg->DegCod); Hie_PutParOtherHieCod,&DegInLst->DegCod);
HTM_TD_End (); HTM_TD_End ();
/* Degree code */ /* Degree code */
HTM_TD_Begin ("class=\"DAT_%s CODE\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"DAT_%s CODE\"",The_GetSuffix ());
HTM_Long (Deg->DegCod); HTM_Long (DegInLst->DegCod);
HTM_TD_End (); HTM_TD_End ();
/* Degree logo */ /* Degree logo */
HTM_TD_Begin ("title=\"%s\" class=\"HIE_LOGO\"",Deg->FullName); HTM_TD_Begin ("title=\"%s\" class=\"HIE_LOGO\"",DegInLst->FullName);
Lgo_DrawLogo (HieLvl_DEG,Deg->DegCod,Deg->ShrtName,20,NULL,true); Lgo_DrawLogo (HieLvl_DEG,DegInLst->DegCod,DegInLst->ShrtName,20,NULL,true);
HTM_TD_End (); HTM_TD_End ();
/* Degree short name */ /* Degree short name */
@ -372,15 +374,15 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
if (ICanEdit) if (ICanEdit)
{ {
Frm_BeginForm (ActRenDegSho); Frm_BeginForm (ActRenDegSho);
ParCod_PutPar (ParCod_OthHie,Deg->DegCod); ParCod_PutPar (ParCod_OthHie,DegInLst->DegCod);
HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Deg->ShrtName, HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,DegInLst->ShrtName,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_SHORT_NAME INPUT_%s\"", "class=\"INPUT_SHORT_NAME INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
Frm_EndForm (); Frm_EndForm ();
} }
else else
HTM_Txt (Deg->ShrtName); HTM_Txt (DegInLst->ShrtName);
HTM_TD_End (); HTM_TD_End ();
/* Degree full name */ /* Degree full name */
@ -388,15 +390,15 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
if (ICanEdit) if (ICanEdit)
{ {
Frm_BeginForm (ActRenDegFul); Frm_BeginForm (ActRenDegFul);
ParCod_PutPar (ParCod_OthHie,Deg->DegCod); ParCod_PutPar (ParCod_OthHie,DegInLst->DegCod);
HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Deg->FullName, HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,DegInLst->FullName,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_FULL_NAME INPUT_%s\"", "class=\"INPUT_FULL_NAME INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
Frm_EndForm (); Frm_EndForm ();
} }
else else
HTM_Txt (Deg->FullName); HTM_Txt (DegInLst->FullName);
HTM_TD_End (); HTM_TD_End ();
/* Degree type */ /* Degree type */
@ -404,7 +406,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
if (ICanEdit) if (ICanEdit)
{ {
Frm_BeginForm (ActChgDegTyp); Frm_BeginForm (ActChgDegTyp);
ParCod_PutPar (ParCod_OthHie,Deg->DegCod); ParCod_PutPar (ParCod_OthHie,DegInLst->DegCod);
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL,
"name=\"OthDegTypCod\"" "name=\"OthDegTypCod\""
" class=\"HIE_SEL_NARROW INPUT_%s\"", " class=\"HIE_SEL_NARROW INPUT_%s\"",
@ -413,11 +415,11 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
NumDegTyp < DegTypes->Num; NumDegTyp < DegTypes->Num;
NumDegTyp++) NumDegTyp++)
{ {
DegTyp = &DegTypes->Lst[NumDegTyp]; DegTypInLst = &DegTypes->Lst[NumDegTyp];
HTM_OPTION (HTM_Type_LONG,&DegTyp->DegTypCod, HTM_OPTION (HTM_Type_LONG,&DegTypInLst->DegTypCod,
// Gbl.Hierarchy.Deg.DegCod > 0 && DegTypInLst->DegTypCod == DegInLst->DegTypCod, // Selected?
DegTyp->DegTypCod == Deg->DegTypCod,false, false, // Not disabled
"%s",DegTyp->DegTypName); "%s",DegTypInLst->DegTypName);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -426,8 +428,11 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
for (NumDegTyp = 0; for (NumDegTyp = 0;
NumDegTyp < DegTypes->Num; NumDegTyp < DegTypes->Num;
NumDegTyp++) NumDegTyp++)
if (DegTypes->Lst[NumDegTyp].DegTypCod == Deg->DegTypCod) {
HTM_Txt (DegTypes->Lst[NumDegTyp].DegTypName); DegTypInLst = &DegTypes->Lst[NumDegTyp];
if (DegTypInLst->DegTypCod == DegInLst->DegTypCod)
HTM_Txt (DegTypInLst->DegTypName);
}
HTM_TD_End (); HTM_TD_End ();
/* Degree WWW */ /* Degree WWW */
@ -435,8 +440,8 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
if (ICanEdit) if (ICanEdit)
{ {
Frm_BeginForm (ActChgDegWWW); Frm_BeginForm (ActChgDegWWW);
ParCod_PutPar (ParCod_OthHie,Deg->DegCod); ParCod_PutPar (ParCod_OthHie,DegInLst->DegCod);
HTM_INPUT_URL ("WWW",Deg->WWW,HTM_SUBMIT_ON_CHANGE, HTM_INPUT_URL ("WWW",DegInLst->WWW,HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_WWW_NARROW INPUT_%s\"" "class=\"INPUT_WWW_NARROW INPUT_%s\""
" required=\"required\"", " required=\"required\"",
The_GetSuffix ()); The_GetSuffix ());
@ -444,12 +449,12 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
} }
else else
{ {
Str_Copy (WWW,Deg->WWW,sizeof (WWW) - 1); Str_Copy (WWW,DegInLst->WWW,sizeof (WWW) - 1);
HTM_DIV_Begin ("class=\"EXTERNAL_WWW_SHORT\""); HTM_DIV_Begin ("class=\"EXTERNAL_WWW_SHORT\"");
HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\"" HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\""
" class=\"DAT_%s\"", " class=\"DAT_%s\"",
Deg->WWW, DegInLst->WWW,
Deg->WWW, DegInLst->WWW,
The_GetSuffix ()); The_GetSuffix ());
HTM_Txt (WWW); HTM_Txt (WWW);
HTM_A_End (); HTM_A_End ();
@ -468,7 +473,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
HTM_TD_End (); HTM_TD_End ();
/* Degree requester */ /* Degree requester */
UsrDat.UsrCod = Deg->RequesterUsrCod; UsrDat.UsrCod = DegInLst->RequesterUsrCod;
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat, Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat,
Usr_DONT_GET_PREFS, Usr_DONT_GET_PREFS,
Usr_DONT_GET_ROLE_IN_CURRENT_CRS); Usr_DONT_GET_ROLE_IN_CURRENT_CRS);
@ -479,7 +484,7 @@ static void Deg_ListDegreesForEdition (const struct DegTyp_DegTypes *DegTypes)
/* Degree status */ /* Degree status */
Hie_WriteStatusCellEditable (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM, Hie_WriteStatusCellEditable (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM,
Deg->Status,ActChgDegSta,Deg->DegCod, DegInLst->Status,ActChgDegSta,DegInLst->DegCod,
Txt_DEGREE_STATUS); Txt_DEGREE_STATUS);
HTM_TR_End (); HTM_TR_End ();
@ -511,8 +516,8 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
{ {
extern const char *Txt_New_degree; extern const char *Txt_New_degree;
extern const char *Txt_Create_degree; extern const char *Txt_Create_degree;
struct DegTyp_DegreeType *DegTyp;
unsigned NumDegTyp; unsigned NumDegTyp;
struct DegTyp_DegreeType *DegTypInLst;
/***** Begin form *****/ /***** Begin form *****/
if (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) if (Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM)
@ -573,10 +578,11 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
NumDegTyp < DegTypes->Num; NumDegTyp < DegTypes->Num;
NumDegTyp++) NumDegTyp++)
{ {
DegTyp = &DegTypes->Lst[NumDegTyp]; DegTypInLst = &DegTypes->Lst[NumDegTyp];
HTM_OPTION (HTM_Type_LONG,&DegTyp->DegTypCod, HTM_OPTION (HTM_Type_LONG,&DegTypInLst->DegTypCod,
DegTyp->DegTypCod == Deg_EditingDeg->DegTypCod,false, DegTypInLst->DegTypCod == Deg_EditingDeg->DegTypCod, // Selected?
"%s",DegTyp->DegTypName); false, // Not disabled
"%s",DegTypInLst->DegTypName);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -209,6 +209,7 @@ static void DegCfg_Center (bool PrintView,bool PutForm)
extern const char *Par_CodeStr[]; extern const char *Par_CodeStr[];
extern const char *Txt_Center; extern const char *Txt_Center;
unsigned NumCtr; unsigned NumCtr;
const struct Ctr_Center *CtrInLst;
/***** Center *****/ /***** Center *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -234,9 +235,13 @@ static void DegCfg_Center (bool PrintView,bool PutForm)
for (NumCtr = 0; for (NumCtr = 0;
NumCtr < Gbl.Hierarchy.Ctrs.Num; NumCtr < Gbl.Hierarchy.Ctrs.Num;
NumCtr++) NumCtr++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctrs.Lst[NumCtr].CtrCod, {
Gbl.Hierarchy.Ctrs.Lst[NumCtr].CtrCod == Gbl.Hierarchy.Ctr.CtrCod,false, CtrInLst = &Gbl.Hierarchy.Ctrs.Lst[NumCtr];
"%s",Gbl.Hierarchy.Ctrs.Lst[NumCtr].ShrtName); HTM_OPTION (HTM_Type_LONG,&CtrInLst->CtrCod,
CtrInLst->CtrCod == Gbl.Hierarchy.Ctr.CtrCod, // Selected?
false, // Not disabled
"%s",CtrInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();

View File

@ -105,6 +105,7 @@ void DegTyp_WriteSelectorDegreeTypes (long SelectedDegTypCod)
extern const char *Txt_Any_type_of_degree; extern const char *Txt_Any_type_of_degree;
struct DegTyp_DegTypes DegTypes; struct DegTyp_DegTypes DegTypes;
unsigned NumDegTyp; unsigned NumDegTyp;
const struct DegTyp_DegreeType *DegTypInLst;
/***** Form to select degree types *****/ /***** Form to select degree types *****/
/* Get list of degree types */ /* Get list of degree types */
@ -116,14 +117,19 @@ void DegTyp_WriteSelectorDegreeTypes (long SelectedDegTypCod)
" class=\"INPUT_%s\"", " class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1", HTM_OPTION (HTM_Type_STRING,"-1",
SelectedDegTypCod == -1L,false, SelectedDegTypCod <= 0, // Selected?
false, // Not disabled
"%s",Txt_Any_type_of_degree); "%s",Txt_Any_type_of_degree);
for (NumDegTyp = 0; for (NumDegTyp = 0;
NumDegTyp < DegTypes.Num; NumDegTyp < DegTypes.Num;
NumDegTyp++) NumDegTyp++)
HTM_OPTION (HTM_Type_LONG,&DegTypes.Lst[NumDegTyp].DegTypCod, {
DegTypes.Lst[NumDegTyp].DegTypCod == SelectedDegTypCod,false, DegTypInLst = &DegTypes.Lst[NumDegTyp];
"%s",DegTypes.Lst[NumDegTyp].DegTypName); HTM_OPTION (HTM_Type_LONG,&DegTypInLst->DegTypCod,
DegTypInLst->DegTypCod == SelectedDegTypCod, // Selected?
false, // Not disabled
"%s",DegTypInLst->DegTypName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
/***** Free list of degree types *****/ /***** Free list of degree types *****/

View File

@ -442,9 +442,10 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
{ {
extern const char *Txt_Another_institution; extern const char *Txt_Another_institution;
unsigned NumDpt; unsigned NumDpt;
struct Dpt_Department *Dpt; struct Dpt_Department *DptInLst;
struct Ins_Instit Ins; struct Ins_Instit Ins;
unsigned NumIns; unsigned NumIns;
struct Ins_Instit *InsInLst;
/***** Begin table *****/ /***** Begin table *****/
HTM_TABLE_BeginPadding (2); HTM_TABLE_BeginPadding (2);
@ -457,44 +458,50 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
NumDpt < Departments->Num; NumDpt < Departments->Num;
NumDpt++) NumDpt++)
{ {
Dpt = &Departments->Lst[NumDpt]; DptInLst = &Departments->Lst[NumDpt];
/* Get data of institution of this department */ /* Get data of institution of this department */
Ins.InsCod = Dpt->InsCod; Ins.InsCod = DptInLst->InsCod;
Ins_GetInstitDataByCod (&Ins); Ins_GetInstitDataByCod (&Ins);
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Put icon to remove department */ /* Put icon to remove department */
HTM_TD_Begin ("class=\"BM\""); HTM_TD_Begin ("class=\"BM\"");
if (Dpt->NumTchs) // Department has teachers ==> deletion forbidden if (DptInLst->NumTchs) // Department has teachers ==> deletion forbidden
Ico_PutIconRemovalNotAllowed (); Ico_PutIconRemovalNotAllowed ();
else else
Ico_PutContextualIconToRemove (ActRemDpt,NULL, Ico_PutContextualIconToRemove (ActRemDpt,NULL,
Dpt_PutParDptCod,&Dpt->DptCod); Dpt_PutParDptCod,&DptInLst->DptCod);
HTM_TD_End (); HTM_TD_End ();
/* Department code */ /* Department code */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_TxtF ("%ld&nbsp;",Dpt->DptCod); HTM_TxtF ("%ld&nbsp;",DptInLst->DptCod);
HTM_TD_End (); HTM_TD_End ();
/* Institution */ /* Institution */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgDptIns); Frm_BeginForm (ActChgDptIns);
ParCod_PutPar (ParCod_Dpt,Dpt->DptCod); ParCod_PutPar (ParCod_Dpt,DptInLst->DptCod);
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL,
"name=\"OthInsCod\"" "name=\"OthInsCod\""
" class=\"HIE_SEL_NARROW INPUT_%s\"", " class=\"HIE_SEL_NARROW INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"0",Dpt->InsCod == 0,false, HTM_OPTION (HTM_Type_STRING,"0",
DptInLst->InsCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_institution); "%s",Txt_Another_institution);
for (NumIns = 0; for (NumIns = 0;
NumIns < Gbl.Hierarchy.Inss.Num; NumIns < Gbl.Hierarchy.Inss.Num;
NumIns++) NumIns++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Inss.Lst[NumIns].InsCod, {
Gbl.Hierarchy.Inss.Lst[NumIns].InsCod == Dpt->InsCod,false, InsInLst = &Gbl.Hierarchy.Inss.Lst[NumIns];
"%s",Gbl.Hierarchy.Inss.Lst[NumIns].ShrtName); HTM_OPTION (HTM_Type_LONG,&InsInLst->InsCod,
InsInLst->InsCod == DptInLst->InsCod, // Selected?
false, // Not disabled
"%s",InsInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
@ -502,8 +509,8 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
/* Department short name */ /* Department short name */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenDptSho); Frm_BeginForm (ActRenDptSho);
ParCod_PutPar (ParCod_Dpt,Dpt->DptCod); ParCod_PutPar (ParCod_Dpt,DptInLst->DptCod);
HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Dpt->ShrtName, HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,DptInLst->ShrtName,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_SHORT_NAME INPUT_%s\"", "class=\"INPUT_SHORT_NAME INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -513,8 +520,8 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
/* Department full name */ /* Department full name */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenDptFul); Frm_BeginForm (ActRenDptFul);
ParCod_PutPar (ParCod_Dpt,Dpt->DptCod); ParCod_PutPar (ParCod_Dpt,DptInLst->DptCod);
HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Dpt->FullName, HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,DptInLst->FullName,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_FULL_NAME INPUT_%s\"", "class=\"INPUT_FULL_NAME INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -524,8 +531,8 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
/* Department WWW */ /* Department WWW */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgDptWWW); Frm_BeginForm (ActChgDptWWW);
ParCod_PutPar (ParCod_Dpt,Dpt->DptCod); ParCod_PutPar (ParCod_Dpt,DptInLst->DptCod);
HTM_INPUT_URL ("WWW",Dpt->WWW,HTM_SUBMIT_ON_CHANGE, HTM_INPUT_URL ("WWW",DptInLst->WWW,HTM_SUBMIT_ON_CHANGE,
"class=\"INPUT_WWW_NARROW INPUT_%s\"" "class=\"INPUT_WWW_NARROW INPUT_%s\""
" required=\"required\"", " required=\"required\"",
The_GetSuffix ()); The_GetSuffix ());
@ -534,7 +541,7 @@ static void Dpt_ListDepartmentsForEdition (const struct Dpt_Departments *Departm
/* Number of teachers */ /* Number of teachers */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_Unsigned (Dpt->NumTchs); HTM_Unsigned (DptInLst->NumTchs);
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
@ -789,6 +796,7 @@ static void Dpt_PutFormToCreateDepartment (void)
extern const char *Txt_Another_institution; extern const char *Txt_Another_institution;
extern const char *Txt_Create_department; extern const char *Txt_Create_department;
unsigned NumIns; unsigned NumIns;
const struct Ins_Instit *InsInLst;
/***** Begin form *****/ /***** Begin form *****/
Frm_BeginForm (ActNewDpt); Frm_BeginForm (ActNewDpt);
@ -814,14 +822,20 @@ static void Dpt_PutFormToCreateDepartment (void)
"name=\"OthInsCod\"" "name=\"OthInsCod\""
" class=\"HIE_SEL_NARROW INPUT_%s\"", " class=\"HIE_SEL_NARROW INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"0",Dpt_EditingDpt->InsCod == 0,false, HTM_OPTION (HTM_Type_STRING,"0",
Dpt_EditingDpt->InsCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_institution); "%s",Txt_Another_institution);
for (NumIns = 0; for (NumIns = 0;
NumIns < Gbl.Hierarchy.Inss.Num; NumIns < Gbl.Hierarchy.Inss.Num;
NumIns++) NumIns++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Inss.Lst[NumIns].InsCod, {
Gbl.Hierarchy.Inss.Lst[NumIns].InsCod == Dpt_EditingDpt->InsCod,false, InsInLst = &Gbl.Hierarchy.Inss.Lst[NumIns];
"%s",Gbl.Hierarchy.Inss.Lst[NumIns].ShrtName); HTM_OPTION (HTM_Type_LONG,&InsInLst->InsCod,
InsInLst->InsCod == Dpt_EditingDpt->InsCod, // Selected?
false, // Not disabled
"%s",InsInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -988,6 +1002,7 @@ void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
extern const char *Txt_Another_department; extern const char *Txt_Another_department;
struct Dpt_Departments Departments; struct Dpt_Departments Departments;
unsigned NumDpt; unsigned NumDpt;
const struct Dpt_Department *DptInLst;
bool NoDptSelectable; bool NoDptSelectable;
/***** Reset departments context *****/ /***** Reset departments context *****/
@ -1012,12 +1027,16 @@ void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
if (TextWhenNoDptSelected[0]) if (TextWhenNoDptSelected[0])
NoDptSelectable = true; NoDptSelectable = true;
HTM_OPTION (HTM_Type_STRING,"-1",DptCod < 0,!NoDptSelectable, HTM_OPTION (HTM_Type_STRING,"-1",
DptCod < 0, // Selected?
!NoDptSelectable, // Disabled?
"%s",TextWhenNoDptSelected); "%s",TextWhenNoDptSelected);
} }
/* Another department selected (different to all departments listed) */ /* Another department selected (different to all departments listed) */
HTM_OPTION (HTM_Type_STRING,"0",DptCod == 0,false, HTM_OPTION (HTM_Type_STRING,"0",
DptCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_department); "%s",Txt_Another_department);
} }
@ -1025,9 +1044,13 @@ void Dpt_WriteSelectorDepartment (long InsCod,long DptCod,
for (NumDpt = 0; for (NumDpt = 0;
NumDpt < Departments.Num; NumDpt < Departments.Num;
NumDpt++) NumDpt++)
HTM_OPTION (HTM_Type_LONG,&Departments.Lst[NumDpt].DptCod, {
Departments.Lst[NumDpt].DptCod == DptCod,false, DptInLst = &Departments.Lst[NumDpt];
"%s",Departments.Lst[NumDpt].FullName); HTM_OPTION (HTM_Type_LONG,&DptInLst->DptCod,
DptInLst->DptCod == DptCod, // Selected?
false, // Not disabled
"%s",DptInLst->FullName);
}
/* End selector */ /* End selector */
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -680,7 +680,8 @@ void Enr_AskRemoveOldUsrs (void)
Months <= Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS; Months <= Usr_MAX_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS;
Months++) Months++)
HTM_OPTION (HTM_Type_UNSIGNED,&Months, HTM_OPTION (HTM_Type_UNSIGNED,&Months,
Months == Usr_DEF_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS,false, Months == Usr_DEF_MONTHS_WITHOUT_ACCESS_TO_REMOVE_OLD_USRS, // Selected?
false, // Not disabled
"%u",Months); "%u",Months);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_NBSP (); HTM_NBSP ();

View File

@ -815,9 +815,18 @@ static void ExaPrn_WriteTF_AnsToFill (const struct ExaPrn_Print *Print,
HTM_TxtF ("<select id=\"%s\" name=\"Ans\"",Id); HTM_TxtF ("<select id=\"%s\" name=\"Ans\"",Id);
ExaPrn_WriteJSToUpdateExamPrint (Print,QstInd,Id,-1); ExaPrn_WriteJSToUpdateExamPrint (Print,QstInd,Id,-1);
HTM_Txt (" />"); HTM_Txt (" />");
HTM_OPTION (HTM_Type_STRING,"" ,Print->PrintedQuestions[QstInd].StrAnswers[0] == '\0',false,"&nbsp;"); HTM_OPTION (HTM_Type_STRING,"" ,
HTM_OPTION (HTM_Type_STRING,"T",Print->PrintedQuestions[QstInd].StrAnswers[0] == 'T' ,false,"%s",Txt_TF_QST[0]); Print->PrintedQuestions[QstInd].StrAnswers[0] == '\0',// Selected?
HTM_OPTION (HTM_Type_STRING,"F",Print->PrintedQuestions[QstInd].StrAnswers[0] == 'F' ,false,"%s",Txt_TF_QST[1]); false, // Not disabled
"&nbsp;");
HTM_OPTION (HTM_Type_STRING,"T",
Print->PrintedQuestions[QstInd].StrAnswers[0] == 'T', // Selected?
false, // Not disabled
"%s",Txt_TF_QST[0]);
HTM_OPTION (HTM_Type_STRING,"F",
Print->PrintedQuestions[QstInd].StrAnswers[0] == 'F', // Selected?
false, // Not disabled
"%s",Txt_TF_QST[1]);
HTM_Txt ("</select>"); HTM_Txt ("</select>");
} }

View File

@ -124,7 +124,8 @@ static void Fig_ReqShowFigure (Fig_FigureType_t SelectedFigureType)
{ {
FigureTypeUnsigned = (unsigned) FigType; FigureTypeUnsigned = (unsigned) FigType;
HTM_OPTION (HTM_Type_UNSIGNED,&FigureTypeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&FigureTypeUnsigned,
FigType == SelectedFigureType,false, FigType == SelectedFigureType, // Selected?
false, // Not disabled?
"%s",Txt_FIGURE_TYPES[FigType]); "%s",Txt_FIGURE_TYPES[FigType]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -1264,10 +1264,12 @@ static void Grp_ListGroupTypesForEdition (void)
" class=\"INPUT_%s\" style=\"width:150px;\"", " class=\"INPUT_%s\" style=\"width:150px;\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"N", HTM_OPTION (HTM_Type_STRING,"N",
!Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MandatoryEnrolment,false, !Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MandatoryEnrolment, // Selected?
false, // Not disabled
"%s",Txt_It_is_optional_to_choose_a_group); "%s",Txt_It_is_optional_to_choose_a_group);
HTM_OPTION (HTM_Type_STRING,"Y", HTM_OPTION (HTM_Type_STRING,"Y",
Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MandatoryEnrolment,false, Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MandatoryEnrolment, // Selected?
false, // Not disabled
"%s",Txt_It_is_mandatory_to_choose_a_group); "%s",Txt_It_is_mandatory_to_choose_a_group);
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -1282,10 +1284,12 @@ static void Grp_ListGroupTypesForEdition (void)
" class=\"INPUT_%s\" style=\"width:150px;\"", " class=\"INPUT_%s\" style=\"width:150px;\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"N", HTM_OPTION (HTM_Type_STRING,"N",
!Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MultipleEnrolment,false, !Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MultipleEnrolment, // Selected?
false, // Not disabled
"%s",Txt_A_student_can_only_belong_to_one_group); "%s",Txt_A_student_can_only_belong_to_one_group);
HTM_OPTION (HTM_Type_STRING,"Y", HTM_OPTION (HTM_Type_STRING,"Y",
Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MultipleEnrolment,false, Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].MultipleEnrolment, // Selected?
false, // Not disabled
"%s",Txt_A_student_can_belong_to_several_groups); "%s",Txt_A_student_can_belong_to_several_groups);
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -1400,13 +1404,14 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
{ {
extern const char *Txt_No_assigned_room; extern const char *Txt_No_assigned_room;
extern const char *Txt_Another_room; extern const char *Txt_Another_room;
unsigned NumGrpTyp; unsigned NumGrpTyp1;
unsigned NumTipGrpAux; const struct GroupType *GrpTyp1InLst;
unsigned NumGrpTyp2;
const struct GroupType *GrpTyp2InLst;
unsigned NumGrpThisType; unsigned NumGrpThisType;
unsigned NumRoo;
struct GroupType *GrpTyp;
struct GroupType *GrpTypAux;
struct Group *Grp; struct Group *Grp;
unsigned NumRoo;
const struct Roo_Room *RooInLst;
Rol_Role_t Role; Rol_Role_t Role;
char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
@ -1417,16 +1422,16 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
Grp_WriteHeadingGroups (); Grp_WriteHeadingGroups ();
/***** List the groups *****/ /***** List the groups *****/
for (NumGrpTyp = 0; for (NumGrpTyp1 = 0;
NumGrpTyp < Gbl.Crs.Grps.GrpTypes.NumGrpTypes; NumGrpTyp1 < Gbl.Crs.Grps.GrpTypes.NumGrpTypes;
NumGrpTyp++) NumGrpTyp1++)
{ {
GrpTyp = &Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp]; GrpTyp1InLst = &Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp1];
for (NumGrpThisType = 0; for (NumGrpThisType = 0;
NumGrpThisType < GrpTyp->NumGrps; NumGrpThisType < GrpTyp1InLst->NumGrps;
NumGrpThisType++) NumGrpThisType++)
{ {
Grp = &(GrpTyp->LstGrps[NumGrpThisType]); Grp = &GrpTyp1InLst->LstGrps[NumGrpThisType];
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
@ -1477,14 +1482,15 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
The_GetSuffix ()); The_GetSuffix ());
/* Options for group types */ /* Options for group types */
for (NumTipGrpAux = 0; for (NumGrpTyp2 = 0;
NumTipGrpAux < Gbl.Crs.Grps.GrpTypes.NumGrpTypes; NumGrpTyp2 < Gbl.Crs.Grps.GrpTypes.NumGrpTypes;
NumTipGrpAux++) NumGrpTyp2++)
{ {
GrpTypAux = &Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumTipGrpAux]; GrpTyp2InLst = &Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp2];
HTM_OPTION (HTM_Type_LONG,&GrpTypAux->GrpTypCod, HTM_OPTION (HTM_Type_LONG,&GrpTyp2InLst->GrpTypCod,
GrpTypAux->GrpTypCod == GrpTyp->GrpTypCod,false, GrpTyp2InLst->GrpTypCod == GrpTyp1InLst->GrpTypCod, // Selected?
"%s",GrpTypAux->GrpTypName); false, // Not disabled
"%s",GrpTyp2InLst->GrpTypName);
} }
/* End selector */ /* End selector */
@ -1515,7 +1521,8 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
/* Option for no assigned room */ /* Option for no assigned room */
HTM_OPTION (HTM_Type_STRING,"-1", HTM_OPTION (HTM_Type_STRING,"-1",
Grp->Room.RooCod < 0,false, Grp->Room.RooCod < 0, // Selected?
false, // Not disabled
"%s",Txt_No_assigned_room); "%s",Txt_No_assigned_room);
/* Option for another room */ /* Option for another room */
@ -1527,9 +1534,13 @@ static void Grp_ListGroupsForEdition (const struct Roo_Rooms *Rooms)
for (NumRoo = 0; for (NumRoo = 0;
NumRoo < Rooms->Num; NumRoo < Rooms->Num;
NumRoo++) NumRoo++)
HTM_OPTION (HTM_Type_LONG,&Rooms->Lst[NumRoo].RooCod, {
Rooms->Lst[NumRoo].RooCod == Grp->Room.RooCod,false, RooInLst = &Rooms->Lst[NumRoo];
"%s",Rooms->Lst[NumRoo].ShrtName); HTM_OPTION (HTM_Type_LONG,&RooInLst->RooCod,
RooInLst->RooCod == Grp->Room.RooCod, // Selected
false, // Not disabled
"%s",RooInLst->ShrtName);
}
/* End selector */ /* End selector */
HTM_SELECT_End (); HTM_SELECT_End ();
@ -2437,10 +2448,12 @@ static void Grp_PutFormToCreateGroupType (void)
" class=\"INPUT_%s\" style=\"width:150px;\"", " class=\"INPUT_%s\" style=\"width:150px;\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"N", HTM_OPTION (HTM_Type_STRING,"N",
!Gbl.Crs.Grps.GrpTyp.MandatoryEnrolment,false, !Gbl.Crs.Grps.GrpTyp.MandatoryEnrolment, // Selected?
false, // Not disabled
"%s",Txt_It_is_optional_to_choose_a_group); "%s",Txt_It_is_optional_to_choose_a_group);
HTM_OPTION (HTM_Type_STRING,"Y", HTM_OPTION (HTM_Type_STRING,"Y",
Gbl.Crs.Grps.GrpTyp.MandatoryEnrolment,false, Gbl.Crs.Grps.GrpTyp.MandatoryEnrolment, // Selected?
false, // Not disabled
"%s",Txt_It_is_mandatory_to_choose_a_group); "%s",Txt_It_is_mandatory_to_choose_a_group);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -2452,10 +2465,12 @@ static void Grp_PutFormToCreateGroupType (void)
" class=\"INPUT_%s\" style=\"width:150px;\"", " class=\"INPUT_%s\" style=\"width:150px;\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"N", HTM_OPTION (HTM_Type_STRING,"N",
!Gbl.Crs.Grps.GrpTyp.MultipleEnrolment,false, !Gbl.Crs.Grps.GrpTyp.MultipleEnrolment, // Selected?
false, // Not disabled
"%s",Txt_A_student_can_only_belong_to_one_group); "%s",Txt_A_student_can_only_belong_to_one_group);
HTM_OPTION (HTM_Type_STRING,"Y", HTM_OPTION (HTM_Type_STRING,"Y",
Gbl.Crs.Grps.GrpTyp.MultipleEnrolment,false, Gbl.Crs.Grps.GrpTyp.MultipleEnrolment, // Selected?
false, // Not disabled
"%s",Txt_A_student_can_belong_to_several_groups); "%s",Txt_A_student_can_belong_to_several_groups);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -2520,7 +2535,9 @@ static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms)
extern const char *Txt_Another_room; extern const char *Txt_Another_room;
extern const char *Txt_Create_group; extern const char *Txt_Create_group;
unsigned NumGrpTyp; unsigned NumGrpTyp;
const struct GroupType *GrpTypInLst;
unsigned NumRoo; unsigned NumRoo;
const struct Roo_Room *RooInLst;
Rol_Role_t Role; Rol_Role_t Role;
char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrMaxStudents[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
@ -2566,10 +2583,13 @@ static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms)
for (NumGrpTyp = 0; for (NumGrpTyp = 0;
NumGrpTyp < Gbl.Crs.Grps.GrpTypes.NumGrpTypes; NumGrpTyp < Gbl.Crs.Grps.GrpTypes.NumGrpTypes;
NumGrpTyp++) NumGrpTyp++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod, {
Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypCod == GrpTypInLst = &Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp];
Gbl.Crs.Grps.GrpTyp.GrpTypCod,false, HTM_OPTION (HTM_Type_LONG,&GrpTypInLst->GrpTypCod,
"%s",Gbl.Crs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName); GrpTypInLst->GrpTypCod == Gbl.Crs.Grps.GrpTyp.GrpTypCod, // Selected?
false, // Not disabled
"%s",GrpTypInLst->GrpTypName);
}
/* End selector */ /* End selector */
HTM_SELECT_End (); HTM_SELECT_End ();
@ -2593,20 +2613,28 @@ static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms)
The_GetSuffix ()); The_GetSuffix ());
/* Option for no assigned room */ /* Option for no assigned room */
HTM_OPTION (HTM_Type_STRING,"-1",Gbl.Crs.Grps.RooCod < 0,false, HTM_OPTION (HTM_Type_STRING,"-1",
Gbl.Crs.Grps.RooCod < 0, // Selected?
false, // Not disabled
"%s",Txt_No_assigned_room); "%s",Txt_No_assigned_room);
/* Option for another room */ /* Option for another room */
HTM_OPTION (HTM_Type_STRING,"0",Gbl.Crs.Grps.RooCod == 0,false, HTM_OPTION (HTM_Type_STRING,"0",
Gbl.Crs.Grps.RooCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_room); "%s",Txt_Another_room);
/* Options for rooms */ /* Options for rooms */
for (NumRoo = 0; for (NumRoo = 0;
NumRoo < Rooms->Num; NumRoo < Rooms->Num;
NumRoo++) NumRoo++)
HTM_OPTION (HTM_Type_LONG,&Rooms->Lst[NumRoo].RooCod, {
Rooms->Lst[NumRoo].RooCod == Gbl.Crs.Grps.RooCod,false, RooInLst = &Rooms->Lst[NumRoo];
"%s",Rooms->Lst[NumRoo].ShrtName); HTM_OPTION (HTM_Type_LONG,&RooInLst->RooCod,
RooInLst->RooCod == Gbl.Crs.Grps.RooCod, // Selected?
false, // Not disabled
"%s",RooInLst->ShrtName);
}
/* End selector */ /* End selector */
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -810,11 +810,15 @@ void Hie_WriteStatusCellEditable (bool ICanEdit,Hie_Status_t Status,
"name=\"Status\" class=\"INPUT_STATUS\""); "name=\"Status\" class=\"INPUT_STATUS\"");
StatusUnsigned = (unsigned) Hie_GetStatusBitsFromStatusTxt (Hie_STATUS_PENDING); StatusUnsigned = (unsigned) Hie_GetStatusBitsFromStatusTxt (Hie_STATUS_PENDING);
HTM_OPTION (HTM_Type_UNSIGNED,&StatusUnsigned,true,false, HTM_OPTION (HTM_Type_UNSIGNED,&StatusUnsigned,
true, // Selected
false, // Not disabled
"%s",Txt[Hie_STATUS_PENDING]); "%s",Txt[Hie_STATUS_PENDING]);
StatusUnsigned = (unsigned) Hie_GetStatusBitsFromStatusTxt (Hie_STATUS_ACTIVE); StatusUnsigned = (unsigned) Hie_GetStatusBitsFromStatusTxt (Hie_STATUS_ACTIVE);
HTM_OPTION (HTM_Type_UNSIGNED,&StatusUnsigned,false,false, HTM_OPTION (HTM_Type_UNSIGNED,&StatusUnsigned,
false, // Not selected
false, // Not disabled
"%s",Txt[Hie_STATUS_ACTIVE]); "%s",Txt[Hie_STATUS_ACTIVE]);
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -481,8 +481,9 @@ static void Hld_ListHolidaysForEdition (const struct Hld_Holidays *Holidays,
extern const char *Txt_All_places; extern const char *Txt_All_places;
extern const char *Txt_HOLIDAY_TYPES[Hld_NUM_TYPES_HOLIDAY]; extern const char *Txt_HOLIDAY_TYPES[Hld_NUM_TYPES_HOLIDAY];
unsigned NumHld; unsigned NumHld;
struct Hld_Holiday *HldInLst;
unsigned NumPlc; unsigned NumPlc;
struct Hld_Holiday *Hld; const struct Plc_Place *PlcInLst;
Hld_HolidayType_t HolidayType; Hld_HolidayType_t HolidayType;
unsigned HolidayTypeUnsigned; unsigned HolidayTypeUnsigned;
unsigned CurrentYear = Dat_GetCurrentYear (); unsigned CurrentYear = Dat_GetCurrentYear ();
@ -500,36 +501,42 @@ static void Hld_ListHolidaysForEdition (const struct Hld_Holidays *Holidays,
NumHld < Holidays->Num; NumHld < Holidays->Num;
NumHld++) NumHld++)
{ {
Hld = &Holidays->Lst[NumHld]; HldInLst = &Holidays->Lst[NumHld];
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Put icon to remove holiday */ /* Put icon to remove holiday */
HTM_TD_Begin ("class=\"BM\""); HTM_TD_Begin ("class=\"BM\"");
Ico_PutContextualIconToRemove (ActRemHld,NULL, Ico_PutContextualIconToRemove (ActRemHld,NULL,
Hld_PutParHldCod,&Hld->HldCod); Hld_PutParHldCod,&HldInLst->HldCod);
HTM_TD_End (); HTM_TD_End ();
/* Holiday code */ /* Holiday code */
HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ());
HTM_TxtF ("%ld&nbsp;",Hld->HldCod); HTM_TxtF ("%ld&nbsp;",HldInLst->HldCod);
HTM_TD_End (); HTM_TD_End ();
/* Holiday place */ /* Holiday place */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgHldPlc); Frm_BeginForm (ActChgHldPlc);
ParCod_PutPar (ParCod_Hld,Hld->HldCod); ParCod_PutPar (ParCod_Hld,HldInLst->HldCod);
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL,
"name=\"PlcCod\" class=\"PLC_SEL INPUT_%s\"", "name=\"PlcCod\" class=\"PLC_SEL INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1",Hld->PlcCod <= 0,false, HTM_OPTION (HTM_Type_STRING,"-1",
HldInLst->PlcCod <= 0, // Selected?
false, // Not disabled
"%s",Txt_All_places); "%s",Txt_All_places);
for (NumPlc = 0; for (NumPlc = 0;
NumPlc < Places->Num; NumPlc < Places->Num;
NumPlc++) NumPlc++)
HTM_OPTION (HTM_Type_LONG,&Places->Lst[NumPlc].PlcCod, {
Places->Lst[NumPlc].PlcCod == Hld->PlcCod,false, PlcInLst = &Places->Lst[NumPlc];
"%s",Places->Lst[NumPlc].ShrtName); HTM_OPTION (HTM_Type_LONG,&PlcInLst->PlcCod,
PlcInLst->PlcCod == HldInLst->PlcCod, // Selected?
false, // Not disabled
"%s",PlcInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
@ -537,7 +544,7 @@ static void Hld_ListHolidaysForEdition (const struct Hld_Holidays *Holidays,
/* Holiday type */ /* Holiday type */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgHldTyp); Frm_BeginForm (ActChgHldTyp);
ParCod_PutPar (ParCod_Hld,Hld->HldCod); ParCod_PutPar (ParCod_Hld,HldInLst->HldCod);
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL,
"name=\"HldTyp\" class=\"INPUT_%s\"" "name=\"HldTyp\" class=\"INPUT_%s\""
" style=\"width:62px;\"", // TODO: Use a CSS class " style=\"width:62px;\"", // TODO: Use a CSS class
@ -548,7 +555,8 @@ static void Hld_ListHolidaysForEdition (const struct Hld_Holidays *Holidays,
{ {
HolidayTypeUnsigned = (unsigned) HolidayType; HolidayTypeUnsigned = (unsigned) HolidayType;
HTM_OPTION (HTM_Type_UNSIGNED,&HolidayTypeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&HolidayTypeUnsigned,
HolidayType == Hld->HldTyp,false, HolidayType == HldInLst->HldTyp, // Selected?
false, // Not disabled
"%s",Txt_HOLIDAY_TYPES[HolidayType]); "%s",Txt_HOLIDAY_TYPES[HolidayType]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -558,7 +566,7 @@ static void Hld_ListHolidaysForEdition (const struct Hld_Holidays *Holidays,
/* Holiday date / Non school period start date */ /* Holiday date / Non school period start date */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgHldStrDat); Frm_BeginForm (ActChgHldStrDat);
ParCod_PutPar (ParCod_Hld,Hld->HldCod); ParCod_PutPar (ParCod_Hld,HldInLst->HldCod);
Dat_WriteFormDate (CurrentYear - 1, Dat_WriteFormDate (CurrentYear - 1,
CurrentYear + 1, CurrentYear + 1,
"Start", "Start",
@ -571,21 +579,21 @@ static void Hld_ListHolidaysForEdition (const struct Hld_Holidays *Holidays,
/* Non school period end date */ /* Non school period end date */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgHldEndDat); Frm_BeginForm (ActChgHldEndDat);
ParCod_PutPar (ParCod_Hld,Hld->HldCod); ParCod_PutPar (ParCod_Hld,HldInLst->HldCod);
Dat_WriteFormDate (CurrentYear - 1, Dat_WriteFormDate (CurrentYear - 1,
CurrentYear + 1, CurrentYear + 1,
"End", "End",
&(Holidays->Lst[NumHld].EndDate), &(Holidays->Lst[NumHld].EndDate),
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
(Hld->HldTyp == Hld_HOLIDAY)); (HldInLst->HldTyp == Hld_HOLIDAY));
Frm_EndForm (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
/* Holiday name */ /* Holiday name */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActRenHld); Frm_BeginForm (ActRenHld);
ParCod_PutPar (ParCod_Hld,Hld->HldCod); ParCod_PutPar (ParCod_Hld,HldInLst->HldCod);
HTM_INPUT_TEXT ("Name",Hld_MAX_CHARS_HOLIDAY_NAME,Hld->Name, HTM_INPUT_TEXT ("Name",Hld_MAX_CHARS_HOLIDAY_NAME,HldInLst->Name,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"size=\"20\" class=\"INPUT_%s\"", "size=\"20\" class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -654,10 +662,8 @@ void Hld_ChangeHolidayPlace (void)
// <0 (place unspecified/all places) and 0 (another place) are allowed here // <0 (place unspecified/all places) and 0 (another place) are allowed here
NewPlace.PlcCod = ParCod_GetPar (ParCod_Plc); NewPlace.PlcCod = ParCod_GetPar (ParCod_Plc);
/***** Get from the database the data of the place *****/ /***** Get place and holiday data from database *****/
Plc_GetPlaceDataByCod (&NewPlace); Plc_GetPlaceDataByCod (&NewPlace);
/***** Get from the database the data of the holiday *****/
Hld_GetHolidayDataByCod (Hld_EditingHld); Hld_GetHolidayDataByCod (Hld_EditingHld);
/***** Update the place in database *****/ /***** Update the place in database *****/
@ -866,6 +872,7 @@ static void Hld_PutFormToCreateHoliday (const struct Plc_Places *Places)
extern const char *Txt_HOLIDAY_TYPES[Hld_NUM_TYPES_HOLIDAY]; extern const char *Txt_HOLIDAY_TYPES[Hld_NUM_TYPES_HOLIDAY];
extern const char *Txt_Create_holiday; extern const char *Txt_Create_holiday;
unsigned NumPlc; unsigned NumPlc;
const struct Plc_Place *PlcInLst;
Hld_HolidayType_t HolidayType; Hld_HolidayType_t HolidayType;
unsigned HolidayTypeUnsigned; unsigned HolidayTypeUnsigned;
unsigned CurrentYear = Dat_GetCurrentYear (); unsigned CurrentYear = Dat_GetCurrentYear ();
@ -894,14 +901,20 @@ static void Hld_PutFormToCreateHoliday (const struct Plc_Places *Places)
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL,
"name=\"PlcCod\" class=\"PLC_SEL INPUT_%s\"", "name=\"PlcCod\" class=\"PLC_SEL INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1",Hld_EditingHld->PlcCod <= 0,false, HTM_OPTION (HTM_Type_STRING,"-1",
Hld_EditingHld->PlcCod <= 0, // Selected?
false, // Not disabled
"%s",Txt_All_places); "%s",Txt_All_places);
for (NumPlc = 0; for (NumPlc = 0;
NumPlc < Places->Num; NumPlc < Places->Num;
NumPlc++) NumPlc++)
HTM_OPTION (HTM_Type_LONG,&Places->Lst[NumPlc].PlcCod, {
Places->Lst[NumPlc].PlcCod == Hld_EditingHld->PlcCod,false, PlcInLst = &Places->Lst[NumPlc];
"%s",Places->Lst[NumPlc].ShrtName); HTM_OPTION (HTM_Type_LONG,&PlcInLst->PlcCod,
PlcInLst->PlcCod == Hld_EditingHld->PlcCod, // Selected?
false, // Not disabled
"%s",PlcInLst->ShrtName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -917,7 +930,8 @@ static void Hld_PutFormToCreateHoliday (const struct Plc_Places *Places)
{ {
HolidayTypeUnsigned = (unsigned) HolidayType; HolidayTypeUnsigned = (unsigned) HolidayType;
HTM_OPTION (HTM_Type_UNSIGNED,&HolidayTypeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&HolidayTypeUnsigned,
HolidayType == Hld_EditingHld->HldTyp,false, HolidayType == Hld_EditingHld->HldTyp, // Selected?
false, // Not disabled
"%s",Txt_HOLIDAY_TYPES[HolidayType]); "%s",Txt_HOLIDAY_TYPES[HolidayType]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -878,7 +878,8 @@ void Ins_WriteSelectorOfInstitution (void)
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"", HTM_OPTION (HTM_Type_STRING,"",
Gbl.Hierarchy.Ins.InsCod < 0,true, Gbl.Hierarchy.Ins.InsCod < 0, // Selected?
true, // Disabled
"[%s]",Txt_Institution); "[%s]",Txt_Institution);
if (Gbl.Hierarchy.Cty.CtyCod > 0) if (Gbl.Hierarchy.Cty.CtyCod > 0)
@ -901,7 +902,8 @@ void Ins_WriteSelectorOfInstitution (void)
/* Write option */ /* Write option */
HTM_OPTION (HTM_Type_LONG,&InsCod, HTM_OPTION (HTM_Type_LONG,&InsCod,
Gbl.Hierarchy.Ins.InsCod > 0 && Gbl.Hierarchy.Ins.InsCod > 0 &&
InsCod == Gbl.Hierarchy.Ins.InsCod,false, InsCod == Gbl.Hierarchy.Ins.InsCod, // Selected?
false, // Not disabled
"%s",row[1]); "%s",row[1]);
} }

View File

@ -64,7 +64,7 @@ typedef enum
struct ListInstits struct ListInstits
{ {
unsigned Num; // Number of institutions unsigned Num; // Number of institutions
struct Ins_Instit *Lst; // List of institutions struct Ins_Instit *Lst; // List of institutions
Ins_Order_t SelectedOrder; // Order of institutions Ins_Order_t SelectedOrder; // Order of institutions
}; };

View File

@ -309,6 +309,7 @@ static void InsCfg_Country (bool PrintView,bool PutForm)
extern const char *Par_CodeStr[]; extern const char *Par_CodeStr[];
extern const char *Txt_Country; extern const char *Txt_Country;
unsigned NumCty; unsigned NumCty;
const struct Cty_Countr *CtyInLst;
/***** Get list of countries *****/ /***** Get list of countries *****/
Cty_GetBasicListOfCountries (); Cty_GetBasicListOfCountries ();
@ -334,9 +335,13 @@ static void InsCfg_Country (bool PrintView,bool PutForm)
for (NumCty = 0; for (NumCty = 0;
NumCty < Gbl.Hierarchy.Ctys.Num; NumCty < Gbl.Hierarchy.Ctys.Num;
NumCty++) NumCty++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod, {
Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod == Gbl.Hierarchy.Cty.CtyCod,false, CtyInLst = &Gbl.Hierarchy.Ctys.Lst[NumCty];
"%s",Gbl.Hierarchy.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); HTM_OPTION (HTM_Type_LONG,&CtyInLst->CtyCod,
CtyInLst->CtyCod == Gbl.Hierarchy.Cty.CtyCod, // Selected?
false, // Not disabled
"%s",CtyInLst->Name[Gbl.Prefs.Language]);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
} }

View File

@ -137,7 +137,8 @@ void Lan_PutSelectorToSelectLanguage (void)
{ {
LanUnsigned = (unsigned) Lan; LanUnsigned = (unsigned) Lan;
HTM_OPTION (HTM_Type_UNSIGNED,&LanUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&LanUnsigned,
Lan == Gbl.Prefs.Language,false, Lan == Gbl.Prefs.Language, // Selected?
false, // Not disabled
"%s",Txt_STR_LANG_NAME[Lan]); "%s",Txt_STR_LANG_NAME[Lan]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -1822,7 +1822,8 @@ static void Msg_ShowFormSelectCourseSentOrRecMsgs (const struct Msg_Messages *Me
/* Write a first option to select any course */ /* Write a first option to select any course */
HTM_OPTION (HTM_Type_STRING,"", HTM_OPTION (HTM_Type_STRING,"",
Messages->FilterCrsCod < 0,false, Messages->FilterCrsCod < 0, // Selected?
false, // Not disabled
"%s",Txt_any_course); "%s",Txt_any_course);
/* Write an option for each origin course */ /* Write an option for each origin course */
@ -1835,7 +1836,8 @@ static void Msg_ShowFormSelectCourseSentOrRecMsgs (const struct Msg_Messages *Me
if ((CrsCod = Str_ConvertStrCodToLongCod (row[0])) > 0) if ((CrsCod = Str_ConvertStrCodToLongCod (row[0])) > 0)
HTM_OPTION (HTM_Type_LONG,&CrsCod, HTM_OPTION (HTM_Type_LONG,&CrsCod,
CrsCod == Messages->FilterCrsCod,false, CrsCod == Messages->FilterCrsCod, // Selected?
false, // Not disabled
"%s",row[1]); // Course short name "%s",row[1]); // Course short name
} }

View File

@ -1802,7 +1802,8 @@ static void Pho_PutSelectorForTypeOfAvg (const struct Pho_DegPhotos *DegPhotos)
{ {
TypeOfAvgUnsigned = (unsigned) TypeOfAvg; TypeOfAvgUnsigned = (unsigned) TypeOfAvg;
HTM_OPTION (HTM_Type_UNSIGNED,&TypeOfAvgUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&TypeOfAvgUnsigned,
TypeOfAvg == DegPhotos->TypeOfAverage,false, TypeOfAvg == DegPhotos->TypeOfAverage, // Selected?
false, // Not disabled
"%s",Txt_AVERAGE_PHOTO_TYPES[TypeOfAvg]); "%s",Txt_AVERAGE_PHOTO_TYPES[TypeOfAvg]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -1867,7 +1868,8 @@ static void Pho_PutSelectorForHowComputePhotoSize (const struct Pho_DegPhotos *D
{ {
PhoSiUnsigned = (unsigned) PhoSi; PhoSiUnsigned = (unsigned) PhoSi;
HTM_OPTION (HTM_Type_UNSIGNED,&PhoSiUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&PhoSiUnsigned,
PhoSi == DegPhotos->HowComputePhotoSize,false, PhoSi == DegPhotos->HowComputePhotoSize, // Selected?
false, // Not disabled
"%s",Txt_STAT_DEGREE_PHOTO_SIZE[PhoSi]); "%s",Txt_STAT_DEGREE_PHOTO_SIZE[PhoSi]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -1931,7 +1933,8 @@ static void Pho_PutSelectorForHowOrderDegrees (const struct Pho_DegPhotos *DegPh
{ {
OrderUnsigned = (unsigned) Order; OrderUnsigned = (unsigned) Order;
HTM_OPTION (HTM_Type_UNSIGNED,&OrderUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&OrderUnsigned,
Order == DegPhotos->HowOrderDegrees,false, Order == DegPhotos->HowOrderDegrees, // Selected?
false, // Not disabled
"%s",Txt_STAT_DEGREE_PHOTO_ORDER[Order]); "%s",Txt_STAT_DEGREE_PHOTO_ORDER[Order]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -2047,7 +2050,9 @@ static void Pho_PutLinkToCalculateDegreeStats (const struct Pho_DegPhotos *DegPh
// Too recently computed ? // Too recently computed ?
Disabled = Pho_GetTimeAvgPhotoWasComputed (Degs.Lst[NumDeg].DegCod) >= Disabled = Pho_GetTimeAvgPhotoWasComputed (Degs.Lst[NumDeg].DegCod) >=
Dat_GetStartExecutionTimeUTC () - Cfg_MIN_TIME_TO_RECOMPUTE_AVG_PHOTO; Dat_GetStartExecutionTimeUTC () - Cfg_MIN_TIME_TO_RECOMPUTE_AVG_PHOTO;
HTM_OPTION (HTM_Type_LONG,&Degs.Lst[NumDeg].DegCod,Selected,Disabled, HTM_OPTION (HTM_Type_LONG,&Degs.Lst[NumDeg].DegCod,
Selected,
Disabled,
"%s (%s: %s)", "%s (%s: %s)",
Degs.Lst[NumDeg].ShrtName, Degs.Lst[NumDeg].ShrtName,
Txt_time,StrEstimatedTimeToComputeAvgPhoto); Txt_time,StrEstimatedTimeToComputeAvgPhoto);

View File

@ -547,7 +547,7 @@ void Plc_RemovePlace (void)
/***** Get place code *****/ /***** Get place code *****/
Plc_EditingPlc->PlcCod = ParCod_GetAndCheckPar (ParCod_Plc); Plc_EditingPlc->PlcCod = ParCod_GetAndCheckPar (ParCod_Plc);
/***** Get data of the place from database *****/ /***** Get place data from database *****/
Plc_GetPlaceDataByCod (Plc_EditingPlc); Plc_GetPlaceDataByCod (Plc_EditingPlc);
/***** Check if this place has centers *****/ /***** Check if this place has centers *****/
@ -630,7 +630,7 @@ static void Plc_RenamePlace (Cns_ShrtOrFullName_t ShrtOrFullName)
/* Get the new name for the place */ /* Get the new name for the place */
Par_GetParText (ParName,NewPlcName,MaxBytes); Par_GetParText (ParName,NewPlcName,MaxBytes);
/***** Get from the database the old names of the place *****/ /***** Get place old names from database *****/
Plc_GetPlaceDataByCod (Plc_EditingPlc); Plc_GetPlaceDataByCod (Plc_EditingPlc);
/***** Check if new name is empty *****/ /***** Check if new name is empty *****/

View File

@ -345,7 +345,7 @@ void Prj_ResetPrjsAndReadConfig (struct Prj_Projects *Projects)
Projects->Prj.PrjCod = -1L; Projects->Prj.PrjCod = -1L;
/***** Read project configuration from database *****/ /***** Read project configuration from database *****/
PrjCfg_GetConfig (Projects); PrjCfg_GetConfig (&Projects->Config);
} }
/*****************************************************************************/ /*****************************************************************************/
@ -1852,7 +1852,8 @@ static void Prj_PutSelectorReviewStatus (struct Prj_Projects *Projects)
{ {
ReviewStatusUnsigned = (unsigned) ReviewStatus; ReviewStatusUnsigned = (unsigned) ReviewStatus;
HTM_OPTION (HTM_Type_UNSIGNED,&ReviewStatusUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ReviewStatusUnsigned,
ReviewStatus == Projects->Prj.Review.Status,false, ReviewStatus == Projects->Prj.Review.Status, // Selected?
false, // Not disabled
"%s",Txt_PROJECT_REVIEW_SINGUL[ReviewStatus]); "%s",Txt_PROJECT_REVIEW_SINGUL[ReviewStatus]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -3839,9 +3840,13 @@ static void Prj_PutFormProject (struct Prj_Projects *Projects,
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL,
"name=\"Assigned\" class=\"INPUT_%s\"", "name=\"Assigned\" class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"Y",Projects->Prj.Assigned == Prj_ASSIGNED,false, HTM_OPTION (HTM_Type_STRING,"Y",
Projects->Prj.Assigned == Prj_ASSIGNED, // Selected?
false, // Not disabled
"%s",Txt_Yes); "%s",Txt_Yes);
HTM_OPTION (HTM_Type_STRING,"N",Projects->Prj.Assigned == Prj_NONASSIG,false, HTM_OPTION (HTM_Type_STRING,"N",
Projects->Prj.Assigned == Prj_NONASSIG, // Selected?
false, // Not disabled
"%s",Txt_No); "%s",Txt_No);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -3882,7 +3887,8 @@ static void Prj_PutFormProject (struct Prj_Projects *Projects,
{ {
ProposalUnsigned = (unsigned) Proposal; ProposalUnsigned = (unsigned) Proposal;
HTM_OPTION (HTM_Type_UNSIGNED,&ProposalUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ProposalUnsigned,
Projects->Prj.Proposal == Proposal,false, Projects->Prj.Proposal == Proposal, // Selected?
false, // Not disabled
"%s",Txt_PROJECT_STATUS[Proposal]); "%s",Txt_PROJECT_STATUS[Proposal]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -30,6 +30,7 @@
#include "swad_browser.h" #include "swad_browser.h"
#include "swad_date.h" #include "swad_date.h"
#include "swad_notification.h" #include "swad_notification.h"
#include "swad_project_config.h"
#include "swad_user.h" #include "swad_user.h"
/*****************************************************************************/ /*****************************************************************************/
@ -185,10 +186,7 @@ struct Prj_Project
struct Prj_Projects struct Prj_Projects
{ {
Prj_ProjectView_t View; Prj_ProjectView_t View;
struct struct PrjCfg_Config Config;
{
bool NETCanCreate;
} Config;
struct Prj_Filter Filter; struct Prj_Filter Filter;
bool LstIsRead; // Is the list already read from database, or it needs to be read? bool LstIsRead; // Is the list already read from database, or it needs to be read?
unsigned Num; // Number of projects unsigned Num; // Number of projects

View File

@ -59,34 +59,42 @@ extern struct Globals Gbl;
/************************* Private global variables **************************/ /************************* Private global variables **************************/
/*****************************************************************************/ /*****************************************************************************/
static struct Rub_Rubric PrjCfg_Rubrics[PrjCfg_NUM_RUBRICS]; // static struct Rub_Rubric PrjCfg_Rubrics[PrjCfg_NUM_RUBRICS];
/*****************************************************************************/ /*****************************************************************************/
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void PrjCfg_ShowFormNETCanCreate (const struct Prj_Projects *Projects); static void PrjCfg_ShowFormNETCanCreate (const struct PrjCfg_Config *Config);
static void PrjCfg_ShowFormRubrics (void); static void PrjCfg_ShowFormRubrics (const struct PrjCfg_Config *Config);
static void PrjCfg_ShowFormRubric (struct Rub_Rubrics *Rubrics, static void PrjCfg_ShowFormRubric (const struct PrjCfg_Config *Config,
const struct Rub_Rubrics *Rubrics,
PrjCfg_Rubric_t WhichRubric); PrjCfg_Rubric_t WhichRubric);
static void PrjCfg_GetConfigDataFromRow (MYSQL_RES *mysql_res, static void PrjCfg_GetConfigDataFromRow (MYSQL_RES *mysql_res,
struct Prj_Projects *Projects); struct PrjCfg_Config *Config);
static bool PrjCfg_GetIfNETCanCreateFromForm (void); static bool PrjCfg_GetIfNETCanCreateFromForm (void);
/*****************************************************************************/ /*****************************************************************************/
/************** Get configuration of projects for current course *************/ /************** Get configuration of projects for current course *************/
/*****************************************************************************/ /*****************************************************************************/
void PrjCfg_GetConfig (struct Prj_Projects *Projects) void PrjCfg_GetConfig (struct PrjCfg_Config *Config)
{ {
MYSQL_RES *mysql_res; MYSQL_RES *mysql_res;
PrjCfg_Rubric_t WhichRubric;
/***** Get configuration of projects for current course from database *****/ /***** Get configuration of projects for current course from database *****/
if (Prj_DB_GetConfig (&mysql_res)) if (Prj_DB_GetConfig (&mysql_res))
PrjCfg_GetConfigDataFromRow (mysql_res,Projects); PrjCfg_GetConfigDataFromRow (mysql_res,Config);
else else
Projects->Config.NETCanCreate = PrjCfg_NET_CAN_CREATE_DEFAULT; {
for (WhichRubric = (PrjCfg_Rubric_t) 0;
WhichRubric <= (PrjCfg_Rubric_t) (PrjCfg_NUM_RUBRICS - 1);
WhichRubric++)
Config->RubCod[WhichRubric] = -1L;
Config->NETCanCreate = PrjCfg_NET_CAN_CREATE_DEFAULT;
}
/***** Free structure that stores the query result *****/ /***** Free structure that stores the query result *****/
DB_FreeMySQLResult (&mysql_res); DB_FreeMySQLResult (&mysql_res);
@ -132,10 +140,10 @@ void PrjCfg_ShowFormConfig (void)
HTM_TABLE_BeginCenterPadding (2); HTM_TABLE_BeginCenterPadding (2);
/***** Projects are editable by non-editing teachers? *****/ /***** Projects are editable by non-editing teachers? *****/
PrjCfg_ShowFormNETCanCreate (&Projects); PrjCfg_ShowFormNETCanCreate (&Projects.Config);
/***** Rubrics *****/ /***** Rubrics *****/
PrjCfg_ShowFormRubrics (); PrjCfg_ShowFormRubrics (&Projects.Config);
HTM_TABLE_End (); HTM_TABLE_End ();
@ -149,43 +157,11 @@ void PrjCfg_ShowFormConfig (void)
Box_BoxEnd (); Box_BoxEnd ();
} }
/*****************************************************************************/
/****** Show form to edit if non-editing teachers create new projects ********/
/*****************************************************************************/
static void PrjCfg_ShowFormNETCanCreate (const struct Prj_Projects *Projects)
{
extern const char *Txt_Create_project;
extern const char *Txt_Non_editing_teachers_can_create_new_projects;
HTM_TR_Begin (NULL);
/***** Label *****/
HTM_TD_Begin ("class=\"RM FORM_IN_%s\"",
The_GetSuffix ());
HTM_TxtColon (Txt_Create_project);
HTM_TD_End ();
/***** Data *****/
HTM_TD_Begin ("class=\"LM\"");
HTM_LABEL_Begin ("class=\"DAT_%s\"",
The_GetSuffix ());
HTM_INPUT_CHECKBOX ("NETCanCreate",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"NETCanCreate\" value=\"Y\"%s",
Projects->Config.NETCanCreate ? " checked=\"checked\"" :
"");
HTM_Txt (Txt_Non_editing_teachers_can_create_new_projects);
HTM_LABEL_End ();
HTM_TD_End ();
HTM_TR_End ();
}
/*****************************************************************************/ /*****************************************************************************/
/************ Show form to edit rubrics associated to projects ***************/ /************ Show form to edit rubrics associated to projects ***************/
/*****************************************************************************/ /*****************************************************************************/
static void PrjCfg_ShowFormRubrics (void) static void PrjCfg_ShowFormRubrics (const struct PrjCfg_Config *Config)
{ {
struct Rub_Rubrics Rubrics; struct Rub_Rubrics Rubrics;
PrjCfg_Rubric_t WhichRubric; PrjCfg_Rubric_t WhichRubric;
@ -200,43 +176,59 @@ static void PrjCfg_ShowFormRubrics (void)
for (WhichRubric = (PrjCfg_Rubric_t) 0; for (WhichRubric = (PrjCfg_Rubric_t) 0;
WhichRubric <= (PrjCfg_Rubric_t) (PrjCfg_NUM_RUBRICS - 1); WhichRubric <= (PrjCfg_Rubric_t) (PrjCfg_NUM_RUBRICS - 1);
WhichRubric++) WhichRubric++)
PrjCfg_ShowFormRubric (&Rubrics,WhichRubric); PrjCfg_ShowFormRubric (Config,&Rubrics,WhichRubric);
/***** Free list of rubrics *****/ /***** Free list of rubrics *****/
Rub_FreeListRubrics (&Rubrics); Rub_FreeListRubrics (&Rubrics);
} }
/*****************************************************************************/ /*****************************************************************************/
/************ Show form to edit rubrics associated to projects ***************/ /******** Show form to edit one of the rubrics associated to projects ********/
/*****************************************************************************/ /*****************************************************************************/
static void PrjCfg_ShowFormRubric (struct Rub_Rubrics *Rubrics, static void PrjCfg_ShowFormRubric (const struct PrjCfg_Config *Config,
const struct Rub_Rubrics *Rubrics,
PrjCfg_Rubric_t WhichRubric) PrjCfg_Rubric_t WhichRubric)
{ {
extern const char *Txt_PROJECT_RUBRIC[PrjCfg_NUM_RUBRICS]; extern const char *Txt_PROJECT_RUBRIC[PrjCfg_NUM_RUBRICS];
extern const char *Txt_no_rubric;
unsigned NumRub; unsigned NumRub;
const struct Rub_Rubric *Rubric;
long RubCodInConfig = Config->RubCod[WhichRubric];
/***** Row with form for rubric *****/ /***** Row with form for rubric *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Label */ /* Label */
HTM_TD_Begin ("class=\"RM FORM_IN_%s\"", HTM_TD_Begin ("class=\"RM FORM_IN_%s\"",The_GetSuffix ());
The_GetSuffix ());
HTM_TxtColon (Txt_PROJECT_RUBRIC[WhichRubric]); HTM_TxtColon (Txt_PROJECT_RUBRIC[WhichRubric]);
HTM_TD_End (); HTM_TD_End ();
/* Data */ /* Selector of rubrics */
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL,
"id=\"%s\" name=\"%s\" class=\"PrjCfg_RUBRIC_SEL\"", "id=\"%s\" name=\"%s\" class=\"PrjCfg_RUBRIC_SEL\"",
PrjCfg_RubricIDs[WhichRubric], PrjCfg_RubricIDs[WhichRubric],
PrjCfg_RubricIDs[WhichRubric]); PrjCfg_RubricIDs[WhichRubric]);
/* First option to indicate that no rubric is selected */
HTM_OPTION (HTM_Type_STRING,"-1",
RubCodInConfig <= 0, // Selected?
false, // Not disabled
"[%s]",Txt_no_rubric);
/* One option for each rubric in this course */
for (NumRub = 0; for (NumRub = 0;
NumRub < Rubrics->Num; NumRub < Rubrics->Num;
NumRub++) NumRub++)
HTM_OPTION (HTM_Type_LONG,&Rubrics->Lst[NumRub].RubCod, {
Rubrics->Lst[NumRub].RubCod == PrjCfg_Rubrics[WhichRubric].RubCod,false, Rubric = &Rubrics->Lst[NumRub];
"%s",Rubrics->Lst[NumRub].Title); HTM_OPTION (HTM_Type_LONG,&Rubric->RubCod,
Rubric->RubCod == RubCodInConfig, // Selected?
false, // Not disabled
"%s",Rubric->Title);
}
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -248,15 +240,57 @@ static void PrjCfg_ShowFormRubric (struct Rub_Rubrics *Rubrics,
/*****************************************************************************/ /*****************************************************************************/
static void PrjCfg_GetConfigDataFromRow (MYSQL_RES *mysql_res, static void PrjCfg_GetConfigDataFromRow (MYSQL_RES *mysql_res,
struct Prj_Projects *Projects) struct PrjCfg_Config *Config)
{ {
MYSQL_ROW row; MYSQL_ROW row;
PrjCfg_Rubric_t WhichRubric;
/***** Get row *****/ /***** Get row *****/
row = mysql_fetch_row (mysql_res); row = mysql_fetch_row (mysql_res);
/*
row[0] RubTutCod
row[1] RubEvlCod
row[2] RubGblCod
row[3] NETCanCreate
*/
/***** Get rubric codes (row[0], row[1], row[2] *****/
for (WhichRubric = (PrjCfg_Rubric_t) 0;
WhichRubric <= (PrjCfg_Rubric_t) (PrjCfg_NUM_RUBRICS - 1);
WhichRubric++)
Config->RubCod[WhichRubric] = Str_ConvertStrCodToLongCod (row[WhichRubric]);
/***** Get whether non-editing teachers can create new projects or not *****/ /***** Get whether non-editing teachers can create new projects or not (row[3]) *****/
Projects->Config.NETCanCreate = (row[0][0] == 'Y'); Config->NETCanCreate = (row[3][0] == 'Y');
}
/*****************************************************************************/
/****** Show form to edit if non-editing teachers create new projects ********/
/*****************************************************************************/
static void PrjCfg_ShowFormNETCanCreate (const struct PrjCfg_Config *Config)
{
extern const char *Txt_Create_project;
extern const char *Txt_Non_editing_teachers_can_create_new_projects;
HTM_TR_Begin (NULL);
/***** Label *****/
HTM_TD_Begin ("class=\"RM FORM_IN_%s\"",The_GetSuffix ());
HTM_TxtColon (Txt_Create_project);
HTM_TD_End ();
/***** Data *****/
HTM_TD_Begin ("class=\"LM\"");
HTM_LABEL_Begin ("class=\"DAT_%s\"",The_GetSuffix ());
HTM_INPUT_CHECKBOX ("NETCanCreate",HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"NETCanCreate\" value=\"Y\"%s",
Config->NETCanCreate ? " checked=\"checked\"" :
"");
HTM_Txt (Txt_Non_editing_teachers_can_create_new_projects);
HTM_LABEL_End ();
HTM_TD_End ();
HTM_TR_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -267,15 +301,22 @@ void PrjCfg_ReceiveConfig (void)
{ {
extern const char *Txt_The_configuration_of_the_projects_has_been_updated; extern const char *Txt_The_configuration_of_the_projects_has_been_updated;
struct Prj_Projects Projects; struct Prj_Projects Projects;
PrjCfg_Rubric_t WhichRubric;
/***** Reset projects *****/ /***** Reset projects *****/
Prj_ResetPrjsAndReadConfig (&Projects); Prj_ResetPrjsAndReadConfig (&Projects);
/***** Get rubric codes *****/
for (WhichRubric = (PrjCfg_Rubric_t) 0;
WhichRubric <= (PrjCfg_Rubric_t) (PrjCfg_NUM_RUBRICS - 1);
WhichRubric++)
Projects.Config.RubCod[WhichRubric] = Par_GetParLong (PrjCfg_RubricIDs[WhichRubric]);
/***** Get non-editing teachers can create new projects or not *****/ /***** Get non-editing teachers can create new projects or not *****/
Projects.Config.NETCanCreate = PrjCfg_GetIfNETCanCreateFromForm (); Projects.Config.NETCanCreate = PrjCfg_GetIfNETCanCreateFromForm ();
/***** Update database *****/ /***** Update database *****/
Prj_DB_UpdateCrsPrjsConfig (Projects.Config.NETCanCreate); Prj_DB_UpdateConfig (&Projects);
/***** Show confirmation message *****/ /***** Show confirmation message *****/
Ale_ShowAlert (Ale_SUCCESS,Txt_The_configuration_of_the_projects_has_been_updated); Ale_ShowAlert (Ale_SUCCESS,Txt_The_configuration_of_the_projects_has_been_updated);

View File

@ -27,6 +27,8 @@
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#include "swad_project.h"
/*****************************************************************************/ /*****************************************************************************/
/************************** Public types and constants ***********************/ /************************** Public types and constants ***********************/
/*****************************************************************************/ /*****************************************************************************/
@ -41,11 +43,17 @@ typedef enum
PrjCfg_RUBRIC_GBL, PrjCfg_RUBRIC_GBL,
} PrjCfg_Rubric_t; } PrjCfg_Rubric_t;
struct PrjCfg_Config
{
long RubCod[PrjCfg_NUM_RUBRICS];
bool NETCanCreate;
};
/*****************************************************************************/ /*****************************************************************************/
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
void PrjCfg_GetConfig (struct Prj_Projects *Projects); void PrjCfg_GetConfig (struct PrjCfg_Config *Config);
bool PrjCfg_CheckIfICanConfig (void); bool PrjCfg_CheckIfICanConfig (void);
void PrjCfg_ShowFormConfig (void); void PrjCfg_ShowFormConfig (void);

View File

@ -60,22 +60,6 @@ const char *Prj_ReviewStatus_DB[Prj_NUM_REVIEW_STATUS] =
[Prj_APPROVED ] = "approved", [Prj_APPROVED ] = "approved",
}; };
/*****************************************************************************/
/************ Update configuration of projects for current course ************/
/*****************************************************************************/
void Prj_DB_UpdateCrsPrjsConfig (bool Editable)
{
DB_QueryREPLACE ("can not save configuration of projects",
"REPLACE INTO prj_config"
" (CrsCod,Editable)"
" VALUES"
" (%ld,'%c')",
Gbl.Hierarchy.Crs.CrsCod,
Editable ? 'Y' :
'N');
}
/*****************************************************************************/ /*****************************************************************************/
/**************************** Lock project edition ***************************/ /**************************** Lock project edition ***************************/
/*****************************************************************************/ /*****************************************************************************/
@ -547,20 +531,6 @@ unsigned Prj_DB_GetListProjects (MYSQL_RES **mysql_res,
return NumPrjsFromDB; return NumPrjsFromDB;
} }
/*****************************************************************************/
/************** Get configuration of projects for current course *************/
/*****************************************************************************/
unsigned Prj_DB_GetConfig (MYSQL_RES **mysql_res)
{
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get project configuration",
"SELECT Editable" // row[0]
" FROM prj_config"
" WHERE CrsCod=%ld",
Gbl.Hierarchy.Crs.CrsCod);
}
/*****************************************************************************/ /*****************************************************************************/
/********************* Get project data using its code ***********************/ /********************* Get project data using its code ***********************/
/*****************************************************************************/ /*****************************************************************************/
@ -957,3 +927,39 @@ void Prj_DB_RemoveCrsPrjs (long CrsCod)
" WHERE CrsCod=%ld", " WHERE CrsCod=%ld",
CrsCod); CrsCod);
} }
/*****************************************************************************/
/************ Update configuration of projects for current course ************/
/*****************************************************************************/
void Prj_DB_UpdateConfig (const struct Prj_Projects *Projects)
{
DB_QueryREPLACE ("can not save configuration of projects",
"REPLACE INTO prj_config"
" (CrsCod,RubTutCod,RubEvlCod,RubGblCod,NETCanCreate)"
" VALUES"
" (%ld,%ld,%ld,%ld,'%c')",
Gbl.Hierarchy.Crs.CrsCod,
Projects->Config.RubCod[PrjCfg_RUBRIC_TUT],
Projects->Config.RubCod[PrjCfg_RUBRIC_EVL],
Projects->Config.RubCod[PrjCfg_RUBRIC_GBL],
Projects->Config.NETCanCreate ? 'Y' :
'N');
}
/*****************************************************************************/
/************** Get configuration of projects for current course *************/
/*****************************************************************************/
unsigned Prj_DB_GetConfig (MYSQL_RES **mysql_res)
{
return (unsigned)
DB_QuerySELECT (mysql_res,"can not get project configuration",
"SELECT RubTutCod," // row[0]
"RubEvlCod," // row[1]
"RubGblCod," // row[2]
"NETCanCreate" // row[3]
" FROM prj_config"
" WHERE CrsCod=%ld",
Gbl.Hierarchy.Crs.CrsCod);
}

View File

@ -33,8 +33,6 @@
/***************************** Public prototypes *****************************/ /***************************** Public prototypes *****************************/
/*****************************************************************************/ /*****************************************************************************/
void Prj_DB_UpdateCrsPrjsConfig (bool Editable);
void Prj_DB_LockProjectEdition (long PrjCod); void Prj_DB_LockProjectEdition (long PrjCod);
void Prj_DB_UnlockProjectEdition (long PrjCod); void Prj_DB_UnlockProjectEdition (long PrjCod);
long Prj_DB_CreateProject (const struct Prj_Project *Prj); long Prj_DB_CreateProject (const struct Prj_Project *Prj);
@ -46,7 +44,6 @@ void Prj_DB_UpdateReview (const struct Prj_Project *Prj);
unsigned Prj_DB_GetListProjects (MYSQL_RES **mysql_res, unsigned Prj_DB_GetListProjects (MYSQL_RES **mysql_res,
const struct Prj_Projects *Projects, const struct Prj_Projects *Projects,
const char *UsrsSubQuery); // NULL if no users const char *UsrsSubQuery); // NULL if no users
unsigned Prj_DB_GetConfig (MYSQL_RES **mysql_res);
unsigned Prj_DB_GetProjectDataByCod (MYSQL_RES **mysql_res,long PrjCod); unsigned Prj_DB_GetProjectDataByCod (MYSQL_RES **mysql_res,long PrjCod);
void Prj_DB_GetProjectTitle (long PrjCod,char *Title,size_t TitleSize); void Prj_DB_GetProjectTitle (long PrjCod,char *Title,size_t TitleSize);
unsigned Prj_DB_GetPrjDataToCheckFaults (MYSQL_RES **mysql_res,long PrjCod); unsigned Prj_DB_GetPrjDataToCheckFaults (MYSQL_RES **mysql_res,long PrjCod);
@ -66,4 +63,9 @@ void Prj_DB_RemoveConfigOfCrsPrjs (long CrsCod);
void Prj_DB_RemovePrj (long PrjCod); void Prj_DB_RemovePrj (long PrjCod);
void Prj_DB_RemoveCrsPrjs (long CrsCod); void Prj_DB_RemoveCrsPrjs (long CrsCod);
//----------------------------- Configuration ---------------------------------
void Prj_DB_UpdateConfig (const struct Prj_Projects *Projects);
unsigned Prj_DB_GetConfig (MYSQL_RES **mysql_res);
#endif #endif

View File

@ -1927,7 +1927,10 @@ void Qst_PutFormEditOneQst (struct Qst_Question *Question)
IndTag,IndTag, IndTag,IndTag,
The_GetSuffix ()); The_GetSuffix ());
free (FuncOnChange); free (FuncOnChange);
HTM_OPTION (HTM_Type_STRING,"",false,false,"&nbsp;"); HTM_OPTION (HTM_Type_STRING,"",
false, // Not selected
false, // Not disabled
"&nbsp;");
mysql_data_seek (mysql_res,0); mysql_data_seek (mysql_res,0);
TagFound = false; TagFound = false;
for (NumTag = 1; for (NumTag = 1;
@ -1948,16 +1951,19 @@ void Qst_PutFormEditOneQst (struct Qst_Question *Question)
TagFound = true; TagFound = true;
} }
HTM_OPTION (HTM_Type_STRING,row[1], HTM_OPTION (HTM_Type_STRING,row[1],
IsThisTag,false, IsThisTag, // Selected?
false, // Not disabled
"%s",row[1]); "%s",row[1]);
} }
/* If it's a new tag received from the form */ /* If it's a new tag received from the form */
if (!TagFound && Question->Tags.Txt[IndTag][0]) if (!TagFound && Question->Tags.Txt[IndTag][0])
HTM_OPTION (HTM_Type_STRING,Question->Tags.Txt[IndTag], HTM_OPTION (HTM_Type_STRING,Question->Tags.Txt[IndTag],
true,false, true, // Selected
false, // Not disabled
"%s",Question->Tags.Txt[IndTag]); "%s",Question->Tags.Txt[IndTag]);
HTM_OPTION (HTM_Type_STRING,"", HTM_OPTION (HTM_Type_STRING,"",
false,false, false, // Selected
false, // Not disabled
"[%s]",Txt_new_tag); "[%s]",Txt_new_tag);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -267,6 +267,7 @@ void Rec_ListFieldsRecordsForEdition (void)
{ {
extern const char *Txt_RECORD_FIELD_VISIBILITY_MENU[Rec_NUM_TYPES_VISIBILITY]; extern const char *Txt_RECORD_FIELD_VISIBILITY_MENU[Rec_NUM_TYPES_VISIBILITY];
unsigned NumField; unsigned NumField;
struct RecordField *FldInLst;
Rec_VisibilityRecordFields_t Vis; Rec_VisibilityRecordFields_t Vis;
unsigned VisUnsigned; unsigned VisUnsigned;
char StrNumLines[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrNumLines[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
@ -279,18 +280,20 @@ void Rec_ListFieldsRecordsForEdition (void)
NumField < Gbl.Crs.Records.LstFields.Num; NumField < Gbl.Crs.Records.LstFields.Num;
NumField++) NumField++)
{ {
FldInLst = &Gbl.Crs.Records.LstFields.Lst[NumField];
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Write icon to remove the field */ /* Write icon to remove the field */
HTM_TD_Begin ("class=\"BM\""); HTM_TD_Begin ("class=\"BM\"");
Ico_PutContextualIconToRemove (ActReqRemFie,NULL, Ico_PutContextualIconToRemove (ActReqRemFie,NULL,
Rec_PutParFldCod,&Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod); Rec_PutParFldCod,&FldInLst->FieldCod);
HTM_TD_End (); HTM_TD_End ();
/* Name of the field */ /* Name of the field */
HTM_TD_Begin ("class=\"LM\""); HTM_TD_Begin ("class=\"LM\"");
Frm_BeginForm (ActRenFie); Frm_BeginForm (ActRenFie);
ParCod_PutPar (ParCod_Fld,Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod); ParCod_PutPar (ParCod_Fld,FldInLst->FieldCod);
HTM_INPUT_TEXT ("FieldName",Rec_MAX_CHARS_NAME_FIELD, HTM_INPUT_TEXT ("FieldName",Rec_MAX_CHARS_NAME_FIELD,
Gbl.Crs.Records.LstFields.Lst[NumField].Name, Gbl.Crs.Records.LstFields.Lst[NumField].Name,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
@ -302,9 +305,9 @@ void Rec_ListFieldsRecordsForEdition (void)
/* Number of lines in the form */ /* Number of lines in the form */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgRowFie); Frm_BeginForm (ActChgRowFie);
ParCod_PutPar (ParCod_Fld,Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod); ParCod_PutPar (ParCod_Fld,FldInLst->FieldCod);
snprintf (StrNumLines,sizeof (StrNumLines),"%u", snprintf (StrNumLines,sizeof (StrNumLines),"%u",
Gbl.Crs.Records.LstFields.Lst[NumField].NumLines); FldInLst->NumLines);
HTM_INPUT_TEXT ("NumLines",Cns_MAX_DECIMAL_DIGITS_UINT,StrNumLines, HTM_INPUT_TEXT ("NumLines",Cns_MAX_DECIMAL_DIGITS_UINT,StrNumLines,
HTM_SUBMIT_ON_CHANGE, HTM_SUBMIT_ON_CHANGE,
"size=\"2\" class=\"INPUT_%s\"", "size=\"2\" class=\"INPUT_%s\"",
@ -315,7 +318,7 @@ void Rec_ListFieldsRecordsForEdition (void)
/* Visibility of a field */ /* Visibility of a field */
HTM_TD_Begin ("class=\"CM\""); HTM_TD_Begin ("class=\"CM\"");
Frm_BeginForm (ActChgVisFie); Frm_BeginForm (ActChgVisFie);
ParCod_PutPar (ParCod_Fld,Gbl.Crs.Records.LstFields.Lst[NumField].FieldCod); ParCod_PutPar (ParCod_Fld,FldInLst->FieldCod);
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL,
"name=\"Visibility\" class=\"INPUT_%s\"", "name=\"Visibility\" class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
@ -325,7 +328,8 @@ void Rec_ListFieldsRecordsForEdition (void)
{ {
VisUnsigned = (unsigned) Vis; VisUnsigned = (unsigned) Vis;
HTM_OPTION (HTM_Type_UNSIGNED,&VisUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&VisUnsigned,
Gbl.Crs.Records.LstFields.Lst[NumField].Visibility == Vis,false, Vis == FldInLst->Visibility, // Selected?
false, // Not disabled
"%s",Txt_RECORD_FIELD_VISIBILITY_MENU[Vis]); "%s",Txt_RECORD_FIELD_VISIBILITY_MENU[Vis]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -399,7 +403,8 @@ void Rec_ShowFormCreateRecordField (void)
{ {
VisUnsigned = (unsigned) Vis; VisUnsigned = (unsigned) Vis;
HTM_OPTION (HTM_Type_UNSIGNED,&VisUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&VisUnsigned,
Gbl.Crs.Records.Field.Visibility == Vis,false, Vis == Gbl.Crs.Records.Field.Visibility, // Selected?
false, // Not disabled
"%s",Txt_RECORD_FIELD_VISIBILITY_MENU[Vis]); "%s",Txt_RECORD_FIELD_VISIBILITY_MENU[Vis]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -1411,7 +1416,8 @@ static void Rec_ShowLinkToPrintPreviewOfRecords (void)
i <= Rec_MAX_RECORDS_PER_PAGE; i <= Rec_MAX_RECORDS_PER_PAGE;
i++) i++)
HTM_OPTION (HTM_Type_UNSIGNED,&i, HTM_OPTION (HTM_Type_UNSIGNED,&i,
i == Gbl.Usrs.Listing.RecsPerPag,false, i == Gbl.Usrs.Listing.RecsPerPag, // Selected?
false, // Not disabled
"%u",i); "%u",i);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TxtF (" %s)",Txt_record_cards_per_page); HTM_TxtF (" %s)",Txt_record_cards_per_page);
@ -2807,7 +2813,8 @@ static void Rec_ShowRole (struct Usr_Data *UsrDat,
{ {
RoleUnsigned = (unsigned) Role; RoleUnsigned = (unsigned) Role;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
Role == DefaultRoleInForm,false, Role == DefaultRoleInForm, // Selected?
false, // Not disabled
"%s",Txt_ROLES_SINGUL_Abc[Role][UsrDat->Sex]); "%s",Txt_ROLES_SINGUL_Abc[Role][UsrDat->Sex]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -2872,7 +2879,9 @@ static void Rec_ShowRole (struct Usr_Data *UsrDat,
case Rol_STD: case Rol_STD:
case Rol_NET: case Rol_NET:
RoleUnsigned = (unsigned) Gbl.Usrs.Me.Role.Logged; RoleUnsigned = (unsigned) Gbl.Usrs.Me.Role.Logged;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,true,true, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
true, // Selected
true, // Disabled
"%s",Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Me.Role.Logged][UsrDat->Sex]); "%s",Txt_ROLES_SINGUL_Abc[Gbl.Usrs.Me.Role.Logged][UsrDat->Sex]);
break; break;
case Rol_TCH: case Rol_TCH:
@ -2886,7 +2895,8 @@ static void Rec_ShowRole (struct Usr_Data *UsrDat,
{ {
RoleUnsigned = (unsigned) Role; RoleUnsigned = (unsigned) Role;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
Role == DefaultRoleInForm,false, Role == DefaultRoleInForm, // Selected?
false, // Not disabled
"%s",Txt_ROLES_SINGUL_Abc[Role][UsrDat->Sex]); "%s",Txt_ROLES_SINGUL_Abc[Role][UsrDat->Sex]);
} }
break; break;
@ -2909,7 +2919,9 @@ static void Rec_ShowRole (struct Usr_Data *UsrDat,
" class=\"INPUT_%s\"", " class=\"INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
RoleUnsigned = (unsigned) DefaultRoleInForm; RoleUnsigned = (unsigned) DefaultRoleInForm;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,true,true, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
true, // Selected
true, // Disabled
"%s",Txt_ROLES_SINGUL_Abc[DefaultRoleInForm][UsrDat->Sex]); "%s",Txt_ROLES_SINGUL_Abc[DefaultRoleInForm][UsrDat->Sex]);
HTM_SELECT_End (); HTM_SELECT_End ();
} }
@ -2951,7 +2963,8 @@ static void Rec_ShowRole (struct Usr_Data *UsrDat,
{ {
RoleUnsigned = (unsigned) Role; RoleUnsigned = (unsigned) Role;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
Role == DefaultRoleInForm,false, Role == DefaultRoleInForm, // Selected?
false, // Not disabled
"%s",Txt_ROLES_SINGUL_Abc[Role][Usr_SEX_UNKNOWN]); "%s",Txt_ROLES_SINGUL_Abc[Role][Usr_SEX_UNKNOWN]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -2970,7 +2983,8 @@ static void Rec_ShowRole (struct Usr_Data *UsrDat,
The_GetSuffix ()); The_GetSuffix ());
RoleUnsigned = (unsigned) Rol_GST; RoleUnsigned = (unsigned) Rol_GST;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
true,false, true, // Selected
false, // Not disabled
"%s",Txt_ROLES_SINGUL_Abc[Rol_GST][Usr_SEX_UNKNOWN]); "%s",Txt_ROLES_SINGUL_Abc[Rol_GST][Usr_SEX_UNKNOWN]);
HTM_SELECT_End (); HTM_SELECT_End ();
break; break;
@ -3158,6 +3172,7 @@ static void Rec_ShowCountry (struct Usr_Data *UsrDat,bool PutForm)
extern const char *Txt_Another_country; extern const char *Txt_Another_country;
char *Label; char *Label;
unsigned NumCty; unsigned NumCty;
const struct Cty_Countr *CtyInLst;
/***** If list of countries is empty, try to get it *****/ /***** If list of countries is empty, try to get it *****/
Cty_GetBasicListOfCountries (); Cty_GetBasicListOfCountries ();
@ -3183,16 +3198,24 @@ static void Rec_ShowCountry (struct Usr_Data *UsrDat,bool PutForm)
" class=\"REC_C2_BOT_INPUT INPUT_%s\"" " class=\"REC_C2_BOT_INPUT INPUT_%s\""
" required=\"required\"", " required=\"required\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"",false,false, HTM_OPTION (HTM_Type_STRING,"",
false, // Not selected
false, // Not disabled
"%s",Txt_Country); "%s",Txt_Country);
HTM_OPTION (HTM_Type_STRING,"0",UsrDat->CtyCod == 0,false, HTM_OPTION (HTM_Type_STRING,"0",
UsrDat->CtyCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_country); "%s",Txt_Another_country);
for (NumCty = 0; for (NumCty = 0;
NumCty < Gbl.Hierarchy.Ctys.Num; NumCty < Gbl.Hierarchy.Ctys.Num;
NumCty++) NumCty++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod, {
Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod == UsrDat->CtyCod,false, CtyInLst = &Gbl.Hierarchy.Ctys.Lst[NumCty];
"%s",Gbl.Hierarchy.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); HTM_OPTION (HTM_Type_LONG,&CtyInLst->CtyCod,
CtyInLst->CtyCod == UsrDat->CtyCod, // Selected?
false, // Not disabled
"%s",CtyInLst->Name[Gbl.Prefs.Language]);
}
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_TD_End (); HTM_TD_End ();
@ -3767,8 +3790,11 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
extern const char *Txt_Office; extern const char *Txt_Office;
extern const char *Txt_Phone; extern const char *Txt_Phone;
unsigned NumCty; unsigned NumCty;
const struct Cty_Countr *CtyInLst;
unsigned NumIns; unsigned NumIns;
const struct Ins_Instit *InsInLst;
unsigned NumCtr; unsigned NumCtr;
const struct Ctr_Center *CtrInLst;
char StrRecordWidth[Cns_MAX_DECIMAL_DIGITS_UINT + 1]; char StrRecordWidth[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char *Label; char *Label;
char *SelectClass; char *SelectClass;
@ -3806,14 +3832,19 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
" class=\"REC_C2_BOT_INPUT INPUT_%s\"", " class=\"REC_C2_BOT_INPUT INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1", HTM_OPTION (HTM_Type_STRING,"-1",
Gbl.Usrs.Me.UsrDat.InsCtyCod <= 0,true, Gbl.Usrs.Me.UsrDat.InsCtyCod <= 0, // Selected?
true, // Disabled
NULL); NULL);
for (NumCty = 0; for (NumCty = 0;
NumCty < Gbl.Hierarchy.Ctys.Num; NumCty < Gbl.Hierarchy.Ctys.Num;
NumCty++) NumCty++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod, {
Gbl.Hierarchy.Ctys.Lst[NumCty].CtyCod == Gbl.Usrs.Me.UsrDat.InsCtyCod,false, CtyInLst = &Gbl.Hierarchy.Ctys.Lst[NumCty];
"%s",Gbl.Hierarchy.Ctys.Lst[NumCty].Name[Gbl.Prefs.Language]); HTM_OPTION (HTM_Type_LONG,&CtyInLst->CtyCod,
CtyInLst->CtyCod == Gbl.Usrs.Me.UsrDat.InsCtyCod, // Selected?
false, // Not disabled
"%s",CtyInLst->Name[Gbl.Prefs.Language]);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
@ -3845,17 +3876,23 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
" class=\"REC_C2_BOT_INPUT INPUT_%s\"", " class=\"REC_C2_BOT_INPUT INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1", HTM_OPTION (HTM_Type_STRING,"-1",
Gbl.Usrs.Me.UsrDat.InsCod < 0,true, Gbl.Usrs.Me.UsrDat.InsCod < 0, // Selected?
true, // Disabled
NULL); NULL);
HTM_OPTION (HTM_Type_STRING,"0", HTM_OPTION (HTM_Type_STRING,"0",
Gbl.Usrs.Me.UsrDat.InsCod == 0,false, Gbl.Usrs.Me.UsrDat.InsCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_institution); "%s",Txt_Another_institution);
for (NumIns = 0; for (NumIns = 0;
NumIns < Gbl.Hierarchy.Inss.Num; NumIns < Gbl.Hierarchy.Inss.Num;
NumIns++) NumIns++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Inss.Lst[NumIns].InsCod, {
Gbl.Hierarchy.Inss.Lst[NumIns].InsCod == Gbl.Usrs.Me.UsrDat.InsCod,false, InsInLst = &Gbl.Hierarchy.Inss.Lst[NumIns];
"%s",Gbl.Hierarchy.Inss.Lst[NumIns].FullName); HTM_OPTION (HTM_Type_LONG,&InsInLst->InsCod,
InsInLst->InsCod == Gbl.Usrs.Me.UsrDat.InsCod, // Selected?
false, // Not disabled
"%s",InsInLst->FullName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();
@ -3888,17 +3925,23 @@ static void Rec_ShowFormMyInsCtrDpt (bool IAmATeacher)
" class=\"REC_C2_BOT_INPUT INPUT_%s\"", " class=\"REC_C2_BOT_INPUT INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1", HTM_OPTION (HTM_Type_STRING,"-1",
Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0,true, Gbl.Usrs.Me.UsrDat.Tch.CtrCod < 0, // Selected?
true, // Disabled
NULL); NULL);
HTM_OPTION (HTM_Type_STRING,"0", HTM_OPTION (HTM_Type_STRING,"0",
Gbl.Usrs.Me.UsrDat.Tch.CtrCod == 0,false, Gbl.Usrs.Me.UsrDat.Tch.CtrCod == 0, // Selected?
false, // Not disabled
Txt_Another_center); Txt_Another_center);
for (NumCtr = 0; for (NumCtr = 0;
NumCtr < Gbl.Hierarchy.Ctrs.Num; NumCtr < Gbl.Hierarchy.Ctrs.Num;
NumCtr++) NumCtr++)
HTM_OPTION (HTM_Type_LONG,&Gbl.Hierarchy.Ctrs.Lst[NumCtr].CtrCod, {
Gbl.Hierarchy.Ctrs.Lst[NumCtr].CtrCod == Gbl.Usrs.Me.UsrDat.Tch.CtrCod,false, CtrInLst = &Gbl.Hierarchy.Ctrs.Lst[NumCtr];
Gbl.Hierarchy.Ctrs.Lst[NumCtr].FullName); HTM_OPTION (HTM_Type_LONG,&CtrInLst->CtrCod,
CtrInLst->CtrCod == Gbl.Usrs.Me.UsrDat.Tch.CtrCod, // Selected?
false, // Not disabled
CtrInLst->FullName);
}
HTM_SELECT_End (); HTM_SELECT_End ();
Frm_EndForm (); Frm_EndForm ();
HTM_TD_End (); HTM_TD_End ();

View File

@ -492,7 +492,8 @@ void Rol_PutFormToChangeMyRole (const char *ClassSelect)
{ {
RoleUnsigned = (unsigned) Role; RoleUnsigned = (unsigned) Role;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&RoleUnsigned,
Role == Gbl.Usrs.Me.Role.Logged,false, Role == Gbl.Usrs.Me.Role.Logged, // Selected?
false, // Not disabled
"%s",Txt_ROLES_SINGUL_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]); "%s",Txt_ROLES_SINGUL_Abc[Role][Gbl.Usrs.Me.UsrDat.Sex]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -781,6 +781,7 @@ static void Roo_PutSelectorBuilding (long BldCod,
extern const char *Txt_No_assigned_building; extern const char *Txt_No_assigned_building;
extern const char *Txt_Another_building; extern const char *Txt_Another_building;
unsigned NumBld; unsigned NumBld;
const struct Bld_Building *BldInLst;
/***** Begin selector *****/ /***** Begin selector *****/
HTM_SELECT_Begin (SubmitOnChange,NULL, HTM_SELECT_Begin (SubmitOnChange,NULL,
@ -789,21 +790,27 @@ static void Roo_PutSelectorBuilding (long BldCod,
/***** Option for no assigned building *****/ /***** Option for no assigned building *****/
HTM_OPTION (HTM_Type_STRING,"-1", HTM_OPTION (HTM_Type_STRING,"-1",
BldCod < 0,false, BldCod < 0, // Selected?
false, // Not disabled
"%s",Txt_No_assigned_building); "%s",Txt_No_assigned_building);
/***** Option for another room *****/ /***** Option for another room *****/
HTM_OPTION (HTM_Type_STRING,"0", HTM_OPTION (HTM_Type_STRING,"0",
BldCod == 0,false, BldCod == 0, // Selected?
false, // Not disabled
"%s",Txt_Another_building); "%s",Txt_Another_building);
/***** Options for buildings *****/ /***** Options for buildings *****/
for (NumBld = 0; for (NumBld = 0;
NumBld < Buildings->Num; NumBld < Buildings->Num;
NumBld++) NumBld++)
HTM_OPTION (HTM_Type_LONG,&Buildings->Lst[NumBld].BldCod, {
BldCod == Buildings->Lst[NumBld].BldCod,false, BldInLst = &Buildings->Lst[NumBld];
"%s",Buildings->Lst[NumBld].ShrtName); HTM_OPTION (HTM_Type_LONG,&BldInLst->BldCod,
BldCod == BldInLst->BldCod, // Selected?
false, // Not disabled
"%s",BldInLst->ShrtName);
}
/***** End selector *****/ /***** End selector *****/
HTM_SELECT_End (); HTM_SELECT_End ();
@ -829,7 +836,8 @@ static void Roo_PutSelectorType (Roo_RoomType_t RoomType,
Type <= (Roo_RoomType_t) (Roo_NUM_TYPES - 1); Type <= (Roo_RoomType_t) (Roo_NUM_TYPES - 1);
Type++) Type++)
HTM_OPTION (HTM_Type_UNSIGNED,&Type, HTM_OPTION (HTM_Type_UNSIGNED,&Type,
Type == RoomType,false, Type == RoomType, // Selected?
false, // Not disabled
"%s",Txt_ROOM_TYPES[Type]); "%s",Txt_ROOM_TYPES[Type]);
/***** End selector *****/ /***** End selector *****/

View File

@ -105,42 +105,48 @@ void Sco_PutSelectorScope (const char *ParName,HTM_SubmitOnChange_t SubmitOnChan
{ {
case HieLvl_SYS: case HieLvl_SYS:
HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned,
Gbl.Scope.Current == Scope,false, Gbl.Scope.Current == Scope, // Selected?
false, // Not disabled
"%s: %s", "%s: %s",
Txt_System, Txt_System,
Cfg_PLATFORM_SHORT_NAME); Cfg_PLATFORM_SHORT_NAME);
break; break;
case HieLvl_CTY: case HieLvl_CTY:
HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned,
Gbl.Scope.Current == Scope,false, Gbl.Scope.Current == Scope, // Selected?
false, // Not disabled
"%s: %s", "%s: %s",
Txt_Country, Txt_Country,
Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]); Gbl.Hierarchy.Cty.Name[Gbl.Prefs.Language]);
break; break;
case HieLvl_INS: case HieLvl_INS:
HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned,
Gbl.Scope.Current == Scope,false, Gbl.Scope.Current == Scope, // Selected?
false, // Not disabled
"%s: %s", "%s: %s",
Txt_Institution, Txt_Institution,
Gbl.Hierarchy.Ins.ShrtName); Gbl.Hierarchy.Ins.ShrtName);
break; break;
case HieLvl_CTR: case HieLvl_CTR:
HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned,
Gbl.Scope.Current == Scope,false, Gbl.Scope.Current == Scope, // Selected?
false, // Not disabled
"%s: %s", "%s: %s",
Txt_Center, Txt_Center,
Gbl.Hierarchy.Ctr.ShrtName); Gbl.Hierarchy.Ctr.ShrtName);
break; break;
case HieLvl_DEG: case HieLvl_DEG:
HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned,
Gbl.Scope.Current == Scope,false, Gbl.Scope.Current == Scope, // Selected?
false, // Not disabled
"%s: %s", "%s: %s",
Txt_Degree, Txt_Degree,
Gbl.Hierarchy.Deg.ShrtName); Gbl.Hierarchy.Deg.ShrtName);
break; break;
case HieLvl_CRS: case HieLvl_CRS:
HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ScopeUnsigned,
Gbl.Scope.Current == Scope,false, Gbl.Scope.Current == Scope, // Selected?
false, // Not disabled
"%s: %s", "%s: %s",
Txt_Course, Txt_Course,
Gbl.Hierarchy.Crs.ShrtName); Gbl.Hierarchy.Crs.ShrtName);

View File

@ -200,7 +200,8 @@ static void Sch_PutFormToSearchWithWhatToSearchAndScope (HieLvl_Level_t DefaultS
{ {
WTS = (unsigned) WhatToSearch; WTS = (unsigned) WhatToSearch;
HTM_OPTION (HTM_Type_UNSIGNED,&WTS, HTM_OPTION (HTM_Type_UNSIGNED,&WTS,
Search->WhatToSearch == WhatToSearch,false, WhatToSearch == Search->WhatToSearch, // Selected?
false, // Not disabled
"%s",*Titles[WhatToSearch]); "%s",*Titles[WhatToSearch]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -370,7 +370,8 @@ static void Sta_PutFormCrsHits (struct Sta_Stats *Stats)
{ {
ClicksGroupedByUnsigned = (unsigned) ClicksGroupedBy; ClicksGroupedByUnsigned = (unsigned) ClicksGroupedBy;
HTM_OPTION (HTM_Type_UNSIGNED,&ClicksGroupedByUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ClicksGroupedByUnsigned,
ClicksGroupedBy == Stats->ClicksGroupedBy,false, ClicksGroupedBy == Stats->ClicksGroupedBy, // Selected?
false, // Not disabled
"%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]); "%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -406,7 +407,8 @@ static void Sta_PutFormCrsHits (struct Sta_Stats *Stats)
i < NUM_OPTIONS_ROWS_PER_PAGE; i < NUM_OPTIONS_ROWS_PER_PAGE;
i++) i++)
HTM_OPTION (HTM_Type_UNSIGNED,&RowsPerPage[i], HTM_OPTION (HTM_Type_UNSIGNED,&RowsPerPage[i],
RowsPerPage[i] == Stats->RowsPerPage,false, RowsPerPage[i] == Stats->RowsPerPage, // Selected?
false, // Not disabled
"%u",RowsPerPage[i]); "%u",RowsPerPage[i]);
HTM_SELECT_End (); HTM_SELECT_End ();
HTM_Txt (")"); HTM_Txt (")");
@ -517,7 +519,8 @@ static void Sta_PutFormGblHits (struct Sta_Stats *Stats)
{ {
RoleStatUnsigned = (unsigned) RoleStat; RoleStatUnsigned = (unsigned) RoleStat;
HTM_OPTION (HTM_Type_UNSIGNED,&RoleStatUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&RoleStatUnsigned,
RoleStat == Stats->Role,false, RoleStat == Stats->Role, // Selected?
false, // Not disabled
"%s",Txt_ROLE_STATS[RoleStat]); "%s",Txt_ROLE_STATS[RoleStat]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -577,7 +580,8 @@ static void Sta_PutFormGblHits (struct Sta_Stats *Stats)
{ {
ClicksGroupedByUnsigned = (unsigned) ClicksGroupedBy; ClicksGroupedByUnsigned = (unsigned) ClicksGroupedBy;
HTM_OPTION (HTM_Type_UNSIGNED,&ClicksGroupedByUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ClicksGroupedByUnsigned,
ClicksGroupedBy == Stats->ClicksGroupedBy,false, ClicksGroupedBy == Stats->ClicksGroupedBy, // Selected?
false, // Not disabled
"%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]); "%s",Txt_STAT_CLICKS_GROUPED_BY[ClicksGroupedBy]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -657,7 +661,8 @@ static void Sta_WriteSelectorCountType (const struct Sta_Stats *Stats)
{ {
StatCountTypeUnsigned = (unsigned) StatCountType; StatCountTypeUnsigned = (unsigned) StatCountType;
HTM_OPTION (HTM_Type_UNSIGNED,&StatCountTypeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&StatCountTypeUnsigned,
StatCountType == Stats->CountType,false, StatCountType == Stats->CountType, // Selected?
false, // Not disabled
"%s",Txt_STAT_TYPE_COUNT_SMALL[StatCountType]); "%s",Txt_STAT_TYPE_COUNT_SMALL[StatCountType]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();
@ -687,7 +692,9 @@ static void Sta_WriteSelectorAction (const struct Sta_Stats *Stats)
"id=\"StatAct\" name=\"StatAct\"" "id=\"StatAct\" name=\"StatAct\""
" class=\"STAT_SEL INPUT_%s\"", " class=\"STAT_SEL INPUT_%s\"",
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"0",Stats->NumAction == 0,false, HTM_OPTION (HTM_Type_STRING,"0",
Stats->NumAction == 0, // Selected?
false, // Not disabled
"%s",Txt_Any_action); "%s",Txt_Any_action);
for (Action = (Act_Action_t) 1; for (Action = (Act_Action_t) 1;
Action <= (Act_Action_t) (ActLst_NUM_ACTIONS - 1); Action <= (Act_Action_t) (ActLst_NUM_ACTIONS - 1);
@ -696,7 +703,8 @@ static void Sta_WriteSelectorAction (const struct Sta_Stats *Stats)
Tab = Act_GetTab (Act_GetSuperAction (Action)); Tab = Act_GetTab (Act_GetSuperAction (Action));
ActionUnsigned = (unsigned) Action; ActionUnsigned = (unsigned) Action;
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
Action == Stats->NumAction,false, Action == Stats->NumAction, // Selected?
false, // Not disabled
"%u: %s &gt; %s", "%u: %s &gt; %s",
(unsigned) Action,Txt_TABS_TXT[Tab],Act_GetActionText (Action)); (unsigned) Action,Txt_TABS_TXT[Tab],Act_GetActionText (Action));
} }
@ -1612,7 +1620,8 @@ static void Sta_ShowDistrAccessesPerDayAndHour (const struct Sta_Stats *Stats,
{ {
ColorTypeUnsigned = (unsigned) ColorType; ColorTypeUnsigned = (unsigned) ColorType;
HTM_OPTION (HTM_Type_UNSIGNED,&ColorTypeUnsigned, HTM_OPTION (HTM_Type_UNSIGNED,&ColorTypeUnsigned,
ColorType == SelectedColorType,false, ColorType == SelectedColorType, // Selected?
false, // Not selected
"%s",Txt_STAT_COLOR_TYPES[ColorType]); "%s",Txt_STAT_COLOR_TYPES[ColorType]);
} }
HTM_SELECT_End (); HTM_SELECT_End ();

View File

@ -397,9 +397,18 @@ static void TstPrn_WriteTF_AnsToFill (const struct TstPrn_PrintedQuestion *Print
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL,
"name=\"Ans%010u\" class=\"INPUT_%s\"", "name=\"Ans%010u\" class=\"INPUT_%s\"",
QstInd,The_GetSuffix ()); QstInd,The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"" ,PrintedQuestion->StrAnswers[0] == '\0',false,"&nbsp;"); HTM_OPTION (HTM_Type_STRING,"" ,
HTM_OPTION (HTM_Type_STRING,"T",PrintedQuestion->StrAnswers[0] == 'T' ,false,"%s",Txt_TF_QST[0]); PrintedQuestion->StrAnswers[0] == '\0', // Selected?
HTM_OPTION (HTM_Type_STRING,"F",PrintedQuestion->StrAnswers[0] == 'F' ,false,"%s",Txt_TF_QST[1]); false, // Not disabled
"&nbsp;");
HTM_OPTION (HTM_Type_STRING,"T",
PrintedQuestion->StrAnswers[0] == 'T', // Selected?
false, // Not disabled
"%s",Txt_TF_QST[0]);
HTM_OPTION (HTM_Type_STRING,"F",
PrintedQuestion->StrAnswers[0] == 'F', // Selected?
false, // Not disabled
"%s",Txt_TF_QST[1]);
HTM_SELECT_End (); HTM_SELECT_End ();
} }

View File

@ -26974,6 +26974,28 @@ const char *Txt_No_results =
#elif L==10 // tr #elif L==10 // tr
"No results."; // Çeviri lazim! "No results."; // Çeviri lazim!
#endif #endif
const char *Txt_no_rubric =
#if L==1 // ca
"sense r&uacute;brica";
#elif L==2 // de
"keine Rubrik";
#elif L==3 // en
"no rubric";
#elif L==4 // es
"sin r&uacute;brica";
#elif L==5 // fr
"pas de rubrique";
#elif L==6 // gn
"ndaip&oacute;ri r&uacute;brica";
#elif L==7 // it
"nessuna rubrica";
#elif L==8 // pl
"bez rubryk";
#elif L==9 // pt
"sem rubrica";
#elif L==10 // tr
"de&gbreve;erlendirme listesi olmadan";
#endif
const char *Txt_No_rubrics = const char *Txt_No_rubrics =
#if L==1 // ca #if L==1 // ca
@ -26987,7 +27009,7 @@ const char *Txt_No_rubrics =
#elif L==5 // fr #elif L==5 // fr
"Pas de rubriques."; "Pas de rubriques.";
#elif L==6 // gn #elif L==6 // gn
"No hay r&uacute;bricas."; // Okoteve traducción "Ndaip&oacute;ri r&uacute;brica.";
#elif L==7 // it #elif L==7 // it
"Non ci sono rubriche."; "Non ci sono rubriche.";
#elif L==8 // pl #elif L==8 // pl

View File

@ -1525,7 +1525,8 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
((Timetable->View == Tmt_CRS_EDIT) && (CT == Tmt_LECTURE || CT == Tmt_PRACTICAL)) || ((Timetable->View == Tmt_CRS_EDIT) && (CT == Tmt_LECTURE || CT == Tmt_PRACTICAL)) ||
((Timetable->View == Tmt_TUT_EDIT) && (CT == Tmt_TUTORING))) ((Timetable->View == Tmt_TUT_EDIT) && (CT == Tmt_TUTORING)))
HTM_OPTION (HTM_Type_STRING,Tmt_DB_ClassType[CT], HTM_OPTION (HTM_Type_STRING,Tmt_DB_ClassType[CT],
CT == ClassType,false, CT == ClassType, // Selected?
false, // Not disabled
"%s",Txt_TIMETABLE_CLASS_TYPES[CT]); "%s",Txt_TIMETABLE_CLASS_TYPES[CT]);
HTM_SELECT_End (); HTM_SELECT_End ();
@ -1572,7 +1573,8 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
Timetable->Config.Range.MinutesPerInterval) < 0) // Minutes Timetable->Config.Range.MinutesPerInterval) < 0) // Minutes
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
HTM_OPTION (HTM_Type_STRING,TTDur, HTM_OPTION (HTM_Type_STRING,TTDur,
Dur == DurationNumIntervals,false, Dur == DurationNumIntervals, // Selected?
false, // Not disabled
"%s",TTDur); "%s",TTDur);
free (TTDur); free (TTDur);
} }
@ -1597,7 +1599,9 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
" class=\"Tmt_GRP INPUT_%s\"", " class=\"Tmt_GRP INPUT_%s\"",
CellStr,Par_CodeStr[ParCod_Grp], CellStr,Par_CodeStr[ParCod_Grp],
The_GetSuffix ()); The_GetSuffix ());
HTM_OPTION (HTM_Type_STRING,"-1",GrpCod <= 0,false, HTM_OPTION (HTM_Type_STRING,"-1",
GrpCod <= 0, // Selected?
false, // Not disabled
"%s",Txt_All_groups); "%s",Txt_All_groups);
for (NumGrpTyp = 0; for (NumGrpTyp = 0;
NumGrpTyp < Gbl.Crs.Grps.GrpTypes.NumGrpTypes; NumGrpTyp < Gbl.Crs.Grps.GrpTypes.NumGrpTypes;
@ -1621,7 +1625,8 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
Err_NotEnoughMemoryExit (); Err_NotEnoughMemoryExit ();
} }
HTM_OPTION (HTM_Type_LONG,&Grp->GrpCod, HTM_OPTION (HTM_Type_LONG,&Grp->GrpCod,
GrpCod == Grp->GrpCod,false, GrpCod == Grp->GrpCod, // Selected?
false, // Not disabled
"%s %s%s", "%s %s%s",
GrpTyp->GrpTypName,Grp->GrpName,Room); GrpTyp->GrpTypName,Grp->GrpName,Room);
free (Room); free (Room);

View File

@ -6227,7 +6227,8 @@ void Usr_PutSelectorNumColsClassPhoto (void)
Cols <= Usr_CLASS_PHOTO_COLS_MAX; Cols <= Usr_CLASS_PHOTO_COLS_MAX;
Cols++) Cols++)
HTM_OPTION (HTM_Type_UNSIGNED,&Cols, HTM_OPTION (HTM_Type_UNSIGNED,&Cols,
Cols == Gbl.Usrs.ClassPhoto.Cols,false, Cols == Gbl.Usrs.ClassPhoto.Cols, // Selected?
false, // Not disabled
"%u",Cols); "%u",Cols);
/***** End selector *****/ /***** End selector *****/