mirror of https://github.com/acanas/swad-core.git
Version 23.53: Dec 15, 2023 Code refactoring and responsive design in timetable.
This commit is contained in:
parent
29ab5cb9fa
commit
a8d8041f7a
|
@ -4168,9 +4168,9 @@ legend {font-size:12pt;}
|
|||
|
||||
.Tmt_HOURCOL {box-sizing:border-box; height:16px; width:7%;}
|
||||
.Tmt_MINICOL {box-sizing:border-box; height:16px; width:2%;}
|
||||
.Tmt_ALIGN {box-sizing:border-box; height:16px; width:1%;}
|
||||
.Tmt_ALIGN {box-sizing:border-box; height:16px; width:1%;}
|
||||
|
||||
.Tmt_CELL {box-sizing:border-box; height:16px; border:solid 1px;}
|
||||
.Tmt_CELL {box-sizing:border-box; height:16px; border:solid 1px;}
|
||||
|
||||
.Tmt_FREE0_WHITE,
|
||||
.Tmt_FREE0_GREY,
|
||||
|
@ -5200,17 +5200,59 @@ button.PAG_DARK:hover, .PAG_CUR_DARK {background-color:#707070;}
|
|||
height:48px;
|
||||
}
|
||||
|
||||
/************************* Indicators about courses **************************/
|
||||
.INDICATORS td,.INDICATORS th
|
||||
/************************* Table with horizontal scroll **********************/
|
||||
@media only screen and (max-width: 480px)
|
||||
{ /* For mobile-phones */
|
||||
.TBL_SCROLL
|
||||
{
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
width: 280px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 480px) and (max-width: 800px)
|
||||
{ /* For mobile-phones */
|
||||
.TBL_SCROLL
|
||||
{
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
width: 400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 800px) and (max-width: 1024px)
|
||||
{ /* For tablets */
|
||||
.TBL_SCROLL
|
||||
{
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
width: 640px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 1024px)
|
||||
{ /* For desktop */
|
||||
.TBL_SCROLL
|
||||
{
|
||||
display: block;
|
||||
overflow-x: auto;
|
||||
width: 900px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.TBL_SCROLL tbody {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.Ind_TBL td,.Ind_TBL th
|
||||
{
|
||||
border:1px solid silver;
|
||||
border-collapse:collapse;
|
||||
padding:1px;
|
||||
}
|
||||
.INDICATORS_INPUT
|
||||
{
|
||||
max-width:500px;
|
||||
}
|
||||
|
||||
/************* Forms to edit institution, center, degree, course *************/
|
||||
.CODE
|
|
@ -1987,6 +1987,11 @@ void HTM_Unsigned (unsigned Num)
|
|||
HTM_TxtF ("%u",Num);
|
||||
}
|
||||
|
||||
void HTM_UnsignedColon (unsigned Num)
|
||||
{
|
||||
HTM_TxtF ("%u:",Num);
|
||||
}
|
||||
|
||||
void HTM_Light0 (void)
|
||||
{
|
||||
HTM_SPAN_Begin ("class=\"VERY_LIGHT\"");
|
||||
|
|
|
@ -234,6 +234,7 @@ void HTM_Comma (void);
|
|||
void HTM_Hyphen (void);
|
||||
void HTM_Asterisk (void);
|
||||
void HTM_Unsigned (unsigned Num);
|
||||
void HTM_UnsignedColon (unsigned Num);
|
||||
void HTM_Light0 (void);
|
||||
void HTM_Int (int Num);
|
||||
void HTM_UnsignedLong (unsigned long Num);
|
||||
|
|
|
@ -2678,7 +2678,7 @@ static void Att_ListEventsToSelect (struct Att_Events *Events,
|
|||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
HTM_LABEL_Begin ("for=\"Event%u\"",NumAttEvent);
|
||||
HTM_TxtF ("%u:",NumAttEvent + 1);
|
||||
HTM_UnsignedColon (NumAttEvent + 1);
|
||||
HTM_LABEL_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -3071,7 +3071,7 @@ static void Att_ListAttEventsForAStd (struct Att_Events *Events,
|
|||
"DAT",
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
HTM_TxtF ("%u:",NumUsr);
|
||||
HTM_UnsignedColon (NumUsr);
|
||||
HTM_TD_End ();
|
||||
|
||||
/***** Show student's photo *****/
|
||||
|
@ -3140,7 +3140,7 @@ static void Att_ListAttEventsForAStd (struct Att_Events *Events,
|
|||
"DAT_RED",
|
||||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
HTM_TxtF ("%u:",NumAttEvent + 1);
|
||||
HTM_UnsignedColon (NumAttEvent + 1);
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TD_Begin ("class=\"BT %s\"",The_GetColorRows ());
|
||||
|
|
|
@ -633,10 +633,12 @@ 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.52.56 (2023-12-14)"
|
||||
#define CSS_FILE "swad23.52.5.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.53 (2023-12-14)"
|
||||
#define CSS_FILE "swad23.53.css"
|
||||
#define JS_FILE "swad23.52.js"
|
||||
/*
|
||||
Version 23.53: Dec 15, 2023 Code refactoring and responsive design in timetable. (335817 lines)
|
||||
Version 23.52.7: Dec 14, 2023 Responsive design in indicators. (335817 lines)
|
||||
Version 23.52.6: Dec 14, 2023 Responsive design in average photos of degrees. (335817 lines)
|
||||
Version 23.52.5: Dec 13, 2023 Responsive design in follow. (335814 lines)
|
||||
Version 23.52.4: Dec 13, 2023 Responsive design in hierarchy configuration and connected users. (335821 lines)
|
||||
|
|
|
@ -114,7 +114,7 @@ void DegTyp_WriteSelectorDegreeTypes (long SelectedDegTypCod)
|
|||
/* List degree types */
|
||||
HTM_SELECT_Begin (HTM_SUBMIT_ON_CHANGE,NULL,
|
||||
"id=\"OthDegTypCod\" name=\"OthDegTypCod\""
|
||||
" class=\"INPUT_%s\"",
|
||||
" class=\"REC_C2_BOT_INPUT INPUT_%s\"",
|
||||
The_GetSuffix ());
|
||||
HTM_OPTION (HTM_Type_STRING,"-1",
|
||||
SelectedDegTypCod <= 0 ? HTM_OPTION_SELECTED :
|
||||
|
|
|
@ -613,7 +613,7 @@ static void ExaRes_ListExamsToSelect (struct Exa_Exams *Exams)
|
|||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
HTM_LABEL_Begin ("for=\"Gam%u\"",NumExam);
|
||||
HTM_TxtF ("%u:",NumExam + 1);
|
||||
HTM_UnsignedColon (NumExam + 1);
|
||||
HTM_LABEL_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
|
|
@ -63,6 +63,7 @@ extern struct Globals Gbl;
|
|||
/******************************* Private types *******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Ind_NUM_LAYOUTS 2
|
||||
typedef enum
|
||||
{
|
||||
Ind_INDICATORS_BRIEF,
|
||||
|
@ -133,10 +134,10 @@ void Ind_ReqIndicatorsCourses (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT","ScopeInd",Txt_Scope);
|
||||
Frm_LabelColumn ("REC_C1_BOT RT","ScopeInd",Txt_Scope);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
HTM_TD_Begin ("class=\"REC_C2_BOT LT\"");
|
||||
Sco_PutSelectorScope ("ScopeInd",HTM_SUBMIT_ON_CHANGE);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -146,10 +147,10 @@ void Ind_ReqIndicatorsCourses (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[ParCod_OthDegTyp],Txt_Types_of_degree);
|
||||
Frm_LabelColumn ("REC_C1_BOT RT",Par_CodeStr[ParCod_OthDegTyp],Txt_Types_of_degree);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT DAT_%s\"",The_GetSuffix ());
|
||||
HTM_TD_Begin ("class=\"REC_C2_BOT LT DAT_%s\"",The_GetSuffix ());
|
||||
DegTyp_WriteSelectorDegreeTypes (Indicators.DegTypCod);
|
||||
HTM_Txt (" (");
|
||||
HTM_TxtF (Txt_only_if_the_scope_is_X,Cfg_PLATFORM_SHORT_NAME);
|
||||
|
@ -162,11 +163,11 @@ void Ind_ReqIndicatorsCourses (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[ParCod_Dpt],Txt_Department);
|
||||
Frm_LabelColumn ("REC_C1_BOT RT",Par_CodeStr[ParCod_Dpt],Txt_Department);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
if (asprintf (&SelectClass,"INDICATORS_INPUT INPUT_%s",
|
||||
HTM_TD_Begin ("class=\"REC_C2_BOT LT\"");
|
||||
if (asprintf (&SelectClass,"REC_C2_BOT_INPUT INPUT_%s",
|
||||
The_GetSuffix ()) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
Dpt_WriteSelectorDepartment (Gbl.Hierarchy.Node[Hie_INS].HieCod, // Departments in current insitution
|
||||
|
@ -195,9 +196,9 @@ void Ind_ReqIndicatorsCourses (void)
|
|||
/* Selection of the number of indicators */
|
||||
HTM_TR_Begin (NULL);
|
||||
|
||||
Frm_LabelColumn ("RT","",Txt_Number_of_indicators);
|
||||
Frm_LabelColumn ("REC_C1_BOT RT","",Txt_Number_of_indicators);
|
||||
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
HTM_TD_Begin ("class=\"REC_C2_BOT LT\"");
|
||||
Ind_ShowNumCoursesWithIndicators (&Indicators,NumCrssWithIndicatorYes,NumCrss,true);
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -438,7 +439,6 @@ static void Ind_ShowNumCoursesWithIndicators (const struct Ind_Indicators *Indic
|
|||
unsigned NumCrss,
|
||||
Frm_PutForm_t PutForm)
|
||||
{
|
||||
extern const char *Txt_Indicators;
|
||||
extern const char *Txt_HIERARCHY_PLURAL_Abc[Hie_NUM_LEVELS];
|
||||
extern const char *Txt_Total;
|
||||
char *ClassNormal;
|
||||
|
@ -459,7 +459,7 @@ static void Ind_ShowNumCoursesWithIndicators (const struct Ind_Indicators *Indic
|
|||
HTM_TR_Begin (NULL);
|
||||
if (PutForm == Frm_PUT_FORM)
|
||||
HTM_TH_Empty (1);
|
||||
HTM_TH (Txt_Indicators ,HTM_HEAD_RIGHT);
|
||||
HTM_TH_Empty (1);
|
||||
HTM_TH_Span (Txt_HIERARCHY_PLURAL_Abc[Hie_CRS],HTM_HEAD_RIGHT,1,2,NULL);
|
||||
HTM_TR_End ();
|
||||
|
||||
|
@ -484,7 +484,7 @@ static void Ind_ShowNumCoursesWithIndicators (const struct Ind_Indicators *Indic
|
|||
|
||||
HTM_TD_Begin ("class=\"%s\"",Class);
|
||||
HTM_LABEL_Begin ("for=\"Indicators%u\"",Ind);
|
||||
HTM_Unsigned (Ind);
|
||||
HTM_UnsignedColon (Ind);
|
||||
HTM_LABEL_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
@ -563,9 +563,14 @@ static void Ind_ShowTableOfCoursesWithIndicators (const struct Ind_Indicators *I
|
|||
unsigned NumIndicators;
|
||||
struct Ind_IndicatorsCrs IndicatorsCrs;
|
||||
long ActCod;
|
||||
static const char *TableClass[Ind_NUM_LAYOUTS] =
|
||||
{
|
||||
[Ind_INDICATORS_BRIEF] = "Ind_TBL TBL_SCROLL",
|
||||
[Ind_INDICATORS_FULL ] = "Ind_TBL",
|
||||
};
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_Begin ("INDICATORS");
|
||||
HTM_TABLE_Begin (TableClass[IndicatorsLayout]);
|
||||
|
||||
/***** Write table heading *****/
|
||||
switch (IndicatorsLayout)
|
||||
|
|
|
@ -575,7 +575,7 @@ static void MchRes_ListGamesToSelect (struct Gam_Games *Games)
|
|||
The_GetSuffix (),
|
||||
The_GetColorRows ());
|
||||
HTM_LABEL_Begin ("for=\"Gam%u\"",NumGame);
|
||||
HTM_TxtF ("%u:",NumGame + 1);
|
||||
HTM_UnsignedColon (NumGame + 1);
|
||||
HTM_LABEL_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
|
|
@ -2033,7 +2033,8 @@ static void Pho_PutLinkToCalculateDegreeStats (const struct Pho_DegPhotos *DegPh
|
|||
|
||||
/* Selector with all degrees with students */
|
||||
HTM_SELECT_Begin (HTM_DONT_SUBMIT_ON_CHANGE,NULL,
|
||||
"name=\"OthDegCod\" class=\"INPUT_%s\"",
|
||||
"name=\"OthDegCod\""
|
||||
" class=\"REC_C2_BOT_INPUT INPUT_%s\"",
|
||||
The_GetSuffix ());
|
||||
for (NumDeg = 0;
|
||||
NumDeg < Degs.Num;
|
||||
|
|
|
@ -1310,9 +1310,8 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
|
|||
Frm_BeginForm (ActPrnRecSevTch);
|
||||
Usr_PutParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||
Par_PutParChar ("ParamOfficeHours",'Y');
|
||||
Par_PutParChar ("ShowOfficeHours",
|
||||
ShowOfficeHours ? 'Y' :
|
||||
'N');
|
||||
Par_PutParChar ("ShowOfficeHours",ShowOfficeHours ? 'Y' :
|
||||
'N');
|
||||
Rec_ShowLinkToPrintPreviewOfRecords ();
|
||||
Frm_EndForm ();
|
||||
|
||||
|
@ -1365,7 +1364,9 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
|
|||
Timetable.Type = Tmt_TUTORING_TIMETABLE;
|
||||
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Timetable.Type],
|
||||
NULL,NULL,
|
||||
Hlp_USERS_Teachers_timetable,Box_NOT_CLOSABLE);
|
||||
Gbl.Action.Act == ActSeeRecSevTch ? Hlp_USERS_Teachers_timetable :
|
||||
NULL,
|
||||
Box_NOT_CLOSABLE);
|
||||
Tmt_ShowTimeTable (&Timetable,UsrDat.UsrCod);
|
||||
Box_BoxEnd ();
|
||||
HTM_DIV_End ();
|
||||
|
|
|
@ -3902,7 +3902,7 @@ const char *Txt_Calculate_average_photo_of_THE_DEGREE_X = // Warning: should end
|
|||
#elif L==5 // fr
|
||||
"Calculer la photo moyenne de ";
|
||||
#elif L==6 // gn
|
||||
"Calcular fotografía promedio de "; // Okoteve traducción
|
||||
"Okalkula ta'anga promedio ";
|
||||
#elif L==7 // it
|
||||
"Calcolare la media della foto di ";
|
||||
#elif L==8 // pl
|
||||
|
@ -3910,7 +3910,7 @@ const char *Txt_Calculate_average_photo_of_THE_DEGREE_X = // Warning: should end
|
|||
#elif L==9 // pt
|
||||
"Calcular a foto média de ";
|
||||
#elif L==10 // tr
|
||||
"Calculate average photo of "; // Çeviri lazim!
|
||||
"Ortalama fotoğrafını hesaplayın ";
|
||||
#endif
|
||||
|
||||
const char *Txt_Calendar =
|
||||
|
@ -17232,7 +17232,7 @@ const char *Txt_Indicators_of_courses =
|
|||
#elif L==5 // fr
|
||||
"Indicateurs de matières";
|
||||
#elif L==6 // gn
|
||||
"Indicadores de asignaturas"; // Okoteve traducción
|
||||
"Umi mba'e ohechaukáva tema rehegua";
|
||||
#elif L==7 // it
|
||||
"Indicatori di corsi";
|
||||
#elif L==8 // pl
|
||||
|
@ -17240,7 +17240,7 @@ const char *Txt_Indicators_of_courses =
|
|||
#elif L==9 // pt
|
||||
"Indicadores de disciplinas";
|
||||
#elif L==10 // tr
|
||||
"Indicators of courses"; // Çeviri lazim!
|
||||
"Kurs göstergeleri";
|
||||
#endif
|
||||
|
||||
const char *Txt_Info =
|
||||
|
|
101
swad_timetable.c
101
swad_timetable.c
|
@ -367,7 +367,7 @@ void Tmt_ShowClassTimeTable (void)
|
|||
else
|
||||
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Timetable.Type],
|
||||
NULL,NULL,
|
||||
Help[Timetable.Type],Box_NOT_CLOSABLE);
|
||||
NULL,Box_NOT_CLOSABLE);
|
||||
|
||||
/***** Begin time table drawing *****/
|
||||
if (Timetable.Type == Tmt_COURSE_TIMETABLE)
|
||||
|
@ -519,27 +519,28 @@ void Tmt_ShowTimeTable (struct Tmt_Timetable *Timetable,long UsrCod)
|
|||
extern const char *Txt_The_timetable_is_empty;
|
||||
|
||||
/***** Set type of view depending on current action *****/
|
||||
Timetable->View = Tmt_CRS_VIEW;
|
||||
Timetable->View = Vie_VIEW;
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
|
||||
case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay:
|
||||
Timetable->View = Tmt_CRS_VIEW;
|
||||
break;
|
||||
case ActSeeRecOneTch: case ActSeeRecSevTch:
|
||||
Timetable->View = Tmt_TUT_VIEW;
|
||||
case ActSeeCrsTT: case ActChgCrsTT1stDay:
|
||||
case ActSeeMyTT: case ActChgMyTT1stDay:
|
||||
case ActSeeRecOneTch:
|
||||
case ActSeeRecSevTch:
|
||||
Timetable->View = Vie_VIEW;
|
||||
break;
|
||||
case ActEdiCrsTT: case ActChgCrsTT:
|
||||
Timetable->View = Tmt_CRS_EDIT;
|
||||
break;
|
||||
case ActEdiTut: case ActChgTut:
|
||||
Timetable->View = Tmt_TUT_EDIT;
|
||||
Timetable->View = Vie_EDIT;
|
||||
break;
|
||||
case ActPrnCrsTT:
|
||||
case ActPrnMyTT:
|
||||
case ActPrnRecSevTch:
|
||||
Timetable->View = Vie_PRINT;
|
||||
break;
|
||||
}
|
||||
|
||||
/***** If editing ==> configure and allocate timetable *****/
|
||||
if (Timetable->View == Tmt_CRS_EDIT ||
|
||||
Timetable->View == Tmt_TUT_EDIT)
|
||||
if (Timetable->View == Vie_EDIT)
|
||||
{
|
||||
Timetable->Config.Range.Hours.Start = Tmt_START_HOUR; // Day starts at this hour
|
||||
Timetable->Config.Range.Hours.End = Tmt_END_HOUR; // Day ends at this hour
|
||||
|
@ -692,10 +693,9 @@ static void Tmt_FillTimeTableFromDB (struct Tmt_Timetable *Timetable,
|
|||
/***** Get timetable from database *****/
|
||||
NumRows = Tmt_DB_GetTimeTable (&mysql_res,Timetable->Type,UsrCod);
|
||||
|
||||
/***** If viewing (not editing) ==>
|
||||
/***** If viewing of printing (not editing) ==>
|
||||
calculate range of hours and resolution *****/
|
||||
if (Timetable->View == Tmt_CRS_VIEW ||
|
||||
Timetable->View == Tmt_TUT_VIEW)
|
||||
if (Timetable->View != Vie_EDIT)
|
||||
{
|
||||
/* Initialize hours and resolution for timetable */
|
||||
Timetable->Config.Range.Hours.Start = Tmt_END_HOUR; // Initialized to maximum hour
|
||||
|
@ -1007,9 +1007,15 @@ static void Tmt_DrawTimeTable (const struct Tmt_Timetable *Timetable)
|
|||
unsigned ColumnsToDraw;
|
||||
unsigned ColumnsToDrawIncludingExtraColumn;
|
||||
unsigned ContinuousFreeMinicolumns;
|
||||
static const char *TableClass[Vie_NUM_VIEW_TYPES] =
|
||||
{
|
||||
[Vie_VIEW ] = "TBL_SCROLL",
|
||||
[Vie_EDIT ] = "TBL_SCROLL",
|
||||
[Vie_PRINT] = "TT",
|
||||
};
|
||||
|
||||
/***** Begin table *****/
|
||||
HTM_TABLE_Begin ("TT");
|
||||
HTM_TABLE_Begin (TableClass[Timetable->View]);
|
||||
|
||||
/***** Top row used for column adjustement *****/
|
||||
Tmt_TimeTableDrawAdjustRow ();
|
||||
|
@ -1064,15 +1070,13 @@ static void Tmt_DrawTimeTable (const struct Tmt_Timetable *Timetable)
|
|||
true, // Top call, non recursive
|
||||
WhichCell.Weekday,WhichCell.Interval);
|
||||
if (ColumnsToDraw == 0 &&
|
||||
(Timetable->View == Tmt_CRS_VIEW ||
|
||||
Timetable->View == Tmt_TUT_VIEW))
|
||||
Timetable->View != Vie_EDIT)
|
||||
ColumnsToDraw = 1;
|
||||
// If editing and there's place for more columns,
|
||||
// a potential new column is added at the end of each day
|
||||
ColumnsToDrawIncludingExtraColumn = ColumnsToDraw;
|
||||
if (ColumnsToDraw < Tmt_MAX_COLUMNS_PER_CELL &&
|
||||
(Timetable->View == Tmt_CRS_EDIT ||
|
||||
Timetable->View == Tmt_TUT_EDIT))
|
||||
Timetable->View == Vie_EDIT)
|
||||
ColumnsToDrawIncludingExtraColumn++;
|
||||
|
||||
/* Draw cells */
|
||||
|
@ -1395,26 +1399,19 @@ static void Tmt_TimeTableDrawCell (const struct Tmt_Timetable *Timetable,
|
|||
free (ClassStr);
|
||||
|
||||
/***** Draw cell depending on type of view *****/
|
||||
switch (Timetable->View)
|
||||
{
|
||||
case Tmt_CRS_VIEW: // View course timetable
|
||||
case Tmt_TUT_VIEW: // View tutoring timetable
|
||||
if (IntervalType != Tmt_FREE_INTERVAL) // If cell is not empty...
|
||||
Tmt_TimeTableDrawCellView (Timetable,
|
||||
CrsCod,GrpCod,
|
||||
ClassType,
|
||||
DurationNumIntervals,
|
||||
Info);
|
||||
break;
|
||||
case Tmt_CRS_EDIT: // Edit course timetable
|
||||
case Tmt_TUT_EDIT: // Edit tutoring timetable
|
||||
Tmt_TimeTableDrawCellEdit (Timetable,WhichCell,
|
||||
GrpCod,
|
||||
IntervalType,ClassType,
|
||||
DurationNumIntervals,
|
||||
Info);
|
||||
break;
|
||||
}
|
||||
if (Timetable->View == Vie_EDIT) // Editing
|
||||
Tmt_TimeTableDrawCellEdit (Timetable,WhichCell,
|
||||
GrpCod,
|
||||
IntervalType,ClassType,
|
||||
DurationNumIntervals,
|
||||
Info);
|
||||
else // Viewing or printing
|
||||
if (IntervalType != Tmt_FREE_INTERVAL) // If cell is not empty...
|
||||
Tmt_TimeTableDrawCellView (Timetable,
|
||||
CrsCod,GrpCod,
|
||||
ClassType,
|
||||
DurationNumIntervals,
|
||||
Info);
|
||||
|
||||
/***** End cell *****/
|
||||
HTM_TD_End ();
|
||||
|
@ -1455,8 +1452,7 @@ static void Tmt_TimeTableDrawCellView (const struct Tmt_Timetable *Timetable,
|
|||
Timetable->Config.Range.MinutesPerInterval); // Minutes
|
||||
|
||||
/***** Group *****/
|
||||
if (Timetable->View == Tmt_CRS_VIEW &&
|
||||
GrpCod > 0)
|
||||
if (GrpCod > 0 && Timetable->Type != Tmt_TUTORING_TIMETABLE)
|
||||
{
|
||||
GrpDat.GrpCod = GrpCod;
|
||||
Grp_GetGroupDataByCod (&GrpDat);
|
||||
|
@ -1495,12 +1491,11 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
|
|||
extern const char *Txt_Group;
|
||||
extern const char *Txt_All_groups;
|
||||
extern const char *Txt_Info;
|
||||
static const Act_Action_t NextAction[Tmt_NUM_VIEW_EDIT] =
|
||||
static const Act_Action_t NextAction[Tmt_NUM_TIMETABLE_TYPES] =
|
||||
{
|
||||
[Tmt_CRS_VIEW] = ActUnk, // course view
|
||||
[Tmt_TUT_VIEW] = ActUnk, // tutorials view
|
||||
[Tmt_CRS_EDIT] = ActChgCrsTT, // course edit
|
||||
[Tmt_TUT_EDIT] = ActChgTut, // tutorials edit
|
||||
[Tmt_COURSE_TIMETABLE ] = ActChgCrsTT,
|
||||
[Tmt_MY_TIMETABLE ] = ActChgTut,
|
||||
[Tmt_TUTORING_TIMETABLE] = ActChgTut,
|
||||
};
|
||||
char *CellStr; // Unique string for this cell used in labels
|
||||
Tmt_ClassType_t CT;
|
||||
|
@ -1515,7 +1510,7 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
|
|||
char *Room;
|
||||
|
||||
/***** Form to modify this cell *****/
|
||||
Frm_BeginForm (NextAction[Timetable->View]);
|
||||
Frm_BeginForm (NextAction[Timetable->Type]);
|
||||
|
||||
/***** Put hidden parameters *****/
|
||||
Par_PutParUnsigned (NULL,"TTDay",WhichCell->Weekday );
|
||||
|
@ -1530,8 +1525,8 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
|
|||
CT <= (Tmt_ClassType_t) (Tmt_NUM_CLASS_TYPES - 1);
|
||||
CT++)
|
||||
if ((CT == Tmt_FREE) ||
|
||||
((Timetable->View == Tmt_CRS_EDIT) && (CT == Tmt_LECTURE || CT == Tmt_PRACTICAL)) ||
|
||||
((Timetable->View == Tmt_TUT_EDIT) && (CT == Tmt_TUTORING)))
|
||||
((Timetable->Type == Tmt_COURSE_TIMETABLE ) && (CT == Tmt_LECTURE || CT == Tmt_PRACTICAL)) ||
|
||||
((Timetable->Type == Tmt_TUTORING_TIMETABLE) && (CT == Tmt_TUTORING)))
|
||||
HTM_OPTION (HTM_Type_STRING,Tmt_DB_ClassType[CT],
|
||||
CT == ClassType ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
|
@ -1597,7 +1592,7 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
|
|||
WhichCell->Column) < 0)
|
||||
Err_NotEnoughMemoryExit ();
|
||||
|
||||
if (Timetable->View == Tmt_CRS_EDIT)
|
||||
if (Timetable->Type == Tmt_COURSE_TIMETABLE)
|
||||
{
|
||||
/***** Group *****/
|
||||
HTM_BR ();
|
||||
|
@ -1658,7 +1653,7 @@ static void Tmt_TimeTableDrawCellEdit (const struct Tmt_Timetable *Timetable,
|
|||
" class=\"Tmt_INF INPUT_%s\"",
|
||||
CellStr,The_GetSuffix ());
|
||||
}
|
||||
else // TimeTableView == Tmt_TUT_EDIT
|
||||
else // Timetable->Type != Tmt_COURSE_TIMETABLE
|
||||
{
|
||||
/***** Info *****/
|
||||
HTM_BR ();
|
||||
|
|
|
@ -36,15 +36,6 @@
|
|||
#define Tmt_MAX_CHARS_INFO (128 - 1) // 127
|
||||
#define Tmt_MAX_BYTES_INFO ((Tmt_MAX_CHARS_INFO + 1) * Str_MAX_BYTES_PER_CHAR - 1) // 2047
|
||||
|
||||
#define Tmt_NUM_VIEW_EDIT 4
|
||||
typedef enum
|
||||
{
|
||||
Tmt_CRS_VIEW = 0, // course view
|
||||
Tmt_TUT_VIEW = 1, // tutorials view
|
||||
Tmt_CRS_EDIT = 2, // course edit
|
||||
Tmt_TUT_EDIT = 3, // tutorials edit
|
||||
} Tmt_TimeTableView_t;
|
||||
|
||||
#define Tmt_NUM_TIMETABLE_TYPES 3
|
||||
typedef enum
|
||||
{
|
||||
|
@ -98,7 +89,7 @@ struct Tmt_Timetable
|
|||
unsigned IntervalsBeforeStartHour;
|
||||
} Config;
|
||||
Tmt_TimeTableType_t Type;
|
||||
Tmt_TimeTableView_t View;
|
||||
Vie_ViewType_t View;
|
||||
struct Tmt_WhichCell WhichCell;
|
||||
Tmt_ClassType_t ClassType;
|
||||
unsigned DurationIntervals;
|
||||
|
|
Loading…
Reference in New Issue