"
"");
TT_ShowTimeTable (TT_TUTOR_TIMETABLE,Gbl.Usrs.Other.UsrDat.UsrCod);
@@ -1175,7 +1175,7 @@ void Rec_ListRecordOneTchCrs (void)
void Rec_ListRecordsTchsCrs (void)
{
extern const char *Txt_You_must_select_one_ore_more_teachers;
- extern const char *Txt_Office_hours;
+ extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
unsigned NumUsrs = 0;
const char *Ptr;
Rec_RecordViewType_t TypeOfView = (Gbl.CurrentAct == ActSeeRecSevTch) ? Rec_RECORD_LIST :
@@ -1251,7 +1251,7 @@ void Rec_ListRecordsTchsCrs (void)
/* Office hours */
if (ShowOfficeHours)
{
- Lay_StartRoundFrameTable10 (NULL,0,Txt_Office_hours);
+ Lay_StartRoundFrameTable10 (NULL,0,Txt_TIMETABLE_TYPES[TT_TUTOR_TIMETABLE]);
fprintf (Gbl.F.Out," |
"
"");
TT_ShowTimeTable (TT_TUTOR_TIMETABLE,UsrDat.UsrCod);
diff --git a/swad_survey.c b/swad_survey.c
index e602efdc..455f0b34 100644
--- a/swad_survey.c
+++ b/swad_survey.c
@@ -164,11 +164,11 @@ void Svy_SeeAllSurveys (void)
static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
{
+ extern const char *Txt_Surveys;
extern const char *Txt_ASG_ATT_OR_SVY_HELP_ORDER[2];
extern const char *Txt_ASG_ATT_OR_SVY_ORDER[2];
extern const char *Txt_Survey;
extern const char *Txt_Status;
- extern const char *Txt_No_surveys;
tSvysOrderType Order;
struct Pagination Pagination;
unsigned NumSvy;
@@ -184,69 +184,72 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
/***** Get list of surveys *****/
Svy_GetListSurveys ();
+ /***** Compute variables related to pagination *****/
+ Pagination.NumItems = Gbl.Svys.Num;
+ Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage;
+ Pag_CalculatePagination (&Pagination);
+ Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage;
+
+ /***** Write links to pages *****/
+ if (Pagination.MoreThanOnePage)
+ Pag_WriteLinksToPagesCentered (Pag_SURVEYS,0,&Pagination);
+
+ /***** Start table *****/
+ Lay_StartRoundFrameTable10 (NULL,2,Txt_Surveys);
+
/***** Select whether show only my groups or all groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps)
- Svy_PutFormToSelectWhichGroupsToShow ();
-
- if (Gbl.Svys.Num) // There are surveys in current course
{
- /***** Compute variables related to pagination *****/
- Pagination.NumItems = Gbl.Svys.Num;
- Pagination.CurrentPage = (int) Gbl.Pag.CurrentPage;
- Pag_CalculatePagination (&Pagination);
- Gbl.Pag.CurrentPage = (unsigned) Pagination.CurrentPage;
-
- /***** Write links to pages *****/
- if (Pagination.MoreThanOnePage)
- Pag_WriteLinksToPagesCentered (Pag_SURVEYS,0,&Pagination);
-
- /***** Table head *****/
- Lay_StartRoundFrameTable10 (NULL,2,NULL);
- fprintf (Gbl.F.Out," |
");
Act_FormStart (ActSeeAllSvy);
Svy_PutHiddenParamSvyOrderType ();
Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
Grp_ShowSelectorWhichGrps ();
- fprintf (Gbl.F.Out,""
- "
");
+ fprintf (Gbl.F.Out,"");
}
/*****************************************************************************/
@@ -2389,7 +2390,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
extern const char *Txt_New_question;
extern const char *Txt_Stem;
extern const char *Txt_Type;
- extern const char *Txt_SVY_STR_ANSWER_TYPES[Svy_NUM_ANS_TYPES];
+ extern const char *Txt_SURVEY_STR_ANSWER_TYPES[Svy_NUM_ANS_TYPES];
extern const char *Txt_Send;
char Query[512];
MYSQL_RES *mysql_res;
@@ -2500,7 +2501,7 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,ch
if (AnsType == SvyQst->AnswerType)
fprintf (Gbl.F.Out," checked=\"checked\"");
fprintf (Gbl.F.Out," />%s");
@@ -267,7 +268,7 @@ void TT_ShowClassTimeTable (void)
fprintf (Gbl.F.Out,"");
}
- if (PrintView)
+ if (!PrintView)
{
Lay_PutLinkToPrintView1 (Gbl.CurrentAct == ActSeeCrsTimTbl ? ActPrnCrsTimTbl :
ActPrnMyTimTbl);
@@ -278,7 +279,7 @@ void TT_ShowClassTimeTable (void)
}
/***** Start frame *****/
- Lay_StartRoundFrameTable10 (NULL,0,NULL);
+ Lay_StartRoundFrameTable10 (NULL,0,Txt_TIMETABLE_TYPES[TimeTableType]);
/***** Start time table drawing *****/
if (TimeTableType == TT_COURSE_TIMETABLE)
@@ -286,6 +287,9 @@ void TT_ShowClassTimeTable (void)
Gbl.CurrentIns.Ins.InsCod,Gbl.CurrentDeg.Deg.DegCod,Gbl.CurrentCrs.Crs.CrsCod);
if (PrintView)
+ /***** Show whether only my groups or all groups are selected *****/
+ TT_ShowTimeTableGrpsSelected ();
+ else
{
/***** Select whether show only my groups or all groups *****/
fprintf (Gbl.F.Out,"
"
@@ -296,9 +300,6 @@ void TT_ShowClassTimeTable (void)
""
"
");
}
- else
- /***** Show whether only my groups or all groups are selected *****/
- TT_ShowTimeTableGrpsSelected ();
/***** Show the time table *****/
fprintf (Gbl.F.Out,"
"
@@ -350,7 +351,7 @@ void TT_ShowMyTutTimeTable (void)
{
extern const char *The_ClassFormul[The_NUM_THEMES];
extern const char *Txt_Show_timetable;
- extern const char *Txt_Office_hours;
+ extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
/***** Link (form) to see my timetable *****/
fprintf (Gbl.F.Out,"");
@@ -361,7 +362,7 @@ void TT_ShowMyTutTimeTable (void)
"
");
/***** Time table *****/
- Lay_StartRoundFrameTable10 ("98%",0,Txt_Office_hours);
+ Lay_StartRoundFrameTable10 (NULL,0,Txt_TIMETABLE_TYPES[TT_TUTOR_TIMETABLE]);
fprintf (Gbl.F.Out,"
"
"");
TT_ShowTimeTable (TT_TUTOR_TIMETABLE,Gbl.Usrs.Me.UsrDat.UsrCod);
@@ -780,7 +781,7 @@ static void TT_DrawTimeTable (void)
}
/***** Table start *****/
- fprintf (Gbl.F.Out,"");
+ fprintf (Gbl.F.Out,"");
/***** Top row used for column adjustement *****/
TT_TimeTableDrawAdjustRow ();
@@ -1035,7 +1036,7 @@ static void TT_TimeTableDrawCell (unsigned Day,unsigned Hour,unsigned Column,uns
long CrsCod,TT_HourType_t HourType,TT_ClassType_t ClassType,unsigned Duration,char *Group,long GrpCod,char *Place)
{
extern const char *Txt_unknown_course;
- extern const char *Txt_TIME_TABLE_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_All_groups;
extern const char *Txt_Classroom;
@@ -1148,7 +1149,7 @@ static void TT_TimeTableDrawCell (unsigned Day,unsigned Hour,unsigned Column,uns
Txt_unknown_course);
}
fprintf (Gbl.F.Out,"%s (%dh%s)",
- Txt_TIME_TABLE_CLASS_TYPES[ClassType],
+ Txt_TIMETABLE_CLASS_TYPES[ClassType],
Duration / 2,
Duration % 2 ? "30'" :
"");
@@ -1199,7 +1200,7 @@ static void TT_TimeTableDrawCell (unsigned Day,unsigned Hour,unsigned Column,uns
fprintf (Gbl.F.Out," selected=\"selected\"");
fprintf (Gbl.F.Out," value=\"%s\">%s",
TimeTableStrsClassTypeDB[CT],
- Txt_TIME_TABLE_CLASS_TYPES[CT]);
+ Txt_TIMETABLE_CLASS_TYPES[CT]);
}
fprintf (Gbl.F.Out,"");
if (HourType == TT_FREE_HOUR)
diff --git a/swad_timetable.h b/swad_timetable.h
index 8d599345..ea378363 100644
--- a/swad_timetable.h
+++ b/swad_timetable.h
@@ -30,22 +30,20 @@
#include "swad_bool.h"
/*****************************************************************************/
-/****************************** Public constants *****************************/
+/************************* Public constants and types ************************/
/*****************************************************************************/
#define TT_MAX_BYTES_PLACE 127
#define TT_MAX_BYTES_GROUP 255
-/*****************************************************************************/
-/******************************** Public types *******************************/
-/*****************************************************************************/
-
+#define TT_NUM_TIMETABLE_TYPES 3
typedef enum
{
- TT_COURSE_TIMETABLE,
- TT_MY_TIMETABLE,
- TT_TUTOR_TIMETABLE,
+ TT_COURSE_TIMETABLE = 0,
+ TT_MY_TIMETABLE = 1,
+ TT_TUTOR_TIMETABLE = 2,
} TT_TimeTableType_t;
+
typedef enum
{
TT_FREE_HOUR,
|