From 5e6ff349cc478afd5e6902a431bbe901fb0c4107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sun, 27 Nov 2016 17:30:10 +0100 Subject: [PATCH] Version 16.73 --- swad_changelog.h | 5 ++- swad_record.c | 79 +++++++++++++++++++++++++++--------------------- 2 files changed, 47 insertions(+), 37 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index b37f31b17..a9fddc377 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -172,19 +172,18 @@ // TODO: List only confirmed emails to send a message with MESSAGES > Email ? -// TODO: Link "Show office hours" in bold when activated - /*****************************************************************************/ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.72.2 (2016-11-27)" +#define Log_PLATFORM_VERSION "SWAD 16.73 (2016-11-27)" #define CSS_FILE "swad16.69.css" #define JS_FILE "swad16.46.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*?.h sql/swad*.sql | tail -1 /* + Version 16.73: Nov 27, 2016 Changes in teacher's record card. (207711 lines) Version 16.72.2: Nov 27, 2016 Fixed bug in answers of survey. (207704 lines) Version 16.72.1: Nov 27, 2016 Fixed bug in answers of test questions, reported by Javier Fernández Baldomero. (207704 lines) Version 16.72: Nov 27, 2016 Link to show all users' data. diff --git a/swad_record.c b/swad_record.c index 5be5cb09c..e0c5bb579 100644 --- a/swad_record.c +++ b/swad_record.c @@ -78,7 +78,10 @@ static void Rec_ShowRecordOneTchCrs (void); static void Rec_ShowLinkToPrintPreviewOfRecords (void); static void Rec_GetParamRecordsPerPage (void); -static void Rec_WriteFormShowOfficeHours (bool ShowOfficeHours,const char *ListUsrCods); +static void Rec_WriteFormShowOfficeHoursOneTch (bool ShowOfficeHours); +static void Rec_WriteFormShowOfficeHoursSeveralTchs (bool ShowOfficeHours); +static void Rec_PutParamsShowOfficeHoursOneTch (void); +static void Rec_PutParamsShowOfficeHoursSeveralTchs (void); static bool Rec_GetParamShowOfficeHours (void); static void Rec_ShowCrsRecord (Rec_CourseRecordViewType_t TypeOfView, struct UsrData *UsrDat,const char *Anchor); @@ -1229,6 +1232,7 @@ static void Rec_ShowRecordOneTchCrs (void) extern const char *Hlp_USERS_Teachers_timetable; extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES]; char Width[10+2+1]; + bool ShowOfficeHours; /***** Width for office hours *****/ sprintf (Width,"%upx",Rec_RECORD_WIDTH); @@ -1241,11 +1245,14 @@ static void Rec_ShowRecordOneTchCrs (void) /***** Asign users listing type depending on current action *****/ Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_TEACHERS; + /***** Get if I want to see teachers' office hours in teachers' records *****/ + ShowOfficeHours = Rec_GetParamShowOfficeHours (); + /***** Show contextual menu *****/ fprintf (Gbl.F.Out,"
"); /* Show office hours? */ - Rec_WriteFormShowOfficeHours (true,Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); + Rec_WriteFormShowOfficeHoursOneTch (ShowOfficeHours); /* Link to print view */ Act_FormStart (ActPrnRecSevTch); @@ -1264,11 +1271,14 @@ static void Rec_ShowRecordOneTchCrs (void) Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat); /* Office hours */ - Gbl.TimeTable.Type = TT_TUTOR_TIMETABLE; - Lay_StartRoundFrame (Width,Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type], - NULL,Hlp_USERS_Teachers_timetable); - TT_ShowTimeTable (Gbl.Usrs.Other.UsrDat.UsrCod); - Lay_EndRoundFrame (); + if (ShowOfficeHours) + { + Gbl.TimeTable.Type = TT_TUTOR_TIMETABLE; + Lay_StartRoundFrame (Width,Txt_TIMETABLE_TYPES[Gbl.TimeTable.Type], + NULL,Hlp_USERS_Teachers_timetable); + TT_ShowTimeTable (Gbl.Usrs.Other.UsrDat.UsrCod); + Lay_EndRoundFrame (); + } fprintf (Gbl.F.Out,"
"); } @@ -1320,7 +1330,7 @@ void Rec_ListRecordsTchs (void) fprintf (Gbl.F.Out,"
"); /* Show office hours? */ - Rec_WriteFormShowOfficeHours (ShowOfficeHours,Gbl.Usrs.Select.All); + Rec_WriteFormShowOfficeHoursSeveralTchs (ShowOfficeHours); /* Link to print view */ Act_FormStart (ActPrnRecSevTch); @@ -1433,38 +1443,39 @@ static void Rec_GetParamRecordsPerPage (void) } /*****************************************************************************/ -/************** Write a form to select whether show full tree ****************/ +/*********** Write a form to select whether show all office hours ************/ /*****************************************************************************/ -static void Rec_WriteFormShowOfficeHours (bool ShowOfficeHours,const char *ListUsrCods) +static void Rec_WriteFormShowOfficeHoursOneTch (bool ShowOfficeHours) { - extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *Txt_Show_office_hours; - /***** Start form *****/ - Act_FormStart (ActSeeRecSevTch); - Usr_PutHiddenParUsrCodAll (ActSeeRecSevTch,ListUsrCods); - Par_PutHiddenParamChar ("ParamOfficeHours",'Y'); + Lay_PutContextualCheckbox (ActSeeRecOneTch,Rec_PutParamsShowOfficeHoursOneTch, + "ShowOfficeHours",ShowOfficeHours, + Txt_Show_office_hours, + Txt_Show_office_hours); + } - /***** End form *****/ - fprintf (Gbl.F.Out,"
" - "" - "\"%s\"" - " %s" - "
", - Gbl.Form.Id, - Gbl.Prefs.IconsURL, - Txt_Show_office_hours, - Txt_Show_office_hours, - The_ClassForm[Gbl.Prefs.Theme], - Txt_Show_office_hours); - Act_FormEnd (); +static void Rec_WriteFormShowOfficeHoursSeveralTchs (bool ShowOfficeHours) + { + extern const char *Txt_Show_office_hours; + + Lay_PutContextualCheckbox (ActSeeRecSevTch,Rec_PutParamsShowOfficeHoursSeveralTchs, + "ShowOfficeHours",ShowOfficeHours, + Txt_Show_office_hours, + Txt_Show_office_hours); + } + +static void Rec_PutParamsShowOfficeHoursOneTch (void) + { + Usr_PutParamUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EncryptedUsrCod); + Par_PutHiddenParamChar ("ParamOfficeHours",'Y'); + } + +static void Rec_PutParamsShowOfficeHoursSeveralTchs (void) + { + Usr_PutHiddenParUsrCodAll (ActSeeRecSevTch,Gbl.Usrs.Select.All); + Par_PutHiddenParamChar ("ParamOfficeHours",'Y'); } /*****************************************************************************/