From a175012444c30342d568eb50cced348ba8130102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 6 Oct 2016 19:29:56 +0200 Subject: [PATCH] Version 16.15 --- sql/cambios.sql | 6 +++++- sql/swad.sql | 13 +++++++++++++ swad_changelog.h | 3 ++- swad_database.c | 27 +++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/sql/cambios.sql b/sql/cambios.sql index 41b8eaf5b..83dc4e2c0 100644 --- a/sql/cambios.sql +++ b/sql/cambios.sql @@ -11637,5 +11637,9 @@ SELECT COUNT(*) FROM msg_content LEFT JOIN msg_snt ON (msg_content.MsgCod=msg_sn SELECT SQL_NO_CACHE YEAR(CONVERT_TZ(ClickTime,@@session.time_zone,'Europe/Berlin')) AS Year,COUNT(*) FROM log_full WHERE ClickTime>=FROM_UNIXTIME('0') AND UsrCod='1' GROUP BY Year DESC; - + +----- SWAD 16.15 (2016/10/06) ----- + +CREATE TABLE IF NOT EXISTS usr_report (RepCod INT NOT NULL AUTO_INCREMENT,UsrCod INT NOT NULL,ReportTime DATETIME NOT NULL,UniqueDirL CHAR(2) NOT NULL,UniqueDirR CHAR(41) NOT NULL,Filename VARCHAR(255) NOT NULL,Permalink VARCHAR(255) NOT NULL,UNIQUE INDEX(RepCod),INDEX(UsrCod)); + diff --git a/sql/swad.sql b/sql/swad.sql index 77458edb4..2faadfc26 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -1321,6 +1321,19 @@ CREATE TABLE IF NOT EXISTS usr_nicknames ( UNIQUE INDEX(UsrCod,Nickname), UNIQUE INDEX(Nickname)); -- +-- Table usr_report: stores users' usage reports +-- +CREATE TABLE IF NOT EXISTS usr_report ( + RepCod INT NOT NULL AUTO_INCREMENT, + UsrCod INT NOT NULL, + ReportTime DATETIME NOT NULL, + UniqueDirL CHAR(2) NOT NULL, + UniqueDirR CHAR(41) NOT NULL, + Filename VARCHAR(255) NOT NULL, + Permalink VARCHAR(255) NOT NULL, + UNIQUE INDEX(RepCod), + INDEX(UsrCod)); +-- -- Table usr_webs: stores users' web and social networks -- CREATE TABLE IF NOT EXISTS usr_webs ( diff --git a/swad_changelog.h b/swad_changelog.h index cdfb3bcfa..11a2ea6f9 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -146,13 +146,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 16.14 (2016-10-06)" +#define Log_PLATFORM_VERSION "SWAD 16.15 (2016-10-06)" #define CSS_FILE "swad15.229.css" #define JS_FILE "swad15.238.1.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.15: Oct 06, 2016 New database table to store user's usage reports. (205896 lines) Version 16.14: Oct 06, 2016 By default, teachers see (do not edit) documents. Now they must click on small edit icon to edit. (205875 lines) Version 16.13.2: Oct 05, 2016 User's usage report is open to any logged user. (205907 lines) Version 16.13.1: Oct 04, 2016 Changes in user's usage report. (205906 lines) diff --git a/swad_database.c b/swad_database.c index c186a7c07..88949cc03 100644 --- a/swad_database.c +++ b/swad_database.c @@ -2782,6 +2782,33 @@ mysql> DESCRIBE usr_nicknames; "UNIQUE INDEX(UsrCod,Nickname)," "UNIQUE INDEX(Nickname))"); + /***** Table usr_report *****/ +/* +mysql> DESCRIBE usr_report; ++------------+--------------+------+-----+---------+----------------+ +| Field | Type | Null | Key | Default | Extra | ++------------+--------------+------+-----+---------+----------------+ +| RepCod | int(11) | NO | PRI | NULL | auto_increment | +| UsrCod | int(11) | NO | MUL | NULL | | +| ReportTime | datetime | NO | | NULL | | +| UniqueDirL | char(2) | NO | | NULL | | +| UniqueDirR | char(41) | NO | | NULL | | +| Filename | varchar(255) | NO | | NULL | | +| Permalink | varchar(255) | NO | | NULL | | ++------------+--------------+------+-----+---------+----------------+ +7 rows in set (0,00 sec) +*/ + DB_CreateTable ("CREATE TABLE IF NOT EXISTS usr_report (" + "RepCod INT NOT NULL AUTO_INCREMENT," + "UsrCod INT NOT NULL," + "ReportTime DATETIME NOT NULL," + "UniqueDirL CHAR(2) NOT NULL," // 2 leftmost chars from a unique 43 chars base64url codified from a unique SHA-256 string + "UniqueDirR CHAR(41) NOT NULL," // 41 rightmost chars from a unique 43 chars base64url codified from a unique SHA-256 string + "Filename VARCHAR(255) NOT NULL," // Report filename + "Permalink VARCHAR(255) NOT NULL," // Full URL (permalink) + "UNIQUE INDEX(RepCod)," + "INDEX(UsrCod))"); + /***** Table usr_webs *****/ /* mysql> DESCRIBE usr_webs;