Version 18.27.11

This commit is contained in:
Antonio Cañas Vargas 2019-01-07 13:19:57 +01:00
parent 4a17e4215c
commit 82c559128e
2 changed files with 69 additions and 29 deletions

View File

@ -345,6 +345,9 @@ Buenos d
// TODO: Al crear un evento de asistencia, podría tener por defecto el aula asignada al grupo elegido. // TODO: Al crear un evento de asistencia, podría tener por defecto el aula asignada al grupo elegido.
// TODO: En la edición del horario de clases, tomar las aulas de la tabla classrooms.
// El actual campo Place puede dejarse sin cambiar en la base de datos y usarse para otras aclaraciones (renombrándolo simplemente).
/*****************************************************************************/ /*****************************************************************************/
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
@ -364,10 +367,11 @@ En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 18.27.10 (2019-01-05)" #define Log_PLATFORM_VERSION "SWAD 18.27.11 (2019-01-07)"
#define CSS_FILE "swad18.22.css" #define CSS_FILE "swad18.22.css"
#define JS_FILE "swad17.17.1.js" #define JS_FILE "swad17.17.1.js"
/* /*
Version 18.27.11: Jan 07, 2019 Changes in edition of timetable related to classrooms. (239185 lines)
Version 18.27.10: Jan 05, 2019 Remove all classrooms in a centre when it is removed. (239151 lines) Version 18.27.10: Jan 05, 2019 Remove all classrooms in a centre when it is removed. (239151 lines)
Version 18.27.9: Jan 05, 2019 When a classroom is removed, if it is assigned to groups, remove the association in groups. (239136 lines) Version 18.27.9: Jan 05, 2019 When a classroom is removed, if it is assigned to groups, remove the association in groups. (239136 lines)
Version 18.27.8: Jan 05, 2019 Get classroom short name from database in listing of groups. (239130 lines) Version 18.27.8: Jan 05, 2019 Get classroom short name from database in listing of groups. (239130 lines)

View File

@ -25,8 +25,9 @@
/*********************************** Headers *********************************/ /*********************************** Headers *********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For asprintf
#include <linux/stddef.h> // For NULL #include <linux/stddef.h> // For NULL
#include <stdio.h> // For fprintf, etc. #include <stdio.h> // For asprintf
#include <stdlib.h> // For malloc, calloc, free #include <stdlib.h> // For malloc, calloc, free
#include <string.h> // For string functions #include <string.h> // For string functions
@ -1448,6 +1449,7 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
"TT_PRAC", // TT_PRACTICAL (practical class) "TT_PRAC", // TT_PRACTICAL (practical class)
"TT_TUTO", // TT_TUTORING (tutoring/office hour) "TT_TUTO", // TT_TUTORING (tutoring/office hour)
}; };
char *CellStr; // Unique string for this cell used in labels
struct GroupData GrpDat; struct GroupData GrpDat;
unsigned NumGrpTyp; unsigned NumGrpTyp;
unsigned NumGrp; unsigned NumGrp;
@ -1457,6 +1459,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
unsigned RowSpan = 0; unsigned RowSpan = 0;
TT_ClassType_t CT; TT_ClassType_t CT;
struct Course Crs; struct Course Crs;
struct GroupType *GrpTyp;
struct Group *Grp;
/***** Compute row span and background color depending on hour type *****/ /***** Compute row span and background color depending on hour type *****/
switch (IntervalType) switch (IntervalType)
@ -1557,6 +1561,12 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
break; break;
case TT_CRS_EDIT: case TT_CRS_EDIT:
case TT_TUT_EDIT: case TT_TUT_EDIT:
/***** Create unique string for this cell used in labels *****/
if (asprintf (&CellStr,"%02u%02u%02u",
Weekday,Interval,Column) < 0)
Lay_NotEnoughMemoryExit ();
/***** Put hidden parameters *****/
Par_PutHiddenParamUnsigned ("TTDay",Weekday); Par_PutHiddenParamUnsigned ("TTDay",Weekday);
Par_PutHiddenParamUnsigned ("TTInt",Interval); Par_PutHiddenParamUnsigned ("TTInt",Interval);
Par_PutHiddenParamUnsigned ("TTCol",Column); Par_PutHiddenParamUnsigned ("TTCol",Column);
@ -1629,12 +1639,16 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
{ {
/***** Group *****/ /***** Group *****/
fprintf (Gbl.F.Out,"<br />" fprintf (Gbl.F.Out,"<br />"
"<label>" "<label for=\"TTGrp%s\">"
"%s" "%s"
"<select name=\"TTGrp\"" "</label>"
"<select id=\"TTGrp%s\" name=\"TTGrp\""
" style=\"width:110px;\"" " style=\"width:110px;\""
" onchange=\"document.getElementById('%s').submit();\">", " onchange=\"document.getElementById('%s').submit();\">",
Txt_Group,Gbl.Form.Id); CellStr,
Txt_Group,
CellStr,
Gbl.Form.Id);
fprintf (Gbl.F.Out,"<option value=\"-1\""); fprintf (Gbl.F.Out,"<option value=\"-1\"");
if (GrpCod <= 0) if (GrpCod <= 0)
fprintf (Gbl.F.Out," selected=\"selected\""); fprintf (Gbl.F.Out," selected=\"selected\"");
@ -1642,44 +1656,66 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
for (NumGrpTyp = 0; for (NumGrpTyp = 0;
NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num; NumGrpTyp < Gbl.CurrentCrs.Grps.GrpTypes.Num;
NumGrpTyp++) NumGrpTyp++)
{
GrpTyp = &Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp];
for (NumGrp = 0; for (NumGrp = 0;
NumGrp < Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].NumGrps; NumGrp < GrpTyp->NumGrps;
NumGrp++) NumGrp++)
{ {
fprintf (Gbl.F.Out,"<option value=\"%ld\"", Grp = &GrpTyp->LstGrps[NumGrp];
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrp].GrpCod);
if (GrpCod == Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrp].GrpCod)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s %s</option>",
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].GrpTypName,
Gbl.CurrentCrs.Grps.GrpTypes.LstGrpTypes[NumGrpTyp].LstGrps[NumGrp].GrpName);
}
fprintf (Gbl.F.Out,"</select>"
"</label>");
/***** Class room *****/ fprintf (Gbl.F.Out,"<option value=\"%ld\"",
Grp->GrpCod);
if (GrpCod == Grp->GrpCod)
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out,">%s %s",
GrpTyp->GrpTypName,Grp->GrpName);
if (Grp->Classroom.ClaCod > 0)
fprintf (Gbl.F.Out," (%s)",
Grp->Classroom.ShrtName);
fprintf (Gbl.F.Out,"</option>");
}
}
fprintf (Gbl.F.Out,"</select>");
/***** Classroom *****/
fprintf (Gbl.F.Out,"<br />" fprintf (Gbl.F.Out,"<br />"
"<label>" "<label for=\"TTPlc%s\">"
"%s" "%s"
"<input type=\"text\" name=\"TTPlc\"" "</label>"
" size=\"1\" maxlength=\"%u\" value=\"%s\"" "<input id=\"TTPlc%s\" name=\"TTPlc\""
" onchange=\"document.getElementById('%s').submit();\" />" " type=\"text\" size=\"1\" maxlength=\"%u\""
"</label>", " value=\"%s\""
Txt_Classroom,TT_MAX_CHARS_PLACE,Place,Gbl.Form.Id); " onchange=\"document.getElementById('%s').submit();\" />",
CellStr,
Txt_Classroom,
CellStr,
TT_MAX_CHARS_PLACE,Place,
Gbl.Form.Id);
} }
else // TimeTableView == TT_TUT_EDIT else // TimeTableView == TT_TUT_EDIT
{ {
/***** Place *****/ /***** Place *****/
fprintf (Gbl.F.Out,"<br />" fprintf (Gbl.F.Out,"<br />"
"<label class=\"DAT_SMALL\">" "<label for=\"TTPlc%s\" class=\"DAT_SMALL\">"
"%s" "%s"
"<input type=\"text\" name=\"TTPlc\"" "</label>"
" size=\"12\" maxlength=\"%u\" value=\"%s\"" "<input id=\"TTPlc%s\" name=\"TTPlc\""
" onchange=\"document.getElementById('%s').submit();\" />" " type=\"text\" size=\"12\" maxlength=\"%u\""
"</label>", " value=\"%s\""
Txt_Place,TT_MAX_CHARS_PLACE,Place,Gbl.Form.Id); " onchange=\"document.getElementById('%s').submit();\" />",
CellStr,
Txt_Place,
CellStr,
TT_MAX_CHARS_PLACE,Place,
Gbl.Form.Id);
} }
} }
/***** Free allocated unique string for this cell used in labels *****/
free ((void *) CellStr);
break; break;
} }