From 41b15cf330deff5b9b906f301a6415c3ab155d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 10 May 2017 10:09:19 +0200 Subject: [PATCH] Version 16.210 --- swad_ID.c | 3 +- swad_changelog.h | 7 ++-- swad_record.c | 89 +++++++++++++++++++++++++++++++++--------------- 3 files changed, 67 insertions(+), 32 deletions(-) diff --git a/swad_ID.c b/swad_ID.c index 8a8982397..fa8ab9ebf 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -456,7 +456,8 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, Anchor); if (Gbl.Action.Original != ActUnk) { - Par_PutHiddenParamLong ("OriginalActCod",Act_Actions[Gbl.Action.Original].ActCod); // Original action, used to know where we came from + Par_PutHiddenParamLong ("OriginalActCod", + Act_Actions[Gbl.Action.Original].ActCod); // Original action, used to know where we came from switch (Gbl.Action.Original) { case ActSeeRecSevGst: diff --git a/swad_changelog.h b/swad_changelog.h index dfeec379b..25d0a9dd7 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -234,15 +234,16 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.209.4 (2017-05-10)" +#define Log_PLATFORM_VERSION "SWAD 16.210 (2017-05-10)" #define CSS_FILE "swad16.209.3.css" #define JS_FILE "swad16.206.3.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.209.4: May 09, 2017 Changes in layout of list of guests' records. (218838 lines) - Version 16.209.3: May 09, 2017 Changes in layout of list of teachers' records. (218830 lines) + Version 16.210: May 10, 2017 Changes in layout of records. (218869 lines) + Version 16.209.4: May 10, 2017 Changes in layout of list of guests' records. (218838 lines) + Version 16.209.3: May 10, 2017 Changes in layout of list of teachers' records. (218830 lines) Version 16.209.2: May 09, 2017 Fixed bug in hidden parameters. (218831 lines) 1 change necessary in database: ALTER TABLE hidden_params CHANGE COLUMN ParamValue ParamValue LONGTEXT NOT NULL; diff --git a/swad_record.c b/swad_record.c index 27ab61f07..8bca2f4d1 100644 --- a/swad_record.c +++ b/swad_record.c @@ -109,8 +109,8 @@ static void Rec_ShowCountryInHead (struct UsrData *UsrDat,bool ShowData); static void Rec_ShowWebsAndSocialNets (struct UsrData *UsrDat, Rec_SharedRecordViewType_t TypeOfView); static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm); -static void Rec_ShowUsrIDs (struct UsrData *UsrDat,const char *Anchor, - const char *ClassForm); +static void Rec_ShowUsrIDs (struct UsrData *UsrDat,const char *ClassForm, + const char *Anchor); static void Rec_ShowRole (struct UsrData *UsrDat, Rec_SharedRecordViewType_t TypeOfView, const char *ClassForm); @@ -984,7 +984,7 @@ void Rec_PutLinkToEditRecordFields (void) void Rec_ListRecordsGstsShow (void) { - Gbl.Action.Original = ActSeeRecSevGst; + Gbl.Action.Original = ActSeeRecSevGst; // Used to know where to go when confirming ID Rec_ListRecordsGsts (Rec_SHA_RECORD_LIST); } @@ -999,6 +999,7 @@ static void Rec_ListRecordsGsts (Rec_SharedRecordViewType_t TypeOfView) unsigned NumUsr = 0; const char *Ptr; struct UsrData UsrDat; + char Anchor[32]; /***** Assign users listing type depending on current action *****/ Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_GUESTS; @@ -1046,16 +1047,22 @@ static void Rec_ListRecordsGsts (Rec_SharedRecordViewType_t TypeOfView) if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the student { /* Start container for this user */ - fprintf (Gbl.F.Out,"
"); + /* Show optional alert */ + if (UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) // Selected user + Lay_ShowPendingAlert (); + /* Shared record */ fprintf (Gbl.F.Out,"
"); - Rec_ShowSharedUsrRecord (TypeOfView,&UsrDat,NULL); + Rec_ShowSharedUsrRecord (TypeOfView,&UsrDat,Anchor); fprintf (Gbl.F.Out,"
"); /* End container for this user */ @@ -1096,9 +1103,12 @@ static void Rec_ShowRecordOneStdCrs (void) Gbl.CurrentCrs.Crs.CrsCod, true); - /***** Asign users listing type depending on current action *****/ + /***** Assign users listing type depending on current action *****/ Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_STUDENTS; + /***** Get list of fields of records in current course *****/ + Rec_GetListRecordFieldsInCurrentCrs (); + /***** Put contextual links *****/ fprintf (Gbl.F.Out,"
"); @@ -1114,27 +1124,40 @@ static void Rec_ShowRecordOneStdCrs (void) fprintf (Gbl.F.Out,"
"); - /***** Show optional alert *****/ + /***** Show optional alert (result of editing data in course record) *****/ Lay_ShowPendingAlert (); + /***** Start container for this user *****/ + fprintf (Gbl.F.Out,"
"); + /***** Shared record *****/ + fprintf (Gbl.F.Out,"
"); Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat,NULL); + fprintf (Gbl.F.Out,"
"); /***** Record of the student in the course *****/ - /* Get list of fields of records in current course */ - Rec_GetListRecordFieldsInCurrentCrs (); - if (Gbl.CurrentCrs.Records.LstFields.Num) // There are fields in the record { if (Gbl.Usrs.Me.LoggedRole == Rol_TEACHER || Gbl.Usrs.Me.LoggedRole == Rol_SYS_ADM) + { + fprintf (Gbl.F.Out,"
"); Rec_ShowCrsRecord (Rec_CRS_LIST_ONE_RECORD,&Gbl.Usrs.Other.UsrDat,NULL); + fprintf (Gbl.F.Out,"
"); + } else if (Gbl.Usrs.Me.LoggedRole == Rol_STUDENT && Gbl.Usrs.Me.UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) // It's me + { + fprintf (Gbl.F.Out,"
"); Rec_ShowCrsRecord (Rec_CRS_MY_RECORD_AS_STUDENT_FORM,&Gbl.Usrs.Other.UsrDat,NULL); + fprintf (Gbl.F.Out,"
"); + } } - /* Free list of fields of records */ + /***** End container for this user *****/ + fprintf (Gbl.F.Out,"
"); + + /***** Free list of fields of records *****/ Rec_FreeListFields (); } @@ -1144,7 +1167,8 @@ static void Rec_ShowRecordOneStdCrs (void) void Rec_ListRecordsStdsShow (void) { - Gbl.Action.Original = ActSeeRecSevStd; + Gbl.Action.Original = ActSeeRecSevStd; // Used to know where to go when confirming ID... + // ...or changing course record Rec_ListRecordsStds (Rec_SHA_RECORD_LIST, Rec_CRS_LIST_SEVERAL_RECORDS); } @@ -1161,10 +1185,10 @@ static void Rec_ListRecordsStds (Rec_SharedRecordViewType_t ShaTypeOfView, extern const char *Txt_You_must_select_one_ore_more_students; unsigned NumUsr = 0; const char *Ptr; - char Anchor[32]; struct UsrData UsrDat; + char Anchor[32]; - /***** Asign users listing type depending on current action *****/ + /***** Assign users listing type depending on current action *****/ Gbl.Usrs.Listing.RecsUsrs = Rec_RECORD_USERS_STUDENTS; /***** Get parameter with number of user records per page (only for printing) *****/ @@ -1304,7 +1328,7 @@ static void Rec_ShowRecordOneTchCrs (void) Gbl.CurrentCrs.Crs.CrsCod, true); - /***** Asign users listing type depending on current action *****/ + /***** Assign 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 *****/ @@ -1326,23 +1350,28 @@ static void Rec_ShowRecordOneTchCrs (void) fprintf (Gbl.F.Out,""); - fprintf (Gbl.F.Out,"
"); + /***** Start container for this user *****/ + fprintf (Gbl.F.Out,"
"); - /* Shared record */ + /***** Shared record *****/ + fprintf (Gbl.F.Out,"
"); Rec_ShowSharedUsrRecord (Rec_SHA_RECORD_LIST,&Gbl.Usrs.Other.UsrDat,NULL); + fprintf (Gbl.F.Out,"
"); - /* Office hours */ + /***** Office hours *****/ if (ShowOfficeHours) { + fprintf (Gbl.F.Out,"
"); Gbl.TimeTable.Type = TT_TUTORING_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,"
"); } - fprintf (Gbl.F.Out,"
"); + /***** Start container for this user *****/ + fprintf (Gbl.F.Out,"
"); } /*****************************************************************************/ @@ -1351,7 +1380,7 @@ static void Rec_ShowRecordOneTchCrs (void) void Rec_ListRecordsTchsShow (void) { - Gbl.Action.Original = ActSeeRecSevTch; + Gbl.Action.Original = ActSeeRecSevTch; // Used to know where to go when confirming ID Rec_ListRecordsTchs (Rec_SHA_RECORD_LIST); } @@ -1367,15 +1396,15 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView) extern const char *Txt_TIMETABLE_TYPES[TT_NUM_TIMETABLE_TYPES]; unsigned NumUsr = 0; const char *Ptr; - char Anchor[32]; struct UsrData UsrDat; + char Anchor[32]; bool ShowOfficeHours; char Width[10 + 2 + 1]; /***** Width for office hours *****/ sprintf (Width,"%upx",Rec_RECORD_WIDTH); - /***** Asign users listing type depending on current action *****/ + /***** Assign 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 *****/ @@ -1448,9 +1477,13 @@ static void Rec_ListRecordsTchs (Rec_SharedRecordViewType_t TypeOfView) fprintf (Gbl.F.Out," style=\"page-break-before:always;\""); fprintf (Gbl.F.Out,">"); - /* Shared record */ + /* Show optional alert */ + if (UsrDat.UsrCod == Gbl.Usrs.Other.UsrDat.UsrCod) // Selected user + Lay_ShowPendingAlert (); + + /* Shared record */ fprintf (Gbl.F.Out,"
"); - Rec_ShowSharedUsrRecord (TypeOfView,&UsrDat,NULL); + Rec_ShowSharedUsrRecord (TypeOfView,&UsrDat,Anchor); fprintf (Gbl.F.Out,"
"); /* Office hours */ @@ -2313,7 +2346,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, Rec_ShowEmail (UsrDat,ClassForm); /* Show user's IDs */ - Rec_ShowUsrIDs (UsrDat,Anchor,ClassForm); + Rec_ShowUsrIDs (UsrDat,ClassForm,Anchor); Lay_EndTable (); } @@ -2830,8 +2863,8 @@ static void Rec_ShowEmail (struct UsrData *UsrDat,const char *ClassForm) /******************************* Show user's IDs *****************************/ /*****************************************************************************/ -static void Rec_ShowUsrIDs (struct UsrData *UsrDat,const char *Anchor, - const char *ClassForm) +static void Rec_ShowUsrIDs (struct UsrData *UsrDat,const char *ClassForm, + const char *Anchor) { extern const char *Txt_ID;