mirror of https://github.com/acanas/swad-core.git
Version 18.28
This commit is contained in:
parent
82c559128e
commit
f32368c9ae
|
@ -12591,3 +12591,21 @@ OPTIMIZE TABLE usr_webs;
|
||||||
SHOW TABLE STATUS WHERE Name = 'ws_keys';
|
SHOW TABLE STATUS WHERE Name = 'ws_keys';
|
||||||
ALTER TABLE ws_keys ENGINE=MyISAM;
|
ALTER TABLE ws_keys ENGINE=MyISAM;
|
||||||
OPTIMIZE TABLE ws_keys;
|
OPTIMIZE TABLE ws_keys;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SELECT Weekday,TIME_TO_SEC(StartTime) AS S,TIME_TO_SEC(Duration) AS D,Place,ClassType,GrpCod FROM timetable_crs WHERE CrsCod=19 ORDER BY Weekday,S,ClassType,GrpCod,Place,D DESC;
|
||||||
|
|
|
@ -1160,8 +1160,7 @@ CREATE TABLE IF NOT EXISTS timetable_crs (
|
||||||
StartTime TIME NOT NULL,
|
StartTime TIME NOT NULL,
|
||||||
Duration TIME NOT NULL,
|
Duration TIME NOT NULL,
|
||||||
ClassType ENUM('free','lecture','practical') NOT NULL,
|
ClassType ENUM('free','lecture','practical') NOT NULL,
|
||||||
Place VARCHAR(511) NOT NULL,
|
Info VARCHAR(2047) NOT NULL DEFAULT '',
|
||||||
GroupName VARCHAR(2047) NOT NULL,
|
|
||||||
INDEX(CrsCod,GrpCod));
|
INDEX(CrsCod,GrpCod));
|
||||||
--
|
--
|
||||||
-- Table timetable_tut: stores the timetables of office hours of the teachers
|
-- Table timetable_tut: stores the timetables of office hours of the teachers
|
||||||
|
@ -1171,7 +1170,7 @@ CREATE TABLE IF NOT EXISTS timetable_tut (
|
||||||
Weekday TINYINT NOT NULL,
|
Weekday TINYINT NOT NULL,
|
||||||
StartTime TIME NOT NULL,
|
StartTime TIME NOT NULL,
|
||||||
Duration TIME NOT NULL,
|
Duration TIME NOT NULL,
|
||||||
Place VARCHAR(511) NOT NULL,
|
Info VARCHAR(2047) NOT NULL DEFAULT '',
|
||||||
INDEX(UsrCod));
|
INDEX(UsrCod));
|
||||||
--
|
--
|
||||||
-- Table tst_answers: stores the answers to the questions in tests
|
-- Table tst_answers: stores the answers to the questions in tests
|
||||||
|
|
|
@ -345,9 +345,6 @@ 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 *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -367,10 +364,22 @@ En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 18.27.11 (2019-01-07)"
|
#define Log_PLATFORM_VERSION "SWAD 18.28 (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.28: Jan 07, 2019 Changes in edition of timetable related to classrooms. (239208 lines)
|
||||||
|
9 changes necessary in database:
|
||||||
|
ALTER TABLE timetable_crs CHANGE COLUMN GroupName GroupName VARCHAR(2047) NOT NULL DEFAULT '';
|
||||||
|
ALTER TABLE timetable_crs ADD COLUMN Info VARCHAR(2047) NOT NULL DEFAULT '' AFTER ClassType;
|
||||||
|
ALTER TABLE timetable_tut ADD COLUMN Info VARCHAR(2047) NOT NULL DEFAULT '' AFTER Duration;
|
||||||
|
UPDATE timetable_crs SET Info=Place WHERE Place<>'' AND GroupName='';
|
||||||
|
UPDATE timetable_crs SET Info=GroupName WHERE Place='' AND GroupName<>'';
|
||||||
|
UPDATE timetable_crs SET Info=CONCAT(Place,', ',GroupName) WHERE Place<>'' AND GroupName<>'';
|
||||||
|
UPDATE timetable_tut SET Info=Place WHERE Place<>'';
|
||||||
|
ALTER TABLE timetable_crs DROP COLUMN Place,DROP COLUMN GroupName;
|
||||||
|
ALTER TABLE timetable_tut DROP COLUMN Place;
|
||||||
|
|
||||||
Version 18.27.11: Jan 07, 2019 Changes in edition of timetable related to classrooms. (239185 lines)
|
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)
|
||||||
|
|
|
@ -2461,10 +2461,9 @@ mysql> DESCRIBE timetable_crs;
|
||||||
| StartTime | time | NO | | NULL | |
|
| StartTime | time | NO | | NULL | |
|
||||||
| Duration | time | NO | | NULL | |
|
| Duration | time | NO | | NULL | |
|
||||||
| ClassType | enum('free','lecture','practical') | NO | | NULL | |
|
| ClassType | enum('free','lecture','practical') | NO | | NULL | |
|
||||||
| Place | varchar(511) | NO | | NULL | |
|
| Info | varchar(2047) | NO | | | |
|
||||||
| GroupName | varchar(2047) | NO | | NULL | |
|
|
||||||
+-----------+------------------------------------+------+-----+---------+-------+
|
+-----------+------------------------------------+------+-----+---------+-------+
|
||||||
8 rows in set (0,00 sec)
|
7 rows in set (0.00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS timetable_crs ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS timetable_crs ("
|
||||||
"CrsCod INT NOT NULL DEFAULT -1,"
|
"CrsCod INT NOT NULL DEFAULT -1,"
|
||||||
|
@ -2473,30 +2472,29 @@ mysql> DESCRIBE timetable_crs;
|
||||||
"StartTime TIME NOT NULL,"
|
"StartTime TIME NOT NULL,"
|
||||||
"Duration TIME NOT NULL,"
|
"Duration TIME NOT NULL,"
|
||||||
"ClassType ENUM('free','lecture','practical') NOT NULL,"
|
"ClassType ENUM('free','lecture','practical') NOT NULL,"
|
||||||
"Place VARCHAR(511) NOT NULL," // TT_MAX_BYTES_PLACE
|
"Info VARCHAR(2047) NOT NULL DEFAULT ''," // TT_MAX_BYTES_INFO
|
||||||
"GroupName VARCHAR(2047) NOT NULL," // Grp_MAX_BYTES_GROUP_NAME
|
|
||||||
"INDEX(CrsCod,GrpCod))");
|
"INDEX(CrsCod,GrpCod))");
|
||||||
|
|
||||||
/***** Table timetable_tut *****/
|
/***** Table timetable_tut *****/
|
||||||
/*
|
/*
|
||||||
mysql> DESCRIBE timetable_tut;
|
mysql> DESCRIBE timetable_tut;
|
||||||
+-----------+--------------+------+-----+---------+-------+
|
+-----------+---------------+------+-----+---------+-------+
|
||||||
| Field | Type | Null | Key | Default | Extra |
|
| Field | Type | Null | Key | Default | Extra |
|
||||||
+-----------+--------------+------+-----+---------+-------+
|
+-----------+---------------+------+-----+---------+-------+
|
||||||
| UsrCod | int(11) | NO | MUL | NULL | |
|
| UsrCod | int(11) | NO | MUL | NULL | |
|
||||||
| Weekday | tinyint(4) | NO | | NULL | |
|
| Weekday | tinyint(4) | NO | | NULL | |
|
||||||
| StartTime | time | NO | | NULL | |
|
| StartTime | time | NO | | NULL | |
|
||||||
| Duration | time | NO | | NULL | |
|
| Duration | time | NO | | NULL | |
|
||||||
| Place | varchar(511) | NO | | NULL | |
|
| Info | varchar(2047) | NO | | | |
|
||||||
+-----------+--------------+------+-----+---------+-------+
|
+-----------+---------------+------+-----+---------+-------+
|
||||||
5 rows in set (0,00 sec)
|
5 rows in set (0.00 sec)
|
||||||
*/
|
*/
|
||||||
DB_CreateTable ("CREATE TABLE IF NOT EXISTS timetable_tut ("
|
DB_CreateTable ("CREATE TABLE IF NOT EXISTS timetable_tut ("
|
||||||
"UsrCod INT NOT NULL,"
|
"UsrCod INT NOT NULL,"
|
||||||
"Weekday TINYINT NOT NULL," // 0=Monday...6=Sunday
|
"Weekday TINYINT NOT NULL," // 0=Monday...6=Sunday
|
||||||
"StartTime TIME NOT NULL,"
|
"StartTime TIME NOT NULL,"
|
||||||
"Duration TIME NOT NULL,"
|
"Duration TIME NOT NULL,"
|
||||||
"Place VARCHAR(511) NOT NULL," // TT_MAX_BYTES_PLACE
|
"Info VARCHAR(2047) NOT NULL DEFAULT ''," // TT_MAX_BYTES_INFO
|
||||||
"INDEX(UsrCod))");
|
"INDEX(UsrCod))");
|
||||||
|
|
||||||
/***** Table tst_answers *****/
|
/***** Table tst_answers *****/
|
||||||
|
|
|
@ -668,8 +668,8 @@ struct Globals
|
||||||
unsigned Column;
|
unsigned Column;
|
||||||
TT_ClassType_t ClassType;
|
TT_ClassType_t ClassType;
|
||||||
unsigned DurationIntervals;
|
unsigned DurationIntervals;
|
||||||
char Place[TT_MAX_BYTES_PLACE + 1];
|
char Info[TT_MAX_BYTES_INFO + 1];
|
||||||
char Group[Grp_MAX_BYTES_GROUP_NAME + 1];
|
// char Place[TT_MAX_BYTES_PLACE + 1];
|
||||||
long GrpCod; // Group code (-1 if no group selected)
|
long GrpCod; // Group code (-1 if no group selected)
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
|
|
57
swad_group.c
57
swad_group.c
|
@ -965,8 +965,12 @@ void Grp_ChangeGrpsOtherUsrAtomically (struct ListCodGrps *LstGrpsUsrWants)
|
||||||
static void Grp_LockTables (void)
|
static void Grp_LockTables (void)
|
||||||
{
|
{
|
||||||
DB_Query ("can not lock tables to change user's groups",
|
DB_Query ("can not lock tables to change user's groups",
|
||||||
"LOCK TABLES crs_grp_types WRITE,crs_grp WRITE,"
|
"LOCK TABLES "
|
||||||
"crs_grp_usr WRITE,crs_usr READ");
|
"crs_grp_types WRITE,"
|
||||||
|
"crs_grp WRITE,"
|
||||||
|
"crs_grp_usr WRITE,"
|
||||||
|
"crs_usr READ,"
|
||||||
|
"classrooms READ");
|
||||||
Gbl.DB.LockedTables = true;
|
Gbl.DB.LockedTables = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3128,7 +3132,8 @@ unsigned long Grp_GetGrpsOfType (long GrpTypCod,MYSQL_RES **mysql_res)
|
||||||
"crs_grp.MaxStudents,"
|
"crs_grp.MaxStudents,"
|
||||||
"crs_grp.Open,"
|
"crs_grp.Open,"
|
||||||
"crs_grp.FileZones"
|
"crs_grp.FileZones"
|
||||||
" FROM crs_grp LEFT JOIN classrooms"
|
" FROM crs_grp"
|
||||||
|
" LEFT JOIN classrooms"
|
||||||
" ON crs_grp.ClaCod=classrooms.ClaCod"
|
" ON crs_grp.ClaCod=classrooms.ClaCod"
|
||||||
" WHERE crs_grp.GrpTypCod=%ld"
|
" WHERE crs_grp.GrpTypCod=%ld"
|
||||||
" ORDER BY crs_grp.GrpName",
|
" ORDER BY crs_grp.GrpName",
|
||||||
|
@ -3213,31 +3218,35 @@ void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat)
|
||||||
unsigned long NumRows;
|
unsigned long NumRows;
|
||||||
|
|
||||||
/***** Reset values *****/
|
/***** Reset values *****/
|
||||||
GrpDat->GrpTypCod = -1L;
|
GrpDat->GrpTypCod = -1L;
|
||||||
GrpDat->CrsCod = -1L;
|
GrpDat->CrsCod = -1L;
|
||||||
GrpDat->GrpTypName[0] = '\0';
|
GrpDat->GrpTypName[0] = '\0';
|
||||||
GrpDat->GrpName[0] = '\0';
|
GrpDat->GrpName[0] = '\0';
|
||||||
GrpDat->ClaCod = -1L;
|
GrpDat->Classroom.ClaCod = -1L;
|
||||||
GrpDat->MaxStudents = 0;
|
GrpDat->Classroom.ShrtName[0] = '\0';
|
||||||
GrpDat->Vacant = 0;
|
GrpDat->MaxStudents = 0;
|
||||||
GrpDat->Open = false;
|
GrpDat->Vacant = 0;
|
||||||
GrpDat->FileZones = false;
|
GrpDat->Open = false;
|
||||||
GrpDat->MultipleEnrolment = false;
|
GrpDat->FileZones = false;
|
||||||
|
GrpDat->MultipleEnrolment = false;
|
||||||
|
|
||||||
if (GrpDat->GrpCod > 0)
|
if (GrpDat->GrpCod > 0)
|
||||||
{
|
{
|
||||||
/***** Get data of a group from database *****/
|
/***** Get data of a group from database *****/
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get data of a group",
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get data of a group",
|
||||||
"SELECT crs_grp_types.GrpTypCod,"
|
"SELECT crs_grp.GrpTypCod,"
|
||||||
"crs_grp_types.CrsCod,"
|
"crs_grp_types.CrsCod,"
|
||||||
"crs_grp_types.GrpTypName,"
|
"crs_grp_types.GrpTypName,"
|
||||||
"crs_grp_types.Multiple,"
|
"crs_grp_types.Multiple,"
|
||||||
"crs_grp.GrpName,"
|
"crs_grp.GrpName,"
|
||||||
"crs_grp.ClaCod,"
|
"crs_grp.ClaCod,"
|
||||||
|
"classrooms.ShortName,"
|
||||||
"crs_grp.MaxStudents,"
|
"crs_grp.MaxStudents,"
|
||||||
"crs_grp.Open,"
|
"crs_grp.Open,"
|
||||||
"crs_grp.FileZones"
|
"crs_grp.FileZones"
|
||||||
" FROM crs_grp,crs_grp_types"
|
" FROM (crs_grp,crs_grp_types)"
|
||||||
|
" LEFT JOIN classrooms"
|
||||||
|
" ON crs_grp.ClaCod=classrooms.ClaCod"
|
||||||
" WHERE crs_grp.GrpCod=%ld"
|
" WHERE crs_grp.GrpCod=%ld"
|
||||||
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod",
|
" AND crs_grp.GrpTypCod=crs_grp_types.GrpTypCod",
|
||||||
GrpDat->GrpCod);
|
GrpDat->GrpCod);
|
||||||
|
@ -3267,16 +3276,20 @@ void Grp_GetDataOfGroupByCod (struct GroupData *GrpDat)
|
||||||
Grp_MAX_BYTES_GROUP_NAME);
|
Grp_MAX_BYTES_GROUP_NAME);
|
||||||
|
|
||||||
/* Get the code of the course (row[5]) */
|
/* Get the code of the course (row[5]) */
|
||||||
GrpDat->ClaCod = Str_ConvertStrCodToLongCod (row[5]);
|
GrpDat->Classroom.ClaCod = Str_ConvertStrCodToLongCod (row[5]);
|
||||||
|
|
||||||
/* Get maximum number of students (row[6]) */
|
/* Get the name of the classroom (row[6]) */
|
||||||
GrpDat->MaxStudents = Grp_ConvertToNumMaxStdsGrp (row[6]);
|
Str_Copy (GrpDat->Classroom.ShrtName,row[6],
|
||||||
|
Grp_MAX_BYTES_GROUP_NAME);
|
||||||
|
|
||||||
/* Get whether group is open or closed (row[7]) */
|
/* Get maximum number of students (row[7]) */
|
||||||
GrpDat->Open = (row[7][0] == 'Y');
|
GrpDat->MaxStudents = Grp_ConvertToNumMaxStdsGrp (row[7]);
|
||||||
|
|
||||||
/* Get whether group has file zones (row[8]) */
|
/* Get whether group is open or closed (row[8]) */
|
||||||
GrpDat->FileZones = (row[8][0] == 'Y');
|
GrpDat->Open = (row[8][0] == 'Y');
|
||||||
|
|
||||||
|
/* Get whether group has file zones (row[9]) */
|
||||||
|
GrpDat->FileZones = (row[9][0] == 'Y');
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Free structure that stores the query result *****/
|
/***** Free structure that stores the query result *****/
|
||||||
|
|
|
@ -63,7 +63,11 @@ struct GroupData
|
||||||
long CrsCod; // Course code
|
long CrsCod; // Course code
|
||||||
char GrpTypName[Grp_MAX_BYTES_GROUP_TYPE_NAME + 1];
|
char GrpTypName[Grp_MAX_BYTES_GROUP_TYPE_NAME + 1];
|
||||||
char GrpName[Grp_MAX_BYTES_GROUP_NAME + 1];
|
char GrpName[Grp_MAX_BYTES_GROUP_NAME + 1];
|
||||||
long ClaCod; // Classroom code
|
struct
|
||||||
|
{
|
||||||
|
long ClaCod; // Classroom code
|
||||||
|
char ShrtName[Cla_MAX_BYTES_SHRT_NAME + 1]; // Classroom short name
|
||||||
|
} Classroom;
|
||||||
unsigned MaxStudents;
|
unsigned MaxStudents;
|
||||||
int Vacant;
|
int Vacant;
|
||||||
bool Open; // Group is open?
|
bool Open; // Group is open?
|
||||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -15357,6 +15357,27 @@ const char *Txt_Indicators_of_courses =
|
||||||
"Indicadores de disciplinas";
|
"Indicadores de disciplinas";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_Info =
|
||||||
|
#if L==1 // ca
|
||||||
|
"Info";
|
||||||
|
#elif L==2 // de
|
||||||
|
"Info";
|
||||||
|
#elif L==3 // en
|
||||||
|
"Info";
|
||||||
|
#elif L==4 // es
|
||||||
|
"Info";
|
||||||
|
#elif L==5 // fr
|
||||||
|
"Info";
|
||||||
|
#elif L==6 // gn
|
||||||
|
"Info"; // Okoteve traducción
|
||||||
|
#elif L==7 // it
|
||||||
|
"Informazione";
|
||||||
|
#elif L==8 // pl
|
||||||
|
"Info";
|
||||||
|
#elif L==9 // pt
|
||||||
|
"Info";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES] =
|
const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES] =
|
||||||
{
|
{
|
||||||
// Inf_INTRODUCTION
|
// Inf_INTRODUCTION
|
||||||
|
|
157
swad_timetable.c
157
swad_timetable.c
|
@ -85,8 +85,8 @@ struct TT_Column
|
||||||
TT_IntervalType_t IntervalType;
|
TT_IntervalType_t IntervalType;
|
||||||
TT_ClassType_t ClassType;
|
TT_ClassType_t ClassType;
|
||||||
unsigned DurationIntervals;
|
unsigned DurationIntervals;
|
||||||
char Place[TT_MAX_BYTES_PLACE + 1];
|
char Info[TT_MAX_BYTES_INFO + 1];
|
||||||
char Group[Grp_MAX_BYTES_GROUP_NAME + 1];
|
// char Place[TT_MAX_BYTES_PLACE + 1];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TT_Cell
|
struct TT_Cell
|
||||||
|
@ -151,7 +151,7 @@ static unsigned TT_CalculateColsToDrawInCell (bool TopCall,
|
||||||
static void TT_DrawCellAlignTimeTable (void);
|
static void TT_DrawCellAlignTimeTable (void);
|
||||||
static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Column,unsigned ColSpan,
|
static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Column,unsigned ColSpan,
|
||||||
long CrsCod,TT_IntervalType_t IntervalType,TT_ClassType_t ClassType,
|
long CrsCod,TT_IntervalType_t IntervalType,TT_ClassType_t ClassType,
|
||||||
unsigned DurationNumIntervals,char *Group,long GrpCod,char *Place);
|
unsigned DurationNumIntervals,long GrpCod,const char *Info);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************** Create internal timetable in memory ********************/
|
/******************** Create internal timetable in memory ********************/
|
||||||
|
@ -296,8 +296,8 @@ static void TT_GetParamsTimeTable (void)
|
||||||
/***** Get group code *****/
|
/***** Get group code *****/
|
||||||
Gbl.TimeTable.GrpCod = Par_GetParToLong ("TTGrp");
|
Gbl.TimeTable.GrpCod = Par_GetParToLong ("TTGrp");
|
||||||
|
|
||||||
/***** Get place *****/
|
/***** Get info *****/
|
||||||
Par_GetParToText ("TTPlc",Gbl.TimeTable.Place,TT_MAX_BYTES_PLACE);
|
Par_GetParToText ("TTInf",Gbl.TimeTable.Info,TT_MAX_BYTES_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -588,10 +588,10 @@ static void TT_WriteCrsTimeTableIntoDB (long CrsCod)
|
||||||
DB_QueryINSERT ("can not create course timetable",
|
DB_QueryINSERT ("can not create course timetable",
|
||||||
"INSERT INTO timetable_crs"
|
"INSERT INTO timetable_crs"
|
||||||
" (CrsCod,GrpCod,Weekday,StartTime,Duration,"
|
" (CrsCod,GrpCod,Weekday,StartTime,Duration,"
|
||||||
"ClassType,Place,GroupName)"
|
"ClassType,Info)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%ld,%u,'%02u:%02u:00',SEC_TO_TIME(%u),"
|
" (%ld,%ld,%u,'%02u:%02u:00',SEC_TO_TIME(%u),"
|
||||||
"'%s','%s','%s')",
|
"'%s','%s')",
|
||||||
CrsCod,
|
CrsCod,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].GrpCod,
|
TT_TimeTable[Weekday][Interval].Columns[Column].GrpCod,
|
||||||
Weekday,
|
Weekday,
|
||||||
|
@ -599,8 +599,7 @@ static void TT_WriteCrsTimeTableIntoDB (long CrsCod)
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals *
|
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals *
|
||||||
Gbl.TimeTable.Config.SecondsPerInterval,
|
Gbl.TimeTable.Config.SecondsPerInterval,
|
||||||
TT_ClassTypeDB[TT_TimeTable[Weekday][Interval].Columns[Column].ClassType],
|
TT_ClassTypeDB[TT_TimeTable[Weekday][Interval].Columns[Column].ClassType],
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Place,
|
TT_TimeTable[Weekday][Interval].Columns[Column].Info);
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Group);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -636,7 +635,7 @@ static void TT_WriteTutTimeTableIntoDB (long UsrCod)
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals)
|
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals)
|
||||||
DB_QueryINSERT ("can not create office timetable",
|
DB_QueryINSERT ("can not create office timetable",
|
||||||
"INSERT INTO timetable_tut"
|
"INSERT INTO timetable_tut"
|
||||||
" (UsrCod,Weekday,StartTime,Duration,Place)"
|
" (UsrCod,Weekday,StartTime,Duration,Info)"
|
||||||
" VALUES"
|
" VALUES"
|
||||||
" (%ld,%u,'%02u:%02u:00',SEC_TO_TIME(%u),'%s')",
|
" (%ld,%u,'%02u:%02u:00',SEC_TO_TIME(%u),'%s')",
|
||||||
UsrCod,
|
UsrCod,
|
||||||
|
@ -644,7 +643,7 @@ static void TT_WriteTutTimeTableIntoDB (long UsrCod)
|
||||||
Hour,Min,
|
Hour,Min,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals *
|
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals *
|
||||||
Gbl.TimeTable.Config.SecondsPerInterval,
|
Gbl.TimeTable.Config.SecondsPerInterval,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Place);
|
TT_TimeTable[Weekday][Interval].Columns[Column].Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -668,7 +667,6 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
unsigned EndTimeSeconds;
|
unsigned EndTimeSeconds;
|
||||||
struct TT_Range RangeCell;
|
struct TT_Range RangeCell;
|
||||||
unsigned FirstFreeColumn;
|
unsigned FirstFreeColumn;
|
||||||
long GrpCod;
|
|
||||||
TT_ClassType_t ClassType = TT_FREE; // Initialized to avoid warning
|
TT_ClassType_t ClassType = TT_FREE; // Initialized to avoid warning
|
||||||
bool TimeTableIsIncomplete = false;
|
bool TimeTableIsIncomplete = false;
|
||||||
bool TimeTableHasSpaceForThisClass;
|
bool TimeTableHasSpaceForThisClass;
|
||||||
|
@ -685,9 +683,8 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT timetable_crs.Weekday,"
|
"SELECT timetable_crs.Weekday,"
|
||||||
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
||||||
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
||||||
"timetable_crs.Place,"
|
"timetable_crs.Info,"
|
||||||
"timetable_crs.ClassType,"
|
"timetable_crs.ClassType,"
|
||||||
"timetable_crs.GroupName,"
|
|
||||||
"timetable_crs.GrpCod,"
|
"timetable_crs.GrpCod,"
|
||||||
"timetable_crs.CrsCod"
|
"timetable_crs.CrsCod"
|
||||||
" FROM timetable_crs,crs_usr"
|
" FROM timetable_crs,crs_usr"
|
||||||
|
@ -698,9 +695,8 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT timetable_crs.Weekday,"
|
"SELECT timetable_crs.Weekday,"
|
||||||
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
||||||
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
||||||
"timetable_crs.Place,"
|
"timetable_crs.Info,"
|
||||||
"timetable_crs.ClassType,"
|
"timetable_crs.ClassType,"
|
||||||
"timetable_crs.GroupName,"
|
|
||||||
"timetable_crs.GrpCod,"
|
"timetable_crs.GrpCod,"
|
||||||
"timetable_crs.CrsCod"
|
"timetable_crs.CrsCod"
|
||||||
" FROM timetable_crs,crs_grp_usr"
|
" FROM timetable_crs,crs_grp_usr"
|
||||||
|
@ -710,15 +706,14 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT Weekday,"
|
"SELECT Weekday,"
|
||||||
"TIME_TO_SEC(StartTime) AS S,"
|
"TIME_TO_SEC(StartTime) AS S,"
|
||||||
"TIME_TO_SEC(Duration) AS D,"
|
"TIME_TO_SEC(Duration) AS D,"
|
||||||
"Place,"
|
"Info,"
|
||||||
"'tutoring' AS ClassType,"
|
"'tutoring' AS ClassType,"
|
||||||
"'' AS GroupName,"
|
|
||||||
"-1 AS GrpCod,"
|
"-1 AS GrpCod,"
|
||||||
"-1 AS CrsCod"
|
"-1 AS CrsCod"
|
||||||
" FROM timetable_tut"
|
" FROM timetable_tut"
|
||||||
" WHERE UsrCod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" ORDER BY Weekday,S,ClassType,"
|
" ORDER BY Weekday,S,ClassType,"
|
||||||
"GroupName,GrpCod,Place,D DESC,CrsCod",
|
"GrpCod,Info,D DESC,CrsCod",
|
||||||
UsrCod,UsrCod,UsrCod);
|
UsrCod,UsrCod,UsrCod);
|
||||||
break;
|
break;
|
||||||
case Grp_ALL_GROUPS:
|
case Grp_ALL_GROUPS:
|
||||||
|
@ -726,9 +721,8 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT timetable_crs.Weekday,"
|
"SELECT timetable_crs.Weekday,"
|
||||||
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
||||||
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
||||||
"timetable_crs.Place,"
|
"timetable_crs.Info,"
|
||||||
"timetable_crs.ClassType,"
|
"timetable_crs.ClassType,"
|
||||||
"timetable_crs.GroupName,"
|
|
||||||
"timetable_crs.GrpCod,"
|
"timetable_crs.GrpCod,"
|
||||||
"timetable_crs.CrsCod"
|
"timetable_crs.CrsCod"
|
||||||
" FROM timetable_crs,crs_usr"
|
" FROM timetable_crs,crs_usr"
|
||||||
|
@ -738,15 +732,14 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT Weekday,"
|
"SELECT Weekday,"
|
||||||
"TIME_TO_SEC(StartTime) AS S,"
|
"TIME_TO_SEC(StartTime) AS S,"
|
||||||
"TIME_TO_SEC(Duration) AS D,"
|
"TIME_TO_SEC(Duration) AS D,"
|
||||||
"Place,"
|
"Info,"
|
||||||
"'tutoring' AS ClassType,"
|
"'tutoring' AS ClassType,"
|
||||||
"'' AS GroupName,"
|
|
||||||
"-1 AS GrpCod,"
|
"-1 AS GrpCod,"
|
||||||
"-1 AS CrsCod"
|
"-1 AS CrsCod"
|
||||||
" FROM timetable_tut"
|
" FROM timetable_tut"
|
||||||
" WHERE UsrCod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" ORDER BY Weekday,S,ClassType,"
|
" ORDER BY Weekday,S,ClassType,"
|
||||||
"GroupName,GrpCod,Place,D DESC,CrsCod",
|
"GrpCod,Info,D DESC,CrsCod",
|
||||||
UsrCod,UsrCod);
|
UsrCod,UsrCod);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -759,23 +752,21 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT Weekday,"
|
"SELECT Weekday,"
|
||||||
"TIME_TO_SEC(StartTime) AS S,"
|
"TIME_TO_SEC(StartTime) AS S,"
|
||||||
"TIME_TO_SEC(Duration) AS D,"
|
"TIME_TO_SEC(Duration) AS D,"
|
||||||
"Place,"
|
"Info,"
|
||||||
"ClassType,"
|
"ClassType,"
|
||||||
"GroupName,"
|
|
||||||
"GrpCod"
|
"GrpCod"
|
||||||
" FROM timetable_crs"
|
" FROM timetable_crs"
|
||||||
" WHERE CrsCod=%ld"
|
" WHERE CrsCod=%ld"
|
||||||
" ORDER BY Weekday,S,ClassType,"
|
" ORDER BY Weekday,S,ClassType,"
|
||||||
"GroupName,GrpCod,Place,D DESC",
|
"GrpCod,Info,D DESC",
|
||||||
Gbl.CurrentCrs.Crs.CrsCod);
|
Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
else
|
else
|
||||||
NumRows = DB_QuerySELECT (&mysql_res,"can not get timetable",
|
NumRows = DB_QuerySELECT (&mysql_res,"can not get timetable",
|
||||||
"SELECT timetable_crs.Weekday,"
|
"SELECT timetable_crs.Weekday,"
|
||||||
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
||||||
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
||||||
"timetable_crs.Place,"
|
"timetable_crs.Info,"
|
||||||
"timetable_crs.ClassType,"
|
"timetable_crs.ClassType,"
|
||||||
"timetable_crs.GroupName,"
|
|
||||||
"timetable_crs.GrpCod"
|
"timetable_crs.GrpCod"
|
||||||
" FROM timetable_crs,crs_usr"
|
" FROM timetable_crs,crs_usr"
|
||||||
" WHERE timetable_crs.CrsCod=%ld"
|
" WHERE timetable_crs.CrsCod=%ld"
|
||||||
|
@ -785,16 +776,15 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT timetable_crs.Weekday,"
|
"SELECT timetable_crs.Weekday,"
|
||||||
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
"TIME_TO_SEC(timetable_crs.StartTime) AS S,"
|
||||||
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
"TIME_TO_SEC(timetable_crs.Duration) AS D,"
|
||||||
"timetable_crs.Place,"
|
"timetable_crs.Info,"
|
||||||
"timetable_crs.ClassType,"
|
"timetable_crs.ClassType,"
|
||||||
"timetable_crs.GroupName,"
|
|
||||||
"timetable_crs.GrpCod"
|
"timetable_crs.GrpCod"
|
||||||
" FROM timetable_crs,crs_grp_usr"
|
" FROM timetable_crs,crs_grp_usr"
|
||||||
" WHERE timetable_crs.CrsCod=%ld"
|
" WHERE timetable_crs.CrsCod=%ld"
|
||||||
" AND crs_grp_usr.UsrCod=%ld"
|
" AND crs_grp_usr.UsrCod=%ld"
|
||||||
" AND timetable_crs.GrpCod=crs_grp_usr.GrpCod"
|
" AND timetable_crs.GrpCod=crs_grp_usr.GrpCod"
|
||||||
" ORDER BY Weekday,S,ClassType,"
|
" ORDER BY Weekday,S,ClassType,"
|
||||||
"GroupName,GrpCod,Place,D DESC",
|
"GrpCod,Info,D DESC",
|
||||||
Gbl.CurrentCrs.Crs.CrsCod,UsrCod,
|
Gbl.CurrentCrs.Crs.CrsCod,UsrCod,
|
||||||
Gbl.CurrentCrs.Crs.CrsCod,UsrCod);
|
Gbl.CurrentCrs.Crs.CrsCod,UsrCod);
|
||||||
break;
|
break;
|
||||||
|
@ -803,10 +793,10 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
"SELECT Weekday,"
|
"SELECT Weekday,"
|
||||||
"TIME_TO_SEC(StartTime) AS S,"
|
"TIME_TO_SEC(StartTime) AS S,"
|
||||||
"TIME_TO_SEC(Duration) AS D,"
|
"TIME_TO_SEC(Duration) AS D,"
|
||||||
"Place"
|
"Info"
|
||||||
" FROM timetable_tut"
|
" FROM timetable_tut"
|
||||||
" WHERE UsrCod=%ld"
|
" WHERE UsrCod=%ld"
|
||||||
" ORDER BY Weekday,S,Place,D DESC",
|
" ORDER BY Weekday,S,Info,D DESC",
|
||||||
UsrCod);
|
UsrCod);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -873,8 +863,7 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].IntervalType = TT_FREE_INTERVAL;
|
TT_TimeTable[Weekday][Interval].Columns[Column].IntervalType = TT_FREE_INTERVAL;
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].ClassType = TT_FREE;
|
TT_TimeTable[Weekday][Interval].Columns[Column].ClassType = TT_FREE;
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals = 0;
|
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals = 0;
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Group[0] = '\0';
|
TT_TimeTable[Weekday][Interval].Columns[Column].Info[0] = '\0';
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Place[0] = '\0';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -885,12 +874,6 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
{
|
{
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
|
||||||
if (Gbl.TimeTable.Type == TT_MY_TIMETABLE ||
|
|
||||||
Gbl.TimeTable.Type == TT_COURSE_TIMETABLE)
|
|
||||||
/* Group code */
|
|
||||||
if (sscanf (row[6],"%ld",&GrpCod) != 1)
|
|
||||||
GrpCod = -1;
|
|
||||||
|
|
||||||
/* Day of week (row[0]) */
|
/* Day of week (row[0]) */
|
||||||
if (sscanf (row[0],"%u",&Weekday) != 1)
|
if (sscanf (row[0],"%u",&Weekday) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong day of week in timetable.");
|
Lay_ShowErrorAndExit ("Wrong day of week in timetable.");
|
||||||
|
@ -979,24 +962,27 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
TT_TimeTable[Weekday][i].NumColumns++;
|
TT_TimeTable[Weekday][i].NumColumns++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Course (row[7]), group (row[5]) and place (row[3])*/
|
/* Course (row[6]) and info (row[3])*/
|
||||||
switch (Gbl.TimeTable.Type)
|
switch (Gbl.TimeTable.Type)
|
||||||
{
|
{
|
||||||
case TT_MY_TIMETABLE:
|
case TT_MY_TIMETABLE:
|
||||||
case TT_COURSE_TIMETABLE:
|
case TT_COURSE_TIMETABLE:
|
||||||
|
/* Group code (row[5]) */
|
||||||
|
if (Gbl.TimeTable.Type == TT_MY_TIMETABLE ||
|
||||||
|
Gbl.TimeTable.Type == TT_COURSE_TIMETABLE)
|
||||||
|
if (sscanf (row[5],"%ld",&TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod) != 1)
|
||||||
|
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod = -1;
|
||||||
|
|
||||||
|
/* Course code (row[6]) */
|
||||||
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].CrsCod =
|
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].CrsCod =
|
||||||
(Gbl.TimeTable.Type == TT_MY_TIMETABLE ? Str_ConvertStrCodToLongCod (row[7]) :
|
(Gbl.TimeTable.Type == TT_MY_TIMETABLE ? Str_ConvertStrCodToLongCod (row[6]) :
|
||||||
Gbl.CurrentCrs.Crs.CrsCod);
|
Gbl.CurrentCrs.Crs.CrsCod);
|
||||||
Str_Copy (TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].Group,
|
|
||||||
row[5],
|
|
||||||
Grp_MAX_BYTES_GROUP_NAME);
|
|
||||||
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod = GrpCod;
|
|
||||||
/* falls through */
|
/* falls through */
|
||||||
/* no break */
|
/* no break */
|
||||||
case TT_TUTORING_TIMETABLE:
|
case TT_TUTORING_TIMETABLE:
|
||||||
Str_Copy (TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].Place,
|
Str_Copy (TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].Info,
|
||||||
row[3],
|
row[3],
|
||||||
TT_MAX_BYTES_PLACE);
|
TT_MAX_BYTES_INFO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1098,8 +1084,7 @@ static void TT_ModifTimeTable (void)
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].IntervalType = TT_FREE_INTERVAL;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].IntervalType = TT_FREE_INTERVAL;
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].ClassType = TT_FREE;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].ClassType = TT_FREE;
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].DurationIntervals = 0;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].DurationIntervals = 0;
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].Group[0] = '\0';
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].Info[0] = '\0';
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].Place[0] = '\0';
|
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].NumColumns--;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].NumColumns--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1113,12 +1098,9 @@ static void TT_ModifTimeTable (void)
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].IntervalType = TT_FIRST_INTERVAL;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].IntervalType = TT_FIRST_INTERVAL;
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].ClassType = Gbl.TimeTable.ClassType;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].ClassType = Gbl.TimeTable.ClassType;
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].DurationIntervals = Gbl.TimeTable.DurationIntervals;
|
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].DurationIntervals = Gbl.TimeTable.DurationIntervals;
|
||||||
Str_Copy (TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].Group,
|
Str_Copy (TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].Info,
|
||||||
Gbl.TimeTable.Group,
|
Gbl.TimeTable.Info,
|
||||||
Grp_MAX_BYTES_GROUP_NAME);
|
TT_MAX_BYTES_INFO);
|
||||||
Str_Copy (TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].Place,
|
|
||||||
Gbl.TimeTable.Place,
|
|
||||||
TT_MAX_BYTES_PLACE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1225,7 +1207,7 @@ static void TT_DrawTimeTable (void)
|
||||||
if (ContinuousFreeMinicolumns)
|
if (ContinuousFreeMinicolumns)
|
||||||
{
|
{
|
||||||
TT_TimeTableDrawCell (Weekday,Interval,Column - 1,ContinuousFreeMinicolumns,
|
TT_TimeTableDrawCell (Weekday,Interval,Column - 1,ContinuousFreeMinicolumns,
|
||||||
-1L,TT_FREE_INTERVAL,TT_FREE,0,NULL,-1,NULL);
|
-1L,TT_FREE_INTERVAL,TT_FREE,0,-1L,NULL);
|
||||||
ContinuousFreeMinicolumns = 0;
|
ContinuousFreeMinicolumns = 0;
|
||||||
}
|
}
|
||||||
TT_TimeTableDrawCell (Weekday,Interval,Column,
|
TT_TimeTableDrawCell (Weekday,Interval,Column,
|
||||||
|
@ -1235,13 +1217,12 @@ static void TT_DrawTimeTable (void)
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].IntervalType,
|
TT_TimeTable[Weekday][Interval].Columns[Column].IntervalType,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].ClassType,
|
TT_TimeTable[Weekday][Interval].Columns[Column].ClassType,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals,
|
TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Group,
|
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].GrpCod,
|
TT_TimeTable[Weekday][Interval].Columns[Column].GrpCod,
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Place);
|
TT_TimeTable[Weekday][Interval].Columns[Column].Info);
|
||||||
}
|
}
|
||||||
if (ContinuousFreeMinicolumns)
|
if (ContinuousFreeMinicolumns)
|
||||||
TT_TimeTableDrawCell (Weekday,Interval,Column - 1,ContinuousFreeMinicolumns,
|
TT_TimeTableDrawCell (Weekday,Interval,Column - 1,ContinuousFreeMinicolumns,
|
||||||
-1L,TT_FREE_INTERVAL,TT_FREE,0,NULL,-1L,NULL);
|
-1L,TT_FREE_INTERVAL,TT_FREE,0,-1L,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Empty column used to adjust height */
|
/* Empty column used to adjust height */
|
||||||
|
@ -1434,14 +1415,13 @@ static void TT_DrawCellAlignTimeTable (void)
|
||||||
|
|
||||||
static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Column,unsigned ColSpan,
|
static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Column,unsigned ColSpan,
|
||||||
long CrsCod,TT_IntervalType_t IntervalType,TT_ClassType_t ClassType,
|
long CrsCod,TT_IntervalType_t IntervalType,TT_ClassType_t ClassType,
|
||||||
unsigned DurationNumIntervals,char *Group,long GrpCod,char *Place)
|
unsigned DurationNumIntervals,long GrpCod,const char *Info)
|
||||||
{
|
{
|
||||||
extern const char *Txt_unknown_removed_course;
|
extern const char *Txt_unknown_removed_course;
|
||||||
extern const char *Txt_TIMETABLE_CLASS_TYPES[TT_NUM_CLASS_TYPES];
|
extern const char *Txt_TIMETABLE_CLASS_TYPES[TT_NUM_CLASS_TYPES];
|
||||||
extern const char *Txt_Group;
|
extern const char *Txt_Group;
|
||||||
extern const char *Txt_All_groups;
|
extern const char *Txt_All_groups;
|
||||||
extern const char *Txt_Classroom;
|
extern const char *Txt_Info;
|
||||||
extern const char *Txt_Place;
|
|
||||||
static const char *TimeTableClasses[TT_NUM_CLASS_TYPES] =
|
static const char *TimeTableClasses[TT_NUM_CLASS_TYPES] =
|
||||||
{
|
{
|
||||||
"TT_FREE", // TT_FREE (free hour)
|
"TT_FREE", // TT_FREE (free hour)
|
||||||
|
@ -1479,13 +1459,13 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
if (RowSpan == 0)
|
if (RowSpan == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/***** If group code > 0, a group is selected ==> get group type and name *****/
|
/***** If group code > 0, a group is selected ==> get group data *****/
|
||||||
if (IntervalType == TT_FIRST_INTERVAL &&
|
if (IntervalType == TT_FIRST_INTERVAL &&
|
||||||
(Gbl.TimeTable.View == TT_CRS_VIEW ||
|
(Gbl.TimeTable.View == TT_CRS_VIEW ||
|
||||||
Gbl.TimeTable.View == TT_CRS_EDIT) &&
|
Gbl.TimeTable.View == TT_CRS_EDIT) &&
|
||||||
GrpCod > 0)
|
GrpCod > 0)
|
||||||
{
|
{
|
||||||
/* Get group type and name */
|
/* Get group data */
|
||||||
GrpDat.GrpCod = GrpCod;
|
GrpDat.GrpCod = GrpCod;
|
||||||
Grp_GetDataOfGroupByCod (&GrpDat);
|
Grp_GetDataOfGroupByCod (&GrpDat);
|
||||||
}
|
}
|
||||||
|
@ -1539,21 +1519,20 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval); // Minutes
|
Gbl.TimeTable.Config.Range.MinutesPerInterval); // Minutes
|
||||||
|
|
||||||
/***** Group *****/
|
/***** Group *****/
|
||||||
if (Gbl.TimeTable.View == TT_CRS_VIEW)
|
if (Gbl.TimeTable.View == TT_CRS_VIEW &&
|
||||||
|
GrpCod > 0)
|
||||||
{
|
{
|
||||||
if (GrpCod <= 0)
|
fprintf (Gbl.F.Out,"<br />%s"
|
||||||
{
|
"<br />%s",
|
||||||
if (Group[0])
|
GrpDat.GrpTypName,GrpDat.GrpName);
|
||||||
fprintf (Gbl.F.Out,"<br />%s",Group);
|
if (GrpDat.Classroom.ClaCod > 0)
|
||||||
}
|
fprintf (Gbl.F.Out,"<br />(%s)",
|
||||||
else
|
GrpDat.Classroom.ShrtName);
|
||||||
fprintf (Gbl.F.Out,"<br />%s %s",
|
|
||||||
GrpDat.GrpTypName,GrpDat.GrpName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Place *****/
|
/***** Info *****/
|
||||||
if (Place[0])
|
if (Info[0])
|
||||||
fprintf (Gbl.F.Out,"<br />%s",Place);
|
fprintf (Gbl.F.Out,"<br />%s",Info);
|
||||||
|
|
||||||
/***** End cell *****/
|
/***** End cell *****/
|
||||||
fprintf (Gbl.F.Out,"</div>");
|
fprintf (Gbl.F.Out,"</div>");
|
||||||
|
@ -1679,36 +1658,36 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</select>");
|
fprintf (Gbl.F.Out,"</select>");
|
||||||
|
|
||||||
/***** Classroom *****/
|
/***** Info *****/
|
||||||
fprintf (Gbl.F.Out,"<br />"
|
fprintf (Gbl.F.Out,"<br />"
|
||||||
"<label for=\"TTPlc%s\">"
|
"<label for=\"TTInf%s\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</label>"
|
"</label>"
|
||||||
"<input id=\"TTPlc%s\" name=\"TTPlc\""
|
"<input id=\"TTInf%s\" name=\"TTInf\""
|
||||||
" type=\"text\" size=\"1\" maxlength=\"%u\""
|
" type=\"text\" size=\"1\" maxlength=\"%u\""
|
||||||
" value=\"%s\""
|
" value=\"%s\""
|
||||||
" onchange=\"document.getElementById('%s').submit();\" />",
|
" onchange=\"document.getElementById('%s').submit();\" />",
|
||||||
CellStr,
|
CellStr,
|
||||||
Txt_Classroom,
|
Txt_Info,
|
||||||
CellStr,
|
CellStr,
|
||||||
TT_MAX_CHARS_PLACE,Place,
|
TT_MAX_CHARS_INFO,Info,
|
||||||
Gbl.Form.Id);
|
Gbl.Form.Id);
|
||||||
}
|
}
|
||||||
else // TimeTableView == TT_TUT_EDIT
|
else // TimeTableView == TT_TUT_EDIT
|
||||||
{
|
{
|
||||||
/***** Place *****/
|
/***** Info *****/
|
||||||
fprintf (Gbl.F.Out,"<br />"
|
fprintf (Gbl.F.Out,"<br />"
|
||||||
"<label for=\"TTPlc%s\" class=\"DAT_SMALL\">"
|
"<label for=\"TTInf%s\" class=\"DAT_SMALL\">"
|
||||||
"%s"
|
"%s"
|
||||||
"</label>"
|
"</label>"
|
||||||
"<input id=\"TTPlc%s\" name=\"TTPlc\""
|
"<input id=\"TTInf%s\" name=\"TTInf\""
|
||||||
" type=\"text\" size=\"12\" maxlength=\"%u\""
|
" type=\"text\" size=\"12\" maxlength=\"%u\""
|
||||||
" value=\"%s\""
|
" value=\"%s\""
|
||||||
" onchange=\"document.getElementById('%s').submit();\" />",
|
" onchange=\"document.getElementById('%s').submit();\" />",
|
||||||
CellStr,
|
CellStr,
|
||||||
Txt_Place,
|
Txt_Info,
|
||||||
CellStr,
|
CellStr,
|
||||||
TT_MAX_CHARS_PLACE,Place,
|
TT_MAX_CHARS_INFO,Info,
|
||||||
Gbl.Form.Id);
|
Gbl.Form.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,11 @@
|
||||||
/************************* Public constants and types ************************/
|
/************************* Public constants and types ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define TT_MAX_CHARS_PLACE (32 - 1) // 31
|
#define TT_MAX_CHARS_INFO (128 - 1) // 127
|
||||||
#define TT_MAX_BYTES_PLACE ((TT_MAX_CHARS_PLACE + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 511
|
#define TT_MAX_BYTES_INFO ((TT_MAX_CHARS_INFO + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||||
|
|
||||||
|
// #define TT_MAX_CHARS_PLACE (32 - 1) // 31
|
||||||
|
// #define TT_MAX_BYTES_PLACE ((TT_MAX_CHARS_INFO + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 511
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue