Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy.

This commit is contained in:
acanas 2023-11-06 16:54:49 +01:00
parent 69d1ed4108
commit fd67813920
3 changed files with 35 additions and 181 deletions

View File

@ -633,10 +633,11 @@ Me sale este error, no s
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
*/
#define Log_PLATFORM_VERSION "SWAD 23.44.2 (2023-11-06)"
#define Log_PLATFORM_VERSION "SWAD 23.44.3 (2023-11-06)"
#define CSS_FILE "swad23.35.1.css"
#define JS_FILE "swad22.49.js"
/*
Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy. (335391 lines)
Version 23.44.2: Nov 06, 2023 Code refactoring in hierarchy. (335532 lines)
Version 23.44.1: Nov 06, 2023 Code refactoring in hierarchy. (335538 lines)
Version 23.44: Nov 06, 2023 Code refactoring in hierarchy. (335571 lines)

View File

@ -75,16 +75,11 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
extern const char *Txt_Remove_me_from_THE_COURSE_X;
extern const char *Txt_Remove_me;
extern const char *Txt_Register_me_in_X;
extern const char *Txt_Select_create_course_in_X;
extern const char *Txt_Select_or_create_one_course_in_X;
extern const char *Txt_HIERARCHY_PLURAL_Abc[Hie_NUM_LEVELS];
extern const char *Txt_Select_or_create_another_degree_in_X;
extern const char *Txt_Select_or_create_one_course_in_X;
extern const char *Txt_Select_or_create_one_degree_in_X;
extern const char *Txt_Select_or_create_another_center_in_X;
extern const char *Txt_Select_or_create_one_center_in_X;
extern const char *Txt_Select_or_create_another_institution_in_X;
extern const char *Txt_Select_or_create_one_institution_in_X;
extern const char *Txt_Select_another_country;
extern const char *Txt_Select_one_country;
extern const char *Txt_Upload_my_picture;
extern const char *Txt_Upload_photo;
@ -104,7 +99,24 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
[Rol_INS_ADM] = ActUnk,
[Rol_SYS_ADM] = ActUnk,
};
static const Act_Action_t ActionsSelect[Hie_NUM_LEVELS] =
{
[Hie_DEG] = ActSeeCrs,
[Hie_CTR] = ActSeeDeg,
[Hie_INS] = ActSeeCtr,
[Hie_CTY] = ActSeeIns,
[Hie_SYS] = ActSeeCty,
};
static const char **Select_or_create[Hie_NUM_LEVELS] =
{
[Hie_DEG] = &Txt_Select_or_create_one_course_in_X,
[Hie_CTR] = &Txt_Select_or_create_one_degree_in_X,
[Hie_INS] = &Txt_Select_or_create_one_center_in_X,
[Hie_CTY] = &Txt_Select_or_create_one_institution_in_X,
[Hie_SYS] = &Txt_Select_one_country,
};
char *Description;
Hie_Level_t Level;
/***** Alert message *****/
if (Gbl.Usrs.Me.Logged &&
@ -177,65 +189,21 @@ void Hlp_ShowHelpWhatWouldYouLikeToDo (void)
Btn_CONFIRM_BUTTON,Txt_My_courses);
}
if (Gbl.Hierarchy.Node[Hie_DEG].HieCod > 0) // Degree selected
{
/* Select a course */
if (asprintf (&Description,Gbl.Hierarchy.Level == Hie_CRS ? Txt_Select_create_course_in_X :
Txt_Select_or_create_one_course_in_X,
Gbl.Hierarchy.Node[Hie_DEG].ShrtName) < 0)
Err_NotEnoughMemoryExit ();
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Description,
ActSeeCrs,
Btn_CONFIRM_BUTTON,
Txt_HIERARCHY_PLURAL_Abc[Hie_CRS]);
free (Description);
}
else if (Gbl.Hierarchy.Node[Hie_CTR].HieCod > 0) // Center selected
{
/* Select a degree */
if (asprintf (&Description,Gbl.Hierarchy.Node[Hie_DEG].HieCod > 0 ? Txt_Select_or_create_another_degree_in_X :
Txt_Select_or_create_one_degree_in_X,
Gbl.Hierarchy.Node[Hie_CTR].ShrtName) < 0)
Err_NotEnoughMemoryExit ();
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Description,
ActSeeDeg,
Btn_CONFIRM_BUTTON,
Txt_HIERARCHY_PLURAL_Abc[Hie_DEG]);
free (Description);
}
else if (Gbl.Hierarchy.Node[Hie_INS].HieCod > 0) // Institution selected
{
/* Select a center */
if (asprintf (&Description,Gbl.Hierarchy.Node[Hie_CTR].HieCod > 0 ? Txt_Select_or_create_another_center_in_X :
Txt_Select_or_create_one_center_in_X,
Gbl.Hierarchy.Node[Hie_INS].ShrtName) < 0)
Err_NotEnoughMemoryExit ();
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Description,
ActSeeCtr,
Btn_CONFIRM_BUTTON,
Txt_HIERARCHY_PLURAL_Abc[Hie_CTR]);
free (Description);
}
else if (Gbl.Hierarchy.Node[Hie_CTY].HieCod > 0) // Country selected
{
/* Select an institution */
if (asprintf (&Description,Gbl.Hierarchy.Node[Hie_INS].HieCod > 0 ? Txt_Select_or_create_another_institution_in_X :
Txt_Select_or_create_one_institution_in_X,
Gbl.Hierarchy.Node[Hie_CTY].FullName) < 0)
Err_NotEnoughMemoryExit ();
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Description,
ActSeeIns,
Btn_CONFIRM_BUTTON,
Txt_HIERARCHY_PLURAL_Abc[Hie_INS]);
free (Description);
}
else
/* Select a country */
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Gbl.Hierarchy.Node[Hie_CTY].HieCod > 0 ? Txt_Select_another_country :
Txt_Select_one_country,
ActSeeCty,
Btn_CONFIRM_BUTTON,
Txt_HIERARCHY_PLURAL_Abc[Hie_CTY]);
for (Level = Hie_DEG;
Level >= Hie_SYS;
Level--)
if (Gbl.Hierarchy.Node[Level].HieCod > 0) // Level selected
{
if (asprintf (&Description,*Select_or_create[Level],
Gbl.Hierarchy.Node[Level].ShrtName) < 0)
Err_NotEnoughMemoryExit ();
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Description,
ActionsSelect[Level],
Btn_CONFIRM_BUTTON,
Txt_HIERARCHY_PLURAL_Abc[Level]);
free (Description);
break;
}
if (!Gbl.Usrs.Me.MyPhotoExists) // I have no photo
Hlp_ShowRowHelpWhatWouldYouLikeToDo (Txt_Upload_my_picture,

View File

@ -41050,29 +41050,6 @@ const char *Txt_See_the_previous_X_COMMENTS = // Warning: it is very important t
"See the previous %u"; // Çeviri lazim!
#endif
const char *Txt_Select_another_country =
#if L==1 // ca
"Seleccionar un altre país";
#elif L==2 // de
"W&auml;hlen Sie eine anderes Land";
#elif L==3 // en
"Select another country";
#elif L==4 // es
"Seleccionar otro pa&iacute;s";
#elif L==5 // fr
"S&eacute;lectionnez un autre pays";
#elif L==6 // gn
"Seleccionar otro pa&iacute;s"; // Okoteve traducción
#elif L==7 // it
"Selezionare un altro paese";
#elif L==8 // pl
"Wybierz inny kraj";
#elif L==9 // pt
"Selecionar outro pa&iacute;s";
#elif L==10 // tr
"Select another country"; // Çeviri lazim!
#endif
const char *Txt_Select_one_country =
#if L==1 // ca
"Seleccionar un pa&iacute;s";
@ -41096,98 +41073,6 @@ const char *Txt_Select_one_country =
"Select one country"; // Çeviri lazim!
#endif
const char *Txt_Select_or_create_another_center_in_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Seleccionar o crear un altre center en la instituci&oacute; <strong>%s</strong>";
#elif L==2 // de
"W&auml;hlen oder erstellen Sie einen anderen Lehrinstitut der Hochschule <strong>%s</strong>";
#elif L==3 // en
"Select or create another center in the institution <strong>%s</strong>";
#elif L==4 // es
"Seleccionar o crear otro centro en la instituci&oacute;n <strong>%s</strong>";
#elif L==5 // fr
"S&eacute;lectionnez ou cr&eacute;ez un autre &eacute;tude de l'&eacute;tablissement <strong>%s</strong>";
#elif L==6 // gn
"Seleccionar o crear otro centro en la instituci&oacute;n <strong>%s</strong>"; // Okoteve traducción
#elif L==7 // it
"Selezionare o creare un altro centro di istituzione <strong>%s</strong>";
#elif L==8 // pl
"Select or create another center in the institution <strong>%s</strong>"; // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Selecionar ou criar um outro centro da institu&ccedil;&atilde;o <strong>%s</strong>";
#elif L==10 // tr
"Select or create another center in the institution <strong>%s</strong>"; // Çeviri lazim!
#endif
const char *Txt_Select_create_course_in_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Seleccionar/crear assignatura en <strong>%s</strong>";
#elif L==2 // de
"W&auml;hlen/erstellen Kurs von <strong>%s</strong>";
#elif L==3 // en
"Select/create in <strong>%s</strong>";
#elif L==4 // es
"Seleccionar/crear asignatura en <strong>%s</strong>";
#elif L==5 // fr
"S&eacute;lectionner/cr&eacute;er mati&egrave;re dans <strong>%s</strong>";
#elif L==6 // gn
"Seleccionar/crear asignatura en <strong>%s</strong>"; // Okoteve traducción
#elif L==7 // it
"Selezionare/creare corso di <strong>%s</strong>";
#elif L==8 // pl
"Select/create course in <strong>%s</strong>"; // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Selecionar/criar disciplina de <strong>%s</strong>";
#elif L==10 // tr
"Select/create in <strong>%s</strong>"; // Çeviri lazim!
#endif
const char *Txt_Select_or_create_another_degree_in_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Seleccionar o crear una altra titulaci&oacute; en <strong>%s</strong>";
#elif L==2 // de
"W&auml;hlen oder erstellen Sie einen anderen Studiengang von <strong>%s</strong>";
#elif L==3 // en
"Select or create another degree in <strong>%s</strong>";
#elif L==4 // es
"Seleccionar o crear otra titulaci&oacute;n en <strong>%s</strong>";
#elif L==5 // fr
"S&eacute;lectionnez ou cr&eacute;ez un autre &eacute;tude dans <strong>%s</strong>";
#elif L==6 // gn
"Seleccionar o crear otra titulaci&oacute;n en <strong>%s</strong>"; // Okoteve traducción
#elif L==7 // it
"Selezionare o creare una altra laurea di <strong>%s</strong>";
#elif L==8 // pl
"Select or create another degree in <strong>%s</strong>"; // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Selecionar ou criar outro grau de <strong>%s</strong>";
#elif L==10 // tr
"Select or create another degree in <strong>%s</strong>"; // Çeviri lazim!
#endif
const char *Txt_Select_or_create_another_institution_in_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Seleccionar o crear una altra instituci&oacute; en <strong>%s</strong>";
#elif L==2 // de
"W&auml;hlen oder erstellen Sie einen anderen Hochschule von <strong>%s</strong>";
#elif L==3 // en
"Select or create another institution in <strong>%s</strong>";
#elif L==4 // es
"Seleccionar o crear otra instituci&oacute;n en <strong>%s</strong>";
#elif L==5 // fr
"S&eacute;lectionnez ou cr&eacute;ez un autre &eacute;tablissement de <strong>%s</strong>";
#elif L==6 // gn
"Seleccionar o crear otra instituci&oacute;n en <strong>%s</strong>"; // Okoteve traducción
#elif L==7 // it
"Selezionare o creare una altra istituzione di <strong>%s</strong>";
#elif L==8 // pl
"Select or create another institution in <strong>%s</strong>"; // Potrzebujesz tlumaczenie
#elif L==9 // pt
"Selecionar ou criar outra institu&ccedil;&atilde;o de <strong>%s</strong>";
#elif L==10 // tr
"Select or create another institution in <strong>%s</strong>"; // Çeviri lazim!
#endif
const char *Txt_Select_or_create_one_center_in_X = // Warning: it is very important to include %s in the following sentences
#if L==1 // ca
"Seleccionar o crear un center en <strong>%s</strong>";