diff --git a/swad_changelog.h b/swad_changelog.h
index 3ca0f1304..d753987f9 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -134,13 +134,14 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.202.8 (2016-04-23)"
+#define Log_PLATFORM_VERSION "SWAD 15.202.9 (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.9: Apr 23, 2016 Code refactoring in record card. (200987 lines)
Version 15.202.8: Apr 23, 2016 Code refactoring in record card. (200979 lines)
Version 15.202.7: Apr 23, 2016 Code refactoring in record card. (200964 lines)
Version 15.202.6: Apr 23, 2016 Code refactoring in record card. (200949 lines)
diff --git a/swad_record.c b/swad_record.c
index ba4c223d9..b1ec64e7c 100644
--- a/swad_record.c
+++ b/swad_record.c
@@ -114,17 +114,17 @@ static void Rec_ShowCountry (struct UsrData *UsrDat,
Rec_RecordViewType_t TypeOfView,
const char *ClassForm);
static void Rec_ShowOriginPlace (struct UsrData *UsrDat,
- bool ShowData,
- bool DataForm,
+ bool ShowData,bool DataForm,
const char *ClassForm);
static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,
- bool ShowData,
- bool DataForm,
+ bool ShowData,bool DataForm,
const char *ClassForm);
static void Rec_ShowLocalAddress (struct UsrData *UsrDat,
- bool ShowData,
- bool DataForm,
+ bool ShowData,bool DataForm,
const char *ClassForm);
+static void Rec_ShowLocalPhone (struct UsrData *UsrDat,
+ bool ShowData,bool DataForm,
+ const char *ClassForm);
static void Rec_WriteLinkToDataProtectionClause (void);
@@ -2146,30 +2146,8 @@ void Rec_ShowSharedUsrRecord (Rec_RecordViewType_t TypeOfView,
/***** Local address *****/
Rec_ShowLocalAddress (UsrDat,ShowData,DataForm,ClassForm);
- /* Local phone */
- fprintf (Gbl.F.Out,"
"
- ""
- "%s:"
- " "
- "",
- ClassForm,Rec_C1_BOTTOM,Txt_Phone,
- Rec_C2_BOTTOM);
- if (ShowData)
- {
- if (DataForm)
- fprintf (Gbl.F.Out," ",
- Usr_MAX_LENGTH_PHONE,
- UsrDat->LocalPhone,
- Rec_C2_BOTTOM - 20);
- else if (UsrDat->LocalPhone[0])
- fprintf (Gbl.F.Out,"%s",UsrDat->LocalPhone);
- }
- fprintf (Gbl.F.Out," "
- " ");
+ /***** Local phone *****/
+ Rec_ShowLocalPhone (UsrDat,ShowData,DataForm,ClassForm);
/* Family address */
fprintf (Gbl.F.Out,""
@@ -3250,8 +3228,7 @@ static void Rec_ShowCountry (struct UsrData *UsrDat,
/*****************************************************************************/
static void Rec_ShowOriginPlace (struct UsrData *UsrDat,
- bool ShowData,
- bool DataForm,
+ bool ShowData,bool DataForm,
const char *ClassForm)
{
extern const char *Txt_Place_of_origin;
@@ -3286,8 +3263,7 @@ static void Rec_ShowOriginPlace (struct UsrData *UsrDat,
/*****************************************************************************/
static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,
- bool ShowData,
- bool DataForm,
+ bool ShowData,bool DataForm,
const char *ClassForm)
{
extern const char *Txt_Date_of_birth;
@@ -3321,8 +3297,7 @@ static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,
/*****************************************************************************/
static void Rec_ShowLocalAddress (struct UsrData *UsrDat,
- bool ShowData,
- bool DataForm,
+ bool ShowData,bool DataForm,
const char *ClassForm)
{
extern const char *Txt_Local_address;
@@ -3352,6 +3327,41 @@ static void Rec_ShowLocalAddress (struct UsrData *UsrDat,
" ");
}
+/*****************************************************************************/
+/************************* Show user's local phone ***************************/
+/*****************************************************************************/
+
+static void Rec_ShowLocalPhone (struct UsrData *UsrDat,
+ bool ShowData,bool DataForm,
+ const char *ClassForm)
+ {
+ extern const char *Txt_Phone;
+
+ fprintf (Gbl.F.Out,""
+ ""
+ "%s:"
+ " "
+ "",
+ ClassForm,Rec_C1_BOTTOM,Txt_Phone,
+ Rec_C2_BOTTOM);
+ if (ShowData)
+ {
+ if (DataForm)
+ fprintf (Gbl.F.Out," ",
+ Usr_MAX_LENGTH_PHONE,
+ UsrDat->LocalPhone,
+ Rec_C2_BOTTOM - 20);
+ else if (UsrDat->LocalPhone[0])
+ fprintf (Gbl.F.Out,"%s",UsrDat->LocalPhone);
+ }
+ fprintf (Gbl.F.Out," "
+ " ");
+ }
+
/*****************************************************************************/
/*********************** Write a link to netiquette rules ********************/
/*****************************************************************************/