Version 16.198.9

This commit is contained in:
Antonio Cañas Vargas 2017-05-02 01:05:23 +02:00
parent 34a8d3b3b5
commit 794aac3960
8 changed files with 66 additions and 44 deletions

View File

@ -1571,10 +1571,10 @@ static void Ctr_ListCentresForEdition (void)
/* Centre requester */
UsrDat.UsrCod = Ctr->RequesterUsrCod;
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
@ -2516,10 +2516,10 @@ static void Ctr_PutFormToCreateCentre (void)
"</td>");
/***** Centre requester *****/
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");

View File

@ -219,19 +219,18 @@
// TODO: Icon to view en "Fuente de información"
// TODO: Print view of an assignment (suggested by Sandra Daniela Tazzioli Barroso).
// TODO: Buscar Msg_WriteMsgAuthor y ver si la tabla que hay alrededor se puede meter dentro de la función
/*****************************************************************************/
/****************************** Public constants *****************************/
/*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.198.8 (2017-05-01)"
#define Log_PLATFORM_VERSION "SWAD 16.198.9 (2017-05-02)"
#define CSS_FILE "swad16.195.8.css"
#define JS_FILE "swad16.181.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.198.9: May 02, 2017 Code refactoring related to message author. (218345 lines)
Version 16.198.8: May 01, 2017 Code refactoring related to tables. (218323 lines)
Version 16.198.7: May 01, 2017 Code refactoring related to tables. (218319 lines)
Version 16.198.6: May 01, 2017 Code refactoring related to tables. (218312 lines)

View File

@ -1517,10 +1517,10 @@ static void Crs_ListCoursesOfAYearForEdition (unsigned Year)
/* Course requester */
UsrDat.UsrCod = Crs->RequesterUsrCod;
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
@ -1695,10 +1695,10 @@ static void Crs_PutFormToCreateCourse (void)
"</td>");
/***** Course requester *****/
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");

View File

@ -817,10 +817,10 @@ static void Deg_ListDegreesForEdition (void)
/* Degree requester */
UsrDat.UsrCod = Deg->RequesterUsrCod;
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
@ -1002,10 +1002,10 @@ static void Deg_PutFormToCreateDegree (void)
"</td>");
/***** Degree requester *****/
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");

View File

@ -1318,21 +1318,19 @@ static void For_ShowAForumPost (unsigned PstNum,long PstCod,
fprintf (Gbl.F.Out,"</td>");
/***** Write author *****/
fprintf (Gbl.F.Out,"<td colspan=\"2\" class=\"LEFT_TOP\""
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
fprintf (Gbl.F.Out,"<td colspan=\"2\" class=\"AUTHOR_TXT LEFT_TOP\""
" style=\"width:150px;\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
Msg_WriteMsgAuthor (&UsrDat,"AUTHOR_TXT",Enabled,NULL);
Msg_WriteMsgAuthor (&UsrDat,NULL,Enabled,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
if (Enabled)
{
/* Write number of posts from this user */
fprintf (Gbl.F.Out,"<tr>");
For_WriteNumberOfPosts (UsrDat.UsrCod);
fprintf (Gbl.F.Out,"</tr>");
}
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
/***** Write post content *****/
@ -1479,8 +1477,7 @@ static void For_WriteNumberOfPosts (long UsrCod)
unsigned NumPsts;
/***** Star table cell *****/
fprintf (Gbl.F.Out,"<td colspan=\"2\" class=\"AUTHOR_TXT CENTER_TOP\""
" style=\"width:150px;\">");
fprintf (Gbl.F.Out,"<div class=\"AUTHOR_TXT LEFT_TOP\">");
/***** Get number of posts from database *****/
if (Gbl.Forum.ForumSelected.Location > 0)
@ -1502,7 +1499,7 @@ static void For_WriteNumberOfPosts (long UsrCod)
fprintf (Gbl.F.Out,"[%u %s]",NumPsts,Txt_posts);
/***** End table cell *****/
fprintf (Gbl.F.Out,"</td>");
fprintf (Gbl.F.Out,"</div>");
}
/*****************************************************************************/
@ -2583,7 +2580,7 @@ static void For_ShowForumThreadsHighlightingOneThread (long ThrCodHighlighted,
Order <= For_LAST_MSG;
Order++)
{
fprintf (Gbl.F.Out,"<th colspan=\"3\" class=\"CENTER_MIDDLE\">");
fprintf (Gbl.F.Out,"<th colspan=\"2\" class=\"CENTER_MIDDLE\">");
Act_FormStartAnchor (For_ActionsSeeFor[Gbl.Forum.ForumSelected.Type],
For_ID_FORUM_THREADS_SECTION);
For_PutAllHiddenParamsForum (Gbl.Forum.CurrentPageThrs, // Page of threads = current
@ -3412,7 +3409,13 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
/* Write the author of first or last message */
UsrDat.UsrCod = Thr.UsrCod[Order];
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
Msg_WriteMsgAuthor (&UsrDat,Style,Thr.Enabled[Order],BgColor);
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP %s\">",Style,BgColor);
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,NULL,Thr.Enabled[Order],BgColor);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
/* Write the date of first or last message (it's in YYYYMMDDHHMMSS format) */
TimeUTC = Thr.WriteTime[Order];
@ -3428,7 +3431,7 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
}
else
for (Column = 1;
Column <= 3;
Column <= 2;
Column++)
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP %s\">"
"</td>",

View File

@ -1538,10 +1538,10 @@ static void Ins_ListInstitutionsForEdition (void)
/* Institution requester */
UsrDat.UsrCod = Ins->RequesterUsrCod;
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
@ -2232,10 +2232,10 @@ static void Ins_PutFormToCreateInstitution (void)
"</td>");
/***** Institution requester *****/
fprintf (Gbl.F.Out,"<td class=\"INPUT_REQUESTER LEFT_TOP\">");
fprintf (Gbl.F.Out,"<td class=\"DAT INPUT_REQUESTER LEFT_TOP\">");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,"DAT",true,NULL);
Msg_WriteMsgAuthor (&Gbl.Usrs.Me.UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");

View File

@ -2957,10 +2957,16 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod)
/***** Write message author *****/
Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat);
Msg_WriteMsgAuthor (&UsrDat,
Open ? "MSG_AUT_BG" :
"MSG_AUT_BG_NEW", // Style
true,NULL);
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP\">",
Open ? "MSG_AUT_BG" :
"MSG_AUT_BG_NEW");
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
/***** Write subject *****/
Msg_WriteSentOrReceivedMsgSubject (MsgCod,Subject,Open,Expanded);
@ -2974,7 +2980,7 @@ static void Msg_ShowASentOrReceivedMessage (long MsgNum,long MsgCod)
if (Expanded)
{
fprintf (Gbl.F.Out,"<tr>"
"<td rowspan=\"3\" colspan=\"3\" class=\"LEFT_TOP\">");
"<td rowspan=\"3\" colspan=\"2\" class=\"LEFT_TOP\">");
Lay_StartTable (2);
/***** Write course origin of message *****/
@ -3172,7 +3178,10 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
bool WriteAuthor = false;
/***** Start first column *****/
fprintf (Gbl.F.Out,"<td class=\"%s CENTER_TOP",Style);
fprintf (Gbl.F.Out,"<td class=\"");
if (Style)
fprintf (Gbl.F.Out,"%s ",Style);
fprintf (Gbl.F.Out,"CENTER_TOP");
if (BgColor)
fprintf (Gbl.F.Out," %s",BgColor);
fprintf (Gbl.F.Out,"\" style=\"width:30px;\">");
@ -3192,7 +3201,10 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
fprintf (Gbl.F.Out,"</td>");
/***** Second column with user name (if author has a web page, put a link to it) *****/
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP",Style);
fprintf (Gbl.F.Out,"<td class=\"");
if (Style)
fprintf (Gbl.F.Out,"%s ",Style);
fprintf (Gbl.F.Out,"LEFT_TOP");
if (BgColor)
fprintf (Gbl.F.Out," %s",BgColor);
fprintf (Gbl.F.Out,"\">"
@ -3206,10 +3218,12 @@ void Msg_WriteMsgAuthor (struct UsrData *UsrDat,
" alt=\"%s\" title=\"%s\""
" class=\"PHOTO30x40\" />"
"</td>"
"<td class=\"%s LEFT_MIDDLE",
"<td class=\"",
Gbl.Prefs.IconsURL,
Txt_Unknown_or_without_photo,Txt_Unknown_or_without_photo,
Style);
Txt_Unknown_or_without_photo,Txt_Unknown_or_without_photo);
if (Style)
fprintf (Gbl.F.Out,"%s ",Style);
fprintf (Gbl.F.Out,"LEFT_MIDDLE");
if (BgColor)
fprintf (Gbl.F.Out," %s",BgColor);
fprintf (Gbl.F.Out,"\">");

View File

@ -393,7 +393,7 @@ void Ntf_ShowMyNotifications (void)
"<th colspan=\"2\" class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th colspan=\"2\" class=\"LEFT_MIDDLE\">"
"<th class=\"LEFT_MIDDLE\">"
"%s"
"</th>"
"<th class=\"LEFT_MIDDLE\">"
@ -533,7 +533,13 @@ void Ntf_ShowMyNotifications (void)
fprintf (Gbl.F.Out,"</td>");
/* Write user (from) */
Msg_WriteMsgAuthor (&UsrDat,ClassAuthorBg,true,NULL);
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP\">",ClassAuthorBg);
Lay_StartTable (2);
fprintf (Gbl.F.Out,"<tr>");
Msg_WriteMsgAuthor (&UsrDat,NULL,true,NULL);
fprintf (Gbl.F.Out,"</tr>");
Lay_EndTable ();
fprintf (Gbl.F.Out,"</td>");
/* Write location */
fprintf (Gbl.F.Out,"<td class=\"%s LEFT_TOP\">",
@ -607,7 +613,7 @@ void Ntf_ShowMyNotifications (void)
false);
fprintf (Gbl.F.Out,"<tr>"
"<td colspan=\"2\"></td>"
"<td colspan=\"5\" class=\"DAT LEFT_TOP\""
"<td colspan=\"4\" class=\"DAT LEFT_TOP\""
" style=\"padding-bottom:12px;\">"
"%s"
"</td>"