Version 22.108: May 11, 2023 Code refactoring in forms.

This commit is contained in:
acanas 2023-05-11 18:35:16 +02:00
parent 1bd200959b
commit 2f2f88d74a
28 changed files with 1326 additions and 1716 deletions

View File

@ -789,18 +789,8 @@ void Ban_ContEditAfterChgBan (void)
static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewBan]);
/***** Begin form *****/
Frm_BeginForm (ActNewBan);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewBan,NULL,NULL,NULL);
/***** Write heading *****/
Ban_PutHeadBanners ();
@ -856,15 +846,8 @@ static void Ban_PutFormToCreateBanner (const struct Ban_Banner *Ban)
/* End table row */
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -670,18 +670,8 @@ void Bld_ContEditAfterChgBuilding (void)
static void Bld_PutFormToCreateBuilding (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewBld]);
/***** Begin form *****/
Frm_BeginForm (ActNewBld);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewBld,NULL,NULL,NULL);
/***** Write heading *****/
Bld_PutHeadBuildings ();
@ -724,15 +714,8 @@ static void Bld_PutFormToCreateBuilding (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -37,15 +37,12 @@ void Btn_PutButton (Btn_Button_t Button,const char *TxtButton)
{
static void (*Function[Btn_NUM_BUTTON_TYPES]) (const char *TxtButton) =
{
[Btn_NO_BUTTON ] = NULL,
[Btn_CREATE_BUTTON ] = Btn_PutCreateButton,
[Btn_CONFIRM_BUTTON] = Btn_PutConfirmButton,
[Btn_REMOVE_BUTTON ] = Btn_PutRemoveButton,
};
if (TxtButton)
if (TxtButton[0])
if (Function[Button])
if (Button != Btn_NO_BUTTON && TxtButton)
Function[Button] (TxtButton);
}
@ -53,15 +50,12 @@ void Btn_PutButtonInline (Btn_Button_t Button,const char *TxtButton)
{
static void (*Function[Btn_NUM_BUTTON_TYPES]) (const char *TxtButton) =
{
[Btn_NO_BUTTON ] = NULL,
[Btn_CREATE_BUTTON ] = Btn_PutCreateButtonInline,
[Btn_CONFIRM_BUTTON] = Btn_PutConfirmButtonInline,
[Btn_REMOVE_BUTTON ] = Btn_PutRemoveButtonInline,
};
if (TxtButton)
if (TxtButton[0])
if (Function[Button])
if (Button != Btn_NO_BUTTON && TxtButton)
Function[Button] (TxtButton);
}

View File

@ -1237,9 +1237,7 @@ static void Ctr_ShowAlertAndButtonToGoToCtr (void)
static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Another_place;
extern const char *Txt_Create;
Act_Action_t NextAction = ActUnk;
unsigned NumPlc;
const struct Plc_Place *PlcInLst;
@ -1252,15 +1250,8 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
else
Err_NoPermissionExit ();
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[NextAction]);
/***** Begin form *****/
Frm_BeginForm (NextAction);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (NextAction,NULL,NULL,NULL);
/***** Write heading *****/
Ctr_PutHeadCentersForEdition ();
@ -1355,15 +1346,8 @@ static void Ctr_PutFormToCreateCenter (const struct Plc_Places *Places)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -629,11 +629,12 @@ 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.
*/
#define Log_PLATFORM_VERSION "SWAD 22.107.40 (2023-05-10)"
#define Log_PLATFORM_VERSION "SWAD 22.108 (2023-05-11)"
#define CSS_FILE "swad22.107.36.css"
#define JS_FILE "swad22.49.js"
/*
Version 22.107.40:May 10, 2023 Changes in creation of test questions and survey questions. (? lines)
Version 22.108: May 11, 2023 Code refactoring in forms. (337145 lines)
Version 22.107.40:May 10, 2023 Changes in creation of test questions and survey questions. (337447 lines)
Version 22.107.39:May 10, 2023 Changes in creation of user account. (337435 lines)
Version 22.107.38:May 10, 2023 Changes in edition of mail domains. (337455 lines)
Version 22.107.37:May 10, 2023 Changes in edition of attendance events and agenda events. (337484 lines)

View File

@ -1401,22 +1401,13 @@ static void Cty_PutFormToCreateCountry (void)
{
extern const char *Lan_STR_LANG_ID[1 + Lan_NUM_LANGUAGES];
extern const char *Par_CodeStr[];
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_STR_LANG_NAME[1 + Lan_NUM_LANGUAGES];
extern const char *Txt_Create;
Lan_Language_t Lan;
char StrCtyCod[Cns_MAX_DECIMAL_DIGITS_LONG + 1];
char StrName[32];
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewCty]);
/***** Begin form *****/
Frm_BeginForm (ActNewCty);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewCty,NULL,NULL,NULL);
/***** Write heading *****/
Cty_PutHeadCountriesForEdition ();
@ -1497,15 +1488,8 @@ static void Cty_PutFormToCreateCountry (void)
HTM_TR_End ();
}
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -1280,9 +1280,7 @@ static bool Crs_CheckIfICanEdit (struct Crs_Course *Crs)
static void Crs_PutFormToCreateCourse (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_YEAR_OF_DEGREE[1 + Deg_MAX_YEARS_PER_DEGREE];
extern const char *Txt_Create;
Act_Action_t NextAction = ActUnk;
unsigned Year;
@ -1296,15 +1294,8 @@ static void Crs_PutFormToCreateCourse (void)
else
Err_NoPermissionExit ();
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[NextAction]);
/***** Begin form *****/
Frm_BeginForm (NextAction);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (NextAction,NULL,NULL,NULL);
/***** Write heading *****/
Crs_PutHeadCoursesForEdition ();
@ -1384,15 +1375,8 @@ static void Crs_PutFormToCreateCourse (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -513,8 +513,6 @@ static bool Deg_CheckIfICanEditADegree (struct Deg_Degree *Deg)
static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
Act_Action_t NextAction = ActUnk;
unsigned NumDegTyp;
struct DegTyp_DegreeType *DegTypInLst;
@ -527,15 +525,8 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
else
Err_NoPermissionExit ();
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[NextAction]);
/***** Begin form *****/
Frm_BeginForm (NextAction);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (NextAction,NULL,NULL,NULL);
/***** Write heading *****/
Deg_PutHeadDegreesForEdition ();
@ -622,15 +613,8 @@ static void Deg_PutFormToCreateDegree (const struct DegTyp_DegTypes *DegTypes)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -457,18 +457,8 @@ bool DegTyp_CheckIfICanCreateDegreeTypes (void)
static void DegTyp_PutFormToCreateDegreeType (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewDegTyp]);
/***** Begin form *****/
Frm_BeginForm (ActNewDegTyp);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewDegTyp,NULL,NULL,NULL);
/***** Write heading *****/
DegTyp_PutHeadDegreeTypesForEdition ();
@ -501,15 +491,8 @@ static void DegTyp_PutFormToCreateDegreeType (void)
/***** End table row *****/
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -810,21 +810,12 @@ void Dpt_ContEditAfterChgDpt (void)
static void Dpt_PutFormToCreateDepartment (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Another_institution;
extern const char *Txt_Create;
unsigned NumIns;
const struct Ins_Instit *InsInLst;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewDpt]);
/***** Begin form *****/
Frm_BeginForm (ActNewDpt);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewDpt,NULL,NULL,NULL);
/***** Write heading *****/
Dpt_PutHeadDepartments ();
@ -895,15 +886,8 @@ static void Dpt_PutFormToCreateDepartment (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -95,7 +95,9 @@ static void ExaSes_ListOneOrMoreSessionsResultTch (struct Exa_Exams *Exams,
static void ExaSes_GetSessionDataFromRow (MYSQL_RES *mysql_res,
struct ExaSes_Session *Session);
static void ExaSes_PutFormSession (const struct ExaSes_Session *Session);
static void ExaSes_PutFormSession (struct ExaSes_Session *Session);
static void ExaSes_ParsFormSession (void *Session);
static void ExaSes_ShowLstGrpsToCreateSession (long SesCod);
static void ExaSes_CreateSession (struct ExaSes_Session *Session);
@ -957,36 +959,24 @@ void ExaSes_GetAndCheckPars (struct Exa_Exams *Exams,
/* Put a big button to play exam session (start a new session) as a teacher **/
/*****************************************************************************/
static void ExaSes_PutFormSession (const struct ExaSes_Session *Session)
static void ExaSes_PutFormSession (struct ExaSes_Session *Session)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Title;
extern const char *Txt_Create;
extern const char *Txt_Save_changes;
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
{
[Dat_STR_TIME] = Dat_HMS_DO_NOT_SET,
[Dat_END_TIME] = Dat_HMS_DO_NOT_SET
};
bool ItsANewSession = Session->SesCod <= 0;
Act_Action_t NextAction = ItsANewSession ? ActNewExaSes :
ActChgExaSes;
bool ItsANewSession = (Session->SesCod <= 0);
/***** Begin section for a new exam session *****/
HTM_SECTION_Begin (ExaSes_NEW_SESSION_SECTION_ID);
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[NextAction]);
/***** Begin form *****/
Frm_BeginForm (NextAction);
ParCod_PutPar (ParCod_Exa,Session->ExaCod);
if (!ItsANewSession) // Existing session
ParCod_PutPar (ParCod_Ses,Session->SesCod);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ItsANewSession ? ActNewExaSes :
ActChgExaSes,
ExaSes_NEW_SESSION_SECTION_ID,
ExaSes_ParsFormSession,Session);
/***** Session title *****/
HTM_TR_Begin (NULL);
@ -1013,23 +1003,20 @@ static void ExaSes_PutFormSession (const struct ExaSes_Session *Session)
/***** Groups *****/
ExaSes_ShowLstGrpsToCreateSession (Session->SesCod);
/***** End table and send button *****/
HTM_TABLE_End ();
if (ItsANewSession)
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
else
Btn_PutButton (Btn_CONFIRM_BUTTON,Txt_Save_changes);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (ItsANewSession ? Btn_CREATE_BUTTON :
Btn_CONFIRM_BUTTON);
/***** End section for a new exam session *****/
HTM_SECTION_End ();
}
static void ExaSes_ParsFormSession (void *Session)
{
ParCod_PutPar (ParCod_Exa,((struct ExaSes_Session *) Session)->ExaCod);
ParCod_PutPar (ParCod_Ses,((struct ExaSes_Session *) Session)->SesCod);
}
/*****************************************************************************/
/************* Show list of groups to create a new exam session **************/
/*****************************************************************************/

View File

@ -180,19 +180,8 @@ static void ExaSet_PutFormNewSet (struct Exa_Exams *Exams,
struct ExaSet_Set *Set,
unsigned MaxSetInd)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewExaSet]);
/***** Begin form *****/
Frm_BeginForm (ActNewExaSet);
Exa_PutPars (Exams);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewExaSet,NULL,Exa_PutPars,Exams);
/***** Table heading *****/
ExaSet_PutTableHeadingForSets ();
@ -234,15 +223,8 @@ static void ExaSet_PutFormNewSet (struct Exa_Exams *Exams,
/***** End row *****/
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -245,6 +245,54 @@ void Frm_EndForm (void)
}
}
/*****************************************************************************/
/********************** Put a form and a table to create *********************/
/*****************************************************************************/
void Frm_BeginFormTable (Act_Action_t NextAction,const char *Anchor,
void (*FuncPars) (void *Args),void *Args)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[NextAction]);
/***** Begin form *****/
Frm_BeginFormAnchor (NextAction,Anchor);
if (FuncPars)
FuncPars (Args);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
}
void Frm_EndFormTable (Btn_Button_t Button)
{
extern const char *Txt_Create;
extern const char *Txt_Save_changes;
extern const char *Txt_Remove;
static const char **TxtButton[Btn_NUM_BUTTON_TYPES] =
{
[Btn_CREATE_BUTTON ] = &Txt_Create,
[Btn_CONFIRM_BUTTON] = &Txt_Save_changes,
[Btn_REMOVE_BUTTON ] = &Txt_Remove,
};
/***** End table *****/
HTM_TABLE_End ();
/***** Send button *****/
if (Button != Btn_NO_BUTTON)
Btn_PutButton (Button,*TxtButton[Button]);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
}
/*****************************************************************************/
/***************************** Get unique Id *********************************/
/*****************************************************************************/

View File

@ -28,6 +28,7 @@
/*****************************************************************************/
#include "swad_action.h"
#include "swad_button.h"
#include "swad_constant.h"
#include "swad_cryptography.h"
@ -65,6 +66,10 @@ void Frm_SetParsForm (char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1],Act_Action_t Ne
bool PutParLocationIfNoSession);
void Frm_EndForm (void);
void Frm_BeginFormTable (Act_Action_t NextAction,const char *Anchor,
void (*FuncPars) (void *Args),void *Args);
void Frm_EndFormTable (Btn_Button_t Button);
void Frm_SetUniqueId (char UniqueId[Frm_MAX_BYTES_ID + 1]);
void Frm_SetAnchorStr (long Cod,char **Anchor);

View File

@ -2373,7 +2373,6 @@ static void Grp_WriteRowGrp (struct Group *Grp,bool Highlight)
static void Grp_PutFormToCreateGroupType (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Type_of_group;
extern const char *Txt_It_is_optional_to_choose_a_group;
extern const char *Txt_It_is_mandatory_to_choose_a_group;
@ -2381,21 +2380,14 @@ static void Grp_PutFormToCreateGroupType (void)
extern const char *Txt_A_student_can_only_belong_to_one_group;
extern const char *Txt_The_groups_will_automatically_open;
extern const char *Txt_The_groups_will_not_automatically_open;
extern const char *Txt_Create;
unsigned CurrentYear = Dat_GetCurrentYear ();
/***** Begin section *****/
HTM_SECTION_Begin (Grp_NEW_GROUP_TYPE_SECTION_ID);
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewGrpTyp]);
/***** Begin form *****/
Frm_BeginFormAnchor (ActNewGrpTyp,Grp_NEW_GROUP_TYPE_SECTION_ID);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewGrpTyp,Grp_NEW_GROUP_TYPE_SECTION_ID,
NULL,NULL);
/***** Write heading *****/
Grp_WriteHeadingGroupTypes ();
@ -2486,15 +2478,8 @@ static void Grp_PutFormToCreateGroupType (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
/***** End section *****/
HTM_SECTION_End ();
@ -2506,13 +2491,11 @@ static void Grp_PutFormToCreateGroupType (void)
static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Group;
extern const char *Txt_Group_closed;
extern const char *Txt_File_zones_disabled;
extern const char *Txt_No_assigned_room;
extern const char *Txt_Another_room;
extern const char *Txt_Create;
unsigned NumGrpTyp;
const struct GroupType *GrpTypInLst;
unsigned NumRoo;
@ -2523,15 +2506,8 @@ static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms)
/***** Begin section *****/
HTM_SECTION_Begin (Grp_NEW_GROUP_SECTION_ID);
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewGrp]);
/***** Begin form *****/
Frm_BeginFormAnchor (ActNewGrp,Grp_GROUPS_SECTION_ID);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewGrp,Grp_GROUPS_SECTION_ID,NULL,NULL);
/***** Write heading *****/
Grp_WriteHeadingGroups ();
@ -2643,15 +2619,8 @@ static void Grp_PutFormToCreateGroup (const struct Roo_Rooms *Rooms)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
/***** End section *****/
HTM_SECTION_End ();

View File

@ -1032,29 +1032,6 @@ const char *Hlp_COURSE_Program =
"COURSE.Program.en";
#endif
const char *Hlp_COURSE_Program_edit_item =
#if L==1
"COURSE.Program.es#editar-item";
#elif L==2
"COURSE.Program.en#edit-item";
#elif L==3
"COURSE.Program.en#edit-item";
#elif L==4
"COURSE.Program.es#editar-item";
#elif L==5
"COURSE.Program.en#edit-item";
#elif L==6
"COURSE.Program.es#editar-item";
#elif L==7
"COURSE.Program.en#edit-item";
#elif L==8
"COURSE.Program.en#edit-item";
#elif L==9
"COURSE.Program.en#edit-item";
#elif L==10 // tr
"COURSE.Program.en#edit-item";
#endif
const char *Hlp_COURSE_Program_resource_clipboard =
#if L==1
"COURSE.Program.en#resource-clipboard";

View File

@ -884,25 +884,16 @@ void Hld_ContEditAfterChgHld (void)
static void Hld_PutFormToCreateHoliday (const struct Plc_Places *Places)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_All_places;
extern const char *Txt_HOLIDAY_TYPES[Hld_NUM_TYPES_HOLIDAY];
extern const char *Txt_Create;
unsigned NumPlc;
const struct Plc_Place *PlcInLst;
Hld_HolidayType_t HolidayType;
unsigned HolidayTypeUnsigned;
unsigned CurrentYear = Dat_GetCurrentYear ();
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewHld]);
/***** Begin form *****/
Frm_BeginForm (ActNewHld);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewHld,NULL,NULL,NULL);
/***** Write heading *****/
Hld_PutHeadHolidays ();
@ -991,15 +982,8 @@ static void Hld_PutFormToCreateHoliday (const struct Plc_Places *Places)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -1365,8 +1365,6 @@ static void Ins_ShowAlertAndButtonToGoToIns (void)
static void Ins_PutFormToCreateInstitution (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
Act_Action_t NextAction = ActUnk;
/***** Set action depending on role *****/
@ -1377,15 +1375,8 @@ static void Ins_PutFormToCreateInstitution (void)
else
Err_NoPermissionExit ();
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[NextAction]);
/***** Begin form *****/
Frm_BeginForm (NextAction);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (NextAction,NULL,NULL,NULL);
/***** Write heading *****/
Ins_PutHeadInstitutionsForEdition ();
@ -1458,15 +1449,8 @@ static void Ins_PutFormToCreateInstitution (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -667,18 +667,8 @@ void Lnk_ContEditAfterChgLnk (void)
static void Lnk_PutFormToCreateLink (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewLnk]);
/***** Begin form *****/
Frm_BeginForm (ActNewLnk);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewLnk,NULL,NULL,NULL);
/***** Write heading *****/
Lnk_PutHeadLinks ();
@ -721,15 +711,8 @@ static void Lnk_PutFormToCreateLink (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -679,18 +679,8 @@ void Mai_ContEditAfterChgMai (void)
static void Mai_PutFormToCreateMailDomain (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewMai]);
/***** Begin form *****/
Frm_BeginForm (ActNewMai);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewMai,NULL,NULL,NULL);
/***** Write heading *****/
Mai_PutHeadMailDomains ();
@ -731,15 +721,8 @@ static void Mai_PutFormToCreateMailDomain (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -676,18 +676,8 @@ void Plc_ContEditAfterChgPlc (void)
static void Plc_PutFormToCreatePlace (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewPlc]);
/***** Begin form *****/
Frm_BeginForm (ActNewPlc);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewPlc,NULL,NULL,NULL);
/***** Write heading *****/
Plc_PutHeadPlaces ();
@ -727,15 +717,8 @@ static void Plc_PutFormToCreatePlace (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -788,18 +788,8 @@ void Plg_ContEditAfterChgPlg (void)
static void Plg_PutFormToCreatePlugin (void)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewPlg]);
/***** Begin form *****/
Frm_BeginForm (ActNewPlg);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewPlg,NULL,NULL,NULL);
/***** Write heading *****/
Plg_PutHeadPlugins ();
@ -877,15 +867,8 @@ static void Plg_PutFormToCreatePlugin (void)
/***** Row end *****/
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -179,6 +179,7 @@ static unsigned Prg_GetLastChild (int NumItem);
static void Prg_ShowFormToCreateItem (long ParentItmCod);
static void Prg_ShowFormToChangeItem (long ItmCod);
static void Prg_ParsFormItem (void *ItmCod);
static void Prg_ShowFormItem (const struct Prg_Item *Item,
const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME],
const char *Txt);
@ -1932,8 +1933,6 @@ void Prg_ReqCreateItem (void)
static void Prg_ShowFormToCreateItem (long ParentItmCod)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
struct Prg_Item ParentItem; // Parent item
struct Prg_Item Item;
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
@ -1955,40 +1954,19 @@ static void Prg_ShowFormToCreateItem (long ParentItmCod)
/***** Show pending alerts */
Ale_ShowAlerts (NULL);
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewPrgItm]);
/***** Begin form *****/
Frm_BeginFormAnchor (ActNewPrgItm,Prg_HIGHLIGHTED_SECTION_ID);
ParCod_PutPar (ParCod_Itm,ParentItem.Hierarchy.ItmCod);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewPrgItm,NULL,
Prg_ParsFormItem,&ParentItem.Hierarchy.ItmCod);
/***** Show form *****/
Prg_ShowFormItem (&Item,SetHMS,NULL);
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/
/***************** Put a form to change program item *******************/
/*****************************************************************************/
static void Prg_ShowFormToChangeItem (long ItmCod)
{
extern const char *Hlp_COURSE_Program_edit_item;
extern const char *Txt_Edit_item;
extern const char *Txt_Save_changes;
struct Prg_Item Item;
char Txt[Cns_MAX_BYTES_TEXT + 1];
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
@ -2002,25 +1980,20 @@ static void Prg_ShowFormToChangeItem (long ItmCod)
Prg_GetItemDataByCod (&Item);
Prg_DB_GetItemTxt (Item.Hierarchy.ItmCod,Txt);
/***** Begin form *****/
Frm_BeginFormAnchor (ActChgPrgItm,Prg_HIGHLIGHTED_SECTION_ID);
ParCod_PutPar (ParCod_Itm,Item.Hierarchy.ItmCod);
/***** Begin box and table *****/
Box_BoxTableBegin ("100%",
Item.Title[0] ? Item.Title :
Txt_Edit_item,
NULL,NULL,
Hlp_COURSE_Program_edit_item,Box_NOT_CLOSABLE,2);
/***** Begin form to change *****/
Frm_BeginFormTable (ActChgPrgItm,Prg_HIGHLIGHTED_SECTION_ID,
Prg_ParsFormItem,&Item.Hierarchy.ItmCod);
/***** Show form *****/
Prg_ShowFormItem (&Item,SetHMS,Txt);
/***** End table, send button and end box *****/
Box_BoxTableWithButtonEnd (Btn_CONFIRM_BUTTON,Txt_Save_changes);
/***** End form to change *****/
Frm_EndFormTable (Btn_CONFIRM_BUTTON);
}
/***** End form *****/
Frm_EndForm ();
static void Prg_ParsFormItem (void *ItmCod)
{
ParCod_PutPar (ParCod_Itm,*(long *) ItmCod);
}
/*****************************************************************************/

View File

@ -352,22 +352,13 @@ static void Rec_ListFieldsRecordsForEdition (void)
void Rec_ShowFormCreateRecordField (void)
{
extern const char *Hlp_USERS_Students_course_record_card;
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_RECORD_FIELD_VISIBILITY_MENU[Rec_NUM_TYPES_VISIBILITY];
extern const char *Txt_Create;
Rec_VisibilityRecordFields_t Vis;
unsigned VisUnsigned;
char StrNumLines[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewFie]);
/***** Begin form *****/
Frm_BeginForm (ActNewFie);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewFie,NULL,NULL,NULL);
/***** Write heading *****/
Rec_WriteHeadingRecordFields ();
@ -419,15 +410,8 @@ void Rec_ShowFormCreateRecordField (void)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -1210,20 +1210,11 @@ void Roo_ContEditAfterChgRoom (void)
static void Roo_PutFormToCreateRoom (const struct Bld_Buildings *Buildings)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
char StrCapacity[Cns_MAX_DECIMAL_DIGITS_UINT + 1];
char MACstr[MAC_LENGTH_MAC_ADDRESS + 1]; // MAC address in xx:xx:xx:xx:xx:xx format
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewRoo]);
/***** Begin form *****/
Frm_BeginForm (ActNewRoo);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewRoo,NULL,NULL,NULL);
/***** Write heading *****/
Roo_PutHeadRooms ();
@ -1296,15 +1287,8 @@ static void Roo_PutFormToCreateRoom (const struct Bld_Buildings *Buildings)
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -171,20 +171,10 @@ void RubCri_GetCriterionDataByCod (struct RubCri_Criterion *Criterion)
static void RubCri_PutFormNewCriterion (struct Rub_Rubrics *Rubrics,
unsigned MaxCriInd)
{
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
extern const char *Txt_Create;
RubCri_ValueRange_t ValueRange;
/***** Begin fieldset *****/
HTM_FIELDSET_Begin (NULL);
HTM_LEGEND (Txt_Actions[ActNewRubCri]);
/***** Begin form *****/
Frm_BeginForm (ActNewRubCri);
Rub_PutPars (Rubrics);
/***** Begin table *****/
HTM_TABLE_BeginWidePadding (2);
/***** Begin form to create *****/
Frm_BeginFormTable (ActNewRubCri,NULL,Rub_PutPars,Rubrics);
/***** Table heading *****/
RubCri_PutTableHeadingForCriteria (RubCri_DONT_PUT_COLUMN_FOR_ICONS,
@ -243,15 +233,8 @@ static void RubCri_PutFormNewCriterion (struct Rub_Rubrics *Rubrics,
/***** End row *****/
HTM_TR_End ();
/***** End table and send button *****/
HTM_TABLE_End ();
Btn_PutButton (Btn_CREATE_BUTTON,Txt_Create);
/***** End form *****/
Frm_EndForm ();
/***** End fieldset *****/
HTM_FIELDSET_End ();
/***** End form to create *****/
Frm_EndFormTable (Btn_CREATE_BUTTON);
}
/*****************************************************************************/

View File

@ -10975,52 +10975,6 @@ const char *Txt_Duplicate_USERS =
"Duplicates"; // Çeviri lazim!
#endif
const char *Txt_Edit_assignment =
#if L==1 // ca
"Editar activitat";
#elif L==2 // de
"Aufgabe bearbeiten";
#elif L==3 // en
"Edit assignment";
#elif L==4 // es
"Editar actividad";
#elif L==5 // fr
"&Eacute;diter activit&eacute;";
#elif L==6 // gn
"Editar actividad"; // Okoteve traducción
#elif L==7 // it
"Editare attivit&agrave;";
#elif L==8 // pl
"Edytuj zadanie";
#elif L==9 // pt
"Editar atividade";
#elif L==10 // tr
"Edit assignment"; // Çeviri lazim!
#endif
const char *Txt_Edit_item =
#if L==1 // ca
"Editar &iacute;tem";
#elif L==2 // de
"Artikel bearbeiten";
#elif L==3 // en
"Edit item";
#elif L==4 // es
"Editar &iacute;tem";
#elif L==5 // fr
"&Eacute;diter article";
#elif L==6 // gn
"Editar &iacute;tem"; // Okoteve traducción
#elif L==7 // it
"Editare articolo";
#elif L==8 // pl
"Edycja przedmiot";
#elif L==9 // pt
"Editar item";
#elif L==10 // tr
"Edit item"; // Çeviri lazim!
#endif
const char *Txt_Edit_plain_text =
#if L==1 // ca
"Editar text sense format";
@ -11067,29 +11021,6 @@ const char *Txt_Edit_record_fields =
"Edit record fields"; // Çeviri lazim!
#endif
const char *Txt_Edit_set_of_questions =
#if L==1 // ca
"Editar conjunt de preguntes";
#elif L==2 // de
"Satz von Fragen bearbeiten";
#elif L==3 // en
"Edit set of questions";
#elif L==4 // es
"Editar conjunto de preguntas";
#elif L==5 // fr
"&Eacute;diter ensemble de questions";
#elif L==6 // gn
"Editar conjunto de preguntas"; // Okoteve traducción
#elif L==7 // it
"Editare set di domande";
#elif L==8 // pl
"Edycja zestaw pyta&nacute;";
#elif L==9 // pt
"Editar conjunto de perguntas";
#elif L==10 // tr
"Edit set of questions"; // Çeviri lazim!
#endif
const char *Txt_Edit_rich_text =
#if L==1 // ca
"Editar text enriquit";
@ -33459,6 +33390,29 @@ const char *Txt_Removal_not_allowed =
"Removal not allowed"; // Çeviri lazim!
#endif
const char *Txt_Remove =
#if L==1 // ca
"Eliminar";
#elif L==2 // de
"Entfernen";
#elif L==3 // en
"Remove";
#elif L==4 // es
"Eliminar";
#elif L==5 // fr
"Supprimer";
#elif L==6 // gn
"Pe'a";
#elif L==7 // it
"Rimuovere";
#elif L==8 // pl
"Usu&nacute;";
#elif L==9 // pt
"Remover";
#elif L==10 // tr
"Elemek";
#endif
const char *Txt_Remove_all_students =
#if L==1 // ca
"Eliminar tots estudiants";

View File

@ -5837,48 +5837,48 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] =
,
[ActChgPrgItm] =
#if L==1 // ca
"Change program item" // Necessita traducció
"Canviar &iacute;tem del programa"
#elif L==2 // de
"Change program item" // Need Übersetzung
"Programmpunkt &auml;ndern"
#elif L==3 // en
"Change program item"
#elif L==4 // es
"Cambiar &iacute;tem del programa"
#elif L==5 // fr
"Change program item" // Besoin de traduction
"Changer &eacute;l&eacute;ment de programme"
#elif L==6 // gn
"Cambiar &iacute;tem del programa" // Okoteve traducción
"Emoambue elemento programa"
#elif L==7 // it
"Change program item" // Bisogno di traduzione
"Cambiare articolo del programma"
#elif L==8 // pl
"Change program item" // Potrzebujesz tlumaczenie
"Zmie&nacute; pozycj&eogon; programu"
#elif L==9 // pt
"Change program item" // Precisa de tradução
"Alterar item do programa"
#elif L==10 // tr
"Change program item" // Çeviri lazim!
"Program &ouml;&gbreve;esini de&gbreve;i&scedil;tir"
#endif
,
[ActNewPrgItm] =
#if L==1 // ca
"Crear &iacute;tem"
"Crear &iacute;tem del programa"
#elif L==2 // de
"Artikel eingeben"
"Programmpunkt erstellen"
#elif L==3 // en
"Create item"
"Create program item"
#elif L==4 // es
"Crear &iacute;tem"
"Crear &iacute;tem del programa"
#elif L==5 // fr
"Cr&eacute;er article"
"Cr&eacute;er &eacute;l&eacute;ment de programme"
#elif L==6 // gn
"Crear &iacute;tem" // Okoteve traducción
"Ojapo elemento programa"
#elif L==7 // it
"Creare articolo"
"Creare articolo del programma"
#elif L==8 // pl
"Utw&oacute;rz przedmiot"
"Utw&oacute;rz pozycj&eogon; programu"
#elif L==9 // pt
"Criar item"
"Criar item do programa"
#elif L==10 // tr
"Create item" // Çeviri lazim!
"Program &ouml;&gbreve;esi olu&scedil;tur"
#endif
,
[ActReqRemPrgItm] =