mirror of https://github.com/acanas/swad-core.git
Version19.169.6
This commit is contained in:
parent
4a01070ca3
commit
6641a97413
|
@ -497,7 +497,7 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
|
||||||
En OpenSWAD:
|
En OpenSWAD:
|
||||||
ps2pdf source.ps destination.pdf
|
ps2pdf source.ps destination.pdf
|
||||||
*/
|
*/
|
||||||
#define Log_PLATFORM_VERSION "SWAD 19.169.5 (2020-04-08)"
|
#define Log_PLATFORM_VERSION "SWAD 19.169.6 (2020-04-08)"
|
||||||
#define CSS_FILE "swad19.146.css"
|
#define CSS_FILE "swad19.146.css"
|
||||||
#define JS_FILE "swad19.153.js"
|
#define JS_FILE "swad19.153.js"
|
||||||
/*
|
/*
|
||||||
|
@ -548,6 +548,7 @@ Funci
|
||||||
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
|
// TODO: Oresti Baños: cambiar ojos por candados en descriptores para prohibir/permitir y dejar los ojos para poder elegir descriptores
|
||||||
// TODO: Integrar pull requests con traducciones del alemán del usuario eruedin en GitHub
|
// TODO: Integrar pull requests con traducciones del alemán del usuario eruedin en GitHub
|
||||||
|
|
||||||
|
Version 19.169.6: Apr 08, 2020 Mark some parameters as unused (functions from S to Z). (284836 lines)
|
||||||
Version 19.169.5: Apr 08, 2020 Mark some parameters as unused (functions from O to R). (284854 lines)
|
Version 19.169.5: Apr 08, 2020 Mark some parameters as unused (functions from O to R). (284854 lines)
|
||||||
Version 19.169.4: Apr 08, 2020 Mark some parameters as unused (functions from I to N). (284903 lines)
|
Version 19.169.4: Apr 08, 2020 Mark some parameters as unused (functions from I to N). (284903 lines)
|
||||||
Version 19.169.3: Apr 08, 2020 Mark some parameters as unused (functions from D to I). (284929 lines)
|
Version 19.169.3: Apr 08, 2020 Mark some parameters as unused (functions from D to I). (284929 lines)
|
||||||
|
|
16
swad_forum.c
16
swad_forum.c
|
@ -392,7 +392,7 @@ static void For_GetParamsForums (struct For_Forums *Forums);
|
||||||
static void For_SetForumType (struct For_Forums *Forums);
|
static void For_SetForumType (struct For_Forums *Forums);
|
||||||
static void For_RestrictAccess (const struct For_Forums *Forums);
|
static void For_RestrictAccess (const struct For_Forums *Forums);
|
||||||
|
|
||||||
static void For_WriteFormForumPst (const struct For_Forums *Forums,
|
static void For_WriteFormForumPst (struct For_Forums *Forums,
|
||||||
bool IsReply,const char *Subject);
|
bool IsReply,const char *Subject);
|
||||||
|
|
||||||
static void For_UpdateNumUsrsNotifiedByEMailAboutPost (long PstCod,unsigned NumUsrsToBeNotifiedByEMail);
|
static void For_UpdateNumUsrsNotifiedByEMailAboutPost (long PstCod,unsigned NumUsrsToBeNotifiedByEMail);
|
||||||
|
@ -1024,7 +1024,7 @@ static void For_ShowPostsOfAThread (struct For_Forums *Forums,
|
||||||
"%s: %s",
|
"%s: %s",
|
||||||
Txt_Thread,Thr.Subject);
|
Txt_Thread,Thr.Subject);
|
||||||
Box_BoxBegin (NULL,FrameTitle,
|
Box_BoxBegin (NULL,FrameTitle,
|
||||||
For_PutIconNewPost,&Gbl,
|
For_PutIconNewPost,Forums,
|
||||||
Hlp_MESSAGES_Forums_posts,Box_NOT_CLOSABLE);
|
Hlp_MESSAGES_Forums_posts,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Get posts of a thread from database *****/
|
/***** Get posts of a thread from database *****/
|
||||||
|
@ -1167,7 +1167,7 @@ static void For_PutIconNewPost (void *Forums)
|
||||||
if (Forums)
|
if (Forums)
|
||||||
Ico_PutContextualIconToAdd (For_ActionsSeePstFor[((struct For_Forums *) Forums)->ForumSelected.Type],
|
Ico_PutContextualIconToAdd (For_ActionsSeePstFor[((struct For_Forums *) Forums)->ForumSelected.Type],
|
||||||
For_NEW_POST_SECTION_ID,
|
For_NEW_POST_SECTION_ID,
|
||||||
For_PutAllHiddenParamsNewPost,&Gbl,
|
For_PutAllHiddenParamsNewPost,Forums,
|
||||||
Txt_New_post);
|
Txt_New_post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3847,7 +3847,7 @@ static void For_RestrictAccess (const struct For_Forums *Forums)
|
||||||
/********************** Show an area to write a message **********************/
|
/********************** Show an area to write a message **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void For_WriteFormForumPst (const struct For_Forums *Forums,
|
static void For_WriteFormForumPst (struct For_Forums *Forums,
|
||||||
bool IsReply,const char *Subject)
|
bool IsReply,const char *Subject)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_MESSAGES_Forums_new_post;
|
extern const char *Hlp_MESSAGES_Forums_new_post;
|
||||||
|
@ -3874,13 +3874,13 @@ static void For_WriteFormForumPst (const struct For_Forums *Forums,
|
||||||
{
|
{
|
||||||
Frm_StartFormAnchor (For_ActionsRecRepFor[Forums->ForumSelected.Type],
|
Frm_StartFormAnchor (For_ActionsRecRepFor[Forums->ForumSelected.Type],
|
||||||
For_FORUM_POSTS_SECTION_ID);
|
For_FORUM_POSTS_SECTION_ID);
|
||||||
For_PutAllHiddenParamsNewPost (&Gbl);
|
For_PutAllHiddenParamsNewPost (Forums);
|
||||||
}
|
}
|
||||||
else // Form to write the first post of a new thread
|
else // Form to write the first post of a new thread
|
||||||
{
|
{
|
||||||
Frm_StartFormAnchor (For_ActionsRecThrFor[Forums->ForumSelected.Type],
|
Frm_StartFormAnchor (For_ActionsRecThrFor[Forums->ForumSelected.Type],
|
||||||
For_FORUM_POSTS_SECTION_ID);
|
For_FORUM_POSTS_SECTION_ID);
|
||||||
For_PutAllHiddenParamsNewThread (&Gbl);
|
For_PutAllHiddenParamsNewThread (Forums);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Subject and content *****/
|
/***** Subject and content *****/
|
||||||
|
@ -4173,14 +4173,14 @@ void For_RequestRemoveThread (void)
|
||||||
if (Subject[0])
|
if (Subject[0])
|
||||||
Ale_ShowAlertAndButton (For_ActionsDelThrFor[Forums.ForumSelected.Type],
|
Ale_ShowAlertAndButton (For_ActionsDelThrFor[Forums.ForumSelected.Type],
|
||||||
For_FORUM_THREADS_SECTION_ID,NULL,
|
For_FORUM_THREADS_SECTION_ID,NULL,
|
||||||
For_PutAllHiddenParamsRemThread,&Gbl,
|
For_PutAllHiddenParamsRemThread,&Forums,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove_thread,
|
Btn_REMOVE_BUTTON,Txt_Remove_thread,
|
||||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread_X,
|
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread_X,
|
||||||
Subject);
|
Subject);
|
||||||
else
|
else
|
||||||
Ale_ShowAlertAndButton (For_ActionsDelThrFor[Forums.ForumSelected.Type],
|
Ale_ShowAlertAndButton (For_ActionsDelThrFor[Forums.ForumSelected.Type],
|
||||||
For_FORUM_THREADS_SECTION_ID,NULL,
|
For_FORUM_THREADS_SECTION_ID,NULL,
|
||||||
For_PutAllHiddenParamsRemThread,&Gbl,
|
For_PutAllHiddenParamsRemThread,&Forums,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove_thread,
|
Btn_REMOVE_BUTTON,Txt_Remove_thread,
|
||||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread);
|
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_entire_thread);
|
||||||
HTM_SECTION_End ();
|
HTM_SECTION_End ();
|
||||||
|
|
13
swad_game.c
13
swad_game.c
|
@ -1897,7 +1897,7 @@ static void Gam_ListGameQuestions (struct Gam_Games *Games,struct Gam_Game *Game
|
||||||
Games->GamCod = Game->GamCod;
|
Games->GamCod = Game->GamCod;
|
||||||
if (ICanEditQuestions)
|
if (ICanEditQuestions)
|
||||||
Box_BoxBegin (NULL,Txt_Questions,
|
Box_BoxBegin (NULL,Txt_Questions,
|
||||||
Gam_PutIconToAddNewQuestions,&Gbl,
|
Gam_PutIconToAddNewQuestions,Games,
|
||||||
Hlp_ASSESSMENT_Games_questions,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Games_questions,Box_NOT_CLOSABLE);
|
||||||
else
|
else
|
||||||
Box_BoxBegin (NULL,Txt_Questions,
|
Box_BoxBegin (NULL,Txt_Questions,
|
||||||
|
@ -2119,11 +2119,10 @@ static void Gam_PutIconToAddNewQuestions (void *Games)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Add_questions;
|
extern const char *Txt_Add_questions;
|
||||||
|
|
||||||
if (Games)
|
/***** Put form to create a new question *****/
|
||||||
/***** Put form to create a new question *****/
|
Ico_PutContextualIconToAdd (ActAddOneGamQst,NULL,
|
||||||
Ico_PutContextualIconToAdd (ActAddOneGamQst,NULL,
|
Gam_PutParams,Games,
|
||||||
Gam_PutParams,Games,
|
Txt_Add_questions);
|
||||||
Txt_Add_questions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -2289,7 +2288,7 @@ void Gam_RequestRemoveQst (void)
|
||||||
Games.GamCod = Game.GamCod;
|
Games.GamCod = Game.GamCod;
|
||||||
Games.QstInd = QstInd;
|
Games.QstInd = QstInd;
|
||||||
Ale_ShowAlertAndButton (ActRemGamQst,NULL,NULL,
|
Ale_ShowAlertAndButton (ActRemGamQst,NULL,NULL,
|
||||||
Gam_PutParamsOneQst,&Gbl,
|
Gam_PutParamsOneQst,&Games,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove_question,
|
Btn_REMOVE_BUTTON,Txt_Remove_question,
|
||||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_question_X,
|
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_question_X,
|
||||||
QstInd);
|
QstInd);
|
||||||
|
|
|
@ -520,55 +520,16 @@ struct Globals
|
||||||
} ZIP;
|
} ZIP;
|
||||||
} FileBrowser; // Struct used for a file browser
|
} FileBrowser; // Struct used for a file browser
|
||||||
struct Prj_Projects Prjs;
|
struct Prj_Projects Prjs;
|
||||||
struct
|
struct TL_Timeline Timeline;
|
||||||
{
|
|
||||||
Usr_Who_t Who;
|
|
||||||
long NotCod; // Used as parameter about social note to be edited, removed...
|
|
||||||
long PubCod; // Used as parameter about social publishing to be edited, removed...
|
|
||||||
} Timeline;
|
|
||||||
struct Msg_Messages Msg;
|
struct Msg_Messages Msg;
|
||||||
struct
|
struct TT_Timetable Timetable;
|
||||||
{
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
struct TT_Range Range;
|
|
||||||
unsigned HoursPerDay; // From start hour to end hour
|
|
||||||
unsigned SecondsPerInterval;
|
|
||||||
unsigned IntervalsPerHour;
|
|
||||||
unsigned IntervalsPerDay;
|
|
||||||
unsigned IntervalsBeforeStartHour;
|
|
||||||
} Config;
|
|
||||||
TT_TimeTableType_t Type;
|
|
||||||
TT_TimeTableView_t View;
|
|
||||||
unsigned Weekday;
|
|
||||||
unsigned Interval;
|
|
||||||
unsigned Column;
|
|
||||||
TT_ClassType_t ClassType;
|
|
||||||
unsigned DurationIntervals;
|
|
||||||
char Info[TT_MAX_BYTES_INFO + 1];
|
|
||||||
// char Place[TT_MAX_BYTES_PLACE + 1];
|
|
||||||
long GrpCod; // Group code (-1 if no group selected)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
bool PutIconEditCrsTT;
|
|
||||||
bool PutIconEditOfficeHours;
|
|
||||||
bool PutIconPrint;
|
|
||||||
} ContextualIcons;
|
|
||||||
} TimeTable;
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct DateTime DateIni; // TODO: Remove in future versions
|
struct DateTime DateIni; // TODO: Remove in future versions
|
||||||
struct DateTime DateEnd; // TODO: Remove in future versions
|
struct DateTime DateEnd; // TODO: Remove in future versions
|
||||||
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
time_t TimeUTC[Dat_NUM_START_END_TIME];
|
||||||
} DateRange;
|
} DateRange;
|
||||||
struct
|
struct Svy_Surveys Svys;
|
||||||
{
|
|
||||||
bool LstIsRead; // Is the list already read from database, or it needs to be read?
|
|
||||||
unsigned Num; // Number of surveys
|
|
||||||
long *LstSvyCods; // List of survey codes
|
|
||||||
Dat_StartEndTime_t SelectedOrder;
|
|
||||||
unsigned CurrentPage;
|
|
||||||
} Svys;
|
|
||||||
struct Sta_Stats Stat;
|
struct Sta_Stats Stat;
|
||||||
|
|
||||||
/* Cache */
|
/* Cache */
|
||||||
|
|
|
@ -117,7 +117,7 @@ void Ico_PutIconsToSelectIconSet (void)
|
||||||
char Icon[PATH_MAX + 1];
|
char Icon[PATH_MAX + 1];
|
||||||
|
|
||||||
Box_BoxBegin (NULL,Txt_Icons,
|
Box_BoxBegin (NULL,Txt_Icons,
|
||||||
Ico_PutIconsIconSet,&Gbl,
|
Ico_PutIconsIconSet,NULL,
|
||||||
Hlp_PROFILE_Settings_icons,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Settings_icons,Box_NOT_CLOSABLE);
|
||||||
Set_StartSettingsHead ();
|
Set_StartSettingsHead ();
|
||||||
Set_StartOneSettingSelector ();
|
Set_StartOneSettingSelector ();
|
||||||
|
|
|
@ -1906,7 +1906,7 @@ void Ntf_PutFormChangeNotifSentByEMail (void)
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Txt_Notifications,
|
Box_BoxBegin (NULL,Txt_Notifications,
|
||||||
Ntf_PutIconsNotif,&Gbl,
|
Ntf_PutIconsNotif,NULL,
|
||||||
Hlp_PROFILE_Settings_notifications,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Settings_notifications,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
|
|
|
@ -1304,8 +1304,8 @@ static void Rec_ShowRecordOneTchCrs (void)
|
||||||
if (ShowOfficeHours)
|
if (ShowOfficeHours)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"REC_RIGHT\"");
|
HTM_DIV_Begin ("class=\"REC_RIGHT\"");
|
||||||
Gbl.TimeTable.Type = TT_TUTORING_TIMETABLE;
|
Gbl.Timetable.Type = TT_TUTORING_TIMETABLE;
|
||||||
Box_BoxBegin (Width,Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type],
|
Box_BoxBegin (Width,Txt_TIMETABLE_TYPES[Gbl.Timetable.Type],
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
Hlp_USERS_Teachers_timetable,Box_NOT_CLOSABLE);
|
Hlp_USERS_Teachers_timetable,Box_NOT_CLOSABLE);
|
||||||
TT_ShowTimeTable (Gbl.Usrs.Other.UsrDat.UsrCod);
|
TT_ShowTimeTable (Gbl.Usrs.Other.UsrDat.UsrCod);
|
||||||
|
@ -1426,8 +1426,8 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView)
|
||||||
if (ShowOfficeHours)
|
if (ShowOfficeHours)
|
||||||
{
|
{
|
||||||
HTM_DIV_Begin ("class=\"REC_RIGHT\"");
|
HTM_DIV_Begin ("class=\"REC_RIGHT\"");
|
||||||
Gbl.TimeTable.Type = TT_TUTORING_TIMETABLE;
|
Gbl.Timetable.Type = TT_TUTORING_TIMETABLE;
|
||||||
Box_BoxBegin (Width,Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type],
|
Box_BoxBegin (Width,Txt_TIMETABLE_TYPES[Gbl.Timetable.Type],
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
Hlp_USERS_Teachers_timetable,Box_NOT_CLOSABLE);
|
Hlp_USERS_Teachers_timetable,Box_NOT_CLOSABLE);
|
||||||
TT_ShowTimeTable (UsrDat.UsrCod);
|
TT_ShowTimeTable (UsrDat.UsrCod);
|
||||||
|
|
|
@ -177,10 +177,10 @@ void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange)
|
||||||
/********************** Put hidden parameter scope ***************************/
|
/********************** Put hidden parameter scope ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Sco_PutParamCurrentScope (void *Args)
|
void Sco_PutParamCurrentScope (void *Scope)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Scope)
|
||||||
Sco_PutParamScope ("ScopeUsr",Gbl.Scope.Current);
|
Sco_PutParamScope ("ScopeUsr",*((Hie_Level_t *) Scope));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sco_PutParamScope (const char *ParamName,Hie_Level_t Scope)
|
void Sco_PutParamScope (const char *ParamName,Hie_Level_t Scope)
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange);
|
void Sco_PutSelectorScope (const char *ParamName,bool SendOnChange);
|
||||||
void Sco_PutParamCurrentScope (void *Args);
|
void Sco_PutParamCurrentScope (void *Scope);
|
||||||
void Sco_PutParamScope (const char *ParamName,Hie_Level_t Scope);
|
void Sco_PutParamScope (const char *ParamName,Hie_Level_t Scope);
|
||||||
void Sco_GetScope (const char *ParamName);
|
void Sco_GetScope (const char *ParamName);
|
||||||
void Sco_AdjustScope (void);
|
void Sco_AdjustScope (void);
|
||||||
|
|
232
swad_survey.c
232
swad_survey.c
|
@ -89,28 +89,25 @@ struct SurveyQuestion // Must be initialized to 0 before using it
|
||||||
/***************************** Private variables *****************************/
|
/***************************** Private variables *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
long Svy_CurrentSvyCod; // Used as parameter in contextual links
|
|
||||||
long Svy_CurrentQstCod; // Used as parameter in contextual links
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Private prototypes ****************************/
|
/***************************** Private prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_ListAllSurveys (void);
|
static void Svy_ListAllSurveys (void);
|
||||||
static bool Svy_CheckIfICanCreateSvy (void);
|
static bool Svy_CheckIfICanCreateSvy (void);
|
||||||
static void Svy_PutIconsListSurveys (void *Args);
|
static void Svy_PutIconsListSurveys (void *Surveys);
|
||||||
static void Svy_PutIconToCreateNewSvy (void);
|
static void Svy_PutIconToCreateNewSvy (struct Svy_Surveys *Surveys);
|
||||||
static void Svy_PutButtonToCreateNewSvy (void);
|
static void Svy_PutButtonToCreateNewSvy (void);
|
||||||
static void Svy_PutParamsToCreateNewSvy (void *Args);
|
static void Svy_PutParamsToCreateNewSvy (void *Surveys);
|
||||||
static void Svy_ParamsWhichGroupsToShow (void *Args);
|
static void Svy_ParamsWhichGroupsToShow (void *Surveys);
|
||||||
static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete);
|
static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete);
|
||||||
static void Svy_WriteAuthor (struct Survey *Svy);
|
static void Svy_WriteAuthor (struct Svy_Survey *Svy);
|
||||||
static void Svy_WriteStatus (struct Survey *Svy);
|
static void Svy_WriteStatus (struct Svy_Survey *Svy);
|
||||||
static void Svy_GetParamSvyOrder (void);
|
static void Svy_GetParamSvyOrder (void);
|
||||||
|
|
||||||
static void Svy_PutFormsToRemEditOneSvy (const struct Survey *Svy,
|
static void Svy_PutFormsToRemEditOneSvy (const struct Svy_Survey *Svy,
|
||||||
const char *Anchor);
|
const char *Anchor);
|
||||||
static void Svy_PutParams (void *Args);
|
static void Svy_PutParams (void *Surveys);
|
||||||
|
|
||||||
static void Svy_GetListSurveys (void);
|
static void Svy_GetListSurveys (void);
|
||||||
|
|
||||||
|
@ -123,17 +120,17 @@ static long Svy_GetParamSvyCod (void);
|
||||||
|
|
||||||
static void Svy_PutButtonToResetSurvey (void);
|
static void Svy_PutButtonToResetSurvey (void);
|
||||||
|
|
||||||
static bool Svy_CheckIfSimilarSurveyExists (struct Survey *Svy);
|
static bool Svy_CheckIfSimilarSurveyExists (struct Svy_Survey *Svy);
|
||||||
static void Svy_SetDefaultAndAllowedScope (struct Survey *Svy);
|
static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy);
|
||||||
static void Svy_ShowLstGrpsToEditSurvey (long SvyCod);
|
static void Svy_ShowLstGrpsToEditSurvey (long SvyCod);
|
||||||
static void Svy_UpdateNumUsrsNotifiedByEMailAboutSurvey (long SvyCod,
|
static void Svy_UpdateNumUsrsNotifiedByEMailAboutSurvey (long SvyCod,
|
||||||
unsigned NumUsrsToBeNotifiedByEMail);
|
unsigned NumUsrsToBeNotifiedByEMail);
|
||||||
static void Svy_CreateSurvey (struct Survey *Svy,const char *Txt);
|
static void Svy_CreateSurvey (struct Svy_Survey *Svy,const char *Txt);
|
||||||
static void Svy_UpdateSurvey (struct Survey *Svy,const char *Txt);
|
static void Svy_UpdateSurvey (struct Svy_Survey *Svy,const char *Txt);
|
||||||
static bool Svy_CheckIfSvyIsAssociatedToGrps (long SvyCod);
|
static bool Svy_CheckIfSvyIsAssociatedToGrps (long SvyCod);
|
||||||
static void Svy_RemoveAllTheGrpsAssociatedToAndSurvey (long SvyCod);
|
static void Svy_RemoveAllTheGrpsAssociatedToAndSurvey (long SvyCod);
|
||||||
static void Svy_CreateGrps (long SvyCod);
|
static void Svy_CreateGrps (long SvyCod);
|
||||||
static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Survey *Svy);
|
static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy);
|
||||||
static bool Svy_CheckIfICanDoThisSurveyBasedOnGrps (long SvyCod);
|
static bool Svy_CheckIfICanDoThisSurveyBasedOnGrps (long SvyCod);
|
||||||
|
|
||||||
static unsigned Svy_GetNumQstsSvy (long SvyCod);
|
static unsigned Svy_GetNumQstsSvy (long SvyCod);
|
||||||
|
@ -152,18 +149,18 @@ static void Svy_FreeTextChoiceAnswer (struct SurveyQuestion *SvyQst,unsigned Num
|
||||||
|
|
||||||
static unsigned Svy_GetQstIndFromQstCod (long QstCod);
|
static unsigned Svy_GetQstIndFromQstCod (long QstCod);
|
||||||
static unsigned Svy_GetNextQuestionIndexInSvy (long SvyCod);
|
static unsigned Svy_GetNextQuestionIndexInSvy (long SvyCod);
|
||||||
static void Svy_ListSvyQuestions (struct Survey *Svy);
|
static void Svy_ListSvyQuestions (struct Svy_Survey *Svy);
|
||||||
static void Svy_PutParamsToEditQuestion (void *Args);
|
static void Svy_PutParamsToEditQuestion (void *Surveys);
|
||||||
static void Svy_PutIconToAddNewQuestion (void *Args);
|
static void Svy_PutIconToAddNewQuestion (void *Surveys);
|
||||||
static void Svy_PutButtonToCreateNewQuestion (void);
|
static void Svy_PutButtonToCreateNewQuestion (void);
|
||||||
static void Svy_WriteQstStem (const char *Stem);
|
static void Svy_WriteQstStem (const char *Stem);
|
||||||
static void Svy_WriteAnswersOfAQst (struct Survey *Svy,
|
static void Svy_WriteAnswersOfAQst (struct Svy_Survey *Svy,
|
||||||
struct SurveyQuestion *SvyQst,
|
struct SurveyQuestion *SvyQst,
|
||||||
bool PutFormAnswerSurvey);
|
bool PutFormAnswerSurvey);
|
||||||
static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs);
|
static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs);
|
||||||
|
|
||||||
static void Svy_PutIconToRemoveOneQst (void *Args);
|
static void Svy_PutIconToRemoveOneQst (void *Surveys);
|
||||||
static void Svy_PutParamsRemoveOneQst (void *Args);
|
static void Svy_PutParamsRemoveOneQst (void *Surveys);
|
||||||
|
|
||||||
static void Svy_ReceiveAndStoreUserAnswersToASurvey (long SvyCod);
|
static void Svy_ReceiveAndStoreUserAnswersToASurvey (long SvyCod);
|
||||||
static void Svy_IncreaseAnswerInDB (long QstCod,unsigned AnsInd);
|
static void Svy_IncreaseAnswerInDB (long QstCod,unsigned AnsInd);
|
||||||
|
@ -219,7 +216,7 @@ static void Svy_ListAllSurveys (void)
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin ("100%",Txt_Surveys,
|
Box_BoxBegin ("100%",Txt_Surveys,
|
||||||
Svy_PutIconsListSurveys,&Gbl,
|
Svy_PutIconsListSurveys,&Gbl.Svys,
|
||||||
Hlp_ASSESSMENT_Surveys,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Surveys,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Select whether show only my groups or all groups *****/
|
/***** Select whether show only my groups or all groups *****/
|
||||||
|
@ -227,7 +224,7 @@ static void Svy_ListAllSurveys (void)
|
||||||
{
|
{
|
||||||
Set_StartSettingsHead ();
|
Set_StartSettingsHead ();
|
||||||
Grp_ShowFormToSelWhichGrps (ActSeeAllSvy,
|
Grp_ShowFormToSelWhichGrps (ActSeeAllSvy,
|
||||||
Svy_ParamsWhichGroupsToShow,&Gbl);
|
Svy_ParamsWhichGroupsToShow,&Gbl.Svys);
|
||||||
Set_EndSettingsHead ();
|
Set_EndSettingsHead ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,29 +325,26 @@ static bool Svy_CheckIfICanCreateSvy (void)
|
||||||
/***************** Put contextual icons in list of surveys *******************/
|
/***************** Put contextual icons in list of surveys *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutIconsListSurveys (void *Args)
|
static void Svy_PutIconsListSurveys (void *Surveys)
|
||||||
{
|
{
|
||||||
if (Args)
|
/***** Put icon to create a new survey *****/
|
||||||
{
|
if (Svy_CheckIfICanCreateSvy ())
|
||||||
/***** Put icon to create a new survey *****/
|
Svy_PutIconToCreateNewSvy ((struct Svy_Surveys *) Surveys);
|
||||||
if (Svy_CheckIfICanCreateSvy ())
|
|
||||||
Svy_PutIconToCreateNewSvy ();
|
|
||||||
|
|
||||||
/***** Put icon to show a figure *****/
|
/***** Put icon to show a figure *****/
|
||||||
Fig_PutIconToShowFigure (Fig_SURVEYS);
|
Fig_PutIconToShowFigure (Fig_SURVEYS);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Put icon to create a new survey **********************/
|
/********************** Put icon to create a new survey **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutIconToCreateNewSvy (void)
|
static void Svy_PutIconToCreateNewSvy (struct Svy_Surveys *Surveys)
|
||||||
{
|
{
|
||||||
extern const char *Txt_New_survey;
|
extern const char *Txt_New_survey;
|
||||||
|
|
||||||
Ico_PutContextualIconToAdd (ActFrmNewSvy,NULL,
|
Ico_PutContextualIconToAdd (ActFrmNewSvy,NULL,
|
||||||
Svy_PutParamsToCreateNewSvy,&Gbl,
|
Svy_PutParamsToCreateNewSvy,Surveys,
|
||||||
Txt_New_survey);
|
Txt_New_survey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +357,7 @@ static void Svy_PutButtonToCreateNewSvy (void)
|
||||||
extern const char *Txt_New_survey;
|
extern const char *Txt_New_survey;
|
||||||
|
|
||||||
Frm_StartForm (ActFrmNewSvy);
|
Frm_StartForm (ActFrmNewSvy);
|
||||||
Svy_PutParamsToCreateNewSvy (&Gbl);
|
Svy_PutParamsToCreateNewSvy (&Gbl.Svys);
|
||||||
Btn_PutConfirmButton (Txt_New_survey);
|
Btn_PutConfirmButton (Txt_New_survey);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -372,16 +366,16 @@ static void Svy_PutButtonToCreateNewSvy (void)
|
||||||
/******************* Put parameters to create a new survey *******************/
|
/******************* Put parameters to create a new survey *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutParamsToCreateNewSvy (void *Args)
|
static void Svy_PutParamsToCreateNewSvy (void *Surveys)
|
||||||
{
|
{
|
||||||
Grp_WhichGroups_t WhichGroups;
|
Grp_WhichGroups_t WhichGroups;
|
||||||
|
|
||||||
if (Args)
|
if (Surveys)
|
||||||
{
|
{
|
||||||
Svy_PutHiddenParamSvyOrder ();
|
Svy_PutHiddenParamSvyOrder (((struct Svy_Surveys *) Surveys)->SelectedOrder);
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
Grp_PutParamWhichGroups (&WhichGroups);
|
Grp_PutParamWhichGroups (&WhichGroups);
|
||||||
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
Pag_PutHiddenParamPagNum (Pag_SURVEYS,((struct Svy_Surveys *) Surveys)->CurrentPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,12 +383,12 @@ static void Svy_PutParamsToCreateNewSvy (void *Args)
|
||||||
/**************** Put params to select which groups to show ******************/
|
/**************** Put params to select which groups to show ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_ParamsWhichGroupsToShow (void *Args)
|
static void Svy_ParamsWhichGroupsToShow (void *Surveys)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Surveys)
|
||||||
{
|
{
|
||||||
Svy_PutHiddenParamSvyOrder ();
|
Svy_PutHiddenParamSvyOrder (((struct Svy_Surveys *) Surveys)->SelectedOrder);
|
||||||
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
Pag_PutHiddenParamPagNum (Pag_SURVEYS,((struct Svy_Surveys *) Surveys)->CurrentPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +398,7 @@ static void Svy_ParamsWhichGroupsToShow (void *Args)
|
||||||
|
|
||||||
void Svy_SeeOneSurvey (void)
|
void Svy_SeeOneSurvey (void)
|
||||||
{
|
{
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -443,7 +437,7 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete)
|
||||||
static unsigned UniqueId = 0;
|
static unsigned UniqueId = 0;
|
||||||
char *Id;
|
char *Id;
|
||||||
Grp_WhichGroups_t WhichGroups;
|
Grp_WhichGroups_t WhichGroups;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
|
@ -532,7 +526,7 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete)
|
||||||
HTM_ARTICLE_Begin (Anchor);
|
HTM_ARTICLE_Begin (Anchor);
|
||||||
Frm_StartForm (ActSeeSvy);
|
Frm_StartForm (ActSeeSvy);
|
||||||
Svy_PutParamSvyCod (SvyCod);
|
Svy_PutParamSvyCod (SvyCod);
|
||||||
Svy_PutHiddenParamSvyOrder ();
|
Svy_PutHiddenParamSvyOrder (Gbl.Svys.SelectedOrder);
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
Grp_PutParamWhichGroups (&WhichGroups);
|
Grp_PutParamWhichGroups (&WhichGroups);
|
||||||
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
||||||
|
@ -574,7 +568,7 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete)
|
||||||
|
|
||||||
Frm_StartForm (ActSeeSvy);
|
Frm_StartForm (ActSeeSvy);
|
||||||
Svy_PutParamSvyCod (Svy.SvyCod);
|
Svy_PutParamSvyCod (Svy.SvyCod);
|
||||||
Svy_PutHiddenParamSvyOrder ();
|
Svy_PutHiddenParamSvyOrder (Gbl.Svys.SelectedOrder);
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
Grp_PutParamWhichGroups (&WhichGroups);
|
Grp_PutParamWhichGroups (&WhichGroups);
|
||||||
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
||||||
|
@ -590,7 +584,7 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete)
|
||||||
|
|
||||||
Frm_StartForm (ActSeeSvy);
|
Frm_StartForm (ActSeeSvy);
|
||||||
Svy_PutParamSvyCod (Svy.SvyCod);
|
Svy_PutParamSvyCod (Svy.SvyCod);
|
||||||
Svy_PutHiddenParamSvyOrder ();
|
Svy_PutHiddenParamSvyOrder (Gbl.Svys.SelectedOrder);
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
Grp_PutParamWhichGroups (&WhichGroups);
|
Grp_PutParamWhichGroups (&WhichGroups);
|
||||||
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
||||||
|
@ -716,7 +710,7 @@ static void Svy_ShowOneSurvey (long SvyCod,bool ShowOnlyThisSvyComplete)
|
||||||
/*********************** Write the author of a survey ************************/
|
/*********************** Write the author of a survey ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_WriteAuthor (struct Survey *Svy)
|
static void Svy_WriteAuthor (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
Usr_WriteAuthor1Line (Svy->UsrCod,!Svy->Status.Visible);
|
Usr_WriteAuthor1Line (Svy->UsrCod,!Svy->Status.Visible);
|
||||||
}
|
}
|
||||||
|
@ -725,7 +719,7 @@ static void Svy_WriteAuthor (struct Survey *Svy)
|
||||||
/************************ Write status of a survey ***************************/
|
/************************ Write status of a survey ***************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_WriteStatus (struct Survey *Svy)
|
static void Svy_WriteStatus (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Hidden_survey;
|
extern const char *Txt_Hidden_survey;
|
||||||
extern const char *Txt_Visible_survey;
|
extern const char *Txt_Visible_survey;
|
||||||
|
@ -843,61 +837,61 @@ static void Svy_GetParamSvyOrder (void)
|
||||||
/***** Put a hidden parameter with the type of order in list of surveys ******/
|
/***** Put a hidden parameter with the type of order in list of surveys ******/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Svy_PutHiddenParamSvyOrder (void)
|
void Svy_PutHiddenParamSvyOrder (Dat_StartEndTime_t SelectedOrder)
|
||||||
{
|
{
|
||||||
Dat_PutHiddenParamOrder (Gbl.Svys.SelectedOrder);
|
Dat_PutHiddenParamOrder (SelectedOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/******************* Put a link (form) to edit one survey ********************/
|
/******************* Put a link (form) to edit one survey ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutFormsToRemEditOneSvy (const struct Survey *Svy,
|
static void Svy_PutFormsToRemEditOneSvy (const struct Svy_Survey *Svy,
|
||||||
const char *Anchor)
|
const char *Anchor)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Reset;
|
extern const char *Txt_Reset;
|
||||||
|
|
||||||
Svy_CurrentSvyCod = Svy->SvyCod; // Used as parameters in contextual links
|
Gbl.Svys.SvyCod = Svy->SvyCod; // Used as parameters in contextual links
|
||||||
|
|
||||||
/***** Put form to remove survey *****/
|
/***** Put form to remove survey *****/
|
||||||
Ico_PutContextualIconToRemove (ActReqRemSvy,
|
Ico_PutContextualIconToRemove (ActReqRemSvy,
|
||||||
Svy_PutParams,&Gbl);
|
Svy_PutParams,&Gbl.Svys);
|
||||||
|
|
||||||
/***** Put form to reset survey *****/
|
/***** Put form to reset survey *****/
|
||||||
Lay_PutContextualLinkOnlyIcon (ActReqRstSvy,NULL,
|
Lay_PutContextualLinkOnlyIcon (ActReqRstSvy,NULL,
|
||||||
Svy_PutParams,&Gbl,
|
Svy_PutParams,&Gbl.Svys,
|
||||||
"recycle.svg",
|
"recycle.svg",
|
||||||
Txt_Reset);
|
Txt_Reset);
|
||||||
|
|
||||||
/***** Put form to hide/show survey *****/
|
/***** Put form to hide/show survey *****/
|
||||||
if (Svy->Status.Visible)
|
if (Svy->Status.Visible)
|
||||||
Ico_PutContextualIconToHide (ActHidSvy,Anchor,
|
Ico_PutContextualIconToHide (ActHidSvy,Anchor,
|
||||||
Svy_PutParams,&Gbl);
|
Svy_PutParams,&Gbl.Svys);
|
||||||
else
|
else
|
||||||
Ico_PutContextualIconToUnhide (ActShoSvy,Anchor,
|
Ico_PutContextualIconToUnhide (ActShoSvy,Anchor,
|
||||||
Svy_PutParams,&Gbl);
|
Svy_PutParams,&Gbl.Svys);
|
||||||
|
|
||||||
/***** Put form to edit survey *****/
|
/***** Put form to edit survey *****/
|
||||||
Ico_PutContextualIconToEdit (ActEdiOneSvy,NULL,
|
Ico_PutContextualIconToEdit (ActEdiOneSvy,NULL,
|
||||||
Svy_PutParams,&Gbl);
|
Svy_PutParams,&Gbl.Svys);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************** Params used to edit a survey *************************/
|
/********************** Params used to edit a survey *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutParams (void *Args)
|
static void Svy_PutParams (void *Surveys)
|
||||||
{
|
{
|
||||||
Grp_WhichGroups_t WhichGroups;
|
Grp_WhichGroups_t WhichGroups;
|
||||||
|
|
||||||
if (Args)
|
if (Surveys)
|
||||||
{
|
{
|
||||||
if (Svy_CurrentSvyCod > 0)
|
if (Gbl.Svys.SvyCod > 0)
|
||||||
Svy_PutParamSvyCod (Svy_CurrentSvyCod);
|
Svy_PutParamSvyCod (Gbl.Svys.SvyCod);
|
||||||
Dat_PutHiddenParamOrder (Gbl.Svys.SelectedOrder);
|
Dat_PutHiddenParamOrder (((struct Svy_Surveys *) Surveys)->SelectedOrder);
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
Grp_PutParamWhichGroups (&WhichGroups);
|
Grp_PutParamWhichGroups (&WhichGroups);
|
||||||
Pag_PutHiddenParamPagNum (Pag_SURVEYS,Gbl.Svys.CurrentPage);
|
Pag_PutHiddenParamPagNum (Pag_SURVEYS,((struct Svy_Surveys *) Surveys)->CurrentPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1226,7 +1220,7 @@ static void Svy_SetAllowedAndHiddenScopes (unsigned *ScopesAllowed,
|
||||||
/********************* Get survey data using its code ************************/
|
/********************* Get survey data using its code ************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Svy_GetDataOfSurveyByCod (struct Survey *Svy)
|
void Svy_GetDataOfSurveyByCod (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
MYSQL_RES *mysql_res;
|
MYSQL_RES *mysql_res;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
|
@ -1554,7 +1548,7 @@ void Svy_AskRemSurvey (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Do_you_really_want_to_remove_the_survey_X;
|
extern const char *Txt_Do_you_really_want_to_remove_the_survey_X;
|
||||||
extern const char *Txt_Remove_survey;
|
extern const char *Txt_Remove_survey;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -1571,9 +1565,9 @@ void Svy_AskRemSurvey (void)
|
||||||
Lay_NoPermissionExit ();
|
Lay_NoPermissionExit ();
|
||||||
|
|
||||||
/***** Show question and button to remove survey *****/
|
/***** Show question and button to remove survey *****/
|
||||||
Svy_CurrentSvyCod = Svy.SvyCod;
|
Gbl.Svys.SvyCod = Svy.SvyCod;
|
||||||
Ale_ShowAlertAndButton (ActRemSvy,NULL,NULL,
|
Ale_ShowAlertAndButton (ActRemSvy,NULL,NULL,
|
||||||
Svy_PutParams,&Gbl,
|
Svy_PutParams,&Gbl.Svys,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove_survey,
|
Btn_REMOVE_BUTTON,Txt_Remove_survey,
|
||||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_survey_X,
|
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_survey_X,
|
||||||
Svy.Title);
|
Svy.Title);
|
||||||
|
@ -1589,7 +1583,7 @@ void Svy_AskRemSurvey (void)
|
||||||
void Svy_RemoveSurvey (void)
|
void Svy_RemoveSurvey (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Survey_X_removed;
|
extern const char *Txt_Survey_X_removed;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -1649,7 +1643,7 @@ void Svy_RemoveSurvey (void)
|
||||||
void Svy_AskResetSurvey (void)
|
void Svy_AskResetSurvey (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Do_you_really_want_to_reset_the_survey_X;
|
extern const char *Txt_Do_you_really_want_to_reset_the_survey_X;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -1670,7 +1664,7 @@ void Svy_AskResetSurvey (void)
|
||||||
Svy.Title);
|
Svy.Title);
|
||||||
|
|
||||||
/***** Button of confirmation of reset *****/
|
/***** Button of confirmation of reset *****/
|
||||||
Svy_CurrentSvyCod = Svy.SvyCod;
|
Gbl.Svys.SvyCod = Svy.SvyCod;
|
||||||
Svy_PutButtonToResetSurvey ();
|
Svy_PutButtonToResetSurvey ();
|
||||||
|
|
||||||
/***** Show surveys again *****/
|
/***** Show surveys again *****/
|
||||||
|
@ -1686,7 +1680,7 @@ static void Svy_PutButtonToResetSurvey (void)
|
||||||
extern const char *Txt_Reset_survey;
|
extern const char *Txt_Reset_survey;
|
||||||
|
|
||||||
Frm_StartForm (ActRstSvy);
|
Frm_StartForm (ActRstSvy);
|
||||||
Svy_PutParams (&Gbl);
|
Svy_PutParams (&Gbl.Svys);
|
||||||
Btn_PutRemoveButton (Txt_Reset_survey);
|
Btn_PutRemoveButton (Txt_Reset_survey);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -1698,7 +1692,7 @@ static void Svy_PutButtonToResetSurvey (void)
|
||||||
void Svy_ResetSurvey (void)
|
void Svy_ResetSurvey (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Survey_X_reset;
|
extern const char *Txt_Survey_X_reset;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -1740,7 +1734,7 @@ void Svy_ResetSurvey (void)
|
||||||
|
|
||||||
void Svy_HideSurvey (void)
|
void Svy_HideSurvey (void)
|
||||||
{
|
{
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -1771,7 +1765,7 @@ void Svy_HideSurvey (void)
|
||||||
|
|
||||||
void Svy_UnhideSurvey (void)
|
void Svy_UnhideSurvey (void)
|
||||||
{
|
{
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get parameters *****/
|
/***** Get parameters *****/
|
||||||
Svy_GetParamSvyOrder ();
|
Svy_GetParamSvyOrder ();
|
||||||
|
@ -1800,7 +1794,7 @@ void Svy_UnhideSurvey (void)
|
||||||
/******************* Check if the title of a survey exists *******************/
|
/******************* Check if the title of a survey exists *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static bool Svy_CheckIfSimilarSurveyExists (struct Survey *Svy)
|
static bool Svy_CheckIfSimilarSurveyExists (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
/***** Get number of surveys with a field value from database *****/
|
/***** Get number of surveys with a field value from database *****/
|
||||||
return (DB_QueryCOUNT ("can not get similar surveys",
|
return (DB_QueryCOUNT ("can not get similar surveys",
|
||||||
|
@ -1828,7 +1822,7 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
extern const char *Txt_Users;
|
extern const char *Txt_Users;
|
||||||
extern const char *Txt_Create_survey;
|
extern const char *Txt_Create_survey;
|
||||||
extern const char *Txt_Save_changes;
|
extern const char *Txt_Save_changes;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
bool ItsANewSurvey;
|
bool ItsANewSurvey;
|
||||||
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
char Txt[Cns_MAX_BYTES_TEXT + 1];
|
||||||
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
static const Dat_SetHMS SetHMS[Dat_NUM_START_END_TIME] =
|
||||||
|
@ -1882,10 +1876,10 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Begin form *****/
|
/***** Begin form *****/
|
||||||
Svy_CurrentSvyCod = Svy.SvyCod;
|
Gbl.Svys.SvyCod = Svy.SvyCod;
|
||||||
Frm_StartForm (ItsANewSurvey ? ActNewSvy :
|
Frm_StartForm (ItsANewSurvey ? ActNewSvy :
|
||||||
ActChgSvy);
|
ActChgSvy);
|
||||||
Svy_PutParams (&Gbl);
|
Svy_PutParams (&Gbl.Svys);
|
||||||
|
|
||||||
/***** Begin box and table *****/
|
/***** Begin box and table *****/
|
||||||
if (ItsANewSurvey)
|
if (ItsANewSurvey)
|
||||||
|
@ -1992,7 +1986,7 @@ void Svy_RequestCreatOrEditSvy (void)
|
||||||
/****** Set default and allowed scopes depending on logged user's role *******/
|
/****** Set default and allowed scopes depending on logged user's role *******/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_SetDefaultAndAllowedScope (struct Survey *Svy)
|
static void Svy_SetDefaultAndAllowedScope (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
bool ICanEdit = false;
|
bool ICanEdit = false;
|
||||||
|
|
||||||
|
@ -2136,8 +2130,8 @@ void Svy_RecFormSurvey (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Already_existed_a_survey_with_the_title_X;
|
extern const char *Txt_Already_existed_a_survey_with_the_title_X;
|
||||||
extern const char *Txt_You_must_specify_the_title_of_the_survey;
|
extern const char *Txt_You_must_specify_the_title_of_the_survey;
|
||||||
struct Survey OldSvy;
|
struct Svy_Survey OldSvy;
|
||||||
struct Survey NewSvy;
|
struct Svy_Survey NewSvy;
|
||||||
bool ItsANewSurvey;
|
bool ItsANewSurvey;
|
||||||
bool NewSurveyIsCorrect = true;
|
bool NewSurveyIsCorrect = true;
|
||||||
unsigned NumUsrsToBeNotifiedByEMail;
|
unsigned NumUsrsToBeNotifiedByEMail;
|
||||||
|
@ -2293,7 +2287,7 @@ static void Svy_UpdateNumUsrsNotifiedByEMailAboutSurvey (long SvyCod,
|
||||||
/*************************** Create a new survey *****************************/
|
/*************************** Create a new survey *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_CreateSurvey (struct Survey *Svy,const char *Txt)
|
static void Svy_CreateSurvey (struct Svy_Survey *Svy,const char *Txt)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Created_new_survey_X;
|
extern const char *Txt_Created_new_survey_X;
|
||||||
|
|
||||||
|
@ -2327,7 +2321,7 @@ static void Svy_CreateSurvey (struct Survey *Svy,const char *Txt)
|
||||||
/************************* Update an existing survey *************************/
|
/************************* Update an existing survey *************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_UpdateSurvey (struct Survey *Svy,const char *Txt)
|
static void Svy_UpdateSurvey (struct Svy_Survey *Svy,const char *Txt)
|
||||||
{
|
{
|
||||||
extern const char *Txt_The_survey_has_been_modified;
|
extern const char *Txt_The_survey_has_been_modified;
|
||||||
|
|
||||||
|
@ -2450,7 +2444,7 @@ static void Svy_CreateGrps (long SvyCod)
|
||||||
/************ Get and write the names of the groups of a survey **************/
|
/************ Get and write the names of the groups of a survey **************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Survey *Svy)
|
static void Svy_GetAndWriteNamesOfGrpsAssociatedToSvy (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Group;
|
extern const char *Txt_Group;
|
||||||
extern const char *Txt_Groups;
|
extern const char *Txt_Groups;
|
||||||
|
@ -2705,13 +2699,13 @@ static void Svy_ShowFormEditOneQst (long SvyCod,struct SurveyQuestion *SvyQst,
|
||||||
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
if (SvyQst->QstCod > 0) // If the question already has assigned a code
|
||||||
{
|
{
|
||||||
/* Parameters for contextual icon */
|
/* Parameters for contextual icon */
|
||||||
Svy_CurrentSvyCod = SvyCod;
|
Gbl.Svys.SvyCod = SvyCod;
|
||||||
Svy_CurrentQstCod = SvyQst->QstCod;
|
Gbl.Svys.QstCod = SvyQst->QstCod;
|
||||||
|
|
||||||
if (asprintf (&Title,"%s %u",Txt_Question,SvyQst->QstInd + 1) < 0) // Question index may be 0, 1, 2, 3,...
|
if (asprintf (&Title,"%s %u",Txt_Question,SvyQst->QstInd + 1) < 0) // Question index may be 0, 1, 2, 3,...
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
Box_BoxBegin (NULL,Title,
|
Box_BoxBegin (NULL,Title,
|
||||||
Svy_PutIconToRemoveOneQst,&Gbl,
|
Svy_PutIconToRemoveOneQst,&Gbl.Svys,
|
||||||
NULL,Box_NOT_CLOSABLE);
|
NULL,Box_NOT_CLOSABLE);
|
||||||
free (Title);
|
free (Title);
|
||||||
}
|
}
|
||||||
|
@ -3201,7 +3195,7 @@ static unsigned Svy_GetNextQuestionIndexInSvy (long SvyCod)
|
||||||
/************************ List the questions of a survey *********************/
|
/************************ List the questions of a survey *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_ListSvyQuestions (struct Survey *Svy)
|
static void Svy_ListSvyQuestions (struct Svy_Survey *Svy)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Surveys_questions;
|
extern const char *Hlp_ASSESSMENT_Surveys_questions;
|
||||||
extern const char *Txt_Questions;
|
extern const char *Txt_Questions;
|
||||||
|
@ -3229,10 +3223,10 @@ static void Svy_ListSvyQuestions (struct Survey *Svy)
|
||||||
Svy->SvyCod);
|
Svy->SvyCod);
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Svy_CurrentSvyCod = Svy->SvyCod;
|
Gbl.Svys.SvyCod = Svy->SvyCod;
|
||||||
if (Svy->Status.ICanEdit)
|
if (Svy->Status.ICanEdit)
|
||||||
Box_BoxBegin (NULL,Txt_Questions,
|
Box_BoxBegin (NULL,Txt_Questions,
|
||||||
Svy_PutIconToAddNewQuestion,&Gbl,
|
Svy_PutIconToAddNewQuestion,&Gbl.Svys,
|
||||||
Hlp_ASSESSMENT_Surveys_questions,Box_NOT_CLOSABLE);
|
Hlp_ASSESSMENT_Surveys_questions,Box_NOT_CLOSABLE);
|
||||||
else
|
else
|
||||||
Box_BoxBegin (NULL,Txt_Questions,
|
Box_BoxBegin (NULL,Txt_Questions,
|
||||||
|
@ -3290,10 +3284,10 @@ static void Svy_ListSvyQuestions (struct Survey *Svy)
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
/* Write icon to edit the question */
|
/* Write icon to edit the question */
|
||||||
Svy_CurrentSvyCod = Svy->SvyCod;
|
Gbl.Svys.SvyCod = Svy->SvyCod;
|
||||||
Svy_CurrentQstCod = SvyQst.QstCod;
|
Gbl.Svys.QstCod = SvyQst.QstCod;
|
||||||
Ico_PutContextualIconToEdit (ActEdiOneSvyQst,NULL,
|
Ico_PutContextualIconToEdit (ActEdiOneSvyQst,NULL,
|
||||||
Svy_PutParamsToEditQuestion,&Gbl);
|
Svy_PutParamsToEditQuestion,&Gbl.Svys);
|
||||||
|
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
}
|
}
|
||||||
|
@ -3351,12 +3345,12 @@ static void Svy_ListSvyQuestions (struct Survey *Svy)
|
||||||
/******************** Put parameters to edit a question **********************/
|
/******************** Put parameters to edit a question **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutParamsToEditQuestion (void *Args)
|
static void Svy_PutParamsToEditQuestion (void *Surveys)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Surveys)
|
||||||
{
|
{
|
||||||
Svy_PutParamSvyCod (Svy_CurrentSvyCod);
|
Svy_PutParamSvyCod (((struct Svy_Surveys *) Surveys)->SvyCod);
|
||||||
Svy_PutParamQstCod (Svy_CurrentQstCod);
|
Svy_PutParamQstCod (((struct Svy_Surveys *) Surveys)->QstCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3364,15 +3358,14 @@ static void Svy_PutParamsToEditQuestion (void *Args)
|
||||||
/***************** Put icon to add a new question to survey ******************/
|
/***************** Put icon to add a new question to survey ******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutIconToAddNewQuestion (void *Args)
|
static void Svy_PutIconToAddNewQuestion (void *Surveys)
|
||||||
{
|
{
|
||||||
extern const char *Txt_New_question;
|
extern const char *Txt_New_question;
|
||||||
|
|
||||||
if (Args)
|
/***** Put form to create a new question *****/
|
||||||
/***** Put form to create a new question *****/
|
Ico_PutContextualIconToAdd (ActEdiOneSvyQst,NULL,
|
||||||
Ico_PutContextualIconToAdd (ActEdiOneSvyQst,NULL,
|
Svy_PutParams,Surveys,
|
||||||
Svy_PutParams,&Gbl,
|
Txt_New_question);
|
||||||
Txt_New_question);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -3384,7 +3377,7 @@ static void Svy_PutButtonToCreateNewQuestion (void)
|
||||||
extern const char *Txt_New_question;
|
extern const char *Txt_New_question;
|
||||||
|
|
||||||
Frm_StartForm (ActEdiOneSvyQst);
|
Frm_StartForm (ActEdiOneSvyQst);
|
||||||
Svy_PutParams (&Gbl);
|
Svy_PutParams (&Gbl.Svys);
|
||||||
Btn_PutConfirmButton (Txt_New_question);
|
Btn_PutConfirmButton (Txt_New_question);
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -3418,7 +3411,7 @@ static void Svy_WriteQstStem (const char *Stem)
|
||||||
/************** Get and write the answers of a survey question ***************/
|
/************** Get and write the answers of a survey question ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_WriteAnswersOfAQst (struct Survey *Svy,
|
static void Svy_WriteAnswersOfAQst (struct Svy_Survey *Svy,
|
||||||
struct SurveyQuestion *SvyQst,
|
struct SurveyQuestion *SvyQst,
|
||||||
bool PutFormAnswerSurvey)
|
bool PutFormAnswerSurvey)
|
||||||
{
|
{
|
||||||
|
@ -3572,23 +3565,22 @@ static void Svy_DrawBarNumUsrs (unsigned NumUsrs,unsigned MaxUsrs)
|
||||||
/********************* Put icon to remove one question ***********************/
|
/********************* Put icon to remove one question ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutIconToRemoveOneQst (void *Args)
|
static void Svy_PutIconToRemoveOneQst (void *Surveys)
|
||||||
{
|
{
|
||||||
if (Args)
|
Ico_PutContextualIconToRemove (ActReqRemSvyQst,
|
||||||
Ico_PutContextualIconToRemove (ActReqRemSvyQst,
|
Svy_PutParamsRemoveOneQst,Surveys);
|
||||||
Svy_PutParamsRemoveOneQst,Args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************** Put parameter to remove one question *********************/
|
/****************** Put parameter to remove one question *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Svy_PutParamsRemoveOneQst (void *Args)
|
static void Svy_PutParamsRemoveOneQst (void *Surveys)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Surveys)
|
||||||
{
|
{
|
||||||
Svy_PutParamSvyCod (Svy_CurrentSvyCod);
|
Svy_PutParamSvyCod (((struct Svy_Surveys *) Surveys)->SvyCod);
|
||||||
Svy_PutParamQstCod (Svy_CurrentQstCod);
|
Svy_PutParamQstCod (((struct Svy_Surveys *) Surveys)->QstCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3619,10 +3611,10 @@ void Svy_RequestRemoveQst (void)
|
||||||
SvyQst.QstInd = Svy_GetQstIndFromQstCod (SvyQst.QstCod);
|
SvyQst.QstInd = Svy_GetQstIndFromQstCod (SvyQst.QstCod);
|
||||||
|
|
||||||
/***** Show question and button to remove question *****/
|
/***** Show question and button to remove question *****/
|
||||||
Svy_CurrentSvyCod = SvyCod;
|
Gbl.Svys.SvyCod = SvyCod;
|
||||||
Svy_CurrentQstCod = SvyQst.QstCod;
|
Gbl.Svys.QstCod = SvyQst.QstCod;
|
||||||
Ale_ShowAlertAndButton (ActRemSvyQst,NULL,NULL,
|
Ale_ShowAlertAndButton (ActRemSvyQst,NULL,NULL,
|
||||||
Svy_PutParamsRemoveOneQst,&Gbl,
|
Svy_PutParamsRemoveOneQst,&Gbl.Svys,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove_question,
|
Btn_REMOVE_BUTTON,Txt_Remove_question,
|
||||||
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_question_X,
|
Ale_QUESTION,Txt_Do_you_really_want_to_remove_the_question_X,
|
||||||
(long) SvyQst.QstInd + 1);
|
(long) SvyQst.QstInd + 1);
|
||||||
|
@ -3688,7 +3680,7 @@ void Svy_ReceiveSurveyAnswers (void)
|
||||||
{
|
{
|
||||||
extern const char *Txt_You_already_answered_this_survey_before;
|
extern const char *Txt_You_already_answered_this_survey_before;
|
||||||
extern const char *Txt_Thanks_for_answering_the_survey;
|
extern const char *Txt_Thanks_for_answering_the_survey;
|
||||||
struct Survey Svy;
|
struct Svy_Survey Svy;
|
||||||
|
|
||||||
/***** Get survey code *****/
|
/***** Get survey code *****/
|
||||||
if ((Svy.SvyCod = Svy_GetParamSvyCod ()) == -1L)
|
if ((Svy.SvyCod = Svy_GetParamSvyCod ()) == -1L)
|
||||||
|
|
|
@ -43,7 +43,18 @@ typedef enum
|
||||||
Svy_END_TIME = 1,
|
Svy_END_TIME = 1,
|
||||||
} Svy_StartOrEndTime_t;
|
} Svy_StartOrEndTime_t;
|
||||||
|
|
||||||
struct Survey
|
struct Svy_Surveys
|
||||||
|
{
|
||||||
|
bool LstIsRead; // Is the list already read from database, or it needs to be read?
|
||||||
|
unsigned Num; // Number of surveys
|
||||||
|
long *LstSvyCods; // List of survey codes
|
||||||
|
Dat_StartEndTime_t SelectedOrder;
|
||||||
|
unsigned CurrentPage;
|
||||||
|
long SvyCod;
|
||||||
|
long QstCod;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Svy_Survey
|
||||||
{
|
{
|
||||||
long SvyCod;
|
long SvyCod;
|
||||||
Hie_Level_t Scope;
|
Hie_Level_t Scope;
|
||||||
|
@ -83,10 +94,10 @@ typedef enum
|
||||||
|
|
||||||
void Svy_SeeAllSurveys (void);
|
void Svy_SeeAllSurveys (void);
|
||||||
void Svy_SeeOneSurvey (void);
|
void Svy_SeeOneSurvey (void);
|
||||||
void Svy_PutHiddenParamSvyOrder (void);
|
void Svy_PutHiddenParamSvyOrder (Dat_StartEndTime_t SelectedOrder);
|
||||||
void Svy_RequestCreatOrEditSvy (void);
|
void Svy_RequestCreatOrEditSvy (void);
|
||||||
void Svy_GetDataOfSurveyByCod (struct Survey *Svy);
|
void Svy_GetDataOfSurveyByCod (struct Svy_Survey *Svy);
|
||||||
void Svy_GetDataOfSurveyByFolder (struct Survey *Svy);
|
void Svy_GetDataOfSurveyByFolder (struct Svy_Survey *Svy);
|
||||||
void Svy_FreeListSurveys (void);
|
void Svy_FreeListSurveys (void);
|
||||||
void Svy_GetNotifSurvey (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
void Svy_GetNotifSurvey (char SummaryStr[Ntf_MAX_BYTES_SUMMARY + 1],
|
||||||
char **ContentStr,
|
char **ContentStr,
|
||||||
|
|
|
@ -105,7 +105,7 @@ static void Syl_ShowSyllabus (bool PutIconToEdit);
|
||||||
static void Syl_ShowRowSyllabus (unsigned NumItem,
|
static void Syl_ShowRowSyllabus (unsigned NumItem,
|
||||||
int Level,int *CodItem,const char *Text,bool NewItem);
|
int Level,int *CodItem,const char *Text,bool NewItem);
|
||||||
static void Syl_PutFormItemSyllabus (bool NewItem,unsigned NumItem,int Level,int *CodItem,const char *Text);
|
static void Syl_PutFormItemSyllabus (bool NewItem,unsigned NumItem,int Level,int *CodItem,const char *Text);
|
||||||
static void Syl_PutParamNumItem (void *Args);
|
static void Syl_PutParamNumItem (void *ParamNumItem);
|
||||||
|
|
||||||
static void Syl_WriteNumItem (char *StrDst,FILE *FileTgt,int Level,int *CodItem);
|
static void Syl_WriteNumItem (char *StrDst,FILE *FileTgt,int Level,int *CodItem);
|
||||||
|
|
||||||
|
@ -608,7 +608,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem,
|
||||||
{
|
{
|
||||||
Frm_StartForm (Gbl.Crs.Info.Type == Inf_LECTURES ? ActDelItmSylLec :
|
Frm_StartForm (Gbl.Crs.Info.Type == Inf_LECTURES ? ActDelItmSylLec :
|
||||||
ActDelItmSylPra);
|
ActDelItmSylPra);
|
||||||
Syl_PutParamNumItem (&Gbl);
|
Syl_PutParamNumItem (&Gbl.Syllabus.ParamNumItem);
|
||||||
Ico_PutIconRemove ();
|
Ico_PutIconRemove ();
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
}
|
}
|
||||||
|
@ -622,7 +622,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem,
|
||||||
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActUp_IteSylLec :
|
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActUp_IteSylLec :
|
||||||
ActUp_IteSylPra,
|
ActUp_IteSylPra,
|
||||||
NULL,
|
NULL,
|
||||||
Syl_PutParamNumItem,&Gbl,
|
Syl_PutParamNumItem,&Gbl.Syllabus.ParamNumItem,
|
||||||
"arrow-up.svg",
|
"arrow-up.svg",
|
||||||
Str_BuildStringStr (Syl_LstItemsSyllabus.Lst[NumItem].HasChildren ? Txt_Move_up_X_and_its_subsections :
|
Str_BuildStringStr (Syl_LstItemsSyllabus.Lst[NumItem].HasChildren ? Txt_Move_up_X_and_its_subsections :
|
||||||
Txt_Move_up_X,
|
Txt_Move_up_X,
|
||||||
|
@ -641,7 +641,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem,
|
||||||
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActDwnIteSylLec :
|
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActDwnIteSylLec :
|
||||||
ActDwnIteSylPra,
|
ActDwnIteSylPra,
|
||||||
NULL,
|
NULL,
|
||||||
Syl_PutParamNumItem,&Gbl,
|
Syl_PutParamNumItem,&Gbl.Syllabus.ParamNumItem,
|
||||||
"arrow-down.svg",
|
"arrow-down.svg",
|
||||||
Str_BuildStringStr (Syl_LstItemsSyllabus.Lst[NumItem].HasChildren ? Txt_Move_down_X_and_its_subsections :
|
Str_BuildStringStr (Syl_LstItemsSyllabus.Lst[NumItem].HasChildren ? Txt_Move_down_X_and_its_subsections :
|
||||||
Txt_Move_down_X,
|
Txt_Move_down_X,
|
||||||
|
@ -659,7 +659,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem,
|
||||||
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActRgtIteSylLec :
|
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActRgtIteSylLec :
|
||||||
ActRgtIteSylPra,
|
ActRgtIteSylPra,
|
||||||
NULL,
|
NULL,
|
||||||
Syl_PutParamNumItem,&Gbl,
|
Syl_PutParamNumItem,&Gbl.Syllabus.ParamNumItem,
|
||||||
"arrow-left.svg",
|
"arrow-left.svg",
|
||||||
Str_BuildStringStr (Txt_Increase_level_of_X,
|
Str_BuildStringStr (Txt_Increase_level_of_X,
|
||||||
StrItemCod));
|
StrItemCod));
|
||||||
|
@ -677,7 +677,7 @@ static void Syl_ShowRowSyllabus (unsigned NumItem,
|
||||||
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActLftIteSylLec :
|
Lay_PutContextualLinkOnlyIcon (Gbl.Crs.Info.Type == Inf_LECTURES ? ActLftIteSylLec :
|
||||||
ActLftIteSylPra,
|
ActLftIteSylPra,
|
||||||
NULL,
|
NULL,
|
||||||
Syl_PutParamNumItem,&Gbl,
|
Syl_PutParamNumItem,&Gbl.Syllabus.ParamNumItem,
|
||||||
"arrow-right.svg",
|
"arrow-right.svg",
|
||||||
Str_BuildStringStr (Txt_Decrease_level_of_X,
|
Str_BuildStringStr (Txt_Decrease_level_of_X,
|
||||||
StrItemCod));
|
StrItemCod));
|
||||||
|
@ -837,7 +837,7 @@ static void Syl_PutFormItemSyllabus (bool NewItem,unsigned NumItem,int Level,int
|
||||||
(Gbl.Crs.Info.Type == Inf_LECTURES ? ActModIteSylLec :
|
(Gbl.Crs.Info.Type == Inf_LECTURES ? ActModIteSylLec :
|
||||||
ActModIteSylPra));
|
ActModIteSylPra));
|
||||||
Gbl.Syllabus.ParamNumItem = NumItem;
|
Gbl.Syllabus.ParamNumItem = NumItem;
|
||||||
Syl_PutParamNumItem (&Gbl);
|
Syl_PutParamNumItem (&Gbl.Syllabus.ParamNumItem);
|
||||||
HTM_INPUT_TEXT ("Txt",Syl_MAX_CHARS_TEXT_ITEM,Text,true,
|
HTM_INPUT_TEXT ("Txt",Syl_MAX_CHARS_TEXT_ITEM,Text,true,
|
||||||
"size=\"60\" placeholder=\"%s\"%s",
|
"size=\"60\" placeholder=\"%s\"%s",
|
||||||
Txt_Enter_a_new_item_here,
|
Txt_Enter_a_new_item_here,
|
||||||
|
@ -851,10 +851,10 @@ static void Syl_PutFormItemSyllabus (bool NewItem,unsigned NumItem,int Level,int
|
||||||
/***** Write parameter with the number of an item in a syllabus form *********/
|
/***** Write parameter with the number of an item in a syllabus form *********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Syl_PutParamNumItem (void *Args)
|
static void Syl_PutParamNumItem (void *ParamNumItem)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (ParamNumItem)
|
||||||
Par_PutHiddenParamUnsigned (NULL,"NumI",Gbl.Syllabus.ParamNumItem);
|
Par_PutHiddenParamUnsigned (NULL,"NumI",*((unsigned *) ParamNumItem));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -67,7 +67,7 @@ extern struct Globals Gbl; // All the global parameters and variables must be in
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void SysCfg_Configuration (bool PrintView);
|
static void SysCfg_Configuration (bool PrintView);
|
||||||
static void SysCfg_PutIconToPrint (void *Args);
|
static void SysCfg_PutIconToPrint (__attribute__((unused)) void *Args);
|
||||||
static void SysCfg_GetCoordAndZoom (struct Coordinates *Coord,unsigned *Zoom);
|
static void SysCfg_GetCoordAndZoom (struct Coordinates *Coord,unsigned *Zoom);
|
||||||
static void SysCfg_Map (void);
|
static void SysCfg_Map (void);
|
||||||
static void SysCfg_Platform (void);
|
static void SysCfg_Platform (void);
|
||||||
|
@ -117,7 +117,7 @@ static void SysCfg_Configuration (bool PrintView)
|
||||||
NULL,Box_NOT_CLOSABLE);
|
NULL,Box_NOT_CLOSABLE);
|
||||||
else
|
else
|
||||||
Box_BoxBegin (NULL,Cfg_PLATFORM_SHORT_NAME,
|
Box_BoxBegin (NULL,Cfg_PLATFORM_SHORT_NAME,
|
||||||
SysCfg_PutIconToPrint,&Gbl,
|
SysCfg_PutIconToPrint,NULL,
|
||||||
Hlp_SYSTEM_Information,Box_NOT_CLOSABLE);
|
Hlp_SYSTEM_Information,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/**************************** Left part ***********************************/
|
/**************************** Left part ***********************************/
|
||||||
|
@ -185,11 +185,10 @@ static void SysCfg_Configuration (bool PrintView)
|
||||||
/************* Put icon to print the configuration of a country **************/
|
/************* Put icon to print the configuration of a country **************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void SysCfg_PutIconToPrint (void *Args)
|
static void SysCfg_PutIconToPrint (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Ico_PutContextualIconToPrint (ActPrnSysInf,
|
||||||
Ico_PutContextualIconToPrint (ActPrnSysInf,
|
NULL,NULL);
|
||||||
NULL,NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -145,7 +145,9 @@ static void TstExa_StoreOneExamQstInDB (const struct TstExa_Exam *Exam,
|
||||||
unsigned NumQst);
|
unsigned NumQst);
|
||||||
static void Tst_UpdateQstScoreInDB (const struct TstExa_Exam *Exam,unsigned NumQst);
|
static void Tst_UpdateQstScoreInDB (const struct TstExa_Exam *Exam,unsigned NumQst);
|
||||||
|
|
||||||
static void TstExa_ShowUsrsExams (void *Args);
|
static void TstExa_PutFormToSelectUsrsToViewUsrsExams (__attribute__((unused)) void *Args);
|
||||||
|
|
||||||
|
static void TstExa_ShowUsrsExams (__attribute__((unused)) void *Args);
|
||||||
static void TstExa_ShowHeaderExams (void);
|
static void TstExa_ShowHeaderExams (void);
|
||||||
static void TstExa_ShowExams (struct UsrData *UsrDat);
|
static void TstExa_ShowExams (struct UsrData *UsrDat);
|
||||||
static void TstExa_ShowExamsSummaryRow (bool ItsMe,
|
static void TstExa_ShowExamsSummaryRow (bool ItsMe,
|
||||||
|
@ -1451,20 +1453,24 @@ static void Tst_UpdateQstScoreInDB (const struct TstExa_Exam *Exam,unsigned NumQ
|
||||||
/************* Select users and dates to show their test exams ***************/
|
/************* Select users and dates to show their test exams ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void TstExa_SelUsrsToViewUsrsExams (void *Args)
|
void TstExa_SelUsrsToViewUsrsExams (void)
|
||||||
|
{
|
||||||
|
TstExa_PutFormToSelectUsrsToViewUsrsExams (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void TstExa_PutFormToSelectUsrsToViewUsrsExams (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Tests_results;
|
extern const char *Hlp_ASSESSMENT_Tests_results;
|
||||||
extern const char *Txt_Results;
|
extern const char *Txt_Results;
|
||||||
extern const char *Txt_View_test_results;
|
extern const char *Txt_View_test_results;
|
||||||
|
|
||||||
if (Args)
|
Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected,
|
||||||
Usr_PutFormToSelectUsrsToGoToAct (&Gbl.Usrs.Selected,
|
ActSeeUsrTstRes,
|
||||||
ActSeeUsrTstRes,
|
NULL,NULL,
|
||||||
NULL,NULL,
|
Txt_Results,
|
||||||
Txt_Results,
|
Hlp_ASSESSMENT_Tests_results,
|
||||||
Hlp_ASSESSMENT_Tests_results,
|
Txt_View_test_results,
|
||||||
Txt_View_test_results,
|
true); // Put form with date range
|
||||||
true); // Put form with date range
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -1533,23 +1539,20 @@ void TstExa_ShowMyExams (void)
|
||||||
void TstExa_GetUsrsAndShowExams (void)
|
void TstExa_GetUsrsAndShowExams (void)
|
||||||
{
|
{
|
||||||
Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected,
|
Usr_GetSelectedUsrsAndGoToAct (&Gbl.Usrs.Selected,
|
||||||
TstExa_ShowUsrsExams,&Gbl,
|
TstExa_ShowUsrsExams,NULL,
|
||||||
TstExa_SelUsrsToViewUsrsExams,&Gbl);
|
TstExa_PutFormToSelectUsrsToViewUsrsExams,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********************* Show test exams for several users *********************/
|
/********************* Show test exams for several users *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void TstExa_ShowUsrsExams (void *Args)
|
static void TstExa_ShowUsrsExams (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
extern const char *Hlp_ASSESSMENT_Tests_results;
|
extern const char *Hlp_ASSESSMENT_Tests_results;
|
||||||
extern const char *Txt_Results;
|
extern const char *Txt_Results;
|
||||||
const char *Ptr;
|
const char *Ptr;
|
||||||
|
|
||||||
if (!Args)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/***** Get starting and ending dates *****/
|
/***** Get starting and ending dates *****/
|
||||||
Dat_GetIniEndDatesFromForm ();
|
Dat_GetIniEndDatesFromForm ();
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ void TstExa_ComputeAndShowGrade (unsigned NumQsts,double Score,double MaxGrade);
|
||||||
double TstExa_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade);
|
double TstExa_ComputeGrade (unsigned NumQsts,double Score,double MaxGrade);
|
||||||
void TstExa_ShowGrade (double Grade,double MaxGrade);
|
void TstExa_ShowGrade (double Grade,double MaxGrade);
|
||||||
|
|
||||||
void TstExa_SelUsrsToViewUsrsExams (void *Args);
|
void TstExa_SelUsrsToViewUsrsExams (void);
|
||||||
void TstExa_SelDatesToSeeMyExams (void);
|
void TstExa_SelDatesToSeeMyExams (void);
|
||||||
void TstExa_ShowMyExams (void);
|
void TstExa_ShowMyExams (void);
|
||||||
void TstExa_GetUsrsAndShowExams (void);
|
void TstExa_GetUsrsAndShowExams (void);
|
||||||
|
|
|
@ -333,7 +333,7 @@ static void TL_CreateNotifToAuthor (long AuthorCod,long PubCod,
|
||||||
Ntf_NotifyEvent_t NotifyEvent);
|
Ntf_NotifyEvent_t NotifyEvent);
|
||||||
|
|
||||||
static void TL_RequestRemovalNote (void);
|
static void TL_RequestRemovalNote (void);
|
||||||
static void TL_PutParamsRemoveNote (void *Args);
|
static void TL_PutParamsRemoveNote (void *Timeline);
|
||||||
static void TL_RemoveNote (void);
|
static void TL_RemoveNote (void);
|
||||||
static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot);
|
static void TL_RemoveNoteMediaAndDBEntries (struct TL_Note *SocNot);
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ static long TL_GetNotCodOfPublication (long PubCod);
|
||||||
static long TL_GetPubCodOfOriginalNote (long NotCod);
|
static long TL_GetPubCodOfOriginalNote (long NotCod);
|
||||||
|
|
||||||
static void TL_RequestRemovalComment (void);
|
static void TL_RequestRemovalComment (void);
|
||||||
static void TL_PutParamsRemoveCommment (void *Args);
|
static void TL_PutParamsRemoveComment (void *Timeline);
|
||||||
static void TL_RemoveComment (void);
|
static void TL_RemoveComment (void);
|
||||||
static void TL_RemoveCommentMediaAndDBEntries (long PubCod);
|
static void TL_RemoveCommentMediaAndDBEntries (long PubCod);
|
||||||
|
|
||||||
|
@ -4071,11 +4071,11 @@ static void TL_RequestRemovalNote (void)
|
||||||
Gbl.Timeline.NotCod = SocNot.NotCod; // Note to be removed
|
Gbl.Timeline.NotCod = SocNot.NotCod; // Note to be removed
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||||
Ale_ShowAlertAndButton2 (ActRemSocPubUsr,"timeline",NULL,
|
Ale_ShowAlertAndButton2 (ActRemSocPubUsr,"timeline",NULL,
|
||||||
TL_PutParamsRemoveNote,&Gbl,
|
TL_PutParamsRemoveNote,&Gbl.Timeline,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove);
|
Btn_REMOVE_BUTTON,Txt_Remove);
|
||||||
else
|
else
|
||||||
Ale_ShowAlertAndButton2 (ActRemSocPubGbl,NULL,NULL,
|
Ale_ShowAlertAndButton2 (ActRemSocPubGbl,NULL,NULL,
|
||||||
TL_PutParamsRemoveNote,&Gbl,
|
TL_PutParamsRemoveNote,&Gbl.Timeline,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove);
|
Btn_REMOVE_BUTTON,Txt_Remove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4087,15 +4087,15 @@ static void TL_RequestRemovalNote (void)
|
||||||
/********************* Put parameters to remove a note ***********************/
|
/********************* Put parameters to remove a note ***********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void TL_PutParamsRemoveNote (void *Args)
|
static void TL_PutParamsRemoveNote (void *Timeline)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Timeline)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||||
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
||||||
else
|
else
|
||||||
Usr_PutHiddenParamWho (Gbl.Timeline.Who);
|
Usr_PutHiddenParamWho (((struct TL_Timeline *) Timeline)->Who);
|
||||||
TL_PutHiddenParamNotCod (Gbl.Timeline.NotCod);
|
TL_PutHiddenParamNotCod (((struct TL_Timeline *) Timeline)->NotCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4384,11 +4384,11 @@ static void TL_RequestRemovalComment (void)
|
||||||
Gbl.Timeline.PubCod = SocCom.PubCod; // Publication to be removed
|
Gbl.Timeline.PubCod = SocCom.PubCod; // Publication to be removed
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||||
Ale_ShowAlertAndButton2 (ActRemSocComUsr,"timeline",NULL,
|
Ale_ShowAlertAndButton2 (ActRemSocComUsr,"timeline",NULL,
|
||||||
TL_PutParamsRemoveCommment,&Gbl,
|
TL_PutParamsRemoveComment,&Gbl.Timeline,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove);
|
Btn_REMOVE_BUTTON,Txt_Remove);
|
||||||
else
|
else
|
||||||
Ale_ShowAlertAndButton2 (ActRemSocComGbl,NULL,NULL,
|
Ale_ShowAlertAndButton2 (ActRemSocComGbl,NULL,NULL,
|
||||||
TL_PutParamsRemoveCommment,&Gbl,
|
TL_PutParamsRemoveComment,&Gbl.Timeline,
|
||||||
Btn_REMOVE_BUTTON,Txt_Remove);
|
Btn_REMOVE_BUTTON,Txt_Remove);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4403,15 +4403,15 @@ static void TL_RequestRemovalComment (void)
|
||||||
/******************** Put parameters to remove a comment *********************/
|
/******************** Put parameters to remove a comment *********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void TL_PutParamsRemoveCommment (void *Args)
|
static void TL_PutParamsRemoveComment (void *Timeline)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Timeline)
|
||||||
{
|
{
|
||||||
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
if (Gbl.Usrs.Other.UsrDat.UsrCod > 0)
|
||||||
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
Usr_PutParamOtherUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod);
|
||||||
else
|
else
|
||||||
Usr_PutHiddenParamWho (Gbl.Timeline.Who);
|
Usr_PutHiddenParamWho (((struct TL_Timeline *) Timeline)->Who);
|
||||||
TL_PutHiddenParamPubCod (Gbl.Timeline.PubCod);
|
TL_PutHiddenParamPubCod (((struct TL_Timeline *) Timeline)->PubCod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,13 @@ struct TL_Publication
|
||||||
TL_TopMessage_t TopMessage; // Used to show feedback on the action made
|
TL_TopMessage_t TopMessage; // Used to show feedback on the action made
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct TL_Timeline
|
||||||
|
{
|
||||||
|
Usr_Who_t Who;
|
||||||
|
long NotCod; // Used as parameter about social note to be edited, removed...
|
||||||
|
long PubCod; // Used as parameter about social publishing to be edited, removed...
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public prototypes ****************************/
|
/****************************** Public prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
347
swad_timetable.c
347
swad_timetable.c
|
@ -129,11 +129,11 @@ static void TT_FreeTimeTable (void);
|
||||||
|
|
||||||
static void TT_ShowTimeTableGrpsSelected (void);
|
static void TT_ShowTimeTableGrpsSelected (void);
|
||||||
static void TT_GetParamsTimeTable (void);
|
static void TT_GetParamsTimeTable (void);
|
||||||
static void TT_PutContextualIcons (void *Args);
|
static void TT_PutContextualIcons (void *Timetable);
|
||||||
static void TT_PutFormToSelectWhichGroupsToShow (void);
|
static void TT_PutFormToSelectWhichGroupsToShow (void);
|
||||||
|
|
||||||
static void TT_PutIconToViewCrsTT (void *Args);
|
static void TT_PutIconToViewCrsTT (__attribute__((unused)) void *Args);
|
||||||
static void TT_PutIconToViewMyTT (void *Args);
|
static void TT_PutIconToViewMyTT (__attribute__((unused)) void *Args);
|
||||||
|
|
||||||
static void TT_WriteCrsTimeTableIntoDB (long CrsCod);
|
static void TT_WriteCrsTimeTableIntoDB (long CrsCod);
|
||||||
static void TT_WriteTutTimeTableIntoDB (long UsrCod);
|
static void TT_WriteTutTimeTableIntoDB (long UsrCod);
|
||||||
|
@ -163,38 +163,38 @@ static void TT_TimeTableConfigureIntervalsAndAllocateTimeTable (void)
|
||||||
{
|
{
|
||||||
unsigned Weekday;
|
unsigned Weekday;
|
||||||
|
|
||||||
if (Gbl.TimeTable.Config.Range.Hours.End >
|
if (Gbl.Timetable.Config.Range.Hours.End >
|
||||||
Gbl.TimeTable.Config.Range.Hours.Start)
|
Gbl.Timetable.Config.Range.Hours.Start)
|
||||||
{
|
{
|
||||||
/***** Configuration of timetable depending on hours and resolution *****/
|
/***** Configuration of timetable depending on hours and resolution *****/
|
||||||
Gbl.TimeTable.Config.HoursPerDay = Gbl.TimeTable.Config.Range.Hours.End -
|
Gbl.Timetable.Config.HoursPerDay = Gbl.Timetable.Config.Range.Hours.End -
|
||||||
Gbl.TimeTable.Config.Range.Hours.Start; // From start hour to end hour
|
Gbl.Timetable.Config.Range.Hours.Start; // From start hour to end hour
|
||||||
Gbl.TimeTable.Config.SecondsPerInterval = Gbl.TimeTable.Config.Range.MinutesPerInterval *
|
Gbl.Timetable.Config.SecondsPerInterval = Gbl.Timetable.Config.Range.MinutesPerInterval *
|
||||||
TT_SECONDS_PER_MINUTE;
|
TT_SECONDS_PER_MINUTE;
|
||||||
Gbl.TimeTable.Config.IntervalsPerHour = TT_MINUTES_PER_HOUR /
|
Gbl.Timetable.Config.IntervalsPerHour = TT_MINUTES_PER_HOUR /
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval;
|
Gbl.Timetable.Config.Range.MinutesPerInterval;
|
||||||
Gbl.TimeTable.Config.IntervalsPerDay = Gbl.TimeTable.Config.IntervalsPerHour *
|
Gbl.Timetable.Config.IntervalsPerDay = Gbl.Timetable.Config.IntervalsPerHour *
|
||||||
Gbl.TimeTable.Config.HoursPerDay;
|
Gbl.Timetable.Config.HoursPerDay;
|
||||||
Gbl.TimeTable.Config.IntervalsBeforeStartHour = Gbl.TimeTable.Config.IntervalsPerHour *
|
Gbl.Timetable.Config.IntervalsBeforeStartHour = Gbl.Timetable.Config.IntervalsPerHour *
|
||||||
Gbl.TimeTable.Config.Range.Hours.Start;
|
Gbl.Timetable.Config.Range.Hours.Start;
|
||||||
|
|
||||||
/***** Allocate memory for timetable *****/
|
/***** Allocate memory for timetable *****/
|
||||||
for (Weekday = 0;
|
for (Weekday = 0;
|
||||||
Weekday < TT_DAYS_PER_WEEK;
|
Weekday < TT_DAYS_PER_WEEK;
|
||||||
Weekday++)
|
Weekday++)
|
||||||
if ((TT_TimeTable[Weekday] = (struct TT_Cell *)
|
if ((TT_TimeTable[Weekday] = (struct TT_Cell *)
|
||||||
malloc (Gbl.TimeTable.Config.IntervalsPerDay *
|
malloc (Gbl.Timetable.Config.IntervalsPerDay *
|
||||||
sizeof (struct TT_Cell))) == NULL)
|
sizeof (struct TT_Cell))) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Error allocating memory for timetable.");
|
Lay_ShowErrorAndExit ("Error allocating memory for timetable.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/***** Table is empty *****/
|
/***** Table is empty *****/
|
||||||
Gbl.TimeTable.Config.HoursPerDay = 0;
|
Gbl.Timetable.Config.HoursPerDay = 0;
|
||||||
Gbl.TimeTable.Config.SecondsPerInterval = 0;
|
Gbl.Timetable.Config.SecondsPerInterval = 0;
|
||||||
Gbl.TimeTable.Config.IntervalsPerHour = 0;
|
Gbl.Timetable.Config.IntervalsPerHour = 0;
|
||||||
Gbl.TimeTable.Config.IntervalsPerDay = 0;
|
Gbl.Timetable.Config.IntervalsPerDay = 0;
|
||||||
Gbl.TimeTable.Config.IntervalsBeforeStartHour = 0;
|
Gbl.Timetable.Config.IntervalsBeforeStartHour = 0;
|
||||||
|
|
||||||
/***** Clear timetable in order to not try to free it *****/
|
/***** Clear timetable in order to not try to free it *****/
|
||||||
for (Weekday = 0;
|
for (Weekday = 0;
|
||||||
|
@ -257,21 +257,21 @@ static void TT_GetParamsTimeTable (void)
|
||||||
unsigned Minutes;
|
unsigned Minutes;
|
||||||
|
|
||||||
/***** Get day (0: monday, 1: tuesday,..., 6: sunday *****/
|
/***** Get day (0: monday, 1: tuesday,..., 6: sunday *****/
|
||||||
Gbl.TimeTable.Weekday = (unsigned)
|
Gbl.Timetable.Weekday = (unsigned)
|
||||||
Par_GetParToUnsignedLong ("TTDay",
|
Par_GetParToUnsignedLong ("TTDay",
|
||||||
0,
|
0,
|
||||||
TT_DAYS_PER_WEEK - 1,
|
TT_DAYS_PER_WEEK - 1,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
/***** Get hour *****/
|
/***** Get hour *****/
|
||||||
Gbl.TimeTable.Interval = (unsigned)
|
Gbl.Timetable.Interval = (unsigned)
|
||||||
Par_GetParToUnsignedLong ("TTInt",
|
Par_GetParToUnsignedLong ("TTInt",
|
||||||
0,
|
0,
|
||||||
Gbl.TimeTable.Config.IntervalsPerDay - 1,
|
Gbl.Timetable.Config.IntervalsPerDay - 1,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
/***** Get number of column *****/
|
/***** Get number of column *****/
|
||||||
Gbl.TimeTable.Column = (unsigned)
|
Gbl.Timetable.Column = (unsigned)
|
||||||
Par_GetParToUnsignedLong ("TTCol",
|
Par_GetParToUnsignedLong ("TTCol",
|
||||||
0,
|
0,
|
||||||
TT_MAX_COLUMNS_PER_CELL - 1,
|
TT_MAX_COLUMNS_PER_CELL - 1,
|
||||||
|
@ -279,26 +279,26 @@ static void TT_GetParamsTimeTable (void)
|
||||||
|
|
||||||
/***** Get class type *****/
|
/***** Get class type *****/
|
||||||
Par_GetParToText ("TTTyp",StrClassType,TT_MAX_BYTES_STR_CLASS_TYPE);
|
Par_GetParToText ("TTTyp",StrClassType,TT_MAX_BYTES_STR_CLASS_TYPE);
|
||||||
for (Gbl.TimeTable.ClassType = (TT_ClassType_t) 0;
|
for (Gbl.Timetable.ClassType = (TT_ClassType_t) 0;
|
||||||
Gbl.TimeTable.ClassType <= (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1);
|
Gbl.Timetable.ClassType <= (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1);
|
||||||
Gbl.TimeTable.ClassType++)
|
Gbl.Timetable.ClassType++)
|
||||||
if (!strcmp (StrClassType,TT_ClassTypeDB[Gbl.TimeTable.ClassType]))
|
if (!strcmp (StrClassType,TT_ClassTypeDB[Gbl.Timetable.ClassType]))
|
||||||
break;
|
break;
|
||||||
if (Gbl.TimeTable.ClassType > (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1))
|
if (Gbl.Timetable.ClassType > (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1))
|
||||||
Lay_ShowErrorAndExit ("Type of timetable cell is missing.");
|
Lay_ShowErrorAndExit ("Type of timetable cell is missing.");
|
||||||
|
|
||||||
/***** Get class duration *****/
|
/***** Get class duration *****/
|
||||||
Par_GetParToText ("TTDur",StrDuration,TT_MAX_BYTES_STR_DURATION);
|
Par_GetParToText ("TTDur",StrDuration,TT_MAX_BYTES_STR_DURATION);
|
||||||
if (sscanf (StrDuration,"%u:%u",&Hours,&Minutes) != 2)
|
if (sscanf (StrDuration,"%u:%u",&Hours,&Minutes) != 2)
|
||||||
Lay_ShowErrorAndExit ("Duration is missing.");
|
Lay_ShowErrorAndExit ("Duration is missing.");
|
||||||
Gbl.TimeTable.DurationIntervals = Hours * Gbl.TimeTable.Config.IntervalsPerHour +
|
Gbl.Timetable.DurationIntervals = Hours * Gbl.Timetable.Config.IntervalsPerHour +
|
||||||
Minutes / Gbl.TimeTable.Config.Range.MinutesPerInterval;
|
Minutes / Gbl.Timetable.Config.Range.MinutesPerInterval;
|
||||||
|
|
||||||
/***** Get group code *****/
|
/***** Get group code *****/
|
||||||
Gbl.TimeTable.GrpCod = Par_GetParToLong ("TTGrp");
|
Gbl.Timetable.GrpCod = Par_GetParToLong ("TTGrp");
|
||||||
|
|
||||||
/***** Get info *****/
|
/***** Get info *****/
|
||||||
Par_GetParToText ("TTInf",Gbl.TimeTable.Info,TT_MAX_BYTES_INFO);
|
Par_GetParToText ("TTInf",Gbl.Timetable.Info,TT_MAX_BYTES_INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -332,42 +332,42 @@ void TT_ShowClassTimeTable (void)
|
||||||
case ActSeeCrsTT:
|
case ActSeeCrsTT:
|
||||||
case ActPrnCrsTT:
|
case ActPrnCrsTT:
|
||||||
case ActChgCrsTT1stDay:
|
case ActChgCrsTT1stDay:
|
||||||
Gbl.TimeTable.Type = TT_COURSE_TIMETABLE;
|
Gbl.Timetable.Type = TT_COURSE_TIMETABLE;
|
||||||
break;
|
break;
|
||||||
case ActSeeMyTT:
|
case ActSeeMyTT:
|
||||||
case ActPrnMyTT:
|
case ActPrnMyTT:
|
||||||
case ActChgMyTT1stDay:
|
case ActChgMyTT1stDay:
|
||||||
Gbl.TimeTable.Type = TT_MY_TIMETABLE;
|
Gbl.Timetable.Type = TT_MY_TIMETABLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Lay_ShowErrorAndExit ("Wrong action.");
|
Lay_ShowErrorAndExit ("Wrong action.");
|
||||||
}
|
}
|
||||||
|
|
||||||
Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT = (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE &&
|
Gbl.Timetable.ContextualIcons.PutIconEditCrsTT = (Gbl.Timetable.Type == TT_COURSE_TIMETABLE &&
|
||||||
!PrintView &&
|
!PrintView &&
|
||||||
Gbl.Usrs.Me.Role.Logged >= Rol_TCH);
|
Gbl.Usrs.Me.Role.Logged >= Rol_TCH);
|
||||||
Gbl.TimeTable.ContextualIcons.PutIconEditOfficeHours = (Gbl.TimeTable.Type == TT_MY_TIMETABLE &&
|
Gbl.Timetable.ContextualIcons.PutIconEditOfficeHours = (Gbl.Timetable.Type == TT_MY_TIMETABLE &&
|
||||||
!PrintView &&
|
!PrintView &&
|
||||||
(Gbl.Usrs.Me.Role.Available & (1 << Rol_TCH)));
|
(Gbl.Usrs.Me.Role.Available & (1 << Rol_TCH)));
|
||||||
Gbl.TimeTable.ContextualIcons.PutIconPrint = !PrintView;
|
Gbl.Timetable.ContextualIcons.PutIconPrint = !PrintView;
|
||||||
|
|
||||||
/***** Get whether to show only my groups or all groups *****/
|
/***** Get whether to show only my groups or all groups *****/
|
||||||
Grp_GetParamWhichGroups ();
|
Grp_GetParamWhichGroups ();
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
if (Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT ||
|
if (Gbl.Timetable.ContextualIcons.PutIconEditCrsTT ||
|
||||||
Gbl.TimeTable.ContextualIcons.PutIconEditOfficeHours ||
|
Gbl.Timetable.ContextualIcons.PutIconEditOfficeHours ||
|
||||||
Gbl.TimeTable.ContextualIcons.PutIconPrint)
|
Gbl.Timetable.ContextualIcons.PutIconPrint)
|
||||||
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type],
|
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.Timetable.Type],
|
||||||
TT_PutContextualIcons,&Gbl,
|
TT_PutContextualIcons,&Gbl.Timetable,
|
||||||
Help[Gbl.TimeTable.Type],Box_NOT_CLOSABLE);
|
Help[Gbl.Timetable.Type],Box_NOT_CLOSABLE);
|
||||||
else
|
else
|
||||||
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type],
|
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.Timetable.Type],
|
||||||
NULL,NULL,
|
NULL,NULL,
|
||||||
Help[Gbl.TimeTable.Type],Box_NOT_CLOSABLE);
|
Help[Gbl.Timetable.Type],Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Start time table drawing *****/
|
/***** Start time table drawing *****/
|
||||||
if (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE)
|
if (Gbl.Timetable.Type == TT_COURSE_TIMETABLE)
|
||||||
Lay_WriteHeaderClassPhoto (PrintView,false,
|
Lay_WriteHeaderClassPhoto (PrintView,false,
|
||||||
Gbl.Hierarchy.Ins.InsCod,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Ins.InsCod,Gbl.Hierarchy.Deg.DegCod,Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
|
||||||
|
@ -380,14 +380,14 @@ void TT_ShowClassTimeTable (void)
|
||||||
Set_StartSettingsHead ();
|
Set_StartSettingsHead ();
|
||||||
|
|
||||||
/* Select whether show only my groups or all groups */
|
/* Select whether show only my groups or all groups */
|
||||||
if ( Gbl.TimeTable.Type == TT_MY_TIMETABLE ||
|
if ( Gbl.Timetable.Type == TT_MY_TIMETABLE ||
|
||||||
(Gbl.TimeTable.Type == TT_COURSE_TIMETABLE &&
|
(Gbl.Timetable.Type == TT_COURSE_TIMETABLE &&
|
||||||
Gbl.Crs.Grps.NumGrps))
|
Gbl.Crs.Grps.NumGrps))
|
||||||
TT_PutFormToSelectWhichGroupsToShow ();
|
TT_PutFormToSelectWhichGroupsToShow ();
|
||||||
|
|
||||||
/* Show form to change first day of week */
|
/* Show form to change first day of week */
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
Cal_ShowFormToSelFirstDayOfWeek (ActChgTT1stDay[Gbl.TimeTable.Type],
|
Cal_ShowFormToSelFirstDayOfWeek (ActChgTT1stDay[Gbl.Timetable.Type],
|
||||||
Grp_PutParamWhichGroups,&WhichGroups);
|
Grp_PutParamWhichGroups,&WhichGroups);
|
||||||
|
|
||||||
Set_EndSettingsHead ();
|
Set_EndSettingsHead ();
|
||||||
|
@ -404,24 +404,25 @@ void TT_ShowClassTimeTable (void)
|
||||||
/***************** Put contextual icons above the time table *****************/
|
/***************** Put contextual icons above the time table *****************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void TT_PutContextualIcons (void *Args)
|
static void TT_PutContextualIcons (void *Timetable)
|
||||||
{
|
{
|
||||||
Grp_WhichGroups_t WhichGroups;
|
Grp_WhichGroups_t WhichGroups;
|
||||||
|
|
||||||
if (Args)
|
if (Timetable)
|
||||||
{
|
{
|
||||||
WhichGroups = Grp_GetParamWhichGroups ();
|
WhichGroups = Grp_GetParamWhichGroups ();
|
||||||
if (Gbl.TimeTable.ContextualIcons.PutIconEditCrsTT)
|
|
||||||
|
if (((struct TT_Timetable *) Timetable)->ContextualIcons.PutIconEditCrsTT)
|
||||||
Ico_PutContextualIconToEdit (ActEdiCrsTT,NULL,
|
Ico_PutContextualIconToEdit (ActEdiCrsTT,NULL,
|
||||||
Grp_PutParamWhichGroups,&WhichGroups);
|
Grp_PutParamWhichGroups,&WhichGroups);
|
||||||
|
|
||||||
if (Gbl.TimeTable.ContextualIcons.PutIconEditOfficeHours)
|
if (((struct TT_Timetable *) Timetable)->ContextualIcons.PutIconEditOfficeHours)
|
||||||
Ico_PutContextualIconToEdit (ActEdiTut,NULL,
|
Ico_PutContextualIconToEdit (ActEdiTut,NULL,
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
|
|
||||||
if (Gbl.TimeTable.ContextualIcons.PutIconPrint)
|
if (((struct TT_Timetable *) Timetable)->ContextualIcons.PutIconPrint)
|
||||||
Ico_PutContextualIconToPrint (Gbl.TimeTable.Type == TT_COURSE_TIMETABLE ? ActPrnCrsTT :
|
Ico_PutContextualIconToPrint (((struct TT_Timetable *) Timetable)->Type == TT_COURSE_TIMETABLE ? ActPrnCrsTT :
|
||||||
ActPrnMyTT,
|
ActPrnMyTT,
|
||||||
Grp_PutParamWhichGroups,&WhichGroups);
|
Grp_PutParamWhichGroups,&WhichGroups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -439,7 +440,7 @@ static void TT_PutFormToSelectWhichGroupsToShow (void)
|
||||||
[TT_TUTORING_TIMETABLE] = ActUnk,
|
[TT_TUTORING_TIMETABLE] = ActUnk,
|
||||||
};
|
};
|
||||||
|
|
||||||
Grp_ShowFormToSelWhichGrps (ActSeeTT[Gbl.TimeTable.Type],
|
Grp_ShowFormToSelWhichGrps (ActSeeTT[Gbl.Timetable.Type],
|
||||||
NULL,NULL);
|
NULL,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,9 +454,9 @@ void TT_EditCrsTimeTable (void)
|
||||||
extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
|
extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
|
||||||
|
|
||||||
/***** Editable time table *****/
|
/***** Editable time table *****/
|
||||||
Gbl.TimeTable.Type = TT_COURSE_TIMETABLE;
|
Gbl.Timetable.Type = TT_COURSE_TIMETABLE;
|
||||||
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type],
|
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.Timetable.Type],
|
||||||
TT_PutIconToViewCrsTT,&Gbl,
|
TT_PutIconToViewCrsTT,NULL,
|
||||||
Hlp_COURSE_Timetable,Box_NOT_CLOSABLE);
|
Hlp_COURSE_Timetable,Box_NOT_CLOSABLE);
|
||||||
TT_ShowTimeTable (Gbl.Usrs.Me.UsrDat.UsrCod);
|
TT_ShowTimeTable (Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
@ -471,9 +472,9 @@ void TT_EditMyTutTimeTable (void)
|
||||||
extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
|
extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES];
|
||||||
|
|
||||||
/***** Time table *****/
|
/***** Time table *****/
|
||||||
Gbl.TimeTable.Type = TT_TUTORING_TIMETABLE;
|
Gbl.Timetable.Type = TT_TUTORING_TIMETABLE;
|
||||||
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type],
|
Box_BoxBegin ("100%",Txt_TIMETABLE_TYPES[Gbl.Timetable.Type],
|
||||||
TT_PutIconToViewMyTT,&Gbl,
|
TT_PutIconToViewMyTT,NULL,
|
||||||
Hlp_PROFILE_Timetable,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Timetable,Box_NOT_CLOSABLE);
|
||||||
TT_ShowTimeTable (Gbl.Usrs.Me.UsrDat.UsrCod);
|
TT_ShowTimeTable (Gbl.Usrs.Me.UsrDat.UsrCod);
|
||||||
Box_BoxEnd ();
|
Box_BoxEnd ();
|
||||||
|
@ -483,22 +484,20 @@ void TT_EditMyTutTimeTable (void)
|
||||||
/********************** Put icon to view course timetable ********************/
|
/********************** Put icon to view course timetable ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void TT_PutIconToViewCrsTT (void *Args)
|
static void TT_PutIconToViewCrsTT (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Ico_PutContextualIconToView (ActSeeCrsTT,
|
||||||
Ico_PutContextualIconToView (ActSeeCrsTT,
|
NULL,NULL);
|
||||||
NULL,NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************ Put icon to view my timetable **********************/
|
/************************ Put icon to view my timetable **********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void TT_PutIconToViewMyTT (void *Args)
|
static void TT_PutIconToViewMyTT (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Ico_PutContextualIconToView (ActSeeMyTT,
|
||||||
Ico_PutContextualIconToView (ActSeeMyTT,
|
NULL,NULL);
|
||||||
NULL,NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -510,31 +509,31 @@ void TT_ShowTimeTable (long UsrCod)
|
||||||
extern const char *Txt_The_timetable_is_empty;
|
extern const char *Txt_The_timetable_is_empty;
|
||||||
|
|
||||||
/***** Set type of view depending on current action *****/
|
/***** Set type of view depending on current action *****/
|
||||||
Gbl.TimeTable.View = TT_CRS_VIEW;
|
Gbl.Timetable.View = TT_CRS_VIEW;
|
||||||
switch (Gbl.Action.Act)
|
switch (Gbl.Action.Act)
|
||||||
{
|
{
|
||||||
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
|
case ActSeeCrsTT: case ActPrnCrsTT: case ActChgCrsTT1stDay:
|
||||||
case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay:
|
case ActSeeMyTT: case ActPrnMyTT: case ActChgMyTT1stDay:
|
||||||
Gbl.TimeTable.View = TT_CRS_VIEW;
|
Gbl.Timetable.View = TT_CRS_VIEW;
|
||||||
break;
|
break;
|
||||||
case ActSeeRecOneTch: case ActSeeRecSevTch:
|
case ActSeeRecOneTch: case ActSeeRecSevTch:
|
||||||
Gbl.TimeTable.View = TT_TUT_VIEW;
|
Gbl.Timetable.View = TT_TUT_VIEW;
|
||||||
break;
|
break;
|
||||||
case ActEdiCrsTT: case ActChgCrsTT:
|
case ActEdiCrsTT: case ActChgCrsTT:
|
||||||
Gbl.TimeTable.View = TT_CRS_EDIT;
|
Gbl.Timetable.View = TT_CRS_EDIT;
|
||||||
break;
|
break;
|
||||||
case ActEdiTut: case ActChgTut:
|
case ActEdiTut: case ActChgTut:
|
||||||
Gbl.TimeTable.View = TT_TUT_EDIT;
|
Gbl.Timetable.View = TT_TUT_EDIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** If editing ==> configure and allocate timetable *****/
|
/***** If editing ==> configure and allocate timetable *****/
|
||||||
if (Gbl.TimeTable.View == TT_CRS_EDIT ||
|
if (Gbl.Timetable.View == TT_CRS_EDIT ||
|
||||||
Gbl.TimeTable.View == TT_TUT_EDIT)
|
Gbl.Timetable.View == TT_TUT_EDIT)
|
||||||
{
|
{
|
||||||
Gbl.TimeTable.Config.Range.Hours.Start = TT_START_HOUR; // Day starts at this hour
|
Gbl.Timetable.Config.Range.Hours.Start = TT_START_HOUR; // Day starts at this hour
|
||||||
Gbl.TimeTable.Config.Range.Hours.End = TT_END_HOUR; // Day ends at this hour
|
Gbl.Timetable.Config.Range.Hours.End = TT_END_HOUR; // Day ends at this hour
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval = TT_MinutesPerInterval[0]; // The smallest interval
|
Gbl.Timetable.Config.Range.MinutesPerInterval = TT_MinutesPerInterval[0]; // The smallest interval
|
||||||
TT_TimeTableConfigureIntervalsAndAllocateTimeTable ();
|
TT_TimeTableConfigureIntervalsAndAllocateTimeTable ();
|
||||||
}
|
}
|
||||||
/* If viewing (not editing) ==>
|
/* If viewing (not editing) ==>
|
||||||
|
@ -554,7 +553,7 @@ void TT_ShowTimeTable (long UsrCod)
|
||||||
TT_ModifTimeTable ();
|
TT_ModifTimeTable ();
|
||||||
|
|
||||||
/* Write a new timetable in database */
|
/* Write a new timetable in database */
|
||||||
switch (Gbl.TimeTable.Type)
|
switch (Gbl.Timetable.Type)
|
||||||
{
|
{
|
||||||
case TT_COURSE_TIMETABLE:
|
case TT_COURSE_TIMETABLE:
|
||||||
TT_WriteCrsTimeTableIntoDB (Gbl.Hierarchy.Crs.CrsCod);
|
TT_WriteCrsTimeTableIntoDB (Gbl.Hierarchy.Crs.CrsCod);
|
||||||
|
@ -571,7 +570,7 @@ void TT_ShowTimeTable (long UsrCod)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Draw timetable *****/
|
/***** Draw timetable *****/
|
||||||
if (Gbl.TimeTable.Config.HoursPerDay)
|
if (Gbl.Timetable.Config.HoursPerDay)
|
||||||
TT_DrawTimeTable ();
|
TT_DrawTimeTable ();
|
||||||
else
|
else
|
||||||
Ale_ShowAlert (Ale_INFO,Txt_The_timetable_is_empty);
|
Ale_ShowAlert (Ale_INFO,Txt_The_timetable_is_empty);
|
||||||
|
@ -601,11 +600,11 @@ static void TT_WriteCrsTimeTableIntoDB (long CrsCod)
|
||||||
for (Weekday = 0;
|
for (Weekday = 0;
|
||||||
Weekday < TT_DAYS_PER_WEEK;
|
Weekday < TT_DAYS_PER_WEEK;
|
||||||
Weekday++)
|
Weekday++)
|
||||||
for (Interval = 0, Hour = Gbl.TimeTable.Config.Range.Hours.Start, Min = 0;
|
for (Interval = 0, Hour = Gbl.Timetable.Config.Range.Hours.Start, Min = 0;
|
||||||
Interval < Gbl.TimeTable.Config.IntervalsPerDay;
|
Interval < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
Interval++,
|
Interval++,
|
||||||
Hour += (Min + Gbl.TimeTable.Config.Range.MinutesPerInterval) / TT_SECONDS_PER_MINUTE,
|
Hour += (Min + Gbl.Timetable.Config.Range.MinutesPerInterval) / TT_SECONDS_PER_MINUTE,
|
||||||
Min = (Min + Gbl.TimeTable.Config.Range.MinutesPerInterval) % TT_SECONDS_PER_MINUTE)
|
Min = (Min + Gbl.Timetable.Config.Range.MinutesPerInterval) % TT_SECONDS_PER_MINUTE)
|
||||||
for (Column = 0;
|
for (Column = 0;
|
||||||
Column < TT_MAX_COLUMNS_PER_CELL;
|
Column < TT_MAX_COLUMNS_PER_CELL;
|
||||||
Column++)
|
Column++)
|
||||||
|
@ -623,7 +622,7 @@ static void TT_WriteCrsTimeTableIntoDB (long CrsCod)
|
||||||
Weekday,
|
Weekday,
|
||||||
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_ClassTypeDB[TT_TimeTable[Weekday][Interval].Columns[Column].ClassType],
|
TT_ClassTypeDB[TT_TimeTable[Weekday][Interval].Columns[Column].ClassType],
|
||||||
TT_TimeTable[Weekday][Interval].Columns[Column].Info);
|
TT_TimeTable[Weekday][Interval].Columns[Column].Info);
|
||||||
}
|
}
|
||||||
|
@ -649,11 +648,11 @@ static void TT_WriteTutTimeTableIntoDB (long UsrCod)
|
||||||
for (Weekday = 0;
|
for (Weekday = 0;
|
||||||
Weekday < TT_DAYS_PER_WEEK;
|
Weekday < TT_DAYS_PER_WEEK;
|
||||||
Weekday++)
|
Weekday++)
|
||||||
for (Interval = 0, Hour = Gbl.TimeTable.Config.Range.Hours.Start, Min = 0;
|
for (Interval = 0, Hour = Gbl.Timetable.Config.Range.Hours.Start, Min = 0;
|
||||||
Interval < Gbl.TimeTable.Config.IntervalsPerDay;
|
Interval < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
Interval++,
|
Interval++,
|
||||||
Hour += (Min + Gbl.TimeTable.Config.Range.MinutesPerInterval) / TT_SECONDS_PER_MINUTE,
|
Hour += (Min + Gbl.Timetable.Config.Range.MinutesPerInterval) / TT_SECONDS_PER_MINUTE,
|
||||||
Min = (Min + Gbl.TimeTable.Config.Range.MinutesPerInterval) % TT_SECONDS_PER_MINUTE)
|
Min = (Min + Gbl.Timetable.Config.Range.MinutesPerInterval) % TT_SECONDS_PER_MINUTE)
|
||||||
for (Column = 0;
|
for (Column = 0;
|
||||||
Column < TT_MAX_COLUMNS_PER_CELL;
|
Column < TT_MAX_COLUMNS_PER_CELL;
|
||||||
Column++)
|
Column++)
|
||||||
|
@ -668,7 +667,7 @@ static void TT_WriteTutTimeTableIntoDB (long UsrCod)
|
||||||
Weekday,
|
Weekday,
|
||||||
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].Info);
|
TT_TimeTable[Weekday][Interval].Columns[Column].Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -699,7 +698,7 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
bool Found;
|
bool Found;
|
||||||
|
|
||||||
/***** Get timetable from database *****/
|
/***** Get timetable from database *****/
|
||||||
switch (Gbl.TimeTable.Type)
|
switch (Gbl.Timetable.Type)
|
||||||
{
|
{
|
||||||
case TT_MY_TIMETABLE:
|
case TT_MY_TIMETABLE:
|
||||||
switch (Gbl.Crs.Grps.WhichGrps)
|
switch (Gbl.Crs.Grps.WhichGrps)
|
||||||
|
@ -829,13 +828,13 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
|
|
||||||
/***** If viewing (not editing) ==>
|
/***** If viewing (not editing) ==>
|
||||||
calculate range of hours and resolution *****/
|
calculate range of hours and resolution *****/
|
||||||
if (Gbl.TimeTable.View == TT_CRS_VIEW ||
|
if (Gbl.Timetable.View == TT_CRS_VIEW ||
|
||||||
Gbl.TimeTable.View == TT_TUT_VIEW)
|
Gbl.Timetable.View == TT_TUT_VIEW)
|
||||||
{
|
{
|
||||||
/* Initialize hours and resolution for timetable */
|
/* Initialize hours and resolution for timetable */
|
||||||
Gbl.TimeTable.Config.Range.Hours.Start = TT_END_HOUR; // Initialized to maximum hour
|
Gbl.Timetable.Config.Range.Hours.Start = TT_END_HOUR; // Initialized to maximum hour
|
||||||
Gbl.TimeTable.Config.Range.Hours.End = TT_START_HOUR; // Initialized to minimum hour
|
Gbl.Timetable.Config.Range.Hours.End = TT_START_HOUR; // Initialized to minimum hour
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval = TT_MinutesPerInterval[TT_NUM_RESOLUTIONS - 1]; // The longest interval
|
Gbl.Timetable.Config.Range.MinutesPerInterval = TT_MinutesPerInterval[TT_NUM_RESOLUTIONS - 1]; // The longest interval
|
||||||
|
|
||||||
for (NumRow = 0;
|
for (NumRow = 0;
|
||||||
NumRow < NumRows;
|
NumRow < NumRows;
|
||||||
|
@ -854,12 +853,12 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
|
|
||||||
/* Compute hours and resolution */
|
/* Compute hours and resolution */
|
||||||
TT_CalculateRangeCell (StartTimeSeconds,EndTimeSeconds,&RangeCell);
|
TT_CalculateRangeCell (StartTimeSeconds,EndTimeSeconds,&RangeCell);
|
||||||
if (RangeCell.Hours.Start < Gbl.TimeTable.Config.Range.Hours.Start)
|
if (RangeCell.Hours.Start < Gbl.Timetable.Config.Range.Hours.Start)
|
||||||
Gbl.TimeTable.Config.Range.Hours.Start = RangeCell.Hours.Start;
|
Gbl.Timetable.Config.Range.Hours.Start = RangeCell.Hours.Start;
|
||||||
if (RangeCell.Hours.End > Gbl.TimeTable.Config.Range.Hours.End)
|
if (RangeCell.Hours.End > Gbl.Timetable.Config.Range.Hours.End)
|
||||||
Gbl.TimeTable.Config.Range.Hours.End = RangeCell.Hours.End;
|
Gbl.Timetable.Config.Range.Hours.End = RangeCell.Hours.End;
|
||||||
if (RangeCell.MinutesPerInterval < Gbl.TimeTable.Config.Range.MinutesPerInterval)
|
if (RangeCell.MinutesPerInterval < Gbl.Timetable.Config.Range.MinutesPerInterval)
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval = RangeCell.MinutesPerInterval;
|
Gbl.Timetable.Config.Range.MinutesPerInterval = RangeCell.MinutesPerInterval;
|
||||||
|
|
||||||
}
|
}
|
||||||
mysql_data_seek (mysql_res,0);
|
mysql_data_seek (mysql_res,0);
|
||||||
|
@ -869,14 +868,14 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Build the table by filling it from database *****/
|
/***** Build the table by filling it from database *****/
|
||||||
if (Gbl.TimeTable.Config.HoursPerDay)
|
if (Gbl.Timetable.Config.HoursPerDay)
|
||||||
{
|
{
|
||||||
/***** Initialize timetable to all free *****/
|
/***** Initialize timetable to all free *****/
|
||||||
for (Weekday = 0;
|
for (Weekday = 0;
|
||||||
Weekday < TT_DAYS_PER_WEEK;
|
Weekday < TT_DAYS_PER_WEEK;
|
||||||
Weekday++)
|
Weekday++)
|
||||||
for (Interval = 0;
|
for (Interval = 0;
|
||||||
Interval < Gbl.TimeTable.Config.IntervalsPerDay;
|
Interval < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
Interval++)
|
Interval++)
|
||||||
{
|
{
|
||||||
TT_TimeTable[Weekday][Interval].NumColumns = 0;
|
TT_TimeTable[Weekday][Interval].NumColumns = 0;
|
||||||
|
@ -911,20 +910,20 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
if (sscanf (row[1],"%u",&StartTimeSeconds) != 1)
|
if (sscanf (row[1],"%u",&StartTimeSeconds) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong start time in timetable.");
|
Lay_ShowErrorAndExit ("Wrong start time in timetable.");
|
||||||
Interval = StartTimeSeconds /
|
Interval = StartTimeSeconds /
|
||||||
Gbl.TimeTable.Config.SecondsPerInterval;
|
Gbl.Timetable.Config.SecondsPerInterval;
|
||||||
if (Interval < Gbl.TimeTable.Config.IntervalsBeforeStartHour)
|
if (Interval < Gbl.Timetable.Config.IntervalsBeforeStartHour)
|
||||||
Lay_ShowErrorAndExit ("Wrong start time in timetable.");
|
Lay_ShowErrorAndExit ("Wrong start time in timetable.");
|
||||||
Interval -= Gbl.TimeTable.Config.IntervalsBeforeStartHour;
|
Interval -= Gbl.Timetable.Config.IntervalsBeforeStartHour;
|
||||||
|
|
||||||
/* Duration formatted as seconds (row[2])
|
/* Duration formatted as seconds (row[2])
|
||||||
--> Duration in number of intervals */
|
--> Duration in number of intervals */
|
||||||
if (sscanf (row[2],"%u",&DurationSeconds) != 1)
|
if (sscanf (row[2],"%u",&DurationSeconds) != 1)
|
||||||
Lay_ShowErrorAndExit ("Wrong duration in timetable.");
|
Lay_ShowErrorAndExit ("Wrong duration in timetable.");
|
||||||
DurationNumIntervals = DurationSeconds /
|
DurationNumIntervals = DurationSeconds /
|
||||||
Gbl.TimeTable.Config.SecondsPerInterval;
|
Gbl.Timetable.Config.SecondsPerInterval;
|
||||||
|
|
||||||
/* Type of class (row[4]) */
|
/* Type of class (row[4]) */
|
||||||
switch (Gbl.TimeTable.Type)
|
switch (Gbl.Timetable.Type)
|
||||||
{
|
{
|
||||||
case TT_COURSE_TIMETABLE:
|
case TT_COURSE_TIMETABLE:
|
||||||
case TT_MY_TIMETABLE:
|
case TT_MY_TIMETABLE:
|
||||||
|
@ -966,7 +965,7 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
TimeTableHasSpaceForThisClass = true;
|
TimeTableHasSpaceForThisClass = true;
|
||||||
for (i = Interval + 1;
|
for (i = Interval + 1;
|
||||||
i < Interval + DurationNumIntervals &&
|
i < Interval + DurationNumIntervals &&
|
||||||
i < Gbl.TimeTable.Config.IntervalsPerDay;
|
i < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
i++)
|
i++)
|
||||||
if (TT_TimeTable[Weekday][i].Columns[FirstFreeColumn].IntervalType != TT_FREE_INTERVAL)
|
if (TT_TimeTable[Weekday][i].Columns[FirstFreeColumn].IntervalType != TT_FREE_INTERVAL)
|
||||||
{
|
{
|
||||||
|
@ -981,7 +980,7 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].IntervalType = TT_FIRST_INTERVAL;
|
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].IntervalType = TT_FIRST_INTERVAL;
|
||||||
for (i = Interval + 1;
|
for (i = Interval + 1;
|
||||||
i < Interval + DurationNumIntervals &&
|
i < Interval + DurationNumIntervals &&
|
||||||
i < Gbl.TimeTable.Config.IntervalsPerDay;
|
i < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
i++)
|
i++)
|
||||||
{
|
{
|
||||||
TT_TimeTable[Weekday][i].Columns[FirstFreeColumn].IntervalType = TT_NEXT_INTERVAL;
|
TT_TimeTable[Weekday][i].Columns[FirstFreeColumn].IntervalType = TT_NEXT_INTERVAL;
|
||||||
|
@ -989,19 +988,19 @@ static void TT_FillTimeTableFromDB (long UsrCod)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Course (row[6]) and info (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]) */
|
/* Group code (row[5]) */
|
||||||
if (Gbl.TimeTable.Type == TT_MY_TIMETABLE ||
|
if (Gbl.Timetable.Type == TT_MY_TIMETABLE ||
|
||||||
Gbl.TimeTable.Type == TT_COURSE_TIMETABLE)
|
Gbl.Timetable.Type == TT_COURSE_TIMETABLE)
|
||||||
if (sscanf (row[5],"%ld",&TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod) != 1)
|
if (sscanf (row[5],"%ld",&TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod) != 1)
|
||||||
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod = -1;
|
TT_TimeTable[Weekday][Interval].Columns[FirstFreeColumn].GrpCod = -1;
|
||||||
|
|
||||||
/* Course code (row[6]) */
|
/* 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[6]) :
|
(Gbl.Timetable.Type == TT_MY_TIMETABLE ? Str_ConvertStrCodToLongCod (row[6]) :
|
||||||
Gbl.Hierarchy.Crs.CrsCod);
|
Gbl.Hierarchy.Crs.CrsCod);
|
||||||
/* falls through */
|
/* falls through */
|
||||||
/* no break */
|
/* no break */
|
||||||
|
@ -1103,29 +1102,29 @@ static unsigned TT_CalculateMinutesPerInterval (unsigned Seconds)
|
||||||
|
|
||||||
static void TT_ModifTimeTable (void)
|
static void TT_ModifTimeTable (void)
|
||||||
{
|
{
|
||||||
if (TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].IntervalType == TT_FIRST_INTERVAL)
|
if (TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].Columns[Gbl.Timetable.Column].IntervalType == TT_FIRST_INTERVAL)
|
||||||
{
|
{
|
||||||
/***** Free this cell *****/
|
/***** Free this cell *****/
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].GrpCod = -1L;
|
TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].Columns[Gbl.Timetable.Column].GrpCod = -1L;
|
||||||
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].Info[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].NumColumns--;
|
TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].NumColumns--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Gbl.TimeTable.ClassType != TT_FREE &&
|
if (Gbl.Timetable.ClassType != TT_FREE &&
|
||||||
Gbl.TimeTable.DurationIntervals > 0 &&
|
Gbl.Timetable.DurationIntervals > 0 &&
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].NumColumns < TT_MAX_COLUMNS_PER_CELL)
|
TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].NumColumns < TT_MAX_COLUMNS_PER_CELL)
|
||||||
{
|
{
|
||||||
/***** Change this cell *****/
|
/***** Change this cell *****/
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].NumColumns++;
|
TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].NumColumns++;
|
||||||
TT_TimeTable[Gbl.TimeTable.Weekday][Gbl.TimeTable.Interval].Columns[Gbl.TimeTable.Column].GrpCod = Gbl.TimeTable.GrpCod;
|
TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].Columns[Gbl.Timetable.Column].GrpCod = Gbl.Timetable.GrpCod;
|
||||||
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].Info,
|
Str_Copy (TT_TimeTable[Gbl.Timetable.Weekday][Gbl.Timetable.Interval].Columns[Gbl.Timetable.Column].Info,
|
||||||
Gbl.TimeTable.Info,
|
Gbl.Timetable.Info,
|
||||||
TT_MAX_BYTES_INFO);
|
TT_MAX_BYTES_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1156,7 +1155,7 @@ static void TT_DrawTimeTable (void)
|
||||||
|
|
||||||
HTM_TD_Begin ("rowspan=\"2\" class=\"TT_HOUR_BIG RM\" style=\"width:%u%%;\"",
|
HTM_TD_Begin ("rowspan=\"2\" class=\"TT_HOUR_BIG RM\" style=\"width:%u%%;\"",
|
||||||
TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN);
|
TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN);
|
||||||
HTM_TxtF ("%02u:00",Gbl.TimeTable.Config.Range.Hours.Start);
|
HTM_TxtF ("%02u:00",Gbl.Timetable.Config.Range.Hours.Start);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
TT_DrawCellAlignTimeTable ();
|
TT_DrawCellAlignTimeTable ();
|
||||||
|
@ -1165,7 +1164,7 @@ static void TT_DrawTimeTable (void)
|
||||||
|
|
||||||
HTM_TD_Begin ("rowspan=\"2\" class=\"TT_HOUR_BIG LM\" style=\"width:%u%%;\"",
|
HTM_TD_Begin ("rowspan=\"2\" class=\"TT_HOUR_BIG LM\" style=\"width:%u%%;\"",
|
||||||
TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN);
|
TT_PERCENT_WIDTH_OF_AN_HOUR_COLUMN);
|
||||||
HTM_TxtF ("%02u:00",Gbl.TimeTable.Config.Range.Hours.Start);
|
HTM_TxtF ("%02u:00",Gbl.Timetable.Config.Range.Hours.Start);
|
||||||
HTM_TD_End ();
|
HTM_TD_End ();
|
||||||
|
|
||||||
HTM_TR_End ();
|
HTM_TR_End ();
|
||||||
|
@ -1176,18 +1175,18 @@ static void TT_DrawTimeTable (void)
|
||||||
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
|
Grp_GetListGrpTypesAndGrpsInThisCrs (Grp_ONLY_GROUP_TYPES_WITH_GROUPS);
|
||||||
|
|
||||||
/***** Write the table row by row *****/
|
/***** Write the table row by row *****/
|
||||||
for (Interval = 0, Min = Gbl.TimeTable.Config.Range.MinutesPerInterval;
|
for (Interval = 0, Min = Gbl.Timetable.Config.Range.MinutesPerInterval;
|
||||||
Interval < Gbl.TimeTable.Config.IntervalsPerDay;
|
Interval < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
Interval++,
|
Interval++,
|
||||||
Min = (Min + Gbl.TimeTable.Config.Range.MinutesPerInterval) %
|
Min = (Min + Gbl.Timetable.Config.Range.MinutesPerInterval) %
|
||||||
TT_SECONDS_PER_MINUTE)
|
TT_SECONDS_PER_MINUTE)
|
||||||
{
|
{
|
||||||
HTM_TR_Begin (NULL);
|
HTM_TR_Begin (NULL);
|
||||||
|
|
||||||
/* Left hour:minutes cell */
|
/* Left hour:minutes cell */
|
||||||
if (Interval % 2)
|
if (Interval % 2)
|
||||||
TT_TimeTableDrawHourCell (Gbl.TimeTable.Config.Range.Hours.Start +
|
TT_TimeTableDrawHourCell (Gbl.Timetable.Config.Range.Hours.Start +
|
||||||
(Interval + 2) / Gbl.TimeTable.Config.IntervalsPerHour,
|
(Interval + 2) / Gbl.Timetable.Config.IntervalsPerHour,
|
||||||
Min,
|
Min,
|
||||||
"RM");
|
"RM");
|
||||||
|
|
||||||
|
@ -1210,15 +1209,15 @@ static void TT_DrawTimeTable (void)
|
||||||
ColumnsToDraw = TT_CalculateColsToDrawInCell (true, // Top call, non recursive
|
ColumnsToDraw = TT_CalculateColsToDrawInCell (true, // Top call, non recursive
|
||||||
Weekday,Interval);
|
Weekday,Interval);
|
||||||
if (ColumnsToDraw == 0 &&
|
if (ColumnsToDraw == 0 &&
|
||||||
(Gbl.TimeTable.View == TT_CRS_VIEW ||
|
(Gbl.Timetable.View == TT_CRS_VIEW ||
|
||||||
Gbl.TimeTable.View == TT_TUT_VIEW))
|
Gbl.Timetable.View == TT_TUT_VIEW))
|
||||||
ColumnsToDraw = 1;
|
ColumnsToDraw = 1;
|
||||||
// If editing and there's place for more columns,
|
// If editing and there's place for more columns,
|
||||||
// a potential new column is added at the end of each day
|
// a potential new column is added at the end of each day
|
||||||
ColumnsToDrawIncludingExtraColumn = ColumnsToDraw;
|
ColumnsToDrawIncludingExtraColumn = ColumnsToDraw;
|
||||||
if (ColumnsToDraw < TT_MAX_COLUMNS_PER_CELL &&
|
if (ColumnsToDraw < TT_MAX_COLUMNS_PER_CELL &&
|
||||||
(Gbl.TimeTable.View == TT_CRS_EDIT ||
|
(Gbl.Timetable.View == TT_CRS_EDIT ||
|
||||||
Gbl.TimeTable.View == TT_TUT_EDIT))
|
Gbl.Timetable.View == TT_TUT_EDIT))
|
||||||
ColumnsToDrawIncludingExtraColumn++;
|
ColumnsToDrawIncludingExtraColumn++;
|
||||||
|
|
||||||
/* Draw cells */
|
/* Draw cells */
|
||||||
|
@ -1256,8 +1255,8 @@ static void TT_DrawTimeTable (void)
|
||||||
|
|
||||||
/* Right hour:minutes cell */
|
/* Right hour:minutes cell */
|
||||||
if (Interval % 2)
|
if (Interval % 2)
|
||||||
TT_TimeTableDrawHourCell (Gbl.TimeTable.Config.Range.Hours.Start +
|
TT_TimeTableDrawHourCell (Gbl.Timetable.Config.Range.Hours.Start +
|
||||||
(Interval + 2) / Gbl.TimeTable.Config.IntervalsPerHour,
|
(Interval + 2) / Gbl.Timetable.Config.IntervalsPerHour,
|
||||||
Min,
|
Min,
|
||||||
"LM");
|
"LM");
|
||||||
|
|
||||||
|
@ -1372,7 +1371,7 @@ static unsigned TT_CalculateColsToDrawInCell (bool TopCall,
|
||||||
if (TopCall) // Top call, non recursive call
|
if (TopCall) // Top call, non recursive call
|
||||||
/****** Allocate space to store list of intervals already checked
|
/****** Allocate space to store list of intervals already checked
|
||||||
and initialize to false by using calloc *****/
|
and initialize to false by using calloc *****/
|
||||||
if ((TT_IntervalsChecked = (bool *) calloc (Gbl.TimeTable.Config.IntervalsPerDay,
|
if ((TT_IntervalsChecked = (bool *) calloc (Gbl.Timetable.Config.IntervalsPerDay,
|
||||||
sizeof (bool))) == NULL)
|
sizeof (bool))) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Error allocating memory for timetable.");
|
Lay_ShowErrorAndExit ("Error allocating memory for timetable.");
|
||||||
|
|
||||||
|
@ -1498,8 +1497,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
|
|
||||||
/***** If group code > 0, a group is selected ==> get group data *****/
|
/***** 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 data */
|
/* Get group data */
|
||||||
|
@ -1549,13 +1548,13 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
free (ClassStr);
|
free (ClassStr);
|
||||||
|
|
||||||
/***** Form to modify this cell *****/
|
/***** Form to modify this cell *****/
|
||||||
if (Gbl.TimeTable.View == TT_CRS_EDIT)
|
if (Gbl.Timetable.View == TT_CRS_EDIT)
|
||||||
Frm_StartForm (ActChgCrsTT);
|
Frm_StartForm (ActChgCrsTT);
|
||||||
else if (Gbl.TimeTable.View == TT_TUT_EDIT)
|
else if (Gbl.Timetable.View == TT_TUT_EDIT)
|
||||||
Frm_StartForm (ActChgTut);
|
Frm_StartForm (ActChgTut);
|
||||||
|
|
||||||
/***** Draw cell depending on type of view *****/
|
/***** Draw cell depending on type of view *****/
|
||||||
switch (Gbl.TimeTable.View)
|
switch (Gbl.Timetable.View)
|
||||||
{
|
{
|
||||||
case TT_CRS_VIEW: // View course timetable
|
case TT_CRS_VIEW: // View course timetable
|
||||||
case TT_TUT_VIEW: // View tutoring timetable
|
case TT_TUT_VIEW: // View tutoring timetable
|
||||||
|
@ -1565,7 +1564,7 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
HTM_DIV_Begin ("class=\"TT_CELL TT_TXT\"");
|
HTM_DIV_Begin ("class=\"TT_CELL TT_TXT\"");
|
||||||
|
|
||||||
/***** Course name *****/
|
/***** Course name *****/
|
||||||
if (Gbl.TimeTable.Type == TT_MY_TIMETABLE)
|
if (Gbl.Timetable.Type == TT_MY_TIMETABLE)
|
||||||
{
|
{
|
||||||
Crs.CrsCod = CrsCod;
|
Crs.CrsCod = CrsCod;
|
||||||
Crs_GetDataOfCourseByCod (&Crs);
|
Crs_GetDataOfCourseByCod (&Crs);
|
||||||
|
@ -1581,12 +1580,12 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
/***** Type of class and duration *****/
|
/***** Type of class and duration *****/
|
||||||
HTM_TxtF ("%s (%u:%02u)",
|
HTM_TxtF ("%s (%u:%02u)",
|
||||||
Txt_TIMETABLE_CLASS_TYPES[ClassType],
|
Txt_TIMETABLE_CLASS_TYPES[ClassType],
|
||||||
(DurationNumIntervals / Gbl.TimeTable.Config.IntervalsPerHour), // Hours
|
(DurationNumIntervals / Gbl.Timetable.Config.IntervalsPerHour), // Hours
|
||||||
(DurationNumIntervals % Gbl.TimeTable.Config.IntervalsPerHour) *
|
(DurationNumIntervals % Gbl.Timetable.Config.IntervalsPerHour) *
|
||||||
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)
|
GrpCod > 0)
|
||||||
{
|
{
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
|
@ -1631,8 +1630,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
CT <= (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1);
|
CT <= (TT_ClassType_t) (TT_NUM_CLASS_TYPES - 1);
|
||||||
CT++)
|
CT++)
|
||||||
if ((CT == TT_FREE) ||
|
if ((CT == TT_FREE) ||
|
||||||
((Gbl.TimeTable.View == TT_CRS_EDIT) && (CT == TT_LECTURE || CT == TT_PRACTICAL)) ||
|
((Gbl.Timetable.View == TT_CRS_EDIT) && (CT == TT_LECTURE || CT == TT_PRACTICAL)) ||
|
||||||
((Gbl.TimeTable.View == TT_TUT_EDIT) && (CT == TT_TUTORING)))
|
((Gbl.Timetable.View == TT_TUT_EDIT) && (CT == TT_TUTORING)))
|
||||||
HTM_OPTION (HTM_Type_STRING,TT_ClassTypeDB[CT],
|
HTM_OPTION (HTM_Type_STRING,TT_ClassTypeDB[CT],
|
||||||
CT == ClassType,false,
|
CT == ClassType,false,
|
||||||
"%s",Txt_TIMETABLE_CLASS_TYPES[CT]);
|
"%s",Txt_TIMETABLE_CLASS_TYPES[CT]);
|
||||||
|
@ -1641,17 +1640,17 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
if (IntervalType == TT_FREE_INTERVAL)
|
if (IntervalType == TT_FREE_INTERVAL)
|
||||||
{
|
{
|
||||||
for (i = Interval + 1;
|
for (i = Interval + 1;
|
||||||
i < Gbl.TimeTable.Config.IntervalsPerDay;
|
i < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
i++)
|
i++)
|
||||||
if (TT_TimeTable[Weekday][i].NumColumns == TT_MAX_COLUMNS_PER_CELL)
|
if (TT_TimeTable[Weekday][i].NumColumns == TT_MAX_COLUMNS_PER_CELL)
|
||||||
break;
|
break;
|
||||||
MaxDuration = i - Interval;
|
MaxDuration = i - Interval;
|
||||||
Dur = (MaxDuration >= Gbl.TimeTable.Config.IntervalsPerHour) ? Gbl.TimeTable.Config.IntervalsPerHour : // MaxDuration >= 1h ==> Dur = 1h
|
Dur = (MaxDuration >= Gbl.Timetable.Config.IntervalsPerHour) ? Gbl.Timetable.Config.IntervalsPerHour : // MaxDuration >= 1h ==> Dur = 1h
|
||||||
MaxDuration; // MaxDuration < 1h ==> Dur = MaxDuration
|
MaxDuration; // MaxDuration < 1h ==> Dur = MaxDuration
|
||||||
if (asprintf (&TTDur,"%u:%02u",
|
if (asprintf (&TTDur,"%u:%02u",
|
||||||
(Dur / Gbl.TimeTable.Config.IntervalsPerHour), // Hours
|
(Dur / Gbl.Timetable.Config.IntervalsPerHour), // Hours
|
||||||
(Dur % Gbl.TimeTable.Config.IntervalsPerHour) *
|
(Dur % Gbl.Timetable.Config.IntervalsPerHour) *
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval) < 0) // Minutes
|
Gbl.Timetable.Config.Range.MinutesPerInterval) < 0) // Minutes
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
Par_PutHiddenParamString (NULL,"TTDur",TTDur);
|
Par_PutHiddenParamString (NULL,"TTDur",TTDur);
|
||||||
free (TTDur);
|
free (TTDur);
|
||||||
|
@ -1662,7 +1661,7 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
HTM_SELECT_Begin (true,
|
HTM_SELECT_Begin (true,
|
||||||
"name=\"TTDur\" class=\"TT_DUR\"");
|
"name=\"TTDur\" class=\"TT_DUR\"");
|
||||||
for (i = Interval + TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals;
|
for (i = Interval + TT_TimeTable[Weekday][Interval].Columns[Column].DurationIntervals;
|
||||||
i < Gbl.TimeTable.Config.IntervalsPerDay;
|
i < Gbl.Timetable.Config.IntervalsPerDay;
|
||||||
i++)
|
i++)
|
||||||
if (TT_TimeTable[Weekday][i].NumColumns == TT_MAX_COLUMNS_PER_CELL)
|
if (TT_TimeTable[Weekday][i].NumColumns == TT_MAX_COLUMNS_PER_CELL)
|
||||||
break;
|
break;
|
||||||
|
@ -1674,9 +1673,9 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
Dur++)
|
Dur++)
|
||||||
{
|
{
|
||||||
if (asprintf (&TTDur,"%u:%02u",
|
if (asprintf (&TTDur,"%u:%02u",
|
||||||
(Dur / Gbl.TimeTable.Config.IntervalsPerHour), // Hours
|
(Dur / Gbl.Timetable.Config.IntervalsPerHour), // Hours
|
||||||
(Dur % Gbl.TimeTable.Config.IntervalsPerHour) *
|
(Dur % Gbl.Timetable.Config.IntervalsPerHour) *
|
||||||
Gbl.TimeTable.Config.Range.MinutesPerInterval) < 0) // Minutes
|
Gbl.Timetable.Config.Range.MinutesPerInterval) < 0) // Minutes
|
||||||
Lay_NotEnoughMemoryExit ();
|
Lay_NotEnoughMemoryExit ();
|
||||||
HTM_OPTION (HTM_Type_STRING,TTDur,
|
HTM_OPTION (HTM_Type_STRING,TTDur,
|
||||||
Dur == DurationNumIntervals,false,
|
Dur == DurationNumIntervals,false,
|
||||||
|
@ -1685,7 +1684,7 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
}
|
}
|
||||||
HTM_SELECT_End ();
|
HTM_SELECT_End ();
|
||||||
|
|
||||||
if (Gbl.TimeTable.View == TT_CRS_EDIT)
|
if (Gbl.Timetable.View == TT_CRS_EDIT)
|
||||||
{
|
{
|
||||||
/***** Group *****/
|
/***** Group *****/
|
||||||
HTM_BR ();
|
HTM_BR ();
|
||||||
|
@ -1758,8 +1757,8 @@ static void TT_TimeTableDrawCell (unsigned Weekday,unsigned Interval,unsigned Co
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** End form *****/
|
/***** End form *****/
|
||||||
if (Gbl.TimeTable.View == TT_CRS_EDIT ||
|
if (Gbl.Timetable.View == TT_CRS_EDIT ||
|
||||||
Gbl.TimeTable.View == TT_TUT_EDIT)
|
Gbl.Timetable.View == TT_TUT_EDIT)
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
|
|
||||||
/***** End cell *****/
|
/***** End cell *****/
|
||||||
|
|
|
@ -78,6 +78,34 @@ struct TT_Range
|
||||||
unsigned MinutesPerInterval; // 5, 15 or 30 minutes
|
unsigned MinutesPerInterval; // 5, 15 or 30 minutes
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct TT_Timetable
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
struct TT_Range Range;
|
||||||
|
unsigned HoursPerDay; // From start hour to end hour
|
||||||
|
unsigned SecondsPerInterval;
|
||||||
|
unsigned IntervalsPerHour;
|
||||||
|
unsigned IntervalsPerDay;
|
||||||
|
unsigned IntervalsBeforeStartHour;
|
||||||
|
} Config;
|
||||||
|
TT_TimeTableType_t Type;
|
||||||
|
TT_TimeTableView_t View;
|
||||||
|
unsigned Weekday;
|
||||||
|
unsigned Interval;
|
||||||
|
unsigned Column;
|
||||||
|
TT_ClassType_t ClassType;
|
||||||
|
unsigned DurationIntervals;
|
||||||
|
char Info[TT_MAX_BYTES_INFO + 1];
|
||||||
|
long GrpCod; // Group code (-1 if no group selected)
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
bool PutIconEditCrsTT;
|
||||||
|
bool PutIconEditOfficeHours;
|
||||||
|
bool PutIconPrint;
|
||||||
|
} ContextualIcons;
|
||||||
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public prototypes ****************************/
|
/****************************** Public prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
131
swad_user.c
131
swad_user.c
|
@ -155,7 +155,7 @@ extern struct Globals Gbl;
|
||||||
/****************************** Private variables ****************************/
|
/****************************** Private variables ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void (*Usr_FuncParamsBigList) (); // Used to pass pointer to function
|
static void (*Usr_FuncParamsBigList) (void *Args); // Used to pass pointer to function
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/***************************** Private prototypes ****************************/
|
/***************************** Private prototypes ****************************/
|
||||||
|
@ -179,7 +179,7 @@ static void Usr_ShowAlertThereAreMoreThanOneUsr (void);
|
||||||
|
|
||||||
static void Usr_SetMyPrefsAndRoles (void);
|
static void Usr_SetMyPrefsAndRoles (void);
|
||||||
|
|
||||||
static void Usr_PutLinkToLogOut (void *Args);
|
static void Usr_PutLinkToLogOut (__attribute__((unused)) void *Args);
|
||||||
|
|
||||||
static void Usr_InsertMyLastData (void);
|
static void Usr_InsertMyLastData (void);
|
||||||
|
|
||||||
|
@ -257,9 +257,9 @@ static void Usr_ShowOneListUsrsOption (Usr_ListUsrsOption_t ListUsrsAction,
|
||||||
const char *Label);
|
const char *Label);
|
||||||
static Usr_ListUsrsOption_t Usr_GetListUsrsOption (Usr_ListUsrsOption_t DefaultAction);
|
static Usr_ListUsrsOption_t Usr_GetListUsrsOption (Usr_ListUsrsOption_t DefaultAction);
|
||||||
|
|
||||||
static void Usr_PutIconsListGsts (void *Args);
|
static void Usr_PutIconsListGsts (__attribute__((unused)) void *Args);
|
||||||
static void Usr_PutIconsListStds (void *Args);
|
static void Usr_PutIconsListStds (__attribute__((unused)) void *Args);
|
||||||
static void Usr_PutIconsListTchs (void *Args);
|
static void Usr_PutIconsListTchs (__attribute__((unused)) void *Args);
|
||||||
|
|
||||||
static void Usr_PutIconToPrintGsts (void);
|
static void Usr_PutIconToPrintGsts (void);
|
||||||
static void Usr_PutIconToPrintStds (void);
|
static void Usr_PutIconToPrintStds (void);
|
||||||
|
@ -267,9 +267,9 @@ static void Usr_PutIconToPrintTchs (void);
|
||||||
static void Usr_PutIconToShowGstsAllData (void);
|
static void Usr_PutIconToShowGstsAllData (void);
|
||||||
static void Usr_PutIconToShowStdsAllData (void);
|
static void Usr_PutIconToShowStdsAllData (void);
|
||||||
static void Usr_PutIconToShowTchsAllData (void);
|
static void Usr_PutIconToShowTchsAllData (void);
|
||||||
static void Usr_ShowGstsAllDataParams (void *Args);
|
static void Usr_ShowGstsAllDataParams (__attribute__((unused)) void *Args);
|
||||||
static void Usr_ShowStdsAllDataParams (void *Args);
|
static void Usr_ShowStdsAllDataParams (__attribute__((unused)) void *Args);
|
||||||
static void Usr_ShowTchsAllDataParams (void *Args);
|
static void Usr_ShowTchsAllDataParams (__attribute__((unused)) void *Args);
|
||||||
|
|
||||||
static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType,
|
static void Usr_DrawClassPhoto (Usr_ClassPhotoType_t ClassPhotoType,
|
||||||
Rol_Role_t Role,
|
Rol_Role_t Role,
|
||||||
|
@ -3527,7 +3527,7 @@ void Usr_ShowFormsLogoutAndRole (void)
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Txt_Session,
|
Box_BoxBegin (NULL,Txt_Session,
|
||||||
Usr_PutLinkToLogOut,&Gbl,
|
Usr_PutLinkToLogOut,NULL,
|
||||||
Hlp_PROFILE_Session_role,Box_NOT_CLOSABLE);
|
Hlp_PROFILE_Session_role,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Put a form to change my role *****/
|
/***** Put a form to change my role *****/
|
||||||
|
@ -3557,16 +3557,15 @@ void Usr_ShowFormsLogoutAndRole (void)
|
||||||
/************** Put an icon (form) to close the current session **************/
|
/************** Put an icon (form) to close the current session **************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Usr_PutLinkToLogOut (void *Args)
|
static void Usr_PutLinkToLogOut (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Log_out;
|
extern const char *Txt_Log_out;
|
||||||
|
|
||||||
if (Args)
|
/***** Put form to log out *****/
|
||||||
/***** Put form to log out *****/
|
Lay_PutContextualLinkOnlyIcon (ActLogOut,NULL,
|
||||||
Lay_PutContextualLinkOnlyIcon (ActLogOut,NULL,
|
NULL,NULL,
|
||||||
NULL,NULL,
|
"sign-out-alt-red.svg",
|
||||||
"sign-out-alt-red.svg",
|
Txt_Log_out);
|
||||||
Txt_Log_out);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -5686,7 +5685,7 @@ static void Usr_PutParamsConfirmIWantToSeeBigList (void *Args)
|
||||||
Grp_PutParamsCodGrps ();
|
Grp_PutParamsCodGrps ();
|
||||||
Usr_PutParamsPrefsAboutUsrList ();
|
Usr_PutParamsPrefsAboutUsrList ();
|
||||||
if (Usr_FuncParamsBigList)
|
if (Usr_FuncParamsBigList)
|
||||||
Usr_FuncParamsBigList ();
|
Usr_FuncParamsBigList (Args);
|
||||||
Par_PutHiddenParamChar ("ShowBigList",'Y');
|
Par_PutHiddenParamChar ("ShowBigList",'Y');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7568,7 +7567,7 @@ void Usr_ListDataAdms (void)
|
||||||
HTM_DIV_Begin ("class=\"PREF_CONT\"");
|
HTM_DIV_Begin ("class=\"PREF_CONT\"");
|
||||||
HTM_DIV_Begin ("class=\"PREF_OFF\"");
|
HTM_DIV_Begin ("class=\"PREF_OFF\"");
|
||||||
Frm_StartForm (ActLstOth);
|
Frm_StartForm (ActLstOth);
|
||||||
Sco_PutParamCurrentScope (&Gbl);
|
Sco_PutParamCurrentScope (&Gbl.Scope.Current);
|
||||||
Usr_PutCheckboxListWithPhotos ();
|
Usr_PutCheckboxListWithPhotos ();
|
||||||
Frm_EndForm ();
|
Frm_EndForm ();
|
||||||
HTM_DIV_End ();
|
HTM_DIV_End ();
|
||||||
|
@ -8016,7 +8015,7 @@ void Usr_SeeGuests (void)
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Txt_ROLES_PLURAL_Abc[Rol_GST][Usr_SEX_UNKNOWN],
|
Box_BoxBegin (NULL,Txt_ROLES_PLURAL_Abc[Rol_GST][Usr_SEX_UNKNOWN],
|
||||||
Usr_PutIconsListGsts,&Gbl,
|
Usr_PutIconsListGsts,NULL,
|
||||||
Hlp_USERS_Guests,Box_NOT_CLOSABLE);
|
Hlp_USERS_Guests,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Form to select scope *****/
|
/***** Form to select scope *****/
|
||||||
|
@ -8039,11 +8038,11 @@ void Usr_SeeGuests (void)
|
||||||
if (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs)
|
if (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs)
|
||||||
{
|
{
|
||||||
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs,
|
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs,
|
||||||
Sco_PutParamCurrentScope,&Gbl,
|
Sco_PutParamCurrentScope,&Gbl.Scope.Current,
|
||||||
NULL))
|
NULL))
|
||||||
{
|
{
|
||||||
/***** Form to select type of list of users *****/
|
/***** Form to select type of list of users *****/
|
||||||
Usr_ShowFormsToSelectUsrListType (Sco_PutParamCurrentScope,&Gbl);
|
Usr_ShowFormsToSelectUsrListType (Sco_PutParamCurrentScope,&Gbl.Scope.Current);
|
||||||
|
|
||||||
/***** Draw a class photo with guests *****/
|
/***** Draw a class photo with guests *****/
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_LIST_AS_CLASS_PHOTO)
|
if (Gbl.Usrs.Me.ListType == Usr_LIST_AS_CLASS_PHOTO)
|
||||||
|
@ -8159,7 +8158,7 @@ void Usr_SeeStudents (void)
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],
|
Box_BoxBegin (NULL,Txt_ROLES_PLURAL_Abc[Rol_STD][Usr_SEX_UNKNOWN],
|
||||||
Usr_PutIconsListStds,&Gbl,
|
Usr_PutIconsListStds,NULL,
|
||||||
Hlp_USERS_Students,Box_NOT_CLOSABLE);
|
Hlp_USERS_Students,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Form to select scope *****/
|
/***** Form to select scope *****/
|
||||||
|
@ -8185,7 +8184,7 @@ void Usr_SeeStudents (void)
|
||||||
|
|
||||||
/***** Form to select groups *****/
|
/***** Form to select groups *****/
|
||||||
if (Gbl.Scope.Current == Hie_CRS)
|
if (Gbl.Scope.Current == Hie_CRS)
|
||||||
Grp_ShowFormToSelectSeveralGroups (Sco_PutParamCurrentScope,&Gbl,
|
Grp_ShowFormToSelectSeveralGroups (Sco_PutParamCurrentScope,&Gbl.Scope.Current,
|
||||||
Grp_MY_GROUPS);
|
Grp_MY_GROUPS);
|
||||||
|
|
||||||
/***** Start section with user list *****/
|
/***** Start section with user list *****/
|
||||||
|
@ -8194,11 +8193,11 @@ void Usr_SeeStudents (void)
|
||||||
if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs)
|
if (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs)
|
||||||
{
|
{
|
||||||
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs,
|
if (Usr_GetIfShowBigList (Gbl.Usrs.LstUsrs[Rol_STD].NumUsrs,
|
||||||
Sco_PutParamCurrentScope,&Gbl,
|
Sco_PutParamCurrentScope,&Gbl.Scope.Current,
|
||||||
NULL))
|
NULL))
|
||||||
{
|
{
|
||||||
/***** Form to select type of list of users *****/
|
/***** Form to select type of list of users *****/
|
||||||
Usr_ShowFormsToSelectUsrListType (Sco_PutParamCurrentScope,&Gbl);
|
Usr_ShowFormsToSelectUsrListType (Sco_PutParamCurrentScope,&Gbl.Scope.Current);
|
||||||
|
|
||||||
/***** Draw a class photo with students of the course *****/
|
/***** Draw a class photo with students of the course *****/
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_LIST_AS_CLASS_PHOTO)
|
if (Gbl.Usrs.Me.ListType == Usr_LIST_AS_CLASS_PHOTO)
|
||||||
|
@ -8346,7 +8345,7 @@ void Usr_SeeTeachers (void)
|
||||||
|
|
||||||
/***** Begin box *****/
|
/***** Begin box *****/
|
||||||
Box_BoxBegin (NULL,Txt_ROLES_PLURAL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
|
Box_BoxBegin (NULL,Txt_ROLES_PLURAL_Abc[Rol_TCH][Usr_SEX_UNKNOWN],
|
||||||
Usr_PutIconsListTchs,&Gbl,
|
Usr_PutIconsListTchs,NULL,
|
||||||
Hlp_USERS_Teachers,Box_NOT_CLOSABLE);
|
Hlp_USERS_Teachers,Box_NOT_CLOSABLE);
|
||||||
|
|
||||||
/***** Form to select scope *****/
|
/***** Form to select scope *****/
|
||||||
|
@ -8362,7 +8361,7 @@ void Usr_SeeTeachers (void)
|
||||||
|
|
||||||
/***** Form to select groups *****/
|
/***** Form to select groups *****/
|
||||||
if (Gbl.Scope.Current == Hie_CRS)
|
if (Gbl.Scope.Current == Hie_CRS)
|
||||||
Grp_ShowFormToSelectSeveralGroups (Sco_PutParamCurrentScope,&Gbl,
|
Grp_ShowFormToSelectSeveralGroups (Sco_PutParamCurrentScope,&Gbl.Scope.Current,
|
||||||
Grp_MY_GROUPS);
|
Grp_MY_GROUPS);
|
||||||
|
|
||||||
/***** Start section with user list *****/
|
/***** Start section with user list *****/
|
||||||
|
@ -8371,11 +8370,11 @@ void Usr_SeeTeachers (void)
|
||||||
if (NumUsrs)
|
if (NumUsrs)
|
||||||
{
|
{
|
||||||
if (Usr_GetIfShowBigList (NumUsrs,
|
if (Usr_GetIfShowBigList (NumUsrs,
|
||||||
Sco_PutParamCurrentScope,&Gbl,
|
Sco_PutParamCurrentScope,&Gbl.Scope.Current,
|
||||||
NULL))
|
NULL))
|
||||||
{
|
{
|
||||||
/***** Form to select type of list of users *****/
|
/***** Form to select type of list of users *****/
|
||||||
Usr_ShowFormsToSelectUsrListType (Sco_PutParamCurrentScope,&Gbl);
|
Usr_ShowFormsToSelectUsrListType (Sco_PutParamCurrentScope,&Gbl.Scope.Current);
|
||||||
|
|
||||||
/***** Draw a class photo with teachers of the course *****/
|
/***** Draw a class photo with teachers of the course *****/
|
||||||
if (Gbl.Usrs.Me.ListType == Usr_LIST_AS_CLASS_PHOTO)
|
if (Gbl.Usrs.Me.ListType == Usr_LIST_AS_CLASS_PHOTO)
|
||||||
|
@ -8763,35 +8762,32 @@ static Usr_ListUsrsOption_t Usr_GetListUsrsOption (Usr_ListUsrsOption_t DefaultA
|
||||||
/***************** Put contextual icons in list of guests ********************/
|
/***************** Put contextual icons in list of guests ********************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Usr_PutIconsListGsts (void *Args)
|
static void Usr_PutIconsListGsts (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
switch (Gbl.Usrs.Me.ListType)
|
||||||
{
|
{
|
||||||
switch (Gbl.Usrs.Me.ListType)
|
case Usr_LIST_AS_CLASS_PHOTO:
|
||||||
{
|
if (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs)
|
||||||
case Usr_LIST_AS_CLASS_PHOTO:
|
/***** Put icon to print guests *****/
|
||||||
if (Gbl.Usrs.LstUsrs[Rol_GST].NumUsrs)
|
Usr_PutIconToPrintGsts ();
|
||||||
/***** Put icon to print guests *****/
|
break;
|
||||||
Usr_PutIconToPrintGsts ();
|
case Usr_LIST_AS_LISTING:
|
||||||
break;
|
/***** Put icon to show all data of guests *****/
|
||||||
case Usr_LIST_AS_LISTING:
|
Usr_PutIconToShowGstsAllData ();
|
||||||
/***** Put icon to show all data of guests *****/
|
break;
|
||||||
Usr_PutIconToShowGstsAllData ();
|
default:
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***** Put icon to show a figure *****/
|
|
||||||
Fig_PutIconToShowFigure (Fig_USERS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***** Put icon to show a figure *****/
|
||||||
|
Fig_PutIconToShowFigure (Fig_USERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/**************** Put contextual icons in list of students *******************/
|
/**************** Put contextual icons in list of students *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Usr_PutIconsListStds (void *Args)
|
static void Usr_PutIconsListStds (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Args)
|
||||||
{
|
{
|
||||||
|
@ -8819,7 +8815,7 @@ static void Usr_PutIconsListStds (void *Args)
|
||||||
/**************** Put contextual icons in list of teachers *******************/
|
/**************** Put contextual icons in list of teachers *******************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Usr_PutIconsListTchs (void *Args)
|
static void Usr_PutIconsListTchs (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
if (Args)
|
||||||
{
|
{
|
||||||
|
@ -8850,19 +8846,19 @@ static void Usr_PutIconsListTchs (void *Args)
|
||||||
static void Usr_PutIconToPrintGsts (void)
|
static void Usr_PutIconToPrintGsts (void)
|
||||||
{
|
{
|
||||||
Ico_PutContextualIconToPrint (ActPrnGstPho,
|
Ico_PutContextualIconToPrint (ActPrnGstPho,
|
||||||
Usr_ShowGstsAllDataParams,&Gbl);
|
Usr_ShowGstsAllDataParams,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Usr_PutIconToPrintStds (void)
|
static void Usr_PutIconToPrintStds (void)
|
||||||
{
|
{
|
||||||
Ico_PutContextualIconToPrint (ActPrnStdPho,
|
Ico_PutContextualIconToPrint (ActPrnStdPho,
|
||||||
Usr_ShowStdsAllDataParams,&Gbl);
|
Usr_ShowStdsAllDataParams,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Usr_PutIconToPrintTchs (void)
|
static void Usr_PutIconToPrintTchs (void)
|
||||||
{
|
{
|
||||||
Ico_PutContextualIconToPrint (ActPrnTchPho,
|
Ico_PutContextualIconToPrint (ActPrnTchPho,
|
||||||
Usr_ShowTchsAllDataParams,&Gbl);
|
Usr_ShowTchsAllDataParams,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -8874,7 +8870,7 @@ static void Usr_PutIconToShowGstsAllData (void)
|
||||||
extern const char *Txt_Show_all_data_in_a_table;
|
extern const char *Txt_Show_all_data_in_a_table;
|
||||||
|
|
||||||
Lay_PutContextualLinkOnlyIcon (ActLstGstAll,NULL,
|
Lay_PutContextualLinkOnlyIcon (ActLstGstAll,NULL,
|
||||||
Usr_ShowGstsAllDataParams,&Gbl,
|
Usr_ShowGstsAllDataParams,NULL,
|
||||||
"table.svg",
|
"table.svg",
|
||||||
Txt_Show_all_data_in_a_table);
|
Txt_Show_all_data_in_a_table);
|
||||||
}
|
}
|
||||||
|
@ -8884,7 +8880,7 @@ static void Usr_PutIconToShowStdsAllData (void)
|
||||||
extern const char *Txt_Show_all_data_in_a_table;
|
extern const char *Txt_Show_all_data_in_a_table;
|
||||||
|
|
||||||
Lay_PutContextualLinkOnlyIcon (ActLstStdAll,NULL,
|
Lay_PutContextualLinkOnlyIcon (ActLstStdAll,NULL,
|
||||||
Usr_ShowStdsAllDataParams,&Gbl,
|
Usr_ShowStdsAllDataParams,NULL,
|
||||||
"table.svg",
|
"table.svg",
|
||||||
Txt_Show_all_data_in_a_table);
|
Txt_Show_all_data_in_a_table);
|
||||||
}
|
}
|
||||||
|
@ -8894,33 +8890,26 @@ static void Usr_PutIconToShowTchsAllData (void)
|
||||||
extern const char *Txt_Show_all_data_in_a_table;
|
extern const char *Txt_Show_all_data_in_a_table;
|
||||||
|
|
||||||
Lay_PutContextualLinkOnlyIcon (ActLstTchAll,NULL,
|
Lay_PutContextualLinkOnlyIcon (ActLstTchAll,NULL,
|
||||||
Usr_ShowTchsAllDataParams,&Gbl,
|
Usr_ShowTchsAllDataParams,NULL,
|
||||||
"table.svg",
|
"table.svg",
|
||||||
Txt_Show_all_data_in_a_table);
|
Txt_Show_all_data_in_a_table);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Usr_ShowGstsAllDataParams (void *Args)
|
static void Usr_ShowGstsAllDataParams (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Usr_PutParamListWithPhotos ();
|
||||||
Usr_PutParamListWithPhotos ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Usr_ShowStdsAllDataParams (void *Args)
|
static void Usr_ShowStdsAllDataParams (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Grp_PutParamsCodGrps ();
|
||||||
{
|
Usr_PutParamListWithPhotos ();
|
||||||
Grp_PutParamsCodGrps ();
|
|
||||||
Usr_PutParamListWithPhotos ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Usr_ShowTchsAllDataParams (void *Args)
|
static void Usr_ShowTchsAllDataParams (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Sco_PutParamCurrentScope (&Gbl.Scope.Current);
|
||||||
{
|
Usr_PutParamListWithPhotos ();
|
||||||
Sco_PutParamCurrentScope (&Gbl);
|
|
||||||
Usr_PutParamListWithPhotos ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
15
swad_zip.c
15
swad_zip.c
|
@ -74,7 +74,7 @@ extern struct Globals Gbl;
|
||||||
/***************************** Private prototypes ****************************/
|
/***************************** Private prototypes ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void ZIP_PutLinkToCreateZIPAsgWrkParams (void *Args);
|
static void ZIP_PutLinkToCreateZIPAsgWrkParams (__attribute__((unused)) void *Args);
|
||||||
|
|
||||||
static void ZIP_CreateTmpDirForCompression (void);
|
static void ZIP_CreateTmpDirForCompression (void);
|
||||||
static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat);
|
static void ZIP_CreateDirCompressionUsr (struct UsrData *UsrDat);
|
||||||
|
@ -93,19 +93,16 @@ void ZIP_PutLinkToCreateZIPAsgWrk (void)
|
||||||
extern const char *Txt_Create_ZIP_file;
|
extern const char *Txt_Create_ZIP_file;
|
||||||
|
|
||||||
Lay_PutContextualLinkIconText (ActAdmAsgWrkCrs,NULL,
|
Lay_PutContextualLinkIconText (ActAdmAsgWrkCrs,NULL,
|
||||||
ZIP_PutLinkToCreateZIPAsgWrkParams,&Gbl,
|
ZIP_PutLinkToCreateZIPAsgWrkParams,NULL,
|
||||||
"download.svg",
|
"download.svg",
|
||||||
Txt_Create_ZIP_file);
|
Txt_Create_ZIP_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ZIP_PutLinkToCreateZIPAsgWrkParams (void *Args)
|
static void ZIP_PutLinkToCreateZIPAsgWrkParams (__attribute__((unused)) void *Args)
|
||||||
{
|
{
|
||||||
if (Args)
|
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
||||||
{
|
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
||||||
Usr_PutHiddenParSelectedUsrsCods (&Gbl.Usrs.Selected);
|
Par_PutHiddenParamChar ("CreateZIP",'Y');
|
||||||
Brw_PutHiddenParamFullTreeIfSelected (&Gbl.FileBrowser.FullTree);
|
|
||||||
Par_PutHiddenParamChar ("CreateZIP",'Y');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue