From 41b4dea455c11ac5997eb88a86d0dc21c6872575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 8 Oct 2018 01:07:15 +0200 Subject: [PATCH] Version 18.2 --- swad_changelog.h | 3 +- swad_record.c | 71 ++++++++++++++++++++++++++++++------------------ swad_record.h | 1 - 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index fd14ce688..60f67134b 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -355,10 +355,11 @@ En OpenSWAD: ps2pdf source.ps destination.pdf */ -#define Log_PLATFORM_VERSION "SWAD 18.1.6 (2018-10-07)" +#define Log_PLATFORM_VERSION "SWAD 18.2 (2018-10-08)" #define CSS_FILE "swad17.25.4.css" #define JS_FILE "swad17.17.1.js" /* + Version 18.2: Oct 08, 2018 Changes in layout of record card. (234980 lines) Version 18.1.6: Oct 07, 2018 Icon to change user's institution is moved to record card. (234963 lines) Version 18.1.5: Oct 07, 2018 Icon to change user's privacy is moved to record card. (234958 lines) Version 18.1.4: Oct 07, 2018 Icon to change user's photo is moved to record card. (234955 lines) diff --git a/swad_record.c b/swad_record.c index a80346665..cb96820f5 100644 --- a/swad_record.c +++ b/swad_record.c @@ -151,6 +151,9 @@ static void Rec_ShowFamilyPhone (struct UsrData *UsrDat, static void Rec_ShowComments (struct UsrData *UsrDat, bool ShowData,bool ICanEdit, const char *ClassForm); +static void Rec_ShowTeacherRows (struct UsrData *UsrDat, + struct Instit *Ins, + bool ShowData,const char *ClassForm); static void Rec_ShowInstitution (struct Instit *Ins, bool ShowData,const char *ClassForm); static void Rec_ShowCentre (struct UsrData *UsrDat, @@ -166,6 +169,7 @@ static void Rec_WriteLinkToDataProtectionClause (void); static void Rec_GetUsrExtraDataFromRecordForm (struct UsrData *UsrDat); static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat); +static void Rec_PutLinkToChangeMyInsCtrDpt (void); /*****************************************************************************/ /*************** Create, edit and remove fields of records *******************/ @@ -2421,6 +2425,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, Rec_ShowCountry (UsrDat,TypeOfView,ClassForm); } + /***** Address rows *****/ if (ShowAddressRows) { /***** Origin place *****/ @@ -2445,23 +2450,9 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, Rec_ShowComments (UsrDat,ShowData,ICanEdit,ClassForm); } - if (ShowTeacherRows) - { - /***** Institution *****/ - Rec_ShowInstitution (&Ins,ShowData,ClassForm); - - /***** Centre *****/ - Rec_ShowCentre (UsrDat,ShowData,ClassForm); - - /***** Department *****/ - Rec_ShowDepartment (UsrDat,ShowData,ClassForm); - - /***** Office *****/ - Rec_ShowOffice (UsrDat,ShowData,ClassForm); - - /***** Office phone *****/ - Rec_ShowOfficePhone (UsrDat,ShowData,ClassForm); - } + /***** Teacher's rows *****/ + if (ShowTeacherRows && TypeOfView != Rec_SHA_MY_RECORD_FORM) + Rec_ShowTeacherRows (UsrDat,&Ins,ShowData,ClassForm); Tbl_EndTable (); @@ -2512,6 +2503,15 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView, /***** End table and box *****/ Box_EndBoxTable (); + + /***** Table with teacher rows *****/ + if (ShowTeacherRows && TypeOfView == Rec_SHA_MY_RECORD_FORM) + { + Box_StartBoxTable (StrRecordWidth,NULL,Rec_PutLinkToChangeMyInsCtrDpt, + NULL,Box_NOT_CLOSABLE,2); + Rec_ShowTeacherRows (UsrDat,&Ins,ShowData,ClassForm); + Box_EndBoxTable (); + } } /*****************************************************************************/ @@ -2706,9 +2706,6 @@ static void Rec_PutIconsCommands (void) /* Buttons to change my institution, my social networks and my privacy */ if (ItsMe) { - /* Button to change my institution, centre, department... */ - Rec_PutLinkToChangeMyInsCtrDpt (); - /* Button to change my social networks */ Net_PutLinkToChangeMySocialNetworks (); @@ -3628,6 +3625,30 @@ static void Rec_ShowComments (struct UsrData *UsrDat, /************************** Show user's institution **************************/ /*****************************************************************************/ +static void Rec_ShowTeacherRows (struct UsrData *UsrDat, + struct Instit *Ins, + bool ShowData,const char *ClassForm) + { + /***** Institution *****/ + Rec_ShowInstitution (Ins,ShowData,ClassForm); + + /***** Centre *****/ + Rec_ShowCentre (UsrDat,ShowData,ClassForm); + + /***** Department *****/ + Rec_ShowDepartment (UsrDat,ShowData,ClassForm); + + /***** Office *****/ + Rec_ShowOffice (UsrDat,ShowData,ClassForm); + + /***** Office phone *****/ + Rec_ShowOfficePhone (UsrDat,ShowData,ClassForm); + } + +/*****************************************************************************/ +/************************** Show user's institution **************************/ +/*****************************************************************************/ + static void Rec_ShowInstitution (struct Instit *Ins, bool ShowData,const char *ClassForm) { @@ -3640,7 +3661,6 @@ static void Rec_ShowInstitution (struct Instit *Ins, "", ClassForm,Txt_Institution); if (ShowData) - { if (Ins->InsCod > 0) { if (Ins->WWW[0]) @@ -3651,7 +3671,6 @@ static void Rec_ShowInstitution (struct Instit *Ins, if (Ins->WWW[0]) fprintf (Gbl.F.Out,""); } - } fprintf (Gbl.F.Out,"" ""); } @@ -3937,14 +3956,14 @@ static void Rec_GetUsrCommentsFromForm (struct UsrData *UsrDat) /*** Put a link to the action to edit my institution, centre, department... **/ /*****************************************************************************/ -void Rec_PutLinkToChangeMyInsCtrDpt (void) +static void Rec_PutLinkToChangeMyInsCtrDpt (void) { extern const char *Txt_Edit_my_institution; - /***** Link to edit my institution, centre, department... *****/ + /***** Button to edit my institution *****/ Lay_PutContextualLink (ActReqEdiMyIns,NULL,NULL, - "ins64x64.gif", - Txt_Edit_my_institution,NULL, + "edit64x64.png", + Txt_Edit_my_institution,NULL, NULL); } diff --git a/swad_record.h b/swad_record.h index c484d9a06..ff8d43c04 100644 --- a/swad_record.h +++ b/swad_record.h @@ -173,7 +173,6 @@ void Rec_UpdateMyRecord (void); Rol_Role_t Rec_GetRoleFromRecordForm (void); void Rec_GetUsrNameFromRecordForm (struct UsrData *UsrDat); -void Rec_PutLinkToChangeMyInsCtrDpt (void); void Rec_ShowFormMyInsCtrDpt (void); void Rec_ChgCountryOfMyInstitution (void); void Rec_UpdateMyInstitution (void);