mirror of https://github.com/acanas/swad-core.git
Version 16.12
This commit is contained in:
parent
76f7c99bc4
commit
37da766464
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -143,13 +143,16 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 16.11.3 (2016-10-04)"
|
#define Log_PLATFORM_VERSION "SWAD 16.12 (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.12: Oct 04, 2016 Code refactoring in user's usage report. (205882 lines)
|
||||||
|
Copy icon/report64x64.png to icon directory
|
||||||
|
|
||||||
Version 16.11.3: Oct 04, 2016 Code refactoring in user's usage report. (205834 lines)
|
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)
|
||||||
|
|
|
@ -398,9 +398,6 @@
|
||||||
/* Folder for temporary XML files received to import test questions, inside private swad directory */
|
/* Folder for temporary XML files received to import test questions, inside private swad directory */
|
||||||
#define Cfg_FOLDER_TEST "test" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_TEST "test" // Created automatically the first time it is accessed
|
||||||
|
|
||||||
/* Folder for reports, inside private swad directory */
|
|
||||||
#define Cfg_FOLDER_REP "rep" // Created automatically the first time it is accessed
|
|
||||||
|
|
||||||
/* Folder for compression of assignments and works into a zip files, inside private swad directory */
|
/* Folder for compression of assignments and works into a zip files, inside private swad directory */
|
||||||
#define Cfg_FOLDER_ZIP "zip" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_ZIP "zip" // Created automatically the first time it is accessed
|
||||||
|
|
||||||
|
@ -414,6 +411,9 @@
|
||||||
/* Folders for temporary users' photos inside photos directories */
|
/* Folders for temporary users' photos inside photos directories */
|
||||||
#define Cfg_FOLDER_PHOTO_TMP "tmp" // Created automatically the first time it is accessed
|
#define Cfg_FOLDER_PHOTO_TMP "tmp" // Created automatically the first time it is accessed
|
||||||
|
|
||||||
|
/* Folder for reports, inside public swad directory */
|
||||||
|
#define Cfg_FOLDER_REP "rep" // Created automatically the first time it is accessed
|
||||||
|
|
||||||
/* Folder for banners, inside public swad directory */
|
/* Folder for banners, inside public swad directory */
|
||||||
#define Cfg_FOLDER_BANNER "banner" // If not exists, it should be created during installation inside swad public directory!
|
#define Cfg_FOLDER_BANNER "banner" // If not exists, it should be created during installation inside swad public directory!
|
||||||
|
|
||||||
|
|
|
@ -1508,6 +1508,7 @@ static void Brw_PutIconNewFileOrFolder (void);
|
||||||
static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size,
|
static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size,
|
||||||
struct FileMetadata *FileMetadata,
|
struct FileMetadata *FileMetadata,
|
||||||
const char *FileNameToShow);
|
const char *FileNameToShow);
|
||||||
|
static void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *FileName);
|
||||||
static void Brw_WriteFileName (unsigned Level,bool IsPublic,Brw_FileType_t FileType,
|
static void Brw_WriteFileName (unsigned Level,bool IsPublic,Brw_FileType_t FileType,
|
||||||
const char *PathInTree,const char *FileName,const char *FileNameToShow);
|
const char *PathInTree,const char *FileName,const char *FileNameToShow);
|
||||||
static void Brw_GetFileNameToShow (Brw_FileBrowser_t FileBrowser,unsigned Level,Brw_FileType_t FileType,
|
static void Brw_GetFileNameToShow (Brw_FileBrowser_t FileBrowser,unsigned Level,Brw_FileType_t FileType,
|
||||||
|
@ -5859,7 +5860,7 @@ static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size,
|
||||||
/***************************** Put icon of a file ****************************/
|
/***************************** Put icon of a file ****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *FileName)
|
static void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *FileName)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Link;
|
extern const char *Txt_Link;
|
||||||
extern const char *Txt_X_file;
|
extern const char *Txt_X_file;
|
||||||
|
@ -9879,7 +9880,7 @@ static void Brw_WriteBigLinkToDownloadFile (const char *URL,
|
||||||
fprintf (Gbl.F.Out," %s "
|
fprintf (Gbl.F.Out," %s "
|
||||||
"<img src=\"%s/download64x64.png\""
|
"<img src=\"%s/download64x64.png\""
|
||||||
" alt=\"%s\" title=\"%s\""
|
" alt=\"%s\" title=\"%s\""
|
||||||
" class=\"ICON40x40\">"
|
" class=\"ICON40x40\" />"
|
||||||
"</a>",
|
"</a>",
|
||||||
FileNameToShow,
|
FileNameToShow,
|
||||||
Gbl.Prefs.IconsURL,
|
Gbl.Prefs.IconsURL,
|
||||||
|
|
|
@ -222,8 +222,6 @@ void Brw_CalcSizeOfDir (char *Path);
|
||||||
|
|
||||||
void Brw_SetFullPathInTree (const char *PathInTreeUntilFileOrFolder,const char *FilFolLnkName);
|
void Brw_SetFullPathInTree (const char *PathInTreeUntilFileOrFolder,const char *FilFolLnkName);
|
||||||
|
|
||||||
void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *FileName);
|
|
||||||
|
|
||||||
void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
void Brw_CreateTmpPublicLinkToPrivateFile (const char *FullPathIncludingFile,
|
||||||
const char *FileName);
|
const char *FileName);
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
/*********************************** Headers *********************************/
|
/*********************************** Headers *********************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <sys/stat.h> // For mkdir
|
||||||
|
#include <sys/types.h> // For mkdir
|
||||||
#include <unistd.h> // For unlink
|
#include <unistd.h> // For unlink
|
||||||
|
|
||||||
#include "swad_database.h"
|
#include "swad_database.h"
|
||||||
|
@ -179,6 +181,7 @@ static void Rep_CreateMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
|
||||||
extern const char *Txt_Report;
|
extern const char *Txt_Report;
|
||||||
struct UsrFigures UsrFigures;
|
struct UsrFigures UsrFigures;
|
||||||
char PathReports[PATH_MAX+1];
|
char PathReports[PATH_MAX+1];
|
||||||
|
char PathDirReport[PATH_MAX+1];
|
||||||
char PathFileReport[PATH_MAX+1];
|
char PathFileReport[PATH_MAX+1];
|
||||||
struct tm tm_FirstClickTime;
|
struct tm tm_FirstClickTime;
|
||||||
bool GetUsrFiguresAgain;
|
bool GetUsrFiguresAgain;
|
||||||
|
@ -189,20 +192,36 @@ static void Rep_CreateMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
|
||||||
CurrentTimeUTC->StrTime);
|
CurrentTimeUTC->StrTime);
|
||||||
|
|
||||||
/***** Path for reports *****/
|
/***** Path for reports *****/
|
||||||
sprintf (PathReports,"%s/%s",Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_REP);
|
sprintf (PathReports,"%s/%s",
|
||||||
|
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_REP);
|
||||||
Fil_CreateDirIfNotExists (PathReports);
|
Fil_CreateDirIfNotExists (PathReports);
|
||||||
|
|
||||||
/***** Create a new empty syllabus *****/
|
/***** Create a new report directory *****/
|
||||||
/* Path of the private directory for the file with the report */
|
/* Path of the public directory for the file with the report */
|
||||||
sprintf (PathFileReport,"%s/%s.html",
|
sprintf (PathReports,"%s/%s/%c%c",
|
||||||
PathReports,Gbl.UniqueNameEncrypted);
|
Cfg_PATH_SWAD_PUBLIC,Cfg_FOLDER_REP,
|
||||||
sprintf (Permalink,"%s/%s/%s.html",
|
Gbl.UniqueNameEncrypted[0],
|
||||||
Cfg_URL_SWAD_PUBLIC,
|
Gbl.UniqueNameEncrypted[1]);
|
||||||
Cfg_FOLDER_REP,
|
Fil_CreateDirIfNotExists (PathReports);
|
||||||
Gbl.UniqueNameEncrypted);
|
sprintf (PathDirReport,"%s/%s",
|
||||||
|
PathReports,
|
||||||
|
&Gbl.UniqueNameEncrypted[2]);
|
||||||
|
if (mkdir (PathDirReport,(mode_t) 0xFFF))
|
||||||
|
Lay_ShowErrorAndExit ("Can not create directory for report.");
|
||||||
|
|
||||||
|
/* Path of the public file with the report */
|
||||||
|
sprintf (PathFileReport,"%s/index.html",PathDirReport);
|
||||||
if ((Gbl.F.Rep = fopen (PathFileReport,"wb")) == NULL)
|
if ((Gbl.F.Rep = fopen (PathFileReport,"wb")) == NULL)
|
||||||
Lay_ShowErrorAndExit ("Can not create report file.");
|
Lay_ShowErrorAndExit ("Can not create report file.");
|
||||||
|
|
||||||
|
/* Permalink */
|
||||||
|
sprintf (Permalink,"%s/%s/%c%c/%s/",
|
||||||
|
Cfg_URL_SWAD_PUBLIC,
|
||||||
|
Cfg_FOLDER_REP,
|
||||||
|
Gbl.UniqueNameEncrypted[0],
|
||||||
|
Gbl.UniqueNameEncrypted[1],
|
||||||
|
&Gbl.UniqueNameEncrypted[2]);
|
||||||
|
|
||||||
/***** Start file *****/
|
/***** Start file *****/
|
||||||
Lay_StartHTMLFile (Gbl.F.Rep,Txt_Report);
|
Lay_StartHTMLFile (Gbl.F.Rep,Txt_Report);
|
||||||
fprintf (Gbl.F.Rep,"<body style=\"margin:1em;text-align:left;"
|
fprintf (Gbl.F.Rep,"<body style=\"margin:1em;text-align:left;"
|
||||||
|
@ -255,7 +274,6 @@ static void Rep_PutLinkToMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
|
||||||
{
|
{
|
||||||
extern const char *Txt_Report_of_use_of_PLATFORM;
|
extern const char *Txt_Report_of_use_of_PLATFORM;
|
||||||
extern const char *Txt_Report;
|
extern const char *Txt_Report;
|
||||||
extern const char *Txt_Download;
|
|
||||||
|
|
||||||
/***** Start frame *****/
|
/***** Start frame *****/
|
||||||
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);
|
||||||
|
@ -265,21 +283,19 @@ static void Rep_PutLinkToMyUsageReport (struct CurrentTimeUTC *CurrentTimeUTC,
|
||||||
Req_TitleReport (CurrentTimeUTC);
|
Req_TitleReport (CurrentTimeUTC);
|
||||||
|
|
||||||
/***** Put anchor and report filename *****/
|
/***** Put anchor and report filename *****/
|
||||||
fprintf (Gbl.F.Out,"<div class=\"FILENAME CENTER_MIDDLE\">");
|
fprintf (Gbl.F.Out,"<div class=\"FILENAME CENTER_MIDDLE\">"
|
||||||
fprintf (Gbl.F.Out,"<a href=\"%s\" class=\"FILENAME\""
|
"<a href=\"%s\" class=\"FILENAME\""
|
||||||
" title=\"%s\" target=\"_blank\">",
|
" title=\"%s\" target=\"_blank\">"
|
||||||
Permalink,
|
"<img src=\"%s/report64x64.png\" alt=\"%s\""
|
||||||
Txt_Report);
|
" class=\"ICON64x64\" /><br />"
|
||||||
Brw_PutIconFile (32,Brw_IS_FILE,Permalink);
|
"%s"
|
||||||
fprintf (Gbl.F.Out," %s "
|
|
||||||
"<img src=\"%s/download64x64.png\""
|
|
||||||
" alt=\"%s\" title=\"%s\""
|
|
||||||
" class=\"ICON40x40\">"
|
|
||||||
"</a>"
|
"</a>"
|
||||||
"</div>",
|
"</div>",
|
||||||
Permalink,
|
Permalink,
|
||||||
Gbl.Prefs.IconsURL,
|
Txt_Report,
|
||||||
Txt_Download,Txt_Download);
|
Gbl.Prefs.IconsURL,
|
||||||
|
Txt_Report,
|
||||||
|
Permalink);
|
||||||
|
|
||||||
/***** End frame *****/
|
/***** End frame *****/
|
||||||
Lay_EndRoundFrame ();
|
Lay_EndRoundFrame ();
|
||||||
|
@ -306,22 +322,33 @@ static void Rep_WriteHeader (struct CurrentTimeUTC *CurrentTimeUTC,
|
||||||
const char *Permalink)
|
const char *Permalink)
|
||||||
{
|
{
|
||||||
extern const char *Txt_Report_of_use_of_PLATFORM;
|
extern const char *Txt_Report_of_use_of_PLATFORM;
|
||||||
|
extern const char *Txt_User[Usr_NUM_SEXS];
|
||||||
|
extern const char *Txt_Date;
|
||||||
|
extern const char *Txt_Permalink;
|
||||||
|
|
||||||
/***** Start of header *****/
|
/***** Start of header *****/
|
||||||
fprintf (Gbl.F.Rep,"<header>");
|
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);
|
||||||
fprintf (Gbl.F.Rep,"<h1>%s</h1>",Gbl.Title);
|
fprintf (Gbl.F.Rep,"<h1>%s</h1>"
|
||||||
|
"<ul>",
|
||||||
|
Gbl.Title);
|
||||||
|
|
||||||
/***** Subtitle *****/
|
/***** User *****/
|
||||||
fprintf (Gbl.F.Rep,"<h2>%s",Gbl.Usrs.Me.UsrDat.FullName);
|
fprintf (Gbl.F.Rep,"<li>%s: <strong>%s</strong></li>",
|
||||||
if (CurrentTimeUTC->StrDate[0])
|
Txt_User[Gbl.Usrs.Me.UsrDat.Sex],
|
||||||
fprintf (Gbl.F.Rep,", %s",CurrentTimeUTC->StrDate);
|
Gbl.Usrs.Me.UsrDat.FullName);
|
||||||
fprintf (Gbl.F.Rep,"</h2>");
|
|
||||||
|
/***** Date-time *****/
|
||||||
|
fprintf (Gbl.F.Rep,"<li>%s: %s %s UTC</li>",
|
||||||
|
Txt_Date,
|
||||||
|
CurrentTimeUTC->StrDate,
|
||||||
|
CurrentTimeUTC->StrTime);
|
||||||
|
|
||||||
/***** Permalink *****/
|
/***** Permalink *****/
|
||||||
fprintf (Gbl.F.Rep,"<a href=\"%s\" target=\"_blank\">%s</a>\n",
|
fprintf (Gbl.F.Rep,"<li>%s: <a href=\"%s\" target=\"_blank\">%s</a></li>",
|
||||||
|
Txt_Permalink,
|
||||||
Permalink,Permalink);
|
Permalink,Permalink);
|
||||||
|
|
||||||
/***** End of header *****/
|
/***** End of header *****/
|
||||||
|
@ -380,7 +407,7 @@ static void Rep_WriteSectionUsrInfo (void)
|
||||||
Txt_Personal_information);
|
Txt_Personal_information);
|
||||||
|
|
||||||
/***** User's name *****/
|
/***** User's name *****/
|
||||||
fprintf (Gbl.F.Rep,"<li>%s: <strong>%s</strong></li>",
|
fprintf (Gbl.F.Rep,"<li>%s: %s</li>",
|
||||||
Txt_Name,
|
Txt_Name,
|
||||||
Gbl.Usrs.Me.UsrDat.FullName);
|
Gbl.Usrs.Me.UsrDat.FullName);
|
||||||
|
|
||||||
|
@ -458,7 +485,9 @@ static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
|
||||||
tm_FirstClickTime->tm_sec); // seconds
|
tm_FirstClickTime->tm_sec); // seconds
|
||||||
if (CurrentTimeUTC->StrDate[0])
|
if (CurrentTimeUTC->StrDate[0])
|
||||||
fprintf (Gbl.F.Rep," %s %s %s UTC",
|
fprintf (Gbl.F.Rep," %s %s %s UTC",
|
||||||
Txt_TIME_until,CurrentTimeUTC->StrDate,CurrentTimeUTC->StrTime);
|
Txt_TIME_until,
|
||||||
|
CurrentTimeUTC->StrDate,
|
||||||
|
CurrentTimeUTC->StrTime);
|
||||||
if (UsrFigures->NumDays > 0)
|
if (UsrFigures->NumDays > 0)
|
||||||
fprintf (Gbl.F.Rep," (%d %s)",
|
fprintf (Gbl.F.Rep," (%d %s)",
|
||||||
UsrFigures->NumDays,
|
UsrFigures->NumDays,
|
||||||
|
|
21
swad_text.c
21
swad_text.c
|
@ -27838,6 +27838,27 @@ const char *Txt_PERCENT_of_users =
|
||||||
"% de utilizadores";
|
"% de utilizadores";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *Txt_Permalink =
|
||||||
|
#if L==1
|
||||||
|
"Enllaç permanent";
|
||||||
|
#elif L==2
|
||||||
|
"Permalink";
|
||||||
|
#elif L==3
|
||||||
|
"Permalink";
|
||||||
|
#elif L==4
|
||||||
|
"Permalink";
|
||||||
|
#elif L==5
|
||||||
|
"Permalien";
|
||||||
|
#elif L==6
|
||||||
|
"Permalink"; // Okoteve traducción
|
||||||
|
#elif L==7
|
||||||
|
"Permalink";
|
||||||
|
#elif L==8
|
||||||
|
"Odnośnik bezpośredni";
|
||||||
|
#elif L==9
|
||||||
|
"Ligação permanente";
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Txt_Personal_information =
|
const char *Txt_Personal_information =
|
||||||
#if L==1
|
#if L==1
|
||||||
"Dades personals";
|
"Dades personals";
|
||||||
|
|
Loading…
Reference in New Issue