mirror of https://github.com/acanas/swad-core.git
Version 16.146.5
This commit is contained in:
parent
58f0fc9223
commit
f172ce3f0c
|
@ -432,31 +432,7 @@ static void Asg_ShowOneAssignment (long AsgCod)
|
|||
|
||||
static void Asg_WriteAsgAuthor (struct Assignment *Asg)
|
||||
{
|
||||
bool ShowPhoto = false;
|
||||
char PhotoURL[PATH_MAX + 1];
|
||||
struct UsrData UsrDat;
|
||||
|
||||
/***** Initialize structure with user's data *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
||||
/***** Get data of author *****/
|
||||
UsrDat.UsrCod = Asg->UsrCod;
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat))
|
||||
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
|
||||
|
||||
/***** Show photo *****/
|
||||
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
||||
NULL,
|
||||
"PHOTO15x20",Pho_ZOOM,false);
|
||||
|
||||
/***** Write name *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"AUTHOR_1_LINE %s\">%s</div>",
|
||||
Asg->Hidden ? "AUTHOR_TXT_LIGHT" :
|
||||
"AUTHOR_TXT",
|
||||
UsrDat.FullName);
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
Usr_WriteAuthor1Line (Asg->UsrCod,Asg->Hidden);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -472,31 +472,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
|||
|
||||
static void Att_WriteAttEventAuthor (struct AttendanceEvent *Att)
|
||||
{
|
||||
bool ShowPhoto = false;
|
||||
char PhotoURL[PATH_MAX + 1];
|
||||
struct UsrData UsrDat;
|
||||
|
||||
/***** Initialize structure with user's data *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
||||
/***** Get data of author *****/
|
||||
UsrDat.UsrCod = Att->UsrCod;
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get of the database the data of the author
|
||||
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
|
||||
|
||||
/***** Show photo *****/
|
||||
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
||||
NULL,
|
||||
"PHOTO15x20",Pho_ZOOM,false);
|
||||
|
||||
/***** Write name *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"AUTHOR_1_LINE %s\">%s</div>",
|
||||
Att->Hidden ? "AUTHOR_TXT_LIGHT" :
|
||||
"AUTHOR_TXT",
|
||||
UsrDat.FullName);
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
Usr_WriteAuthor1Line (Att->UsrCod,Att->Hidden);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -197,13 +197,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.146.4 (2017-03-04)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.146.5 (2017-03-04)"
|
||||
#define CSS_FILE "swad16.146.css"
|
||||
#define JS_FILE "swad16.144.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.146.5: Mar 03, 2017 Code refactoring related with author of assignments, attendance events and surveys. (216319 lines)
|
||||
Version 16.146.4: Mar 03, 2017 Changes in layout of surveys. (216349 lines)
|
||||
Version 16.146.3: Mar 04, 2017 Changes in layout of edition of institutions, centres and degrees. (216363 lines)
|
||||
Version 16.146.2: Mar 04, 2017 Changes in layout of authors. (216354 lines)
|
||||
|
|
|
@ -3141,10 +3141,8 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
|
|||
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP",Style);
|
||||
if (BgColor)
|
||||
fprintf (Gbl.F.Out," %s",BgColor);
|
||||
fprintf (Gbl.F.Out,"\">");
|
||||
|
||||
/* Restrict length of firstname and surnames */
|
||||
fprintf (Gbl.F.Out,"<div class=\"AUTHOR_2_LINES %s\">"
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<div class=\"AUTHOR_2_LINES %s\">"
|
||||
"%s<br />"
|
||||
"%s",
|
||||
Style,
|
||||
|
|
|
@ -665,31 +665,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
|
||||
static void Svy_WriteAuthor (struct Survey *Svy)
|
||||
{
|
||||
bool ShowPhoto = false;
|
||||
char PhotoURL[PATH_MAX + 1];
|
||||
struct UsrData UsrDat;
|
||||
|
||||
/***** Initialize structure with user's data *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
||||
/***** Get data of author *****/
|
||||
UsrDat.UsrCod = Svy->UsrCod;
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get of the database the data of the author
|
||||
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
|
||||
|
||||
/***** Show photo *****/
|
||||
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
||||
NULL,
|
||||
"PHOTO15x20",Pho_ZOOM,false);
|
||||
|
||||
/***** Write name *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"AUTHOR_1_LINE %s\">%s</div>",
|
||||
Svy->Status.Visible ? "AUTHOR_TXT" :
|
||||
"AUTHOR_TXT_LIGHT",
|
||||
UsrDat.FullName);
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
Usr_WriteAuthor1Line (Svy->UsrCod,!Svy->Status.Visible);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
33
swad_user.c
33
swad_user.c
|
@ -8524,3 +8524,36 @@ void Usr_PrintUsrQRCode (void)
|
|||
else
|
||||
Lay_ShowAlert (Lay_WARNING,Txt_User_not_found_or_you_do_not_have_permission_);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Write the author of an assignment *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Usr_WriteAuthor1Line (long UsrCod,bool Hidden)
|
||||
{
|
||||
bool ShowPhoto = false;
|
||||
char PhotoURL[PATH_MAX + 1];
|
||||
struct UsrData UsrDat;
|
||||
|
||||
/***** Initialize structure with user's data *****/
|
||||
Usr_UsrDataConstructor (&UsrDat);
|
||||
|
||||
/***** Get data of author *****/
|
||||
UsrDat.UsrCod = UsrCod;
|
||||
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat))
|
||||
ShowPhoto = Pho_ShowingUsrPhotoIsAllowed (&UsrDat,PhotoURL);
|
||||
|
||||
/***** Show photo *****/
|
||||
Pho_ShowUsrPhoto (&UsrDat,ShowPhoto ? PhotoURL :
|
||||
NULL,
|
||||
"PHOTO15x20",Pho_ZOOM,false);
|
||||
|
||||
/***** Write name *****/
|
||||
fprintf (Gbl.F.Out,"<div class=\"AUTHOR_1_LINE %s\">%s</div>",
|
||||
Hidden ? "AUTHOR_TXT_LIGHT" :
|
||||
"AUTHOR_TXT",
|
||||
UsrDat.FullName);
|
||||
|
||||
/***** Free memory used for user's data *****/
|
||||
Usr_UsrDataDestructor (&UsrDat);
|
||||
}
|
||||
|
|
|
@ -402,4 +402,6 @@ void Usr_RemoveUsrFromUsrBanned (long UsrCod);
|
|||
|
||||
void Usr_PrintUsrQRCode (void);
|
||||
|
||||
void Usr_WriteAuthor1Line (long UsrCod,bool Hidden);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue