Version 14.63.5

This commit is contained in:
Antonio Cañas Vargas 2015-01-22 00:17:12 +01:00
parent 4e3b9508d5
commit 4e4d86cf35
6 changed files with 35 additions and 25 deletions

View File

@ -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;

View File

@ -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));
--

View File

@ -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)

View File

@ -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 *****/

View File

@ -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;

View File

@ -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,