Version 16.147.4

This commit is contained in:
Antonio Cañas Vargas 2017-03-05 15:12:48 +01:00
parent 5ac928b7b7
commit ed12d86d9e
11 changed files with 42 additions and 63 deletions

View File

@ -1794,10 +1794,10 @@ a:hover img.CENTRE_PHOTO_SHOW
{ {
display:block; display:block;
width:186px; width:186px;
margin:0 auto;
white-space:nowrap; white-space:nowrap;
overflow:hidden; overflow:hidden;
text-overflow:ellipsis; text-overflow:ellipsis;
margin:0 auto;
} }
.NO_BR {white-space:nowrap;} .NO_BR {white-space:nowrap;}
@ -2419,6 +2419,16 @@ a:hover img.CENTRE_PHOTO_SHOW
text-overflow:ellipsis; text-overflow:ellipsis;
} }
/**************************** Enrollment requests ****************************/
.REQUESTER_NAME
{
box-sizing:border-box;
max-width:100px;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
/******************************** Social activity ****************************/ /******************************** Social activity ****************************/
#view_new_posts_container,#view_old_posts_container #view_new_posts_container,#view_old_posts_container
{ {

View File

@ -197,13 +197,15 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.147.3 (2017-03-04)" #define Log_PLATFORM_VERSION "SWAD 16.147.4 (2017-03-04)"
#define CSS_FILE "swad16.147.css" #define CSS_FILE "swad16.147.css"
#define JS_FILE "swad16.144.js" #define JS_FILE "swad16.144.js"
// 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 16.147.4: Mar 05, 2017 Changes in layout of enrollment requesters.
Code refactoring writing user's name. (216345 lines)
Version 16.147.3: Mar 05, 2017 Changes in layout of followed users, users to follow and connected users. (216365 lines) Version 16.147.3: Mar 05, 2017 Changes in layout of followed users, users to follow and connected users. (216365 lines)
Version 16.147.2: Mar 05, 2017 Changes in layout of notice author. (216316 lines) Version 16.147.2: Mar 05, 2017 Changes in layout of notice author. (216316 lines)
Version 16.147.1: Mar 05, 2017 Changes in layout of notice author. (216300 lines) Version 16.147.1: Mar 05, 2017 Changes in layout of notice author. (216300 lines)

View File

@ -990,11 +990,9 @@ static void Con_WriteRowConnectedUsrOnRightColumn (Rol_Role_t Role)
// the list of connected users // the list of connected users
// is dynamically updated via AJAX // is dynamically updated via AJAX
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
fprintf (Gbl.F.Out,"<div class=\"CON_NAME_NARROW\">"); // To limit width fprintf (Gbl.F.Out,"<div class=\"CON_NAME_NARROW\">"); // Limited width
Act_LinkFormSubmitUnique (Txt_View_record_for_this_course,Font); Act_LinkFormSubmitUnique (Txt_View_record_for_this_course,Font);
fprintf (Gbl.F.Out,"%s<br />%s",UsrDat->FirstName,UsrDat->Surname1); Usr_WriteFirstNameBRSurnames (UsrDat);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
fprintf (Gbl.F.Out,"</a>" fprintf (Gbl.F.Out,"</a>"
"</div>"); "</div>");
Act_FormEnd (); Act_FormEnd ();
@ -1185,12 +1183,10 @@ static void Con_ShowConnectedUsrsCurrentLocationOneByOneOnMainZone (Rol_Role_t R
ActSeeRecOneTch); ActSeeRecOneTch);
Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat.EncryptedUsrCod);
} }
fprintf (Gbl.F.Out,"<div class=\"CON_NAME_WIDE\">"); // To limit width fprintf (Gbl.F.Out,"<div class=\"CON_NAME_WIDE\">"); // Limited width
if (PutLinkToRecord) if (PutLinkToRecord)
Act_LinkFormSubmit (UsrDat.FullName,Font,NULL); Act_LinkFormSubmit (UsrDat.FullName,Font,NULL);
fprintf (Gbl.F.Out,"%s<br />%s",UsrDat.FirstName,UsrDat.Surname1); Usr_WriteFirstNameBRSurnames (&UsrDat);
if (UsrDat.Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat.Surname2);
if (PutLinkToRecord) if (PutLinkToRecord)
fprintf (Gbl.F.Out,"</a>"); fprintf (Gbl.F.Out,"</a>");
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");

View File

@ -2769,9 +2769,11 @@ static void Enr_ShowEnrollmentRequestsGivenRoles (unsigned RolesSelected)
fprintf (Gbl.F.Out,"</td>"); fprintf (Gbl.F.Out,"</td>");
/***** User name *****/ /***** User name *****/
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_TOP\">"); fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_TOP\">"
Usr_RestrictLengthAndWriteName (&UsrDat,20); "<div class=\"REQUESTER_NAME\">"); // Limited width
fprintf (Gbl.F.Out,"</td>"); Usr_WriteFirstNameBRSurnames (&UsrDat);
fprintf (Gbl.F.Out,"</div>"
"</td>");
/***** Requested role (row[3]) *****/ /***** Requested role (row[3]) *****/
fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_TOP\">" fprintf (Gbl.F.Out,"<td class=\"DAT LEFT_TOP\">"

View File

@ -838,11 +838,9 @@ static void Fol_ShowFollowedOrFollower (struct UsrData *UsrDat)
/* Put form to go to public profile */ /* Put form to go to public profile */
Act_FormStart (ActSeeOthPubPrf); Act_FormStart (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
fprintf (Gbl.F.Out,"<div class=\"FOLLOW_USR_NAME\">"); // To limit width fprintf (Gbl.F.Out,"<div class=\"FOLLOW_USR_NAME\">"); // Limited width
Act_LinkFormSubmit (Txt_Another_user_s_profile,"DAT",NULL); Act_LinkFormSubmit (Txt_Another_user_s_profile,"DAT",NULL);
fprintf (Gbl.F.Out,"%s<br />%s",UsrDat->FirstName,UsrDat->Surname1); Usr_WriteFirstNameBRSurnames (UsrDat);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
fprintf (Gbl.F.Out,"</a>" fprintf (Gbl.F.Out,"</a>"
"</div>"); "</div>");
Act_FormEnd (); Act_FormEnd ();
@ -899,11 +897,9 @@ static void Fol_WriteRowUsrToFollowOnRightColumn (struct UsrData *UsrDat)
/* Put form to go to public profile */ /* Put form to go to public profile */
Act_FormStart (ActSeeOthPubPrf); Act_FormStart (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
fprintf (Gbl.F.Out,"<div class=\"CON_NAME\">"); // To limit width fprintf (Gbl.F.Out,"<div class=\"CON_NAME\">"); // Limited width
Act_LinkFormSubmit (Txt_Another_user_s_profile,"CON_CRS",NULL); Act_LinkFormSubmit (Txt_Another_user_s_profile,"CON_CRS",NULL);
fprintf (Gbl.F.Out,"%s<br />%s",UsrDat->FirstName,UsrDat->Surname1); Usr_WriteFirstNameBRSurnames (UsrDat);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
fprintf (Gbl.F.Out,"</a>" fprintf (Gbl.F.Out,"</a>"
"</div>"); "</div>");
Act_FormEnd (); Act_FormEnd ();

View File

@ -3142,11 +3142,8 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
if (BgColor) if (BgColor)
fprintf (Gbl.F.Out," %s",BgColor); fprintf (Gbl.F.Out," %s",BgColor);
fprintf (Gbl.F.Out,"\">" fprintf (Gbl.F.Out,"\">"
"<div class=\"AUTHOR_2_LINES %s\">" "<div class=\"AUTHOR_2_LINES\">"); // Limited width
"%s<br />%s", Usr_WriteFirstNameBRSurnames (UsrDat);
Style,UsrDat->FirstName,UsrDat->Surname1);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out,"%s",UsrDat->Surname2);
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
} }
else else

View File

@ -727,16 +727,12 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
TextClass[Status],Content); TextClass[Status],Content);
/***** Write the author *****/ /***** Write the author *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_AUTHOR %s\">", fprintf (Gbl.F.Out,"<div class=\"NOTICE_AUTHOR %s\">", // Limited width
AuthorClass[Status]); AuthorClass[Status]);
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = UsrCod; UsrDat.UsrCod = UsrCod;
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the autor if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the autor
{ Usr_WriteFirstNameBRSurnames (&UsrDat);
fprintf (Gbl.F.Out,"%s<br />%s",UsrDat.FirstName,UsrDat.Surname1);
if (UsrDat.Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat.Surname2);
}
Usr_UsrDataDestructor (&UsrDat); Usr_UsrDataDestructor (&UsrDat);
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");

View File

@ -1143,11 +1143,8 @@ void Pho_ShowUsrPhoto (const struct UsrData *UsrDat,const char *PhotoURL,
IdCaption); IdCaption);
/* First name and surnames */ /* First name and surnames */
fprintf (Gbl.F.Out,"<div class=\"ZOOM_TXT_LINE DAT_N\">" fprintf (Gbl.F.Out,"<div class=\"ZOOM_TXT_LINE DAT_N\">"); // Limited width
"%s<br />%s", Usr_WriteFirstNameBRSurnames (UsrDat);
UsrDat->FirstName,UsrDat->Surname1);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
/* Institution full name and institution country */ /* Institution full name and institution country */

View File

@ -1552,11 +1552,9 @@ void Prf_ShowUsrInRanking (struct UsrData *UsrDat,unsigned Rank)
{ {
Act_FormStart (ActSeeOthPubPrf); Act_FormStart (ActSeeOthPubPrf);
Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod); Usr_PutParamUsrCodEncrypted (UsrDat->EncryptedUsrCod);
fprintf (Gbl.F.Out,"<div class=\"RANK_USR\">"); fprintf (Gbl.F.Out,"<div class=\"RANK_USR\">"); // Limited width
Act_LinkFormSubmit (Txt_Another_user_s_profile,"DAT_SMALL",NULL); Act_LinkFormSubmit (Txt_Another_user_s_profile,"DAT_SMALL",NULL);
fprintf (Gbl.F.Out,"%s<br />%s",UsrDat->FirstName,UsrDat->Surname1); Usr_WriteFirstNameBRSurnames (UsrDat);
if (UsrDat->Surname2[0])
fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
fprintf (Gbl.F.Out,"</a>" fprintf (Gbl.F.Out,"</a>"
"</div>"); "</div>");
Act_FormEnd (); Act_FormEnd ();

View File

@ -740,32 +740,17 @@ void Usr_BuildFullName (struct UsrData *UsrDat)
} }
/*****************************************************************************/ /*****************************************************************************/
/******** Restrict length of firstname and surnames and write then ***********/ /********* Write user name in two lines. 1: first name, 2: surnames **********/
/*****************************************************************************/ /*****************************************************************************/
void Usr_RestrictLengthAndWriteName (const struct UsrData *UsrDat,unsigned MaxChars) void Usr_WriteFirstNameBRSurnames (const struct UsrData *UsrDat)
{ {
char FirstName[Usr_MAX_BYTES_NAME + 1]; /***** Write first name and surname 1 *****/
char Surnames[Usr_MAX_BYTES_SURNAMES + 1]; fprintf (Gbl.F.Out,"%s<br />%s",UsrDat->FirstName,UsrDat->Surname1);
/***** Restrict length of firstname and surnames *****/ /***** Write surname2 if exists *****/
Str_Copy (FirstName,UsrDat->FirstName,
Usr_MAX_BYTES_NAME);
Str_LimitLengthHTMLStr (FirstName,MaxChars);
Str_Copy (Surnames,UsrDat->Surname1,
Usr_MAX_BYTES_SURNAMES);
if (UsrDat->Surname2[0]) if (UsrDat->Surname2[0])
{ fprintf (Gbl.F.Out," %s",UsrDat->Surname2);
Str_Concat (Surnames," ",
Usr_MAX_BYTES_SURNAMES);
Str_Concat (Surnames,UsrDat->Surname2,
Usr_MAX_BYTES_SURNAMES);
}
Str_LimitLengthHTMLStr (Surnames,MaxChars);
/***** Write shorted firstname, then return, then shorted surnames *****/
fprintf (Gbl.F.Out,"%s<br />%s",FirstName,Surnames);
} }
/*****************************************************************************/ /*****************************************************************************/

View File

@ -231,7 +231,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat);
void Usr_BuildFullName (struct UsrData *UsrDat); void Usr_BuildFullName (struct UsrData *UsrDat);
void Usr_RestrictLengthAndWriteName (const struct UsrData *UsrDat,unsigned MaxChars); void Usr_WriteFirstNameBRSurnames (const struct UsrData *UsrDat);
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);