From 60674f4a8282fe04c07ab42f27f6f9431a3d8478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 23 Apr 2016 15:00:07 +0200 Subject: [PATCH] Version 15.202.14 --- swad_changelog.h | 3 +- swad_record.c | 71 ++++++++++++++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/swad_changelog.h b/swad_changelog.h index 3d08830f8..5b032ae85 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -134,13 +134,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.202.13 (2016-04-23)" +#define Log_PLATFORM_VERSION "SWAD 15.202.14 (2016-04-23)" #define CSS_FILE "swad15.202.css" #define JS_FILE "swad15.197.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 15.202.14:Apr 23, 2016 Code refactoring in record card. (201048 lines) Version 15.202.13:Apr 23, 2016 Code refactoring in record card. (201037 lines) Version 15.202.12:Apr 23, 2016 Code refactoring in record card. (201026 lines) Version 15.202.11:Apr 23, 2016 Code refactoring in record card. (201014 lines) diff --git a/swad_record.c b/swad_record.c index 46f518c01..369aa4582 100644 --- a/swad_record.c +++ b/swad_record.c @@ -136,6 +136,8 @@ static void Rec_ShowComments (struct UsrData *UsrDat, const char *ClassForm); static void Rec_ShowInstitution (struct Institution *Ins, bool ShowData,const char *ClassForm); +static void Rec_ShowCentre (struct UsrData *UsrDat, + bool ShowData,const char *ClassForm); static void Rec_WriteLinkToDataProtectionClause (void); @@ -1998,7 +2000,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, struct UsrData *UsrDat) { extern const char *The_ClassForm[The_NUM_THEMES]; - extern const char *Txt_Centre; extern const char *Txt_Department; extern const char *Txt_Office; extern const char *Txt_Phone; @@ -2037,7 +2038,6 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, TypeOfView == Rec_RECORD_PRINT) && UsrDat->RoleInCurrentCrsDB == Rol_TEACHER)); // He/she is a teacher in the current course struct Institution Ins; - struct Centre Ctr; struct Department Dpt; /***** Initializations *****/ @@ -2172,33 +2172,8 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView, /***** Institution *****/ Rec_ShowInstitution (&Ins,ShowData,ClassForm); - /* Centre */ - fprintf (Gbl.F.Out,"" - "" - "%s:" - "" - "", - ClassForm,Rec_C1_BOTTOM,Txt_Centre, - Rec_C2_BOTTOM); - if (ShowData) - { - if (UsrDat->Tch.CtrCod > 0) - { - Ctr.CtrCod = UsrDat->Tch.CtrCod; - Ctr_GetDataOfCentreByCod (&Ctr); - if (Ctr.WWW[0]) - fprintf (Gbl.F.Out,"", - Ctr.WWW); - fprintf (Gbl.F.Out,"%s",Ctr.FullName); - if (Ctr.WWW[0]) - fprintf (Gbl.F.Out,""); - } - } - fprintf (Gbl.F.Out,"" - ""); + /***** Centre *****/ + Rec_ShowCentre (UsrDat,ShowData,ClassForm); /* Department */ fprintf (Gbl.F.Out,"" @@ -3420,6 +3395,44 @@ static void Rec_ShowInstitution (struct Institution *Ins, ""); } +/*****************************************************************************/ +/*************************** Show user's centre ******************************/ +/*****************************************************************************/ + +static void Rec_ShowCentre (struct UsrData *UsrDat, + bool ShowData,const char *ClassForm) + { + extern const char *Txt_Centre; + struct Centre Ctr; + + fprintf (Gbl.F.Out,"" + "" + "%s:" + "" + "", + ClassForm,Rec_C1_BOTTOM,Txt_Centre, + Rec_C2_BOTTOM); + if (ShowData) + { + if (UsrDat->Tch.CtrCod > 0) + { + Ctr.CtrCod = UsrDat->Tch.CtrCod; + Ctr_GetDataOfCentreByCod (&Ctr); + if (Ctr.WWW[0]) + fprintf (Gbl.F.Out,"", + Ctr.WWW); + fprintf (Gbl.F.Out,"%s",Ctr.FullName); + if (Ctr.WWW[0]) + fprintf (Gbl.F.Out,""); + } + } + fprintf (Gbl.F.Out,"" + ""); + } + /*****************************************************************************/ /*********************** Write a link to netiquette rules ********************/ /*****************************************************************************/