From 371ed6d33f3951e85c50598fc9fb2c8bfa30c192 Mon Sep 17 00:00:00 2001 From: acanas Date: Tue, 9 May 2023 09:10:29 +0200 Subject: [PATCH] Version 22.107.22:May 09, 2023 Changes in edition of courses. --- swad_changelog.h | 3 +- swad_course.c | 165 ++++++++++++++++++++++++--------------------- swad_text.c | 23 ------- swad_text_action.c | 16 ++--- 4 files changed, 99 insertions(+), 108 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index b5e9b48f6..1938ffcbd 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -629,10 +629,11 @@ 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.21 (2023-05-09)" +#define Log_PLATFORM_VERSION "SWAD 22.107.22 (2023-05-09)" #define CSS_FILE "swad22.107.17.css" #define JS_FILE "swad22.49.js" /* + Version 22.107.22:May 09, 2023 Changes in edition of courses. (337817 lines) Version 22.107.21:May 09, 2023 Changes in edition of degrees. (337829 lines) Version 22.107.20:May 09, 2023 Changes in edition of countries. (337842 lines) Version 22.107.19:May 09, 2023 Changes in edition of institutions. (337858 lines) diff --git a/swad_course.c b/swad_course.c index 2213606af..5e20d1198 100644 --- a/swad_course.c +++ b/swad_course.c @@ -1280,106 +1280,119 @@ 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_course; + extern const char *Txt_Create; + Act_Action_t NextAction = ActUnk; unsigned Year; + /***** Set action depending on role *****/ + /***** Begin form *****/ if (Gbl.Usrs.Me.Role.Logged >= Rol_DEG_ADM) - Frm_BeginForm (ActNewCrs); + NextAction = ActNewCrs; else if (Gbl.Usrs.Me.Role.Max >= Rol_GST) - Frm_BeginForm (ActReqCrs); + NextAction = ActReqCrs; else Err_NoPermissionExit (); - /***** Begin box and table *****/ - Box_BoxTableBegin (NULL,NULL, - NULL,NULL, - NULL,Box_NOT_CLOSABLE,2); + /***** Begin fieldset *****/ + HTM_FIELDSET_Begin (NULL); + HTM_LEGEND (Txt_Actions[NextAction]); - /***** Write heading *****/ - Crs_PutHeadCoursesForEdition (); + /***** Begin form *****/ + Frm_BeginForm (NextAction); - HTM_TR_Begin (NULL); + /***** Begin table *****/ + HTM_TABLE_BeginWidePadding (2); - /***** Column to remove course, disabled here *****/ - HTM_TD_Begin ("class=\"BM\""); - HTM_TD_End (); + /***** Write heading *****/ + Crs_PutHeadCoursesForEdition (); - /***** Course code *****/ - HTM_TD_Begin ("class=\"CODE\""); - HTM_TD_End (); + HTM_TR_Begin (NULL); - /***** Institutional code of the course *****/ - HTM_TD_Begin ("class=\"CM\""); - HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD, - Crs_EditingCrs->InstitutionalCrsCod, - HTM_DONT_SUBMIT_ON_CHANGE, - "class=\"INPUT_INS_CODE INPUT_%s\"", - The_GetSuffix ()); - HTM_TD_End (); + /***** Column to remove course, disabled here *****/ + HTM_TD_Begin ("class=\"BM\""); + HTM_TD_End (); - /***** Year *****/ - HTM_TD_Begin ("class=\"CM\""); - HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, - "name=\"OthCrsYear\"" - " class=\"HIE_SEL_NARROW INPUT_%s\"", - The_GetSuffix ()); - for (Year = 0; - Year <= Deg_MAX_YEARS_PER_DEGREE; - Year++) - HTM_OPTION (HTM_Type_UNSIGNED,&Year, - Year == Crs_EditingCrs->Year, // Selected? - HTM_OPTION_ENABLED, - "%s",Txt_YEAR_OF_DEGREE[Year]); - HTM_SELECT_End (); - HTM_TD_End (); + /***** Course code *****/ + HTM_TD_Begin ("class=\"CODE\""); + HTM_TD_End (); - /***** Course short name *****/ - HTM_TD_Begin ("class=\"LM\""); - HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Crs_EditingCrs->ShrtName, - HTM_DONT_SUBMIT_ON_CHANGE, - "class=\"INPUT_SHORT_NAME INPUT_%s\"" - " required=\"required\"", - The_GetSuffix ()); - HTM_TD_End (); + /***** Institutional code of the course *****/ + HTM_TD_Begin ("class=\"CM\""); + HTM_INPUT_TEXT ("InsCrsCod",Crs_MAX_CHARS_INSTITUTIONAL_CRS_COD, + Crs_EditingCrs->InstitutionalCrsCod, + HTM_DONT_SUBMIT_ON_CHANGE, + "class=\"INPUT_INS_CODE INPUT_%s\"", + The_GetSuffix ()); + HTM_TD_End (); - /***** Course full name *****/ - HTM_TD_Begin ("class=\"LM\""); - HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Crs_EditingCrs->FullName, - HTM_DONT_SUBMIT_ON_CHANGE, - "class=\"INPUT_FULL_NAME INPUT_%s\"" - " required=\"required\"", - The_GetSuffix ()); - HTM_TD_End (); + /***** Year *****/ + HTM_TD_Begin ("class=\"CM\""); + HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL, + "name=\"OthCrsYear\"" + " class=\"HIE_SEL_NARROW INPUT_%s\"", + The_GetSuffix ()); + for (Year = 0; + Year <= Deg_MAX_YEARS_PER_DEGREE; + Year++) + HTM_OPTION (HTM_Type_UNSIGNED,&Year, + Year == Crs_EditingCrs->Year, // Selected? + HTM_OPTION_ENABLED, + "%s",Txt_YEAR_OF_DEGREE[Year]); + HTM_SELECT_End (); + HTM_TD_End (); - /***** Current number of teachers in this course *****/ - HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); - HTM_Unsigned (0); - HTM_TD_End (); + /***** Course short name *****/ + HTM_TD_Begin ("class=\"LM\""); + HTM_INPUT_TEXT ("ShortName",Cns_HIERARCHY_MAX_CHARS_SHRT_NAME,Crs_EditingCrs->ShrtName, + HTM_DONT_SUBMIT_ON_CHANGE, + "class=\"INPUT_SHORT_NAME INPUT_%s\"" + " required=\"required\"", + The_GetSuffix ()); + HTM_TD_End (); - /***** Current number of students in this course *****/ - HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); - HTM_Unsigned (0); - HTM_TD_End (); + /***** Course full name *****/ + HTM_TD_Begin ("class=\"LM\""); + HTM_INPUT_TEXT ("FullName",Cns_HIERARCHY_MAX_CHARS_FULL_NAME,Crs_EditingCrs->FullName, + HTM_DONT_SUBMIT_ON_CHANGE, + "class=\"INPUT_FULL_NAME INPUT_%s\"" + " required=\"required\"", + The_GetSuffix ()); + HTM_TD_End (); - /***** Course requester *****/ - HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", - The_GetSuffix ()); - Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true); - HTM_TD_End (); + /***** Current number of teachers in this course *****/ + HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); + HTM_Unsigned (0); + HTM_TD_End (); - /***** Course status *****/ - HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); - HTM_TD_End (); + /***** Current number of students in this course *****/ + HTM_TD_Begin ("class=\"RM DAT_%s\"",The_GetSuffix ()); + HTM_Unsigned (0); + HTM_TD_End (); - HTM_TR_End (); + /***** Course requester *****/ + HTM_TD_Begin ("class=\"LT DAT_%s INPUT_REQUESTER\"", + The_GetSuffix ()); + Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,true); + HTM_TD_End (); - /***** End table, send button and end box *****/ - Box_BoxTableWithButtonEnd (Btn_CREATE_BUTTON,Txt_Create_course); + /***** Course status *****/ + HTM_TD_Begin ("class=\"LM DAT_%s\"",The_GetSuffix ()); + HTM_TD_End (); - /***** End form *****/ - Frm_EndForm (); + 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 (); } /*****************************************************************************/ diff --git a/swad_text.c b/swad_text.c index 764d0f91a..fe5a56f19 100644 --- a/swad_text.c +++ b/swad_text.c @@ -6618,29 +6618,6 @@ const char *Txt_Create_another_type_of_degree = "Create another type of degree"; // Çeviri lazim! #endif -const char *Txt_Create_course = -#if L==1 // ca - "Crear assignatura"; -#elif L==2 // de - "Kurs eingeben"; -#elif L==3 // en - "Create course"; -#elif L==4 // es - "Crear asignatura"; -#elif L==5 // fr - "Créer matière"; -#elif L==6 // gn - "Crear asignatura"; // Okoteve traducción -#elif L==7 // it - "Crea corso"; -#elif L==8 // pl - "Utwórz kursu"; -#elif L==9 // pt - "Criar disciplina"; -#elif L==10 // tr - "Create course"; // Çeviri lazim! -#endif - const char *Txt_Create_department = #if L==1 // ca "Crear departament"; diff --git a/swad_text_action.c b/swad_text_action.c index 6faf8e2b3..5adfcbfac 100644 --- a/swad_text_action.c +++ b/swad_text_action.c @@ -5216,23 +5216,23 @@ const char *Txt_Actions[ActLst_NUM_ACTIONS] = , [ActNewCrs] = #if L==1 // ca - "Create course" // Necessita traducció + "Crear assignatura" #elif L==2 // de - "Create course" // Need Übersetzung + "Kurs eingeben" #elif L==3 // en "Create course" #elif L==4 // es - "Crear una asignatura" + "Crear asignatura" #elif L==5 // fr - "Create course" // Besoin de traduction + "Créer matière" #elif L==6 // gn - "Crear una asignatura" // Okoteve traducción + "Crear asignatura" // Okoteve traducción #elif L==7 // it - "Create course" // Bisogno di traduzione + "Crea corso" #elif L==8 // pl - "Create course" // Potrzebujesz tlumaczenie + "Utwórz kursu" #elif L==9 // pt - "Create course" // Precisa de tradução + "Criar disciplina" #elif L==10 // tr "Create course" // Çeviri lazim! #endif