mirror of https://github.com/acanas/swad-core.git
Version 14.94.4
This commit is contained in:
parent
83c923cc50
commit
c6c16673af
|
@ -823,7 +823,7 @@ a:hover img.CENTRE_PHOTO_SHOW
|
||||||
.RANK
|
.RANK
|
||||||
{
|
{
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size:16pt;
|
font-size:12pt;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -636,7 +636,7 @@ a:hover img.CENTRE_PHOTO_SHOW
|
||||||
.RANK
|
.RANK
|
||||||
{
|
{
|
||||||
color:#808080;
|
color:#808080;
|
||||||
font-size:20pt;
|
font-size:18pt;
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -261,14 +261,15 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
||||||
/***** Start date/time *****/
|
/***** Start date/time *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>" \
|
fprintf (Gbl.F.Out,"<tr>" \
|
||||||
"<td class=\"%s\""
|
"<td class=\"%s\""
|
||||||
" style=\"text-align:left; vertical-align:top;\"",
|
" style=\"text-align:left; vertical-align:top;",
|
||||||
Att->Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" :
|
Att->Hidden ? (Att->Open ? "DATE_GREEN_LIGHT" :
|
||||||
"DATE_RED_LIGHT") :
|
"DATE_RED_LIGHT") :
|
||||||
(Att->Open ? "DATE_GREEN" :
|
(Att->Open ? "DATE_GREEN" :
|
||||||
"DATE_RED"));
|
"DATE_RED"));
|
||||||
if (!ShowOnlyThisAttEventComplete)
|
if (!ShowOnlyThisAttEventComplete)
|
||||||
fprintf (Gbl.F.Out," bgcolor=\"%s\"",Gbl.ColorRows[Gbl.RowEvenOdd]);
|
fprintf (Gbl.F.Out," background-color:%s;",
|
||||||
fprintf (Gbl.F.Out,">%02u/%02u/%02u<br />%02u:%02u h</td>",
|
Gbl.ColorRows[Gbl.RowEvenOdd]);
|
||||||
|
fprintf (Gbl.F.Out,"\">%02u/%02u/%02u<br />%02u:%02u h</td>",
|
||||||
Att->DateTimes[Att_START_TIME].Date.Day,
|
Att->DateTimes[Att_START_TIME].Date.Day,
|
||||||
Att->DateTimes[Att_START_TIME].Date.Month,
|
Att->DateTimes[Att_START_TIME].Date.Month,
|
||||||
Att->DateTimes[Att_START_TIME].Date.Year % 100,
|
Att->DateTimes[Att_START_TIME].Date.Year % 100,
|
||||||
|
|
|
@ -103,11 +103,12 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 14.94.3 (2015/03/17)"
|
#define Log_PLATFORM_VERSION "SWAD 14.94.4 (2015/03/17)"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 14.94.4: Mar 17, 2015 Changes in ranking layout. (182679 lines)
|
||||||
Version 14.94.3: Mar 17, 2015 Changes in record fonts. (182667 lines)
|
Version 14.94.3: Mar 17, 2015 Changes in record fonts. (182667 lines)
|
||||||
Version 14.94.2: Mar 17, 2015 Fixed bug in ranking. (182668 lines)
|
Version 14.94.2: Mar 17, 2015 Fixed bug in ranking. (182668 lines)
|
||||||
Version 14.94.1: Mar 17, 2015 Fixed bug in user's profile. (182667 lines)
|
Version 14.94.1: Mar 17, 2015 Fixed bug in user's profile. (182667 lines)
|
||||||
|
|
|
@ -99,7 +99,7 @@ static void Prf_CreateUsrFigures (long UsrCod,const struct UsrFigures *UsrFigure
|
||||||
static bool Prf_CheckIfUsrFiguresExists (long UsrCod);
|
static bool Prf_CheckIfUsrFiguresExists (long UsrCod);
|
||||||
|
|
||||||
static void Prf_GetAndShowRankingFigure (const char *FieldName);
|
static void Prf_GetAndShowRankingFigure (const char *FieldName);
|
||||||
static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat);
|
static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/************************** Get public profile URL ***************************/
|
/************************** Get public profile URL ***************************/
|
||||||
|
@ -1264,9 +1264,9 @@ static void Prf_GetAndShowRankingFigure (const char *FieldName)
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<table>");
|
fprintf (Gbl.F.Out,"<table>");
|
||||||
|
|
||||||
for (NumUsr = 1, Rank = 1;
|
for (NumUsr = 1, Rank = 1, Gbl.RowEvenOdd = 0;
|
||||||
NumUsr <= NumUsrs;
|
NumUsr <= NumUsrs;
|
||||||
NumUsr++)
|
NumUsr++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd)
|
||||||
{
|
{
|
||||||
/***** Get user and number of clicks *****/
|
/***** Get user and number of clicks *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -1286,15 +1286,12 @@ static void Prf_GetAndShowRankingFigure (const char *FieldName)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Show row *****/
|
/***** Show row *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
"<td style=\"text-align:right;\">#%u</td>"
|
Prf_ShowUsrInRanking (&UsrDat,Rank);
|
||||||
"<td style=\"text-align:left;\">",
|
fprintf (Gbl.F.Out,"<td style=\"text-align:right; height:40px;"
|
||||||
Rank);
|
" background-color:%s;\">%ld</td>"
|
||||||
Prf_ShowUsrInRanking (&UsrDat);
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
|
||||||
"<td style=\"text-align:right;\">%ld</td>"
|
|
||||||
"</tr>",
|
"</tr>",
|
||||||
Figure);
|
Gbl.ColorRows[Gbl.RowEvenOdd],Figure);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</table>");
|
fprintf (Gbl.F.Out,"</table>");
|
||||||
|
@ -1405,9 +1402,9 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"<table>");
|
fprintf (Gbl.F.Out,"<table>");
|
||||||
|
|
||||||
for (NumUsr = 1, Rank = 1;
|
for (NumUsr = 1, Rank = 1, Gbl.RowEvenOdd = 0;
|
||||||
NumUsr <= NumUsrs;
|
NumUsr <= NumUsrs;
|
||||||
NumUsr++)
|
NumUsr++, Gbl.RowEvenOdd = 1 - Gbl.RowEvenOdd)
|
||||||
{
|
{
|
||||||
/***** Get user and number of clicks *****/
|
/***** Get user and number of clicks *****/
|
||||||
row = mysql_fetch_row (mysql_res);
|
row = mysql_fetch_row (mysql_res);
|
||||||
|
@ -1425,13 +1422,11 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***** Show row *****/
|
/***** Show row *****/
|
||||||
fprintf (Gbl.F.Out,"<tr>"
|
fprintf (Gbl.F.Out,"<tr>");
|
||||||
"<td style=\"text-align:right;\">#%u</td>"
|
Prf_ShowUsrInRanking (&UsrDat,Rank);
|
||||||
"<td style=\"text-align:left;\">",
|
fprintf (Gbl.F.Out,"<td style=\"text-align:right; height:40px;"
|
||||||
Rank);
|
" background-color:%s;\">",
|
||||||
Prf_ShowUsrInRanking (&UsrDat);
|
Gbl.ColorRows[Gbl.RowEvenOdd]);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
|
||||||
"<td style=\"text-align:right;\">");
|
|
||||||
Str_WriteFloatNum (NumClicksPerDay);
|
Str_WriteFloatNum (NumClicksPerDay);
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
@ -1451,30 +1446,48 @@ void Prf_GetAndShowRankingClicksPerDay (void)
|
||||||
/************** Show user's photo and nickname in ranking list ***************/
|
/************** Show user's photo and nickname in ranking list ***************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat)
|
static void Prf_ShowUsrInRanking (const struct UsrData *UsrDat,unsigned Rank)
|
||||||
{
|
{
|
||||||
extern const char *Txt_View_public_profile;
|
extern const char *Txt_View_public_profile;
|
||||||
bool ShowPhoto;
|
bool ShowPhoto;
|
||||||
char PhotoURL[PATH_MAX+1];
|
char PhotoURL[PATH_MAX+1];
|
||||||
|
bool Visible = Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod);
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"<tr>"
|
||||||
|
"<td class=\"RANK\" style=\"text-align:right;"
|
||||||
|
" height:40px; background-color:%s;\">"
|
||||||
|
"#%u"
|
||||||
|
"</td>"
|
||||||
|
"<td style=\"width:18px; height:40px;"
|
||||||
|
" background-color:%s;\">",
|
||||||
|
Gbl.ColorRows[Gbl.RowEvenOdd],
|
||||||
|
Rank,
|
||||||
|
Gbl.ColorRows[Gbl.RowEvenOdd]);
|
||||||
|
|
||||||
/***** Check if I can see the public profile *****/
|
/***** Check if I can see the public profile *****/
|
||||||
if (Pri_ShowIsAllowed (UsrDat->ProfileVisibility,UsrDat->UsrCod))
|
if (Visible)
|
||||||
{
|
{
|
||||||
/***** User's photo *****/
|
/***** User's photo *****/
|
||||||
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
ShowPhoto = Pho_ShowUsrPhotoIsAllowed (UsrDat,PhotoURL);
|
||||||
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
|
Pho_ShowUsrPhoto (UsrDat,ShowPhoto ? PhotoURL :
|
||||||
NULL,
|
NULL,
|
||||||
"PHOTO15x20",Pho_ZOOM);
|
"PHOTO18x24",Pho_ZOOM);
|
||||||
|
|
||||||
/***** Put form to go to public profile *****/
|
|
||||||
if (UsrDat->Nickname[0])
|
|
||||||
{
|
|
||||||
Act_FormStart (ActSeePubPrf);
|
|
||||||
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
|
||||||
Act_LinkFormSubmit (Txt_View_public_profile,"DAT_SMALL");
|
|
||||||
fprintf (Gbl.F.Out,"@%s",UsrDat->Nickname);
|
|
||||||
fprintf (Gbl.F.Out,"</a>");
|
|
||||||
Act_FormEnd ();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
|
"<td style=\"height:40px; background-color:%s;\">",
|
||||||
|
Gbl.ColorRows[Gbl.RowEvenOdd]);
|
||||||
|
|
||||||
|
/***** Put form to go to public profile *****/
|
||||||
|
if (Visible && UsrDat->Nickname[0])
|
||||||
|
{
|
||||||
|
Act_FormStart (ActSeePubPrf);
|
||||||
|
Usr_PutParamOtherUsrCodEncrypted (UsrDat->EncryptedUsrCod);
|
||||||
|
Act_LinkFormSubmit (Txt_View_public_profile,"DAT_SMALL");
|
||||||
|
Usr_RestrictLengthAndWriteName (UsrDat,8);
|
||||||
|
fprintf (Gbl.F.Out,"</a>");
|
||||||
|
Act_FormEnd ();
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
}
|
}
|
||||||
|
|
|
@ -666,7 +666,7 @@ void Usr_BuildFullName (struct UsrData *UsrDat)
|
||||||
/******** Restrict length of firstname and surnames and write then ***********/
|
/******** Restrict length of firstname and surnames and write then ***********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Usr_RestrictLengthAndWriteName (struct UsrData *UsrDat,unsigned MaxChars)
|
void Usr_RestrictLengthAndWriteName (const struct UsrData *UsrDat,unsigned MaxChars)
|
||||||
{
|
{
|
||||||
char FirstName[Usr_MAX_BYTES_NAME_SPEC_CHAR+1];
|
char FirstName[Usr_MAX_BYTES_NAME_SPEC_CHAR+1];
|
||||||
char Surnames[2*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)];
|
char Surnames[2*(Usr_MAX_BYTES_NAME_SPEC_CHAR+1)];
|
||||||
|
|
|
@ -206,7 +206,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat);
|
||||||
|
|
||||||
void Usr_BuildFullName (struct UsrData *UsrDat);
|
void Usr_BuildFullName (struct UsrData *UsrDat);
|
||||||
|
|
||||||
void Usr_RestrictLengthAndWriteName (struct UsrData *UsrDat,unsigned MaxChars);
|
void Usr_RestrictLengthAndWriteName (const struct UsrData *UsrDat,unsigned MaxChars);
|
||||||
|
|
||||||
bool Usr_CheckIfUsrIsAdm (long UsrCod,Sco_Scope_t Scope,long Cod);
|
bool Usr_CheckIfUsrIsAdm (long UsrCod,Sco_Scope_t Scope,long Cod);
|
||||||
bool Usr_CheckIfUsrIsSuperuser (long UsrCod);
|
bool Usr_CheckIfUsrIsSuperuser (long UsrCod);
|
||||||
|
|
Loading…
Reference in New Issue