Version 16.11.3

This commit is contained in:
Antonio Cañas Vargas 2016-10-04 01:16:52 +02:00
parent 9cf699ff3d
commit 76f7c99bc4
5 changed files with 29 additions and 25 deletions

View File

@ -143,13 +143,14 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.11.2 (2016-10-04)" #define Log_PLATFORM_VERSION "SWAD 16.11.3 (2016-10-04)"
#define CSS_FILE "swad15.229.css" #define CSS_FILE "swad15.229.css"
#define JS_FILE "swad15.238.1.js" #define JS_FILE "swad15.238.1.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.11.3: Oct 04, 2016 Code refactoring in user's usage report. (205834 lines)
Version 16.11.2: Oct 04, 2016 Code refactoring in user's usage report. (205829 lines) Version 16.11.2: Oct 04, 2016 Code refactoring in user's usage report. (205829 lines)
Version 16.11.1: Oct 04, 2016 Code refactoring in user's usage report. (205824 lines) Version 16.11.1: Oct 04, 2016 Code refactoring in user's usage report. (205824 lines)
Version 16.11: Oct 03, 2016 Created permalinks to report files. (205793 lines) Version 16.11: Oct 03, 2016 Created permalinks to report files. (205793 lines)

View File

@ -1914,10 +1914,10 @@ int Inf_WritePlainTextIntoHTMLBuffer (char **HTMLBuffer)
/***** Write start of HTML code *****/ /***** Write start of HTML code *****/
Lay_StartHTMLFile (FileHTMLTmp,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]); Lay_StartHTMLFile (FileHTMLTmp,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]);
fprintf (FileHTMLTmp,"<body>\n"
"<div class=\"DAT LEFT_MIDDLE\">\n");
/***** Write plain text into text buffer *****/ /***** Write plain text into text buffer *****/
fprintf (FileHTMLTmp,"<div class=\"DAT LEFT_MIDDLE\">\n");
/* Convert to respectful HTML and insert links */ /* Convert to respectful HTML and insert links */
Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML, Str_ChangeFormat (Str_FROM_HTML,Str_TO_RIGOROUS_HTML,
TxtHTML,Cns_MAX_BYTES_LONG_TEXT,false); // Convert from HTML to recpectful HTML TxtHTML,Cns_MAX_BYTES_LONG_TEXT,false); // Convert from HTML to recpectful HTML

View File

@ -1784,8 +1784,7 @@ void Lay_StartHTMLFile (FILE *File,const char *Title)
"<meta http-equiv=\"Content-Type\"" "<meta http-equiv=\"Content-Type\""
" content=\"text/html;charset=windows-1252\" />\n" " content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n" "<title>%s</title>\n"
"</head>\n" "</head>\n",
"<body>\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], // Language Txt_STR_LANG_ID[Gbl.Prefs.Language], // Language
Title); // Page title Title); // Page title
} }

View File

@ -25,9 +25,6 @@
/*********************************** Headers *********************************/ /*********************************** Headers *********************************/
/*****************************************************************************/ /*****************************************************************************/
// #include <stdbool.h> // For boolean type
// #include <stdio.h> // For sprintf
// #include <string.h> // For string functions
#include <unistd.h> // For unlink #include <unistd.h> // For unlink
#include "swad_database.h" #include "swad_database.h"
@ -44,14 +41,15 @@
/*****************************************************************************/ /*****************************************************************************/
#define Rep_MIN_CLICKS_CRS 100 // Minimum number of clicks to show a course in historic log #define Rep_MIN_CLICKS_CRS 100 // Minimum number of clicks to show a course in historic log
#define Rep_MAX_BAR_WIDTH 40 // Maximum width of graphic bar #define Rep_MAX_BAR_WIDTH 50 // Maximum width of graphic bar
// #define Rep_BLOCK "&boxH;" // HTML code for a block in graphic bar // #define Rep_BLOCK "&boxH;" // HTML code for a block in graphic bar
// #define Rep_BLOCK "&blk12;" // HTML code for a block in graphic bar // #define Rep_BLOCK "&blk12;" // HTML code for a block in graphic bar
// #define Rep_BLOCK "&block;" // HTML code for a block in graphic bar // #define Rep_BLOCK "&block;" // HTML code for a block in graphic bar
// #define Rep_BLOCK "&equiv;" // HTML code for a block in graphic bar // #define Rep_BLOCK "&equiv;" // HTML code for a block in graphic bar
// #define Rep_BLOCK "&bull;" // HTML code for a block in graphic bar // #define Rep_BLOCK "&bull;" // HTML code for a block in graphic bar
#define Rep_BLOCK "&squf;" // HTML code for a block in graphic bar // #define Rep_BLOCK "&squf;" // HTML code for a block in graphic bar
#define Rep_BLOCK "-"
/*****************************************************************************/ /*****************************************************************************/
/****************************** Internal types *******************************/ /****************************** Internal types *******************************/
@ -207,7 +205,8 @@ static void Rep_CreateMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
/***** Start file *****/ /***** Start file *****/
Lay_StartHTMLFile (Gbl.F.Rep,Txt_Report); Lay_StartHTMLFile (Gbl.F.Rep,Txt_Report);
fprintf (Gbl.F.Rep,"<div style=\"margin:1em;text-align:left;\">\n"); fprintf (Gbl.F.Rep,"<body style=\"margin:1em;text-align:left;"
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;\">\n");
/***** Header *****/ /***** Header *****/
Rep_WriteHeader (CurrentTimeUTC,Permalink); Rep_WriteHeader (CurrentTimeUTC,Permalink);
@ -240,8 +239,7 @@ static void Rep_CreateMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
MaxHitsPerYear); MaxHitsPerYear);
/***** End file *****/ /***** End file *****/
fprintf (Gbl.F.Rep,"</div>\n" fprintf (Gbl.F.Rep,"</body>\n"
"</body>\n"
"</html>\n"); "</html>\n");
/***** Close report file *****/ /***** Close report file *****/
@ -293,7 +291,7 @@ static void Rep_PutLinkToMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
static void Req_TitleReport (struct CurrentTimeUTC *CurrentTimeUTC) static void Req_TitleReport (struct CurrentTimeUTC *CurrentTimeUTC)
{ {
fprintf (Gbl.F.Out,"<div class=\"DAT_N\">" fprintf (Gbl.F.Out,"<div class=\"DAT_N\" style=\"margin-bottom:10px;\">"
"%s",Gbl.Usrs.Me.UsrDat.FullName); "%s",Gbl.Usrs.Me.UsrDat.FullName);
if (CurrentTimeUTC->StrDate[0]) if (CurrentTimeUTC->StrDate[0])
fprintf (Gbl.F.Out,"<br />%s",CurrentTimeUTC->StrDate); fprintf (Gbl.F.Out,"<br />%s",CurrentTimeUTC->StrDate);
@ -310,7 +308,7 @@ static void Rep_WriteHeader (struct CurrentTimeUTC *CurrentTimeUTC,
extern const char *Txt_Report_of_use_of_PLATFORM; extern const char *Txt_Report_of_use_of_PLATFORM;
/***** Start of header *****/ /***** Start of header *****/
fprintf (Gbl.F.Rep,"<header style=\"text-align:center;\">"); fprintf (Gbl.F.Rep,"<header>");
/***** Main title *****/ /***** Main title *****/
sprintf (Gbl.Title,Txt_Report_of_use_of_PLATFORM,Cfg_PLATFORM_SHORT_NAME); sprintf (Gbl.Title,Txt_Report_of_use_of_PLATFORM,Cfg_PLATFORM_SHORT_NAME);
@ -1034,10 +1032,15 @@ static void Rep_DrawBarNumHits (float HitsNum,float HitsMax,
{ {
/***** Draw bar with a with proportional to the number of hits *****/ /***** Draw bar with a with proportional to the number of hits *****/
BarWidth = (unsigned) (((HitsNum * (float) MaxBarWidth) / HitsMax) + 0.5); BarWidth = (unsigned) (((HitsNum * (float) MaxBarWidth) / HitsMax) + 0.5);
for (i = 0; if (BarWidth)
i < BarWidth; {
i++) fprintf (Gbl.F.Rep,"<strong>");
fprintf (Gbl.F.Rep,Rep_BLOCK); for (i = 0;
i < BarWidth;
i++)
fprintf (Gbl.F.Rep,Rep_BLOCK);
fprintf (Gbl.F.Rep,"</strong>");
}
/***** Write the number of hits *****/ /***** Write the number of hits *****/
fprintf (Gbl.F.Rep,"&nbsp;"); fprintf (Gbl.F.Rep,"&nbsp;");

View File

@ -842,7 +842,8 @@ static void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp)
/***** Write start of HTML code *****/ /***** Write start of HTML code *****/
Lay_StartHTMLFile (FileHTMLTmp,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]); Lay_StartHTMLFile (FileHTMLTmp,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]);
fprintf (FileHTMLTmp,"<table>\n"); fprintf (FileHTMLTmp,"<body>\n"
"<table>\n");
/***** Set width of columns of the table *****/ /***** Set width of columns of the table *****/
fprintf (FileHTMLTmp,"<colgroup>\n"); fprintf (FileHTMLTmp,"<colgroup>\n");
@ -852,7 +853,7 @@ static void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp)
fprintf (FileHTMLTmp,"<col width=\"%d\" />\n", fprintf (FileHTMLTmp,"<col width=\"%d\" />\n",
i * Syl_WIDTH_NUM_SYLLABUS); i * Syl_WIDTH_NUM_SYLLABUS);
fprintf (FileHTMLTmp,"<col width=\"*\" />\n" fprintf (FileHTMLTmp,"<col width=\"*\" />\n"
"</colgroup>\n"); "</colgroup>\n");
/***** Write all items of the current syllabus into text buffer *****/ /***** Write all items of the current syllabus into text buffer *****/
for (NumItem = 0; for (NumItem = 0;
@ -880,8 +881,8 @@ static void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp)
/***** Text of the item *****/ /***** Text of the item *****/
fprintf (FileHTMLTmp,"<td colspan=\"%d\" class=\"%s LEFT_TOP\">" fprintf (FileHTMLTmp,"<td colspan=\"%d\" class=\"%s LEFT_TOP\">"
"%s" "%s"
"</td>", "</td>",
LstItemsSyllabus.NumLevels - LstItemsSyllabus.Lst[NumItem].Level + 1, LstItemsSyllabus.NumLevels - LstItemsSyllabus.Lst[NumItem].Level + 1,
StyleSyllabus[LstItemsSyllabus.Lst[NumItem].Level], StyleSyllabus[LstItemsSyllabus.Lst[NumItem].Level],
LstItemsSyllabus.Lst[NumItem].Text); LstItemsSyllabus.Lst[NumItem].Text);
@ -891,8 +892,8 @@ static void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp)
} }
fprintf (FileHTMLTmp,"</table>\n" fprintf (FileHTMLTmp,"</table>\n"
"</html>\n" "</html>\n"
"</body>\n"); "</body>\n");
} }
/*****************************************************************************/ /*****************************************************************************/