Version19.206.1

This commit is contained in:
acanas 2020-04-29 16:43:07 +02:00
parent 70f9bd4ed5
commit 9dcb4201b9
6 changed files with 56 additions and 77 deletions

View File

@ -785,8 +785,8 @@ void Acc_CreateNewUsr (struct UsrData *UsrDat,bool CreatingMyOwnAccount)
Pri_VisibilityDB[UsrDat->BaPrfVisibility], Pri_VisibilityDB[UsrDat->BaPrfVisibility],
Pri_VisibilityDB[UsrDat->ExPrfVisibility], Pri_VisibilityDB[UsrDat->ExPrfVisibility],
UsrDat->CtyCod, UsrDat->CtyCod,
UsrDat->Phone1, UsrDat->Phone[0],
UsrDat->Phone2, UsrDat->Phone[1],
BirthdayStrDB, BirthdayStrDB,
CommentsLength ? UsrDat->Comments : CommentsLength ? UsrDat->Comments :
"", "",

View File

@ -544,10 +544,11 @@ enscript -2 --landscape --color --file-align=2 --highlight --line-numbers -o - *
En OpenSWAD: En OpenSWAD:
ps2pdf source.ps destination.pdf ps2pdf source.ps destination.pdf
*/ */
#define Log_PLATFORM_VERSION "SWAD 19.206 (2020-04-29)" #define Log_PLATFORM_VERSION "SWAD 19.206.1 (2020-04-29)"
#define CSS_FILE "swad19.193.1.css" #define CSS_FILE "swad19.193.1.css"
#define JS_FILE "swad19.193.1.js" #define JS_FILE "swad19.193.1.js"
/* /*
Version 19.206.1: Apr 29, 2020 Changes in phones. (? lines)
Version 19.206: Apr 29, 2020 Removed addresses in user's data. (300259 lines) Version 19.206: Apr 29, 2020 Removed addresses in user's data. (300259 lines)
Version 19.205: Apr 29, 2020 Removed origin place in user's data. (300399 lines) Version 19.205: Apr 29, 2020 Removed origin place in user's data. (300399 lines)
Version 19.204.5: Apr 28, 2020 Save start and end dates on creation of exam event. (300471 lines) Version 19.204.5: Apr 28, 2020 Save start and end dates on creation of exam event. (300471 lines)

View File

@ -564,8 +564,8 @@ void Enr_UpdateUsrData (struct UsrData *UsrDat)
UsrDat->Surname1,UsrDat->Surname2,UsrDat->FirstName, UsrDat->Surname1,UsrDat->Surname2,UsrDat->FirstName,
Usr_StringsSexDB[UsrDat->Sex], Usr_StringsSexDB[UsrDat->Sex],
UsrDat->CtyCod, UsrDat->CtyCod,
UsrDat->Phone1, UsrDat->Phone[0],
UsrDat->Phone2, UsrDat->Phone[1],
BirthdayStrDB, BirthdayStrDB,
UsrDat->Comments ? UsrDat->Comments : UsrDat->Comments ? UsrDat->Comments :
"", "",

View File

@ -25,8 +25,10 @@
/********************************* Headers ***********************************/ /********************************* Headers ***********************************/
/*****************************************************************************/ /*****************************************************************************/
#define _GNU_SOURCE // For asprintf
#include <linux/limits.h> // For PATH_MAX #include <linux/limits.h> // For PATH_MAX
#include <stddef.h> // For NULL #include <stddef.h> // For NULL
#include <stdio.h> // For asprintf
#include <stdlib.h> // For calloc #include <stdlib.h> // For calloc
#include <string.h> #include <string.h>
@ -128,8 +130,8 @@ static void Rec_ShowSurname2 (struct UsrData *UsrDat,bool PutForm);
static void Rec_ShowFirstName (struct UsrData *UsrDat,bool PutForm); static void Rec_ShowFirstName (struct UsrData *UsrDat,bool PutForm);
static void Rec_ShowCountry (struct UsrData *UsrDat,bool PutForm); static void Rec_ShowCountry (struct UsrData *UsrDat,bool PutForm);
static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,bool ShowData,bool PutForm); static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,bool ShowData,bool PutForm);
static void Rec_ShowPhone1 (struct UsrData *UsrDat,bool ShowData,bool PutForm); static void Rec_ShowPhone (struct UsrData *UsrDat,bool ShowData,bool PutForm,
static void Rec_ShowPhone2 (struct UsrData *UsrDat,bool ShowData,bool PutForm); unsigned NumPhone);
static void Rec_ShowComments (struct UsrData *UsrDat,bool ShowData,bool PutForm); static void Rec_ShowComments (struct UsrData *UsrDat,bool ShowData,bool PutForm);
static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Instit *Ins, static void Rec_ShowTeacherRows (struct UsrData *UsrDat,struct Instit *Ins,
bool ShowData); bool ShowData);
@ -2348,11 +2350,9 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView,
/***** Date of birth *****/ /***** Date of birth *****/
Rec_ShowDateOfBirth (UsrDat,ShowData,ICanEdit); Rec_ShowDateOfBirth (UsrDat,ShowData,ICanEdit);
/***** Phone 1 *****/ /***** Phones *****/
Rec_ShowPhone1 (UsrDat,ShowData,ICanEdit); Rec_ShowPhone (UsrDat,ShowData,ICanEdit,0);
Rec_ShowPhone (UsrDat,ShowData,ICanEdit,1);
/***** Phone 2 *****/
Rec_ShowPhone2 (UsrDat,ShowData,ICanEdit);
/***** User's comments *****/ /***** User's comments *****/
Rec_ShowComments (UsrDat,ShowData,ICanEdit); Rec_ShowComments (UsrDat,ShowData,ICanEdit);
@ -3310,73 +3310,55 @@ static void Rec_ShowDateOfBirth (struct UsrData *UsrDat,bool ShowData,bool PutFo
/*****************************************************************************/ /*****************************************************************************/
/************************* Show user's local phone ***************************/ /************************* Show user's local phone ***************************/
/*****************************************************************************/ /*****************************************************************************/
// NumPhone can be 0 or 1
static void Rec_ShowPhone1 (struct UsrData *UsrDat,bool ShowData,bool PutForm) static void Rec_ShowPhone (struct UsrData *UsrDat,bool ShowData,bool PutForm,
unsigned NumPhone)
{ {
extern const char *Txt_Phone; extern const char *Txt_Phone;
char *Name;
char *Label;
/***** Local phone *****/ /***** Internal name / id *****/
if (asprintf (&Name,"Phone%u",NumPhone) < 0)
Lay_NotEnoughMemoryExit ();
/***** Label to show *****/
if (asprintf (&Label,"%s %u",Txt_Phone,NumPhone + 1) < 0)
Lay_NotEnoughMemoryExit ();
/***** Phone *****/
HTM_TR_Begin (NULL); HTM_TR_Begin (NULL);
/* Label */ /* Label */
Frm_LabelColumn ("REC_C1_BOT RM",PutForm ? "Phone1" : Frm_LabelColumn ("REC_C1_BOT RM",PutForm ? Name :
NULL, NULL,
Txt_Phone); Label);
/* Data */ /* Data */
HTM_TD_Begin ("class=\"REC_C2_BOT DAT_N LM\""); HTM_TD_Begin ("class=\"REC_C2_BOT DAT_N LM\"");
if (ShowData) if (ShowData)
{ {
if (PutForm) if (PutForm)
HTM_INPUT_TEL ("Phone1",UsrDat->Phone1, HTM_INPUT_TEL (Name,UsrDat->Phone[NumPhone],
HTM_DONT_SUBMIT_ON_CHANGE, HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Phone1\" class=\"REC_C2_BOT_INPUT\""); "id=\"%s\" class=\"REC_C2_BOT_INPUT\"",Name);
else if (UsrDat->Phone1[0]) else if (UsrDat->Phone[NumPhone][0])
{ {
HTM_A_Begin ("href=\"tel:%s\" class=\"DAT_N\"",UsrDat->Phone1); HTM_A_Begin ("href=\"tel:%s\" class=\"DAT_N\"",UsrDat->Phone[NumPhone]);
HTM_Txt (UsrDat->Phone1); HTM_Txt (UsrDat->Phone[NumPhone]);
HTM_A_End (); HTM_A_End ();
} }
} }
HTM_TD_End (); HTM_TD_End ();
HTM_TR_End (); HTM_TR_End ();
}
/*****************************************************************************/ /***** Free label *****/
/************************ Show user's family phone ***************************/ free (Label);
/*****************************************************************************/
static void Rec_ShowPhone2 (struct UsrData *UsrDat,bool ShowData,bool PutForm) /***** Free name / id *****/
{ free (Name);
extern const char *Txt_Phone;
/***** Family phone *****/
HTM_TR_Begin (NULL);
/* Label */
Frm_LabelColumn ("REC_C1_BOT RM",PutForm ? "Phone2" :
NULL,
Txt_Phone);
/* Data */
HTM_TD_Begin ("class=\"REC_C2_BOT DAT_N LM\"");
if (ShowData)
{
if (PutForm)
HTM_INPUT_TEL ("Phone2",UsrDat->Phone2,
HTM_DONT_SUBMIT_ON_CHANGE,
"id=\"Phone2\" class=\"REC_C2_BOT_INPUT\"");
else if (UsrDat->Phone2[0])
{
HTM_A_Begin ("href=\"tel:%s\" class=\"DAT_N\"",UsrDat->Phone2);
HTM_Txt (UsrDat->Phone2);
HTM_A_End ();
}
}
HTM_TD_End ();
HTM_TR_End ();
} }
/*****************************************************************************/ /*****************************************************************************/
@ -3731,9 +3713,8 @@ static void Rec_GetUsrExtraDataFromRecordForm (struct UsrData *UsrDat)
&(UsrDat->Birthday.Year )); &(UsrDat->Birthday.Year ));
Dat_ConvDateToDateStr (&(UsrDat->Birthday),UsrDat->StrBirthday); Dat_ConvDateToDateStr (&(UsrDat->Birthday),UsrDat->StrBirthday);
Par_GetParToText ("Phone1",UsrDat->Phone1,Usr_MAX_BYTES_PHONE); Par_GetParToText ("Phone0",UsrDat->Phone[0],Usr_MAX_BYTES_PHONE);
Par_GetParToText ("Phone1",UsrDat->Phone[1],Usr_MAX_BYTES_PHONE);
Par_GetParToText ("Phone2",UsrDat->Phone2,Usr_MAX_BYTES_PHONE);
Rec_GetUsrCommentsFromForm (UsrDat); Rec_GetUsrCommentsFromForm (UsrDat);
} }

View File

@ -353,8 +353,8 @@ void Usr_ResetUsrDataExceptUsrCodAndIDs (struct UsrData *UsrDat)
UsrDat->Birthday.Day = 0; UsrDat->Birthday.Day = 0;
UsrDat->Birthday.Month = 0; UsrDat->Birthday.Month = 0;
UsrDat->Birthday.Year = 0; UsrDat->Birthday.Year = 0;
UsrDat->Phone1[0] = '\0'; UsrDat->Phone[0][0] =
UsrDat->Phone2[0] = '\0'; UsrDat->Phone[1][0] = '\0';
if (UsrDat->Comments) if (UsrDat->Comments)
UsrDat->Comments[0] = '\0'; UsrDat->Comments[0] = '\0';
@ -646,12 +646,10 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
Str_Copy (UsrDat->Tch.OfficePhone,row[16], Str_Copy (UsrDat->Tch.OfficePhone,row[16],
Usr_MAX_BYTES_PHONE); Usr_MAX_BYTES_PHONE);
/* Get phone 1 (row[17]) */ /* Get phones (row[17]) and row[18] */
Str_Copy (UsrDat->Phone1,row[17], Str_Copy (UsrDat->Phone[0],row[17],
Usr_MAX_BYTES_PHONE); Usr_MAX_BYTES_PHONE);
Str_Copy (UsrDat->Phone[1],row[18],
/* Get phone 2 (row[18]) */
Str_Copy (UsrDat->Phone2,row[18],
Usr_MAX_BYTES_PHONE); Usr_MAX_BYTES_PHONE);
/* Get birthday (row[19]) */ /* Get birthday (row[19]) */
@ -3742,12 +3740,12 @@ static void Usr_WriteRowGstAllData (struct UsrData *UsrDat)
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Phone1[0] ? UsrDat->Phone1 : UsrDat->Phone[0][0] ? UsrDat->Phone[0] :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Phone2[0] ? UsrDat->Phone2 : UsrDat->Phone[1][0] ? UsrDat->Phone[1] :
"&nbsp;", "&nbsp;",
NULL,true,false); NULL,true,false);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->StrBirthday[0] ? UsrDat->StrBirthday : UsrDat->StrBirthday[0] ? UsrDat->StrBirthday :
@ -3808,14 +3806,14 @@ static void Usr_WriteRowStdAllData (struct UsrData *UsrDat,char *GroupNames)
/***** Write the rest of the data of the student *****/ /***** Write the rest of the data of the student *****/
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Phone1[0] ? (ShowData ? UsrDat->Phone1 : UsrDat->Phone[0][0] ? (ShowData ? UsrDat->Phone[0] :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->Phone2[0] ? (ShowData ? UsrDat->Phone2 : UsrDat->Phone[1][0] ? (ShowData ? UsrDat->Phone[1] :
"********") : "********") :
"&nbsp;", "&nbsp;",
NULL,true,UsrDat->Accepted); NULL,true,UsrDat->Accepted);
Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd], Usr_WriteUsrData (Gbl.ColorRows[Gbl.RowEvenOdd],
UsrDat->StrBirthday[0] ? (ShowData ? UsrDat->StrBirthday : UsrDat->StrBirthday[0] ? (ShowData ? UsrDat->StrBirthday :

View File

@ -194,8 +194,7 @@ struct UsrData
long CtyCod; // Country long CtyCod; // Country
struct Date Birthday; struct Date Birthday;
char StrBirthday [Cns_MAX_BYTES_DATE + 1]; char StrBirthday [Cns_MAX_BYTES_DATE + 1];
char Phone1 [Usr_MAX_BYTES_PHONE + 1]; char Phone [2][Usr_MAX_BYTES_PHONE + 1];
char Phone2 [Usr_MAX_BYTES_PHONE + 1];
char *Comments; char *Comments;
long InsCtyCod; // Country of the institution long InsCtyCod; // Country of the institution
long InsCod; // Institution long InsCod; // Institution