Version 16.197

This commit is contained in:
Antonio Cañas Vargas 2017-04-30 14:03:45 +02:00
parent 9ce18f4589
commit 2e4d3b50d8
7 changed files with 152 additions and 103 deletions

View File

@ -1674,7 +1674,7 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActChgCtrPhoAtt */{1159,-1,TabUnk,ActSeeCtrInf , 0, 0, 0,0x1C0, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,Ctr_ChangeCtrPhotoAttribution ,NULL},
/* ActSeeDegTyp */{1013,-1,TabUnk,ActSeeDeg , 0, 0, 0,0x1FF, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,DT_SeeDegreeTypesInDegTab ,NULL},
/* ActEdiDegTyp */{ 573,-1,TabUnk,ActSeeDeg , 0, 0, 0,0x100, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,DT_ReqEditDegreeTypes ,NULL},
/* ActEdiDegTyp */{ 573,-1,TabUnk,ActSeeDeg , 0, 0, 0,0x100, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,DT_EditDegreeTypes ,NULL},
/* ActNewDegTyp */{ 537,-1,TabUnk,ActSeeDeg , 0, 0, 0,0x100, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,DT_RecFormNewDegreeType ,NULL},
/* ActRemDegTyp */{ 545,-1,TabUnk,ActSeeDeg , 0, 0, 0,0x100, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,DT_RemoveDegreeType ,NULL},
/* ActRenDegTyp */{ 538,-1,TabUnk,ActSeeDeg , 0, 0, 0,0x100, 0, 0, 0,Act_CONT_NORM,Act_THIS_WINDOW,NULL ,DT_RenameDegreeType ,NULL},

View File

@ -209,7 +209,6 @@
// TODO: Comprobar que, para detectar el número de filas de cabecera y pie automáticamente en los archivos de calificaciones, SWAD mira no sólo que parezcan un ID, sino que coincida con alguno de los DNI de la asignatura (por ejemplo en el caso de los DNI alemanes formados por varias letras)
// TODO: En información de un centro, poner icono que enlace a edición de lugares, y posibilidad de editar lugar del centro en un menú desplegable. Lugar debería ir encima de Acceso directo.
// TODO: Cuando se está editando instituciones, centros, titulaciones y asignaturas, poner un icono Ver (ojo) en la esquina superior izquierda.
// TODO: Fix bug: An URL like https://openswad.org/es?a gives Internal Server Error
@ -223,13 +222,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.196.3 (2017-04-30)"
#define Log_PLATFORM_VERSION "SWAD 16.197 (2017-04-30)"
#define CSS_FILE "swad16.195.8.css"
#define JS_FILE "swad16.181.js"
// Number of lines (includes comments but not blank lines) has been got with the following command:
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1
/*
Version 16.197: Apr 30, 2017 Changes in layout of edition of degree types. (218579 lines)
Version 16.196.3: Apr 30, 2017 Changes in layout of edition of courses. (218540 lines)
Version 16.196.2: Apr 30, 2017 Changes in layout of edition of degrees. (218537 lines)
Version 16.196.1: Apr 30, 2017 Changes in layout of edition of centres. (218538 lines)

View File

@ -1652,11 +1652,9 @@ static void Crs_PutFormToCreateCourse (void)
Lay_StartRoundFrameTable (NULL,Txt_New_course,NULL,NULL,2);
Crs_PutHeadCoursesForEdition ();
/***** Disabled icon to remove course *****/
/***** Column to remove course, disabled here *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"BM\">");
Lay_PutIconRemovalNotAllowed ();
fprintf (Gbl.F.Out,"</td>");
"<td class=\"BM\"></td>");
/***** Course code *****/
fprintf (Gbl.F.Out,"<td class=\"CODE\"></td>");
@ -1712,7 +1710,6 @@ static void Crs_PutFormToCreateCourse (void)
"0"
"</td>");
/***** Course requester *****/
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">"
"<table class=\"INPUT_REQUESTER CELLS_PAD_2\">"

View File

@ -1177,7 +1177,7 @@ static void Deg_ListDegrees (void)
if (Gbl.CurrentCtr.Ctr.Degs.Num) // There are degrees in the current centre
{
/***** Start table *****/
/***** Write heading *****/
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL_WIDE_MARGIN CELLS_PAD_2\">");
Deg_PutHeadDegreesForSeeing ();
@ -1345,7 +1345,7 @@ void Deg_EditDegrees (void)
{
extern const char *Hlp_CENTRE_Degrees;
extern const char *Txt_Degrees_of_CENTRE_X;
extern const char *Txt_There_are_no_types_of_degree;
extern const char *Txt_No_types_of_degree;
/***** Get list of degrees in the current centre *****/
Deg_GetListDegsOfCurrentCtr ();
@ -1371,11 +1371,11 @@ void Deg_EditDegrees (void)
else // No degree types
{
/***** Warning message *****/
Lay_ShowAlert (Lay_WARNING,Txt_There_are_no_types_of_degree);
Lay_ShowAlert (Lay_WARNING,Txt_No_types_of_degree);
/***** Form to create the first degree type *****/
if (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM)
DT_PutFormToCreateDegreeType ();
if (DT_CheckIfICanCreateDegreeTypes ())
DT_EditDegreeTypes ();
}
/***** End frame *****/

View File

@ -62,12 +62,13 @@ extern struct Globals Gbl;
/**************************** Private prototypes *****************************/
/*****************************************************************************/
static void DT_PutIconToViewDegreeTypesWhenEditing (void);
static void DT_SeeDegreeTypes (Act_Action_t NextAction,Sco_Scope_t Scope,
DT_Order_t DefaultOrder);
static DT_Order_t DT_GetParamDegTypOrder (DT_Order_t DefaultOrder);
static void DT_ListDegreeTypes (Act_Action_t NextAction,DT_Order_t SelectedOrder);
static void DT_EditDegreeTypes (void);
static void DT_ListDegreeTypesForSeeing (void);
static void DT_PutIconsListDegTypes (void);
static void DT_PutIconToEditDegTypes (void);
@ -136,6 +137,16 @@ void DT_PutIconToViewDegreeTypes (void)
NULL);
}
static void DT_PutIconToViewDegreeTypesWhenEditing (void)
{
extern const char *Txt_View;
Lay_PutContextualLink (ActSeeDegTyp,NULL,NULL,
"eye-on64x64.png",
Txt_View,NULL,
NULL);
}
/*****************************************************************************/
/***************************** Show degree types *****************************/
/*****************************************************************************/
@ -182,22 +193,6 @@ static DT_Order_t DT_GetParamDegTypOrder (DT_Order_t DefaultOrder)
(unsigned long) DefaultOrder);
}
/*****************************************************************************/
/********************** Request edition of degree types **********************/
/*****************************************************************************/
void DT_ReqEditDegreeTypes (void)
{
/***** Get list of degree types *****/
DT_GetListDegreeTypes (Sco_SCOPE_SYS,DT_ORDER_BY_DEGREE_TYPE);
/***** Put form to edit degree types *****/
DT_EditDegreeTypes ();
/***** Free list of degree types *****/
DT_FreeListDegreeTypes ();
}
/*****************************************************************************/
/***************************** List degree types *****************************/
/*****************************************************************************/
@ -210,51 +205,69 @@ static void DT_ListDegreeTypes (Act_Action_t NextAction,DT_Order_t SelectedOrder
extern const char *Hlp_CENTRE_DegreeTypes;
extern const char *Hlp_STATS_Figures_types_of_degree;
extern const char *Txt_Types_of_degree;
extern const char *Txt_There_are_no_types_of_degree;
extern const char *Txt_No_types_of_degree;
extern const char *Txt_Create_another_type_of_degree;
extern const char *Txt_Create_type_of_degree;
/***** Start frame *****/
switch (NextAction)
{
case ActSeeDegTyp:
Lay_StartRoundFrame (NULL,Txt_Types_of_degree,DT_PutIconsListDegTypes,
Hlp_CENTRE_DegreeTypes);
break;
case ActSeeUseGbl:
Lay_StartRoundFrame (NULL,Txt_Types_of_degree,DT_PutIconToEditDegTypes,
Hlp_STATS_Figures_types_of_degree);
break;
default: // Bad call
return;
}
if (Gbl.Degs.DegTypes.Num)
{
/***** Write heading *****/
switch (NextAction)
{
case ActSeeDegTyp:
Lay_StartRoundFrameTable (NULL,Txt_Types_of_degree,
DT_PutIconsListDegTypes,
Hlp_CENTRE_DegreeTypes,
2);
break;
case ActSeeUseGbl:
Lay_StartRoundFrameTable (NULL,Txt_Types_of_degree,
DT_PutIconToEditDegTypes,
Hlp_STATS_Figures_types_of_degree,
2);
break;
default: // Bad call
return;
}
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL_WIDE_MARGIN CELLS_PAD_2\">");
DT_PutHeadDegreeTypesForSeeing (NextAction,SelectedOrder);
/***** List current degree types for seeing *****/
DT_ListDegreeTypesForSeeing ();
/***** End table and frame *****/
Lay_EndRoundFrameTable ();
/***** End table *****/
fprintf (Gbl.F.Out,"</table>");
}
else
Lay_ShowAlert (Lay_INFO,Txt_There_are_no_types_of_degree);
else // No degree types created
Lay_ShowAlert (Lay_INFO,Txt_No_types_of_degree);
/***** Button to create degree type *****/
if (DT_CheckIfICanCreateDegreeTypes ())
{
Act_FormStart (ActEdiDegTyp);
Lay_PutConfirmButton (Gbl.Degs.DegTypes.Num ? Txt_Create_another_type_of_degree :
Txt_Create_type_of_degree);
Act_FormEnd ();
}
/***** End frame *****/
Lay_EndRoundFrame ();
}
/*****************************************************************************/
/************************ Put forms to edit degree types *********************/
/*****************************************************************************/
static void DT_EditDegreeTypes (void)
void DT_EditDegreeTypes (void)
{
extern const char *Txt_There_are_no_types_of_degree;
extern const char *Hlp_CENTRE_DegreeTypes_edit;
extern const char *Txt_Types_of_degree;
if (!Gbl.Degs.DegTypes.Num)
/***** Help message *****/
Lay_ShowAlert (Lay_INFO,Txt_There_are_no_types_of_degree);
/***** Get list of degree types *****/
DT_GetListDegreeTypes (Sco_SCOPE_SYS,DT_ORDER_BY_DEGREE_TYPE);
/***** Start frame *****/
Lay_StartRoundFrame (NULL,Txt_Types_of_degree,
DT_PutIconToViewDegreeTypesWhenEditing,
Hlp_CENTRE_DegreeTypes_edit);
/***** Put a form to create a new degree type *****/
DT_PutFormToCreateDegreeType ();
@ -262,6 +275,12 @@ static void DT_EditDegreeTypes (void)
/***** Forms to edit current degree types *****/
if (Gbl.Degs.DegTypes.Num)
DT_ListDegreeTypesForEdition ();
/***** End frame *****/
Lay_EndRoundFrame ();
/***** Free list of degree types *****/
DT_FreeListDegreeTypes ();
}
/*****************************************************************************/
@ -327,11 +346,11 @@ static void DT_PutIconsListDegTypes (void)
static void DT_PutIconToEditDegTypes (void)
{
extern const char *Txt_Edit;
bool IsCentreTab = Gbl.CurrentCtr.Ctr.CtrCod > 0 &&
Gbl.CurrentDeg.Deg.DegCod <= 0;
bool CentreTabVisible = Gbl.CurrentCtr.Ctr.CtrCod > 0 && // Centre selected
Gbl.CurrentDeg.Deg.DegCod <= 0; // No degree selected
if (IsCentreTab && // Only editable in centre tab
Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) // Only editable by system admins
if (CentreTabVisible && // Only editable if centre tab is visible
DT_CheckIfICanCreateDegreeTypes ())
Lay_PutContextualLink (ActEdiDegTyp,NULL,NULL,
"edit64x64.png",
Txt_Edit,NULL,
@ -344,13 +363,10 @@ static void DT_PutIconToEditDegTypes (void)
static void DT_ListDegreeTypesForEdition (void)
{
extern const char *Hlp_CENTRE_DegreeTypes_edit;
extern const char *Txt_Types_of_degree;
unsigned NumDegTyp;
/***** Write heading *****/
Lay_StartRoundFrameTable (NULL,Txt_Types_of_degree,
NULL,Hlp_CENTRE_DegreeTypes_edit,2);
fprintf (Gbl.F.Out,"<table class=\"FRAME_TBL_WIDE CELLS_PAD_2\">");
DT_PutHeadDegreeTypesForEdition ();
/***** List degree types with forms for edition *****/
@ -373,7 +389,7 @@ static void DT_ListDegreeTypesForEdition (void)
/* Degree type code */
fprintf (Gbl.F.Out,"</td>"
"<td class=\"DAT CENTER_MIDDLE\">"
"<td class=\"DAT CODE\">"
"%ld"
"</td>",
Gbl.Degs.DegTypes.Lst[NumDegTyp].DegTypCod);
@ -399,7 +415,17 @@ static void DT_ListDegreeTypesForEdition (void)
Gbl.Degs.DegTypes.Lst[NumDegTyp].NumDegs);
}
Lay_EndRoundFrameTable ();
/***** End table *****/
fprintf (Gbl.F.Out,"</table>");
}
/*****************************************************************************/
/******************** Check if I can create degree types *********************/
/*****************************************************************************/
bool DT_CheckIfICanCreateDegreeTypes (void)
{
return (Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM);
}
/*****************************************************************************/
@ -408,35 +434,39 @@ static void DT_ListDegreeTypesForEdition (void)
void DT_PutFormToCreateDegreeType (void)
{
extern const char *Hlp_CENTRE_DegreeTypes_edit;
extern const char *Txt_New_type_of_degree;
extern const char *Txt_Type_of_degree;
extern const char *Txt_Create_type_of_degree;
/***** Start form *****/
Act_FormStart (ActNewDegTyp);
/***** Start of frame *****/
Lay_StartRoundFrameTable (NULL,Txt_New_type_of_degree,
NULL,Hlp_CENTRE_DegreeTypes_edit,2);
Lay_StartRoundFrameTable (NULL,Txt_New_type_of_degree,NULL,NULL,2);
/***** Write heading *****/
DT_PutHeadDegreeTypesForEdition ();
/***** Column to remove degree type, disabled here *****/
fprintf (Gbl.F.Out,"<tr>"
"<th class=\"CENTER_MIDDLE\">"
"%s"
"</th>"
"</tr>",
Txt_Type_of_degree);
"<td class=\"BM\"></td>");
/***** Degree type code *****/
fprintf (Gbl.F.Out,"<td class=\"CODE\"></td>");
/***** Degree type name *****/
fprintf (Gbl.F.Out,"<tr>"
"<td class=\"LEFT_MIDDLE\">"
fprintf (Gbl.F.Out,"<td class=\"LEFT_MIDDLE\">"
"<input type=\"text\" name=\"DegTypName\""
" size=\"25\" maxlength=\"%u\" value=\"%s\""
" required=\"required\" />"
"</td>",
Deg_MAX_CHARS_DEGREE_TYPE_NAME,Gbl.Degs.EditingDegTyp.DegTypName);
/***** Number of degrees of this degree type ****/
fprintf (Gbl.F.Out,"<td class=\"DAT RIGHT_MIDDLE\">"
"0"
"</td>"
"</tr>");
/***** Send button and end frame *****/
Lay_EndRoundFrameTableWithButton (Lay_CREATE_BUTTON,Txt_Create_type_of_degree);
@ -711,7 +741,7 @@ void DT_RecFormNewDegreeType (void)
}
/***** Show the form again *****/
DT_ReqEditDegreeTypes ();
DT_EditDegreeTypes ();
}
/*****************************************************************************/
@ -747,7 +777,7 @@ void DT_RemoveDegreeType (void)
}
/***** Show the form again *****/
DT_ReqEditDegreeTypes ();
DT_EditDegreeTypes ();
}
/*****************************************************************************/
@ -952,7 +982,7 @@ void DT_RenameDegreeType (void)
/***** Show the form again *****/
Str_Copy (DegTyp->DegTypName,NewNameDegTyp,
Deg_MAX_BYTES_DEGREE_TYPE_NAME);
DT_ReqEditDegreeTypes ();
DT_EditDegreeTypes ();
}
/*****************************************************************************/

View File

@ -63,7 +63,8 @@ void DT_WriteSelectorDegreeTypes (void);
void DT_PutIconToViewDegreeTypes (void);
void DT_SeeDegreeTypesInDegTab (void);
void DT_SeeDegreeTypesInStaTab (void);
void DT_ReqEditDegreeTypes (void);
void DT_EditDegreeTypes (void);
bool DT_CheckIfICanCreateDegreeTypes (void);
void DT_PutFormToCreateDegreeType (void);
void DT_GetListDegreeTypes (Sco_Scope_t Scope,DT_Order_t Order);

View File

@ -6176,6 +6176,27 @@ const char *Txt_Create_another_institution =
"Criar uma outra institu&ccedil;&atilde;o";
#endif
const char *Txt_Create_another_type_of_degree =
#if L==1
"Crear otro tipo de titulaci&oacute;n"; // Necessita traduccio
#elif L==2
"Erstellen Sie ein anderes Abschlussart";
#elif L==3
"Create another type of degree";
#elif L==4
"Crear otro tipo de titulaci&oacute;n";
#elif L==5
"Cr&eacute;er un autre type d'&eacute;tude";
#elif L==6
"Crear otro tipo de titulaci&oacute;n"; // Okoteve traducción
#elif L==7
"Crea un altro tipo di laurea";
#elif L==8
"Tworzenie inny typu stopnia";
#elif L==9
"Criar um outro tipo de titula&ccedil;&atilde;o";
#endif
const char *Txt_Create_assignment =
#if L==1
"Crear actividad"; // Necessita traduccio
@ -24720,6 +24741,27 @@ const char *Txt_No_courses =
"N&atilde;o h&aacute; disciplinas.";
#endif
const char *Txt_No_types_of_degree =
#if L==1
"No hay tipos de titulaci&oacute;n."; // Necessita traduccio
#elif L==2
"No types of degree."; // Need Übersetzung
#elif L==3
"No types of degree.";
#elif L==4
"No hay tipos de titulaci&oacute;n.";
#elif L==5
"There are no types of degree."; // Besoin de traduction
#elif L==6
"No hay tipos de titulaci&oacute;n."; // Okoteve traducción
#elif L==7
"Non ci sono tipi di lauree.";
#elif L==8
"No types of degree."; // Potrzebujesz tlumaczenie
#elif L==9
"No types of degree."; // Necessita de tradução
#endif
const char *Txt_No_degrees =
#if L==1
"No hi ha titulacions.";
@ -46706,27 +46748,6 @@ const char *Txt_There_are_no_record_fields_in_the_course_X = // Warning: it is v
"There are no record fields in the course <strong>%s</strong>."; // Necessita de tradução
#endif
const char *Txt_There_are_no_types_of_degree =
#if L==1
"No existen tipos de titulaci&oacute;n."; // Necessita traduccio
#elif L==2
"There are no types of degree."; // Need Übersetzung
#elif L==3
"There are no types of degree.";
#elif L==4
"No existen tipos de titulaci&oacute;n.";
#elif L==5
"There are no types of degree."; // Besoin de traduction
#elif L==6
"No existen tipos de titulaci&oacute;n."; // Okoteve traducción
#elif L==7
"Non ci sono tipi di lauree.";
#elif L==8
"There are no types of degree."; // Potrzebujesz tlumaczenie
#elif L==9
"There are no types of degree."; // Necessita de tradução
#endif
const char *Txt_There_are_no_types_of_group_in_the_course_X = // Warning: it is very important to include %s in the following sentences
#if L==1
"No existen tipos de grupo en la asignatura <strong>%s</strong>."; // Necessita traduccio