From 4e4d86cf3553013319b959a917219c0fe7b898b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Thu, 22 Jan 2015 00:17:12 +0100 Subject: [PATCH] Version 14.63.5 --- sql/cambios.sql | 6 ++++++ sql/swad.sql | 1 - swad_changelog.h | 7 ++++++- swad_database.c | 24 +++++++++++------------- swad_file_browser.c | 18 ++++++++++-------- swad_user.c | 4 ++-- 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/sql/cambios.sql b/sql/cambios.sql index 450abbd63..d9a79ec4e 100644 --- a/sql/cambios.sql +++ b/sql/cambios.sql @@ -10476,3 +10476,9 @@ CREATE INDEX Location ON files (InsCod,CtrCod,DegCod,CrsCod,GrpCod,FileBrowser); ----- 2015-01-21, swad14.63 CREATE TABLE IF NOT EXISTS file_browser_last (UsrCod INT NOT NULL,FileBrowser TINYINT NOT NULL,Cod INT NOT NULL DEFAULT -1,LastClick DATETIME NOT NULL,UNIQUE INDEX(UsrCod,FileBrowser,Cod)); + +----- 2015-01-22, swad14.63.5 + +INSERT INTO file_browser_last (UsrCod,FileBrowser,Cod,LastClick) SELECT UsrCod,'9','-1',LastAccBriefcase FROM usr_last WHERE LastAccBriefcase>0; +ALTER TABLE usr_last DROP COLUMN LastAccBriefcase; + diff --git a/sql/swad.sql b/sql/swad.sql index f98c72f3f..589bc6561 100644 --- a/sql/swad.sql +++ b/sql/swad.sql @@ -1194,7 +1194,6 @@ CREATE TABLE IF NOT EXISTS usr_last ( LastTab TINYINT NOT NULL, LastTime DATETIME NOT NULL DEFAULT 0, LastAccNotif DATETIME NOT NULL DEFAULT 0, - LastAccBriefcase DATETIME NOT NULL DEFAULT 0, UNIQUE INDEX(UsrCod), INDEX(LastTime)); -- diff --git a/swad_changelog.h b/swad_changelog.h index 1be7e26b5..f9850a9eb 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -39,11 +39,16 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.63.4 (2015/01/21)" +#define Log_PLATFORM_VERSION "SWAD 14.63.5 (2015/01/22)" // 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 | tail -1 /* + Version 14.63.5: Jan 22, 2015 Changes in last accesses to file browser (briefcases). (? lines) + 2 changes necessary in database: +INSERT INTO file_browser_last (UsrCod,FileBrowser,Cod,LastClick) SELECT UsrCod,'9','-1',LastAccBriefcase FROM usr_last WHERE LastAccBriefcase>0; +ALTER TABLE usr_last DROP COLUMN LastAccBriefcase; + Version 14.63.4: Jan 21, 2015 Fixed bug in listing of degree administrators, reported by Antonio Fernández Ares. (175548 lines) Version 14.63.3: Jan 21, 2015 Fixed bug when expanding folders, reported by Nadir Román Guerrero and others. (175545 lines) Version 14.63.2: Jan 21, 2015 Fixed bug in search of courses. (175542 lines) diff --git a/swad_database.c b/swad_database.c index ab72fe39f..7817c9eb6 100644 --- a/swad_database.c +++ b/swad_database.c @@ -2395,18 +2395,17 @@ mysql> DESCRIBE usr_IDs; /***** Table usr_last *****/ /* mysql> DESCRIBE usr_last; -+------------------+------------+------+-----+---------------------+-------+ -| Field | Type | Null | Key | Default | Extra | -+------------------+------------+------+-----+---------------------+-------+ -| UsrCod | int(11) | NO | PRI | NULL | | -| WhatToSearch | tinyint(4) | NO | | 0 | | -| LastCrs | int(11) | NO | | -1 | | -| LastTab | tinyint(4) | NO | | 0 | | -| LastTime | datetime | NO | MUL | 0000-00-00 00:00:00 | | -| LastAccNotif | datetime | NO | | 0000-00-00 00:00:00 | | -| LastAccBriefcase | datetime | NO | | 0000-00-00 00:00:00 | | -+------------------+------------+------+-----+---------------------+-------+ -7 rows in set (0.01 sec) ++--------------+------------+------+-----+---------------------+-------+ +| Field | Type | Null | Key | Default | Extra | ++--------------+------------+------+-----+---------------------+-------+ +| UsrCod | int(11) | NO | PRI | NULL | | +| WhatToSearch | tinyint(4) | NO | | 0 | | +| LastCrs | int(11) | NO | | -1 | | +| LastTab | tinyint(4) | NO | | NULL | | +| LastTime | datetime | NO | MUL | 0000-00-00 00:00:00 | | +| LastAccNotif | datetime | NO | | 0000-00-00 00:00:00 | | ++--------------+------------+------+-----+---------------------+-------+ +6 rows in set (0.00 sec) */ DB_CreateTable ("CREATE TABLE IF NOT EXISTS usr_last (" "UsrCod INT NOT NULL," @@ -2415,7 +2414,6 @@ mysql> DESCRIBE usr_last; "LastTab TINYINT NOT NULL," "LastTime DATETIME NOT NULL DEFAULT 0," "LastAccNotif DATETIME NOT NULL DEFAULT 0," - "LastAccBriefcase DATETIME NOT NULL DEFAULT 0," "UNIQUE INDEX(UsrCod),INDEX(LastTime))"); /***** Table usr_nicknames *****/ diff --git a/swad_file_browser.c b/swad_file_browser.c index 2d54b738e..56bafd85c 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -3240,7 +3240,7 @@ static void Brw_UpdateLastAccess (void) Brw_GetAndUpdateDateLastAccFileBrowser ("LastAccCrsWorks"); break; case Brw_FILE_BRW_BRIEFCASE_USR: - Brw_GetAndUpdateDateLastAccFileBrowser ("LastAccBriefcase"); + Brw_GetAndUpdateDateLastAccFileBrowser (""); break; default: break; @@ -3844,13 +3844,15 @@ static void Brw_GetAndUpdateDateLastAccFileBrowser (const char *FieldNameDB) Gbl.Usrs.Me.UsrDat.UsrCod); break; case Brw_FILE_BRW_BRIEFCASE_USR: - // FieldNameDB -> "LastAccBriefcase" - sprintf (Query1,"SELECT UNIX_TIMESTAMP(%s) FROM usr_last" - " WHERE UsrCod='%ld'", - FieldNameDB,Gbl.Usrs.Me.UsrDat.UsrCod); - sprintf (Query2,"UPDATE usr_last SET %s=NOW()" - " WHERE UsrCod='%ld'", - FieldNameDB,Gbl.Usrs.Me.UsrDat.UsrCod); + sprintf (Query1,"SELECT UNIX_TIMESTAMP(LastClick) FROM file_browser_last" + " WHERE UsrCod='%ld' AND FileBrowser='%u' AND Cod='-1'", + Gbl.Usrs.Me.UsrDat.UsrCod, + (unsigned) Brw_FileBrowserForDB[Gbl.FileBrowser.Type]); + sprintf (Query2,"REPLACE INTO file_browser_last (UsrCod,FileBrowser,Cod,LastClick)" + " VALUES ('%ld','%u','-1',NOW())", + Gbl.Usrs.Me.UsrDat.UsrCod, + (unsigned) Brw_FileBrowserForDB[Gbl.FileBrowser.Type], + Gbl.CurrentDeg.Deg.DegCod); break; default: return; diff --git a/swad_user.c b/swad_user.c index 405193d21..072c10cc6 100644 --- a/swad_user.c +++ b/swad_user.c @@ -2459,7 +2459,7 @@ void Usr_UpdateMyLastData (void) if (DB_QueryCOUNT (Query,"can not get last user's click")) { /***** Update my last accessed course, tab and time of click in database *****/ - // WhatToSearch, LastAccNotif, LastAccBriefcase remain unchanged + // WhatToSearch, LastAccNotif remain unchanged sprintf (Query,"UPDATE usr_last SET LastCrs='%ld',LastTab='%u',LastTime=NOW()" " WHERE UsrCod='%ld'", Gbl.CurrentCrs.Crs.CrsCod, @@ -2480,7 +2480,7 @@ static void Usr_InsertMyLastData (void) char Query[256]; /***** Insert my last accessed course, tab and time of click in database *****/ - // WhatToSearch, LastAccNotif, LastAccBriefcase are set to default (0) + // WhatToSearch, LastAccNotif are set to default (0) sprintf (Query,"INSERT INTO usr_last (UsrCod,LastCrs,LastTab,LastTime)" " VALUES ('%ld','%ld','%u',NOW())", Gbl.Usrs.Me.UsrDat.UsrCod,