Version 16.11

This commit is contained in:
Antonio Cañas Vargas 2016-10-03 22:41:45 +02:00
parent 8e8e5d4e0d
commit 6ab1beeb20
10 changed files with 193 additions and 196 deletions

View File

@ -1311,7 +1311,6 @@ Statistics:
1124. ActSeeAccCrs Query clicks to current course 1124. ActSeeAccCrs Query clicks to current course
1125. ActSeeAllStaCrs Show statistics of courses 1125. ActSeeAllStaCrs Show statistics of courses
NEW. ActSeeMyUsgRep Show my usage report NEW. ActSeeMyUsgRep Show my usage report
NEW. ActPrnMyUsgRep Print my usage report
Profile: Profile:
1126. ActFrmLogIn Show landing page (forms to log in and to create a new account) 1126. ActFrmLogIn Show landing page (forms to log in and to create a new account)
1127. ActFrmRolSes Show form to log out and to change current role in this session 1127. ActFrmRolSes Show form to log out and to change current role in this session
@ -2742,7 +2741,6 @@ struct Act_Actions Act_Actions[Act_NUM_ACTIONS] =
/* ActSeeAllStaCrs */{ 768,-1,TabSta,ActReqAccGbl ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Ind_ShowIndicatorsCourses ,NULL}, /* ActSeeAllStaCrs */{ 768,-1,TabSta,ActReqAccGbl ,0x1FF,0x1FF,0x1FF,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Ind_ShowIndicatorsCourses ,NULL},
/* ActSeeMyUsgRep */{1582,-1,TabSta,ActReqMyUsgRep ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rep_ShowMyUsageReport ,NULL}, /* ActSeeMyUsgRep */{1582,-1,TabSta,ActReqMyUsgRep ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_MAIN_WINDOW,NULL ,Rep_ShowMyUsageReport ,NULL},
/* ActPrnMyUsgRep */{1583, 5,TabSta,ActReqMyUsgRep ,0x100,0x100,0x100,Act_CONTENT_NORM,Act_NEW_WINDOW ,NULL ,Rep_PrintMyUsageReport ,NULL},
// TabPrf ****************************************************************** // TabPrf ******************************************************************
// Actions in menu: // Actions in menu:
@ -4441,7 +4439,7 @@ Act_Action_t Act_FromActCodToAction[1+Act_MAX_ACTION_COD] = // Do not reuse uniq
ActRemDupUsr, // #1580 ActRemDupUsr, // #1580
ActSeeMyAgd, // #1581 ActSeeMyAgd, // #1581
ActSeeMyUsgRep, // #1582 ActSeeMyUsgRep, // #1582
ActPrnMyUsgRep, // #1583 -1, // #1583 (obsolete action)
ActChkUsrAcc, // #1584 ActChkUsrAcc, // #1584
ActAutUsrNew, // #1585 ActAutUsrNew, // #1585
ActReqMyUsgRep, // #1586 ActReqMyUsgRep, // #1586

View File

@ -72,7 +72,7 @@ typedef enum
typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action typedef int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
#define Act_NUM_ACTIONS (1+9+51+15+90+70+67+246+186+156+172+36+31+87) #define Act_NUM_ACTIONS (1+9+51+15+90+70+67+246+186+156+172+36+30+87)
#define Act_MAX_ACTION_COD 1586 #define Act_MAX_ACTION_COD 1586
@ -1364,110 +1364,109 @@ typedef int Act_Action_t; // Must be a signed type, because -1 is used to indica
#define ActSeeAllStaCrs (ActUnbUsrLst+ 29) #define ActSeeAllStaCrs (ActUnbUsrLst+ 29)
#define ActSeeMyUsgRep (ActUnbUsrLst+ 30) #define ActSeeMyUsgRep (ActUnbUsrLst+ 30)
#define ActPrnMyUsgRep (ActUnbUsrLst+ 31)
/*****************************************************************************/ /*****************************************************************************/
/******************************** Profile tab ********************************/ /******************************** Profile tab ********************************/
/*****************************************************************************/ /*****************************************************************************/
// Actions in menu // Actions in menu
#define ActFrmLogIn (ActPrnMyUsgRep+ 1) #define ActFrmLogIn (ActSeeMyUsgRep+ 1)
#define ActFrmRolSes (ActPrnMyUsgRep+ 2) #define ActFrmRolSes (ActSeeMyUsgRep+ 2)
#define ActMyCrs (ActPrnMyUsgRep+ 3) #define ActMyCrs (ActSeeMyUsgRep+ 3)
#define ActSeeMyTT (ActPrnMyUsgRep+ 4) #define ActSeeMyTT (ActSeeMyUsgRep+ 4)
#define ActSeeMyAgd (ActPrnMyUsgRep+ 5) #define ActSeeMyAgd (ActSeeMyUsgRep+ 5)
#define ActFrmUsrAcc (ActPrnMyUsgRep+ 6) #define ActFrmUsrAcc (ActSeeMyUsgRep+ 6)
#define ActReqEdiRecCom (ActPrnMyUsgRep+ 7) #define ActReqEdiRecCom (ActSeeMyUsgRep+ 7)
#define ActEdiPrf (ActPrnMyUsgRep+ 8) #define ActEdiPrf (ActSeeMyUsgRep+ 8)
#define ActAdmBrf (ActPrnMyUsgRep+ 9) #define ActAdmBrf (ActSeeMyUsgRep+ 9)
#define ActMFUAct (ActPrnMyUsgRep+10) #define ActMFUAct (ActSeeMyUsgRep+10)
// Secondary actions // Secondary actions
#define ActReqSndNewPwd (ActPrnMyUsgRep+11) #define ActReqSndNewPwd (ActSeeMyUsgRep+11)
#define ActSndNewPwd (ActPrnMyUsgRep+12) #define ActSndNewPwd (ActSeeMyUsgRep+12)
#define ActLogOut (ActPrnMyUsgRep+13) #define ActLogOut (ActSeeMyUsgRep+13)
#define ActAutUsrInt (ActPrnMyUsgRep+14) #define ActAutUsrInt (ActSeeMyUsgRep+14)
#define ActAutUsrNew (ActPrnMyUsgRep+15) #define ActAutUsrNew (ActSeeMyUsgRep+15)
#define ActAutUsrExt (ActPrnMyUsgRep+16) #define ActAutUsrExt (ActSeeMyUsgRep+16)
#define ActAutUsrChgLan (ActPrnMyUsgRep+17) #define ActAutUsrChgLan (ActSeeMyUsgRep+17)
#define ActAnnSee (ActPrnMyUsgRep+18) #define ActAnnSee (ActSeeMyUsgRep+18)
#define ActChgMyRol (ActPrnMyUsgRep+19) #define ActChgMyRol (ActSeeMyUsgRep+19)
#define ActChkUsrAcc (ActPrnMyUsgRep+20) #define ActChkUsrAcc (ActSeeMyUsgRep+20)
#define ActCreUsrAcc (ActPrnMyUsgRep+21) #define ActCreUsrAcc (ActSeeMyUsgRep+21)
#define ActRemID_Me (ActPrnMyUsgRep+22) #define ActRemID_Me (ActSeeMyUsgRep+22)
#define ActNewIDMe (ActPrnMyUsgRep+23) #define ActNewIDMe (ActSeeMyUsgRep+23)
#define ActRemOldNic (ActPrnMyUsgRep+24) #define ActRemOldNic (ActSeeMyUsgRep+24)
#define ActChgNic (ActPrnMyUsgRep+25) #define ActChgNic (ActSeeMyUsgRep+25)
#define ActRemMaiMe (ActPrnMyUsgRep+26) #define ActRemMaiMe (ActSeeMyUsgRep+26)
#define ActNewMaiMe (ActPrnMyUsgRep+27) #define ActNewMaiMe (ActSeeMyUsgRep+27)
#define ActCnfMai (ActPrnMyUsgRep+28) #define ActCnfMai (ActSeeMyUsgRep+28)
#define ActFrmChgMyPwd (ActPrnMyUsgRep+29) #define ActFrmChgMyPwd (ActSeeMyUsgRep+29)
#define ActChgPwd (ActPrnMyUsgRep+30) #define ActChgPwd (ActSeeMyUsgRep+30)
#define ActReqRemMyAcc (ActPrnMyUsgRep+31) #define ActReqRemMyAcc (ActSeeMyUsgRep+31)
#define ActRemMyAcc (ActPrnMyUsgRep+32) #define ActRemMyAcc (ActSeeMyUsgRep+32)
#define ActChgMyData (ActPrnMyUsgRep+33) #define ActChgMyData (ActSeeMyUsgRep+33)
#define ActReqMyPho (ActPrnMyUsgRep+34) #define ActReqMyPho (ActSeeMyUsgRep+34)
#define ActDetMyPho (ActPrnMyUsgRep+35) #define ActDetMyPho (ActSeeMyUsgRep+35)
#define ActUpdMyPho (ActPrnMyUsgRep+36) #define ActUpdMyPho (ActSeeMyUsgRep+36)
#define ActReqRemMyPho (ActPrnMyUsgRep+37) #define ActReqRemMyPho (ActSeeMyUsgRep+37)
#define ActRemMyPho (ActPrnMyUsgRep+38) #define ActRemMyPho (ActSeeMyUsgRep+38)
#define ActEdiPri (ActPrnMyUsgRep+39) #define ActEdiPri (ActSeeMyUsgRep+39)
#define ActChgPriPho (ActPrnMyUsgRep+40) #define ActChgPriPho (ActSeeMyUsgRep+40)
#define ActChgPriPrf (ActPrnMyUsgRep+41) #define ActChgPriPrf (ActSeeMyUsgRep+41)
#define ActReqEdiMyIns (ActPrnMyUsgRep+42) #define ActReqEdiMyIns (ActSeeMyUsgRep+42)
#define ActChgCtyMyIns (ActPrnMyUsgRep+43) #define ActChgCtyMyIns (ActSeeMyUsgRep+43)
#define ActChgMyIns (ActPrnMyUsgRep+44) #define ActChgMyIns (ActSeeMyUsgRep+44)
#define ActChgMyCtr (ActPrnMyUsgRep+45) #define ActChgMyCtr (ActSeeMyUsgRep+45)
#define ActChgMyDpt (ActPrnMyUsgRep+46) #define ActChgMyDpt (ActSeeMyUsgRep+46)
#define ActChgMyOff (ActPrnMyUsgRep+47) #define ActChgMyOff (ActSeeMyUsgRep+47)
#define ActChgMyOffPho (ActPrnMyUsgRep+48) #define ActChgMyOffPho (ActSeeMyUsgRep+48)
#define ActReqEdiMyNet (ActPrnMyUsgRep+49) #define ActReqEdiMyNet (ActSeeMyUsgRep+49)
#define ActChgMyNet (ActPrnMyUsgRep+50) #define ActChgMyNet (ActSeeMyUsgRep+50)
#define ActChgThe (ActPrnMyUsgRep+51) #define ActChgThe (ActSeeMyUsgRep+51)
#define ActReqChgLan (ActPrnMyUsgRep+52) #define ActReqChgLan (ActSeeMyUsgRep+52)
#define ActChgLan (ActPrnMyUsgRep+53) #define ActChgLan (ActSeeMyUsgRep+53)
#define ActChg1stDay (ActPrnMyUsgRep+54) #define ActChg1stDay (ActSeeMyUsgRep+54)
#define ActChgCol (ActPrnMyUsgRep+55) #define ActChgCol (ActSeeMyUsgRep+55)
#define ActHidLftCol (ActPrnMyUsgRep+56) #define ActHidLftCol (ActSeeMyUsgRep+56)
#define ActHidRgtCol (ActPrnMyUsgRep+57) #define ActHidRgtCol (ActSeeMyUsgRep+57)
#define ActShoLftCol (ActPrnMyUsgRep+58) #define ActShoLftCol (ActSeeMyUsgRep+58)
#define ActShoRgtCol (ActPrnMyUsgRep+59) #define ActShoRgtCol (ActSeeMyUsgRep+59)
#define ActChgIco (ActPrnMyUsgRep+60) #define ActChgIco (ActSeeMyUsgRep+60)
#define ActChgMnu (ActPrnMyUsgRep+61) #define ActChgMnu (ActSeeMyUsgRep+61)
#define ActChgNtfPrf (ActPrnMyUsgRep+62) #define ActChgNtfPrf (ActSeeMyUsgRep+62)
#define ActPrnUsrQR (ActPrnMyUsgRep+63) #define ActPrnUsrQR (ActSeeMyUsgRep+63)
#define ActPrnMyTT (ActPrnMyUsgRep+64) #define ActPrnMyTT (ActSeeMyUsgRep+64)
#define ActEdiTut (ActPrnMyUsgRep+65) #define ActEdiTut (ActSeeMyUsgRep+65)
#define ActChgTut (ActPrnMyUsgRep+66) #define ActChgTut (ActSeeMyUsgRep+66)
#define ActChgMyTT1stDay (ActPrnMyUsgRep+67) #define ActChgMyTT1stDay (ActSeeMyUsgRep+67)
#define ActReqRemFilBrf (ActPrnMyUsgRep+68) #define ActReqRemFilBrf (ActSeeMyUsgRep+68)
#define ActRemFilBrf (ActPrnMyUsgRep+69) #define ActRemFilBrf (ActSeeMyUsgRep+69)
#define ActRemFolBrf (ActPrnMyUsgRep+70) #define ActRemFolBrf (ActSeeMyUsgRep+70)
#define ActCopBrf (ActPrnMyUsgRep+71) #define ActCopBrf (ActSeeMyUsgRep+71)
#define ActPasBrf (ActPrnMyUsgRep+72) #define ActPasBrf (ActSeeMyUsgRep+72)
#define ActRemTreBrf (ActPrnMyUsgRep+73) #define ActRemTreBrf (ActSeeMyUsgRep+73)
#define ActFrmCreBrf (ActPrnMyUsgRep+74) #define ActFrmCreBrf (ActSeeMyUsgRep+74)
#define ActCreFolBrf (ActPrnMyUsgRep+75) #define ActCreFolBrf (ActSeeMyUsgRep+75)
#define ActCreLnkBrf (ActPrnMyUsgRep+76) #define ActCreLnkBrf (ActSeeMyUsgRep+76)
#define ActRenFolBrf (ActPrnMyUsgRep+77) #define ActRenFolBrf (ActSeeMyUsgRep+77)
#define ActRcvFilBrfDZ (ActPrnMyUsgRep+78) #define ActRcvFilBrfDZ (ActSeeMyUsgRep+78)
#define ActRcvFilBrfCla (ActPrnMyUsgRep+79) #define ActRcvFilBrfCla (ActSeeMyUsgRep+79)
#define ActExpBrf (ActPrnMyUsgRep+80) #define ActExpBrf (ActSeeMyUsgRep+80)
#define ActConBrf (ActPrnMyUsgRep+81) #define ActConBrf (ActSeeMyUsgRep+81)
#define ActZIPBrf (ActPrnMyUsgRep+82) #define ActZIPBrf (ActSeeMyUsgRep+82)
#define ActReqDatBrf (ActPrnMyUsgRep+83) #define ActReqDatBrf (ActSeeMyUsgRep+83)
#define ActChgDatBrf (ActPrnMyUsgRep+84) #define ActChgDatBrf (ActSeeMyUsgRep+84)
#define ActDowBrf (ActPrnMyUsgRep+85) #define ActDowBrf (ActSeeMyUsgRep+85)
#define ActReqRemOldBrf (ActPrnMyUsgRep+86) #define ActReqRemOldBrf (ActSeeMyUsgRep+86)
#define ActRemOldBrf (ActPrnMyUsgRep+87) #define ActRemOldBrf (ActSeeMyUsgRep+87)
/*****************************************************************************/ /*****************************************************************************/
/******************************** Public types *******************************/ /******************************** Public types *******************************/

View File

@ -143,14 +143,18 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 16.10 (2016-10-03)" #define Log_PLATFORM_VERSION "SWAD 16.11 (2016-10-03)"
#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: Oct 03, 2016 Created permalinks to report files. (? lines) *
Version 16.11: Oct 03, 2016 Created permalinks to report files. (205793 lines)
1 change necessary in database:
UPDATE actions SET Obsolete='Y' WHERE ActCod='1583';
Version 16.10: Oct 03, 2016 All user's figures are calculated in one click. (205795 lines) Version 16.10: Oct 03, 2016 All user's figures are calculated in one click. (205795 lines)
Version 16.9: Oct 03, 2016 User's usage report is written into a temporary file. (205795 lines) Version 16.9: Oct 03, 2016 User's usage report is written into a temporary file. (205795 lines)
Version 16.8.1: Oct 03, 2016 Do not show courses with a few clicks in user's usage report. (205747 lines) Version 16.8.1: Oct 03, 2016 Do not show courses with a few clicks in user's usage report. (205747 lines)

View File

@ -1508,7 +1508,6 @@ 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,
@ -5860,7 +5859,7 @@ static void Brw_PutIconFileWithLinkToViewMetadata (unsigned Size,
/***************************** Put icon of a file ****************************/ /***************************** Put icon of a file ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void Brw_PutIconFile (unsigned Size,Brw_FileType_t FileType,const char *FileName) 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;

View File

@ -222,6 +222,8 @@ 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);

View File

@ -1887,7 +1887,6 @@ static bool Inf_CheckAndShowRichTxt (void)
int Inf_WritePlainTextIntoHTMLBuffer (char **HTMLBuffer) int Inf_WritePlainTextIntoHTMLBuffer (char **HTMLBuffer)
{ {
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
char TxtHTML[Cns_MAX_BYTES_LONG_TEXT+1]; char TxtHTML[Cns_MAX_BYTES_LONG_TEXT+1];
char FileNameHTMLTmp[PATH_MAX+1]; char FileNameHTMLTmp[PATH_MAX+1];
@ -1914,16 +1913,7 @@ int Inf_WritePlainTextIntoHTMLBuffer (char **HTMLBuffer)
"Can not create temporary file"); "Can not create temporary file");
/***** Write start of HTML code *****/ /***** Write start of HTML code *****/
fprintf (FileHTMLTmp,"<!DOCTYPE html>\n" Lay_StartHTMLFile (FileHTMLTmp,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]);
"<html lang=\"%s\">\n"
"<head>\n"
"<meta http-equiv=\"Content-Type\""
" content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n"
"</head>\n"
"<body>\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], // Language
Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]); // Page title
/***** Write plain text into text buffer *****/ /***** Write plain text into text buffer *****/
fprintf (FileHTMLTmp,"<div class=\"DAT LEFT_MIDDLE\">\n"); fprintf (FileHTMLTmp,"<div class=\"DAT LEFT_MIDDLE\">\n");

View File

@ -1730,6 +1730,7 @@ void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[])
IsLastItemInLevel[Level] ? "subend" : IsLastItemInLevel[Level] ? "subend" :
"submid"); "submid");
} }
/*****************************************************************************/ /*****************************************************************************/
/************************** Help for the text editor *************************/ /************************** Help for the text editor *************************/
/*****************************************************************************/ /*****************************************************************************/
@ -1768,3 +1769,23 @@ static void Lay_HelpTextEditor (const char *Text,const char *InlineMath,const ch
Txt_Inline_math,InlineMath, Txt_Inline_math,InlineMath,
Txt_Equation_centered,Equation); Txt_Equation_centered,Equation);
} }
/*****************************************************************************/
/************************** Help for the text editor *************************/
/*****************************************************************************/
void Lay_StartHTMLFile (FILE *File,const char *Title)
{
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
fprintf (File,"<!DOCTYPE html>\n"
"<html lang=\"%s\">\n"
"<head>\n"
"<meta http-equiv=\"Content-Type\""
" content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n"
"</head>\n"
"<body>\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], // Language
Title); // Page title
}

View File

@ -118,4 +118,6 @@ void Lay_IndentDependingOnLevel (unsigned Level,bool IsLastItemInLevel[]);
void Lay_HelpPlainEditor (void); void Lay_HelpPlainEditor (void);
void Lay_HelpRichEditor (void); void Lay_HelpRichEditor (void);
void Lay_StartHTMLFile (FILE *File,const char *Title);
#endif #endif

View File

@ -44,7 +44,7 @@
/*****************************************************************************/ /*****************************************************************************/
#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 80 // Maximum width of graphic bar #define Rep_MAX_BAR_WIDTH 40 // 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
@ -57,12 +57,6 @@
/****************************** Internal types *******************************/ /****************************** Internal types *******************************/
/*****************************************************************************/ /*****************************************************************************/
typedef enum
{
Rep_SEE,
Rep_PRINT,
} Rep_SeeOrPrint_t;
/*****************************************************************************/ /*****************************************************************************/
/************** External global variables from others modules ****************/ /************** External global variables from others modules ****************/
/*****************************************************************************/ /*****************************************************************************/
@ -77,10 +71,7 @@ extern struct Globals Gbl;
/***************************** Private prototypes ****************************/ /***************************** Private prototypes ****************************/
/*****************************************************************************/ /*****************************************************************************/
static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint); static void Rep_WriteHeader (const char *StrCurrentDateUTC,const char *Permalink);
static void Rep_PutIconToPrintMyUsageReport (void);
static void Rep_WriteHeader (FILE *FileDst,const char *StrCurrentDateUTC);
static void Rep_WriteSectionPlatform (void); static void Rep_WriteSectionPlatform (void);
static void Rep_WriteSectionUsrInfo (void); static void Rep_WriteSectionUsrInfo (void);
static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures, static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
@ -142,7 +133,8 @@ void Rep_ReqMyUsageReport (void)
Lay_StartRoundFrame (NULL,Gbl.Title,NULL); Lay_StartRoundFrame (NULL,Gbl.Title,NULL);
/***** Header *****/ /***** Header *****/
fprintf (Gbl.F.Out,"<div class=\"DAT_N\">%s",Gbl.Usrs.Me.UsrDat.FullName); fprintf (Gbl.F.Out,"<div class=\"DAT_N\">"
"%s",Gbl.Usrs.Me.UsrDat.FullName);
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Out,"<br />%s",StrCurrentDateUTC); fprintf (Gbl.F.Out,"<br />%s",StrCurrentDateUTC);
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
@ -156,20 +148,13 @@ void Rep_ReqMyUsageReport (void)
void Rep_ShowMyUsageReport (void) void Rep_ShowMyUsageReport (void)
{ {
Rep_ShowOrPrintMyUsageReport (false); extern const char *Txt_Report_of_use_of_PLATFORM;
}
void Rep_PrintMyUsageReport (void)
{
Rep_ShowOrPrintMyUsageReport (true);
}
static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
{
extern const char *Txt_Report; extern const char *Txt_Report;
extern const char *Txt_Download;
struct UsrFigures UsrFigures; struct UsrFigures UsrFigures;
char PathReports[PATH_MAX+1]; char PathReports[PATH_MAX+1];
char PathFileReport[PATH_MAX+1]; char PathFileReport[PATH_MAX+1];
char Permalink[PATH_MAX+1];
struct tm tm_FirstClickTime; struct tm tm_FirstClickTime;
char StrCurrentDateUTC[10+1]; // Example: 2016-10-02 char StrCurrentDateUTC[10+1]; // Example: 2016-10-02
// 1234567890 // 1234567890
@ -181,27 +166,27 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
/***** Get current date-time *****/ /***** Get current date-time *****/
Dat_GetCurrentDateTimeUTC (StrCurrentDateUTC,StrCurrentTimeUTC); Dat_GetCurrentDateTimeUTC (StrCurrentDateUTC,StrCurrentTimeUTC);
/***** Start frame *****/
if (SeeOrPrint == Rep_SEE)
Lay_StartRoundFrame (NULL,Txt_Report,
Rep_PutIconToPrintMyUsageReport);
/***** Path for reports *****/ /***** Path for reports *****/
sprintf (PathReports,"%s/%s",Cfg_PATH_SWAD_PRIVATE,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 empty syllabus *****/
/* Path of the private directory for the file with the report */ /* Path of the private directory for the file with the report */
sprintf (PathFileReport,"%s/%s.html", sprintf (PathFileReport,"%s/%s.html",
PathReports,Gbl.UniqueNameEncrypted); PathReports,Gbl.UniqueNameEncrypted);
sprintf (Permalink,"%s/%s/%s.html",
Cfg_URL_SWAD_PUBLIC,
Cfg_FOLDER_REP,
Gbl.UniqueNameEncrypted);
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.");
/***** Start file *****/ /***** Start file *****/
fprintf (Gbl.F.Rep,"<div style=\"margin:2em; text-align:left;\">\n"); Lay_StartHTMLFile (Gbl.F.Rep,Txt_Report);
fprintf (Gbl.F.Rep,"<div style=\"margin:1em;text-align:left;\">\n");
/***** Header *****/ /***** Header *****/
Rep_WriteHeader (Gbl.F.Rep,StrCurrentDateUTC); Rep_WriteHeader (StrCurrentDateUTC,Permalink);
/***** Platform *****/ /***** Platform *****/
Rep_WriteSectionPlatform (); Rep_WriteSectionPlatform ();
@ -214,7 +199,6 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
GetUsrFiguresAgain = Prf_GetAndStoreAllUsrFigures (Gbl.Usrs.Me.UsrDat.UsrCod,&UsrFigures); GetUsrFiguresAgain = Prf_GetAndStoreAllUsrFigures (Gbl.Usrs.Me.UsrDat.UsrCod,&UsrFigures);
if (GetUsrFiguresAgain) if (GetUsrFiguresAgain)
Prf_GetUsrFigures (Gbl.Usrs.Me.UsrDat.UsrCod,&UsrFigures); Prf_GetUsrFigures (Gbl.Usrs.Me.UsrDat.UsrCod,&UsrFigures);
if (UsrFigures.FirstClickTimeUTC) if (UsrFigures.FirstClickTimeUTC)
gmtime_r (&UsrFigures.FirstClickTimeUTC,&tm_FirstClickTime); gmtime_r (&UsrFigures.FirstClickTimeUTC,&tm_FirstClickTime);
Rep_WriteSectionUsrFigures (&UsrFigures,&tm_FirstClickTime, Rep_WriteSectionUsrFigures (&UsrFigures,&tm_FirstClickTime,
@ -233,61 +217,72 @@ static void Rep_ShowOrPrintMyUsageReport (Rep_SeeOrPrint_t SeeOrPrint)
MaxHitsPerYear); MaxHitsPerYear);
/***** End file *****/ /***** End file *****/
fprintf (Gbl.F.Rep,"</div>\n"); fprintf (Gbl.F.Rep,"</div>\n"
"</body>\n"
"</html>\n");
/***** Open report file for reading *****/ /***** Close report file *****/
if ((Gbl.F.Rep = fopen (PathFileReport,"rb")) == NULL)
Lay_ShowErrorAndExit ("Can not open report file.");
/***** Copy from report file to output file *****/
Fil_FastCopyOfOpenFiles (Gbl.F.Rep,Gbl.F.Out);
/***** Close and remove report file *****/
Fil_CloseReportFile (); Fil_CloseReportFile ();
unlink (PathFileReport);
/***** Start frame *****/
sprintf (Gbl.Title,Txt_Report_of_use_of_PLATFORM,Cfg_PLATFORM_SHORT_NAME);
Lay_StartRoundFrame (NULL,Gbl.Title,NULL);
/***** Header *****/
fprintf (Gbl.F.Out,"<div class=\"DAT_N\">"
"%s",Gbl.Usrs.Me.UsrDat.FullName);
if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Out,"<br />%s",StrCurrentDateUTC);
fprintf (Gbl.F.Out,"</div>");
/***** Put anchor and report filename *****/
fprintf (Gbl.F.Out,"<div class=\"FILENAME CENTER_MIDDLE\">");
fprintf (Gbl.F.Out,"<a href=\"%s\" class=\"FILENAME\""
" title=\"%s\" target=\"_blank\">",
Permalink,
Txt_Report);
Brw_PutIconFile (32,Brw_IS_FILE,Permalink);
fprintf (Gbl.F.Out,"&nbsp;%s&nbsp;"
"<img src=\"%s/download64x64.png\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON40x40\">"
"</a>"
"</div>",
Permalink,
Gbl.Prefs.IconsURL,
Txt_Download,Txt_Download);
/***** End frame *****/ /***** End frame *****/
if (SeeOrPrint == Rep_SEE) Lay_EndRoundFrame ();
Lay_EndRoundFrame ();
}
/*****************************************************************************/
/********************* Put icon to print my usage report *********************/
/*****************************************************************************/
static void Rep_PutIconToPrintMyUsageReport (void)
{
extern const char *Txt_Print;
Lay_PutContextualLink (ActPrnMyUsgRep,NULL,
"print64x64.png",
Txt_Print,NULL,
NULL);
} }
/*****************************************************************************/ /*****************************************************************************/
/******************** Write header of user's usage report ********************/ /******************** Write header of user's usage report ********************/
/*****************************************************************************/ /*****************************************************************************/
static void Rep_WriteHeader (FILE *FileDst,const char *StrCurrentDateUTC) static void Rep_WriteHeader (const char *StrCurrentDateUTC,const char *Permalink)
{ {
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 (FileDst,"<header style=\"margin:2em; text-align:center;\">"); fprintf (Gbl.F.Rep,"<header style=\"text-align:center;\">");
/***** 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 (FileDst,"<h1>%s</h1>",Gbl.Title); fprintf (Gbl.F.Rep,"<h1>%s</h1>",Gbl.Title);
/***** Subtitle *****/ /***** Subtitle *****/
fprintf (FileDst,"<h2>%s",Gbl.Usrs.Me.UsrDat.FullName); fprintf (Gbl.F.Rep,"<h2>%s",Gbl.Usrs.Me.UsrDat.FullName);
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (FileDst,", %s",StrCurrentDateUTC); fprintf (Gbl.F.Rep,", %s",StrCurrentDateUTC);
fprintf (FileDst,"</h2>"); fprintf (Gbl.F.Rep,"</h2>");
/***** Permalink *****/
fprintf (Gbl.F.Rep,"<a href=\"%s\" target=\"_blank\">%s</a>\n",
Permalink,Permalink);
/***** End of header *****/ /***** End of header *****/
fprintf (FileDst,"</header>\n"); fprintf (Gbl.F.Rep,"</header>\n");
} }
/*****************************************************************************/ /*****************************************************************************/
@ -303,7 +298,7 @@ static void Rep_WriteSectionPlatform (void)
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Rep,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>" "<h2>%s</h2>"
"<ul>", "<ul>",
Txt_Teaching_platform); Txt_Teaching_platform);
@ -337,7 +332,7 @@ static void Rep_WriteSectionUsrInfo (void)
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Rep,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>" "<h2>%s</h2>"
"<ul>", "<ul>",
Txt_Personal_information); Txt_Personal_information);
@ -402,7 +397,7 @@ static void Rep_WriteSectionUsrFigures (struct UsrFigures *UsrFigures,
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Rep,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>" "<h2>%s</h2>"
"<ul>", "<ul>",
Txt_Figures); Txt_Figures);
@ -548,7 +543,7 @@ static void Rep_WriteSectionGlobalHits (struct UsrFigures *UsrFigures,
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Rep,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s</h3>", "<h2>%s</h2>",
Txt_Hits); Txt_Hits);
/***** Global (in any course) hits per year *****/ /***** Global (in any course) hits per year *****/
@ -576,11 +571,11 @@ static void Rep_WriteSectionCurrentCourses (struct UsrFigures *UsrFigures,
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Rep,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s", "<h2>%s",
Txt_Courses); Txt_Courses);
if (StrCurrentDateUTC[0]) if (StrCurrentDateUTC[0])
fprintf (Gbl.F.Rep," (%s)",StrCurrentDateUTC); fprintf (Gbl.F.Rep," (%s)",StrCurrentDateUTC);
fprintf (Gbl.F.Rep,"</h3>" fprintf (Gbl.F.Rep,"</h2>"
"<ul>"); "<ul>");
/***** Number of courses in which the user is student/teacher *****/ /***** Number of courses in which the user is student/teacher *****/
@ -612,7 +607,7 @@ static void Rep_WriteSectionHistoricCourses (struct UsrFigures *UsrFigures,
/***** Start of section *****/ /***** Start of section *****/
fprintf (Gbl.F.Rep,"<section>" fprintf (Gbl.F.Rep,"<section>"
"<h3>%s (%s)</h3>", "<h2>%s (%s)</h2>",
Txt_Courses,Txt_historical_log); Txt_Courses,Txt_historical_log);
fprintf (Gbl.F.Rep,Txt_Only_courses_with_more_than_X_clicks_are_shown, fprintf (Gbl.F.Rep,Txt_Only_courses_with_more_than_X_clicks_are_shown,
Rep_MIN_CLICKS_CRS); Rep_MIN_CLICKS_CRS);
@ -956,7 +951,7 @@ static void Rep_ShowMyHitsPerYear (bool AnyCourse,long CrsCod,Rol_Role_t Role,
Year--) Year--)
{ {
/* Write the year */ /* Write the year */
fprintf (Gbl.F.Rep,"%04u ",Year); fprintf (Gbl.F.Rep,"%04u&nbsp;",Year);
/* Draw bar proportional to number of hits */ /* Draw bar proportional to number of hits */
Rep_DrawBarNumHits (Year == LastYear ? Hits.Num : Rep_DrawBarNumHits (Year == LastYear ? Hits.Num :
@ -972,7 +967,7 @@ static void Rep_ShowMyHitsPerYear (bool AnyCourse,long CrsCod,Rol_Role_t Role,
Year--) Year--)
{ {
/* Write the year */ /* Write the year */
fprintf (Gbl.F.Rep,"%04u ",Year); fprintf (Gbl.F.Rep,"%04u&nbsp;",Year);
/* Draw bar proportional to number of hits */ /* Draw bar proportional to number of hits */
Rep_DrawBarNumHits (0.0,Hits.Max,Rep_MAX_BAR_WIDTH); Rep_DrawBarNumHits (0.0,Hits.Max,Rep_MAX_BAR_WIDTH);
@ -999,12 +994,8 @@ static void Rep_DrawBarNumHits (float HitsNum,float HitsMax,
fprintf (Gbl.F.Rep,Rep_BLOCK); fprintf (Gbl.F.Rep,Rep_BLOCK);
/***** Write the number of hits *****/ /***** Write the number of hits *****/
fprintf (Gbl.F.Rep," "); fprintf (Gbl.F.Rep,"&nbsp;");
Str_WriteFloatNum (Gbl.F.Rep,HitsNum); Str_WriteFloatNum (Gbl.F.Rep,HitsNum);
} }
else
/***** Write the number of clicks *****/
fprintf (Gbl.F.Rep,"0");
fprintf (Gbl.F.Rep,"<br />"); fprintf (Gbl.F.Rep,"<br />");
} }

View File

@ -836,22 +836,13 @@ int Syl_WriteSyllabusIntoHTMLBuffer (char **HTMLBuffer)
static void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp) static void Syl_WriteSyllabusIntoHTMLTmpFile (FILE *FileHTMLTmp)
{ {
extern const char *Txt_STR_LANG_ID[1+Txt_NUM_LANGUAGES];
extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES]; extern const char *Txt_INFO_TITLE[Inf_NUM_INFO_TYPES];
unsigned NumItem; unsigned NumItem;
int i; int i;
/***** Write start of HTML code *****/ /***** Write start of HTML code *****/
fprintf (FileHTMLTmp,"<!DOCTYPE html>\n" Lay_StartHTMLFile (FileHTMLTmp,Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]);
"<html lang=\"%s\">\n" fprintf (FileHTMLTmp,"<table>\n");
"<head>\n"
"<meta http-equiv=\"Content-Type\" content=\"text/html;charset=windows-1252\" />\n"
"<title>%s</title>\n"
"</head>\n"
"<body>\n"
"<table>\n",
Txt_STR_LANG_ID[Gbl.Prefs.Language], // Language
Txt_INFO_TITLE[Gbl.CurrentCrs.Info.Type]); // Page title
/***** Set width of columns of the table *****/ /***** Set width of columns of the table *****/
fprintf (FileHTMLTmp,"<colgroup>\n"); fprintf (FileHTMLTmp,"<colgroup>\n");